From 8bcdfec23e382661627b55a7860f8ae803e0d8f4 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Fri, 13 Jul 2018 02:26:19 +0530 Subject: [PATCH 001/546] Evaluation Article - Spring web-flux --- spring-5-reactive-webflux/pom.xml | 60 +++++++++++++++++ .../reactive/Spring5ReactiveApplication.java | 15 +++++ .../reactive/client/CabLocationConsumer.java | 66 +++++++++++++++++++ .../reactive/controller/CabController.java | 41 ++++++++++++ .../baeldung/reactive/model/CabLocation.java | 52 +++++++++++++++ .../baeldung/reactive/service/CabService.java | 66 +++++++++++++++++++ .../src/main/resources/logback.xml | 15 +++++ spring-5-reactive-webflux/src/site/site.xml | 26 ++++++++ .../baeldung/reactive/CapLocationTests.java | 66 +++++++++++++++++++ 9 files changed, 407 insertions(+) create mode 100644 spring-5-reactive-webflux/pom.xml create mode 100644 spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java create mode 100644 spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/client/CabLocationConsumer.java create mode 100644 spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/controller/CabController.java create mode 100644 spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java create mode 100644 spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java create mode 100644 spring-5-reactive-webflux/src/main/resources/logback.xml create mode 100644 spring-5-reactive-webflux/src/site/site.xml create mode 100644 spring-5-reactive-webflux/src/test/java/com/baeldung/reactive/CapLocationTests.java diff --git a/spring-5-reactive-webflux/pom.xml b/spring-5-reactive-webflux/pom.xml new file mode 100644 index 0000000000..891f997789 --- /dev/null +++ b/spring-5-reactive-webflux/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + com.baeldung + spring-5-reactive-webflux + 1.0-SNAPSHOT + + spring-5-reactive-webflux + A simple spring-5-reactive-webflux. + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-websocket + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + com.baeldung.reactive.Spring5ReactiveApplication + JAR + + + + + diff --git a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java new file mode 100644 index 0000000000..d4546efbeb --- /dev/null +++ b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/Spring5ReactiveApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.reactive; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * A Spring 5 reactive application + * + */ +@SpringBootApplication +public class Spring5ReactiveApplication { + public static void main(String[] args) { + SpringApplication.run(Spring5ReactiveApplication.class, args); + } +} diff --git a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/client/CabLocationConsumer.java b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/client/CabLocationConsumer.java new file mode 100644 index 0000000000..42d96f30b8 --- /dev/null +++ b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/client/CabLocationConsumer.java @@ -0,0 +1,66 @@ +/** + * + */ +package com.baeldung.reactive.client; + +import java.util.UUID; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.reactive.function.client.WebClient; + +import com.baeldung.reactive.model.CabLocation; + +/** + * @author swpraman + * + */ +public class CabLocationConsumer { + + private static final Logger logger = LoggerFactory.getLogger(CabLocationConsumer.class); + + /** + * Main method to consume locations of a cab as a stream + * @param args + */ + public static void main(String[] args) { + + // The id of the booked cab + String cabId = UUID.randomUUID().toString(); + + // URI of the API + String uri = "http://localhost:8080/cab/location/" + cabId; + + // @formatter:off + WebClient.create(uri) + .get() + .retrieve() + .bodyToFlux(CabLocation.class) + .subscribe(CabLocationConsumer::showLocation); + //@formatter:on + + sleepIndefinitely(); + } + + /** + * Helper method to print location of the cab as received from stream + * @param location + */ + private static void showLocation(CabLocation location) { + logger.debug("Current Location : {}", location); + } + + /** + * This method blocks the current thread indefinitely + */ + private static void sleepIndefinitely() { + try { + while (true) { + Thread.sleep(10000); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + +} diff --git a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/controller/CabController.java b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/controller/CabController.java new file mode 100644 index 0000000000..c9d54f917a --- /dev/null +++ b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/controller/CabController.java @@ -0,0 +1,41 @@ +/** + * + */ +package com.baeldung.reactive.controller; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.reactive.model.CabLocation; +import com.baeldung.reactive.service.CabService; + +import reactor.core.publisher.Flux; + +/** + * @author swpraman + * + */ +@RestController +public class CabController { + + /** + * Logger instance + */ + private static final Logger logger = LoggerFactory.getLogger(CabController.class); + + @Autowired + private CabService cabService; + + // Server sends location of the cab at the interval of 1 sec + @GetMapping(value = "cab/location/{cabId}", produces = MediaType.APPLICATION_STREAM_JSON_VALUE) + public Flux cabLocation(@PathVariable("cabId") String cabId) { + logger.debug("Getting location stream for cabId: {}", cabId); + return cabService.getLocation(cabId); + } + +} diff --git a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java new file mode 100644 index 0000000000..dc1ed44520 --- /dev/null +++ b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java @@ -0,0 +1,52 @@ +/** + * + */ +package com.baeldung.reactive.model; + +import java.io.Serializable; + +/** + * @author swapanpramanick2004 + * + */ +public class CabLocation implements Serializable { + + /** + * Serial version UID + */ + private static final long serialVersionUID = -3923503044822400093L; + + private String cabId; + private double latititude; + private double longitude; + + public String getCabId() { + return cabId; + } + + public void setCabId(String cabId) { + this.cabId = cabId; + } + + public double getLatititude() { + return latititude; + } + + public void setLatititude(double latititude) { + this.latititude = latititude; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + @Override + public String toString() { + return "CabLocation [cabId=" + cabId + ", latititude=" + latititude + ", longitude=" + longitude + "]"; + } + +} diff --git a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java new file mode 100644 index 0000000000..2cee734ce6 --- /dev/null +++ b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java @@ -0,0 +1,66 @@ +/** + * + */ +package com.baeldung.reactive.service; + +import java.time.Duration; +import java.util.Random; +import java.util.stream.Stream; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import com.baeldung.reactive.model.CabLocation; + +import reactor.core.publisher.Flux; +import reactor.util.function.Tuple2; + +/** + * @author swpraman + * + */ +@Service +public class CabService { + + /** + * Logger instance + */ + private static final Logger logger = LoggerFactory.getLogger(CabService.class); + + /** + * getLocation service for cab + * @param cabId + * @return + */ + public Flux getLocation(String cabId) { + + // Create a flux to retrieve location + Flux locFlux = Flux.fromStream(Stream.generate(() -> retrieveNewLocation(cabId))); + + // Zip the flux with an interval flux + return Flux.interval(Duration.ofSeconds(1)) + .zipWith(locFlux) + .map(Tuple2::getT2); + } + + /** + * A random instance to create random location parameters + */ + private Random random = new Random(); + + /** + * A Dummy method to return random location. + * In a real project it should retrieve the location from a database or any other data source. + * @param cabId + * @return + */ + private CabLocation retrieveNewLocation(String cabId) { + logger.debug("Retrieveing location for cab: {}", cabId); + CabLocation location = new CabLocation(); + location.setCabId(cabId); + location.setLatititude(random.nextDouble()); + location.setLongitude(random.nextDouble()); + return location; + } +} diff --git a/spring-5-reactive-webflux/src/main/resources/logback.xml b/spring-5-reactive-webflux/src/main/resources/logback.xml new file mode 100644 index 0000000000..bf262ff721 --- /dev/null +++ b/spring-5-reactive-webflux/src/main/resources/logback.xml @@ -0,0 +1,15 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/spring-5-reactive-webflux/src/site/site.xml b/spring-5-reactive-webflux/src/site/site.xml new file mode 100644 index 0000000000..7ca22305ea --- /dev/null +++ b/spring-5-reactive-webflux/src/site/site.xml @@ -0,0 +1,26 @@ + + + + + spring-5-reactive-webflux + https://maven.apache.org/images/apache-maven-project.png + https://www.apache.org/ + + + + https://maven.apache.org/images/maven-logo-black-on-white.png + https://maven.apache.org/ + + + + org.apache.maven.skins + maven-fluido-skin + 1.7 + + + + + + + \ No newline at end of file diff --git a/spring-5-reactive-webflux/src/test/java/com/baeldung/reactive/CapLocationTests.java b/spring-5-reactive-webflux/src/test/java/com/baeldung/reactive/CapLocationTests.java new file mode 100644 index 0000000000..821ba8228b --- /dev/null +++ b/spring-5-reactive-webflux/src/test/java/com/baeldung/reactive/CapLocationTests.java @@ -0,0 +1,66 @@ +package com.baeldung.reactive; + +import java.time.Duration; +import java.util.UUID; + +import org.assertj.core.api.Assertions; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.http.MediaType; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.WebTestClient; + +import com.baeldung.reactive.controller.CabController; +import com.baeldung.reactive.model.CabLocation; +import com.baeldung.reactive.service.CabService; + +import reactor.core.publisher.Flux; +import reactor.test.StepVerifier; +/** + * Unit test for testing Cab Locations + */ +@RunWith(SpringRunner.class) +@ContextConfiguration(classes = { CabController.class, CabService.class }) +@WebFluxTest(controllers = { CabController.class }) +public class CapLocationTests { + + @Autowired + private WebTestClient webClient; + + @Test + public void whenGetAPIConsumed_thenShouldPrintTheLocationAtOneSecInterval() { + + // The id of the booked cab + String cabId = UUID.randomUUID().toString(); + + // URI of the API + String uri = "http://localhost:8080/cab/location/" + cabId; + + // @formatter:off + Flux resultFlux = webClient.get() + .uri(uri).accept(MediaType.APPLICATION_STREAM_JSON) + .exchange() + .returnResult(CabLocation.class) + .getResponseBody(); + + + StepVerifier.create(resultFlux) + .expectSubscription() + .thenAwait(Duration.ofSeconds(1)) + .assertNext(location -> Assertions.assertThat(location) + .hasFieldOrPropertyWithValue("cabId", cabId)) + .thenAwait(Duration.ofSeconds(1)) + .assertNext(location -> Assertions.assertThat(location) + .hasFieldOrPropertyWithValue("cabId", cabId)) + .thenAwait(Duration.ofSeconds(1)) + .assertNext(location -> Assertions.assertThat(location) + .hasFieldOrPropertyWithValue("cabId", cabId)) + .thenCancel() + .verify(); + + // @formatter:on + } +} From f03f66a474b439a732a716b4982709b575fbf798 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Fri, 13 Jul 2018 02:29:40 +0530 Subject: [PATCH 002/546] Evaluation Article - Spring web-flux --- spring-5-reactive-webflux/src/site/site.xml | 26 --------------------- 1 file changed, 26 deletions(-) delete mode 100644 spring-5-reactive-webflux/src/site/site.xml diff --git a/spring-5-reactive-webflux/src/site/site.xml b/spring-5-reactive-webflux/src/site/site.xml deleted file mode 100644 index 7ca22305ea..0000000000 --- a/spring-5-reactive-webflux/src/site/site.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - spring-5-reactive-webflux - https://maven.apache.org/images/apache-maven-project.png - https://www.apache.org/ - - - - https://maven.apache.org/images/maven-logo-black-on-white.png - https://maven.apache.org/ - - - - org.apache.maven.skins - maven-fluido-skin - 1.7 - - - - - - - \ No newline at end of file From 292193e492a98ea06d6dd2596b49a3486733a609 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Fri, 13 Jul 2018 10:31:01 +0530 Subject: [PATCH 003/546] Evaluation Article - Spring web-flux --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 0d78e88c7c..45fa1b6e72 100644 --- a/pom.xml +++ b/pom.xml @@ -272,6 +272,7 @@ antlr maven-archetype apache-meecrowave + spring-5-reactive-webflux From 9f88e41aa870ed675f3d19ab602d668162994c9e Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Sat, 14 Jul 2018 17:08:08 +0530 Subject: [PATCH 004/546] Evaluation Article - Spring web-flux --- .../baeldung/reactive/model/CabLocation.java | 23 ++++++++++++++----- .../baeldung/reactive/service/CabService.java | 6 +---- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java index dc1ed44520..4bc6589c8a 100644 --- a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java +++ b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/model/CabLocation.java @@ -17,8 +17,19 @@ public class CabLocation implements Serializable { private static final long serialVersionUID = -3923503044822400093L; private String cabId; - private double latititude; + private double latitude; private double longitude; + + // default constructor + public CabLocation() { + // create a CabLocation with empty values + } + + public CabLocation(String cabId, double latt, double longt) { + this.cabId = cabId; + this.latitude = latt; + this.longitude = longt; + } public String getCabId() { return cabId; @@ -28,12 +39,12 @@ public class CabLocation implements Serializable { this.cabId = cabId; } - public double getLatititude() { - return latititude; + public double getLatitude() { + return latitude; } - public void setLatititude(double latititude) { - this.latititude = latititude; + public void setLatitude(double latititude) { + this.latitude = latititude; } public double getLongitude() { @@ -46,7 +57,7 @@ public class CabLocation implements Serializable { @Override public String toString() { - return "CabLocation [cabId=" + cabId + ", latititude=" + latititude + ", longitude=" + longitude + "]"; + return "CabLocation [cabId=" + cabId + ", latitude=" + latitude + ", longitude=" + longitude + "]"; } } diff --git a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java index 2cee734ce6..9df56474c1 100644 --- a/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java +++ b/spring-5-reactive-webflux/src/main/java/com/baeldung/reactive/service/CabService.java @@ -57,10 +57,6 @@ public class CabService { */ private CabLocation retrieveNewLocation(String cabId) { logger.debug("Retrieveing location for cab: {}", cabId); - CabLocation location = new CabLocation(); - location.setCabId(cabId); - location.setLatititude(random.nextDouble()); - location.setLongitude(random.nextDouble()); - return location; + return new CabLocation(cabId, random.nextDouble(), random.nextDouble()); } } From e55944b8c14c1475b32148c2558250184a03da77 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Tue, 24 Jul 2018 11:23:39 +0530 Subject: [PATCH 005/546] BAEL-1979 Added examples for SnakeYAML Library --- pom.xml | 3 + snakeyaml/pom.xml | 29 ++++ .../com/baeldung/snakeyaml/model/Address.java | 41 ++++++ .../com/baeldung/snakeyaml/model/Contact.java | 25 ++++ .../baeldung/snakeyaml/model/Customer.java | 62 ++++++++ .../JavaToYAMLSerializationUnitTest.java | 51 +++++++ .../YAMLToJavaDeserialisationUnitTest.java | 135 ++++++++++++++++++ snakeyaml/src/test/resources/customer.yaml | 3 + .../customer_with_contact_details.yaml | 7 + ...omer_with_contact_details_and_address.yaml | 18 +++ ...ustomer_with_contact_details_and_tags.yaml | 6 + .../test/resources/customer_with_type.yaml | 4 + snakeyaml/src/test/resources/customers.yaml | 8 ++ 13 files changed, 392 insertions(+) create mode 100644 snakeyaml/pom.xml create mode 100644 snakeyaml/src/main/java/com/baeldung/snakeyaml/model/Address.java create mode 100644 snakeyaml/src/main/java/com/baeldung/snakeyaml/model/Contact.java create mode 100644 snakeyaml/src/main/java/com/baeldung/snakeyaml/model/Customer.java create mode 100644 snakeyaml/src/test/java/com/baeldung/snakeyaml/JavaToYAMLSerializationUnitTest.java create mode 100644 snakeyaml/src/test/java/com/baeldung/snakeyaml/YAMLToJavaDeserialisationUnitTest.java create mode 100644 snakeyaml/src/test/resources/customer.yaml create mode 100644 snakeyaml/src/test/resources/customer_with_contact_details.yaml create mode 100644 snakeyaml/src/test/resources/customer_with_contact_details_and_address.yaml create mode 100644 snakeyaml/src/test/resources/customer_with_contact_details_and_tags.yaml create mode 100644 snakeyaml/src/test/resources/customer_with_type.yaml create mode 100644 snakeyaml/src/test/resources/customers.yaml diff --git a/pom.xml b/pom.xml index 06ec82e5f0..4aad8d43d6 100644 --- a/pom.xml +++ b/pom.xml @@ -550,6 +550,7 @@ spring-reactive-kotlin jnosql testing-modules/junit-abstract + snakeyaml @@ -670,6 +671,7 @@ spring-apache-camel spring-batch testing-modules/junit-abstract + snakeyaml @@ -1076,6 +1078,7 @@ maven-archetype apache-meecrowave testing-modules/junit-abstract + snakeyaml @@ -1077,8 +1075,7 @@ antlr maven-archetype apache-meecrowave - testing-modules/junit-abstract - snakeyaml + testing-modules/junit-abstract + + junit + junit + 4.12 + test + + + org.scalatest + scalatest_${scala.compat.version} + 3.0.5 + test + + + org.specs2 + specs2-core_${scala.compat.version} + ${spec2.version} + test + + + org.specs2 + specs2-junit_${scala.compat.version} + ${spec2.version} + test + + + + + src/main/scala + src/test/scala + + + + net.alchim31.maven + scala-maven-plugin + 3.3.2 + + + + compile + testCompile + + + + -dependencyfile + ${project.build.directory}/.scala_dependencies + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.21.0 + + + true + + + + org.scalatest + scalatest-maven-plugin + 2.0.0 + + ${project.build.directory}/surefire-reports + . + TestSuiteReport.txt + + samples.AppTest + + + + test + + test + + + + + + + diff --git a/core-scala/project/Dependencies.scala b/core-scala/project/Dependencies.scala new file mode 100644 index 0000000000..558929deb6 --- /dev/null +++ b/core-scala/project/Dependencies.scala @@ -0,0 +1,5 @@ +import sbt._ + +object Dependencies { + lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.5" +} diff --git a/core-scala/project/build.properties b/core-scala/project/build.properties new file mode 100644 index 0000000000..d6e35076cc --- /dev/null +++ b/core-scala/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.1.6 diff --git a/core-scala/src/main/scala/com/baeldung/examples/ClassExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/ClassExamples.scala new file mode 100644 index 0000000000..75a37e2bab --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/ClassExamples.scala @@ -0,0 +1,31 @@ +package com.baeldung.examples + +object ClassExamples extends App { + + import java.time._ + class Customer(val id:Int, val name:String, dob:LocalDate) { + + private var _age = calculateAge(dob) + + def age = _age // getter + def age_= (age:Int) = _age = age //setter + + private def calculateAge(dob:LocalDate) = Period + .between(dob, LocalDate.now) + .getYears + + //override def toString: String = s"(id:${id}, name:${name}, age:${age})" + } + val c = new Customer(1, "Varun Sharma", LocalDate.parse("1980-02-27")) + println(c) + + case class Address(addressLn1:String, area:String, city:String, zip:String) + + val address=Address("102, Raycon Lotus Apartment", "AECS Layout", "Bangalore", "560037") + + val anotherAddress = address.copy(addressLn1="41/2, ITPL Road") + + println(address) + println(anotherAddress) + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/CollectionExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/CollectionExamples.scala new file mode 100644 index 0000000000..1602516067 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/CollectionExamples.scala @@ -0,0 +1,22 @@ +package com.baeldung.examples + +object CollectionExamples extends App { + + val aList = List(5, 3, 9, 2) // create a list + val sortedAscList = aList.sorted // sort ascending + val sortedDescList = aList.sortWith(_ > _) // sort descending + val evenList = aList.filter(_%2 == 0) // filter on some condition + + val mySet = Set(10, 20, 5) // create a set + val changedSet = mySet + 50 // add an element + println(changedSet) + val changedSet2 = mySet - 20 // remove an element + println(changedSet2) + + val capitals = Map("Japan" -> "Tokyo", + "England" -> "London", + "India" -> "New Delhi") // create a map + val capitalOfJapan = capitals("Japan") // get from map + println(capitalOfJapan) + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/ExceptionHandlingExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/ExceptionHandlingExamples.scala new file mode 100644 index 0000000000..16ec7ffdf4 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/ExceptionHandlingExamples.scala @@ -0,0 +1,19 @@ +package com.baeldung.examples + +object ExceptionHandlingExamples extends App { + import java.io._ + def printLines(filename:String) = { + var reader:Option[BufferedReader] = None + try { + reader = Some(new BufferedReader(new FileReader(new File(filename)))) + reader.get.lines().forEach(println(_)) + } catch { + case e:FileNotFoundException => println(s"There was no file named ${filename}") + case e:Throwable => throw new Exception("Some error occurred", e) + } finally { + if (reader.isDefined) reader.get.close() + } + } + printLines("test.txt") + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/FirstClassFunctionExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/FirstClassFunctionExamples.scala new file mode 100644 index 0000000000..bf925f59c7 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/FirstClassFunctionExamples.scala @@ -0,0 +1,17 @@ +package com.baeldung.examples + +object FirstClassFunctionExamples extends App { + + def sum(x:Double, y:Double, f:Double => Double) = f(x) + f(y) + + println(sum(3, 4, x => x*x)) // returns 25.0 + + println(sum(3, 4, x => x*x*x)) // returns 91.0 + + println(sum(3, 4, Math.pow(_, 2))) // returns 25.0 + + def max(first:Int, second:Int) = if (first > second) first else second + + println(max(10, -2)) + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/LoopAndCalculationExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/LoopAndCalculationExamples.scala new file mode 100644 index 0000000000..17091c715d --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/LoopAndCalculationExamples.scala @@ -0,0 +1,39 @@ +package com.baeldung.examples + +object LoopAndCalculationExamples extends App { + import CalculationUtils._ + println(sumWithWhile(Array(10, 20, 30))) + println(sumWithFor(Array(10, 20, 30))) + println(checkEvenOdd((1 to 10).toArray).toList) + println(filterEvens((1 to 10).toArray).toList) +} + +object CalculationUtils { + + def sumWithWhile(values:Array[Int]) = { + var sum = 0 + var i = 0 + while ( i < values.length) { + sum += values(i) + i+=1 + } + sum + } + + def sumWithFor(values:Array[Int]) = { + var sum = 0 + for (i <- values) { + sum += i + } + sum + } + + def checkEvenOdd(values:Array[Int]) = { + for (i <- values) yield if (i%2 == 0) "Even" else "Odd" + } + + def filterEvens(values:Array[Int]) = + for (i <- values if i%2 == 0) + yield i + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/MyApp.scala b/core-scala/src/main/scala/com/baeldung/examples/MyApp.scala new file mode 100644 index 0000000000..d0861a8727 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/MyApp.scala @@ -0,0 +1,15 @@ +package com.baeldung.examples + +/** + * @author ${user.name} + */ +object MyApp { + + def foo(x : Array[String]) = x.foldLeft("")((a,b) => a + b) + + def main(args : Array[String]) { + println( "Hello World!" ) + println("Number of arguments passed:" + args.length) + } + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/ObjectExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/ObjectExamples.scala new file mode 100644 index 0000000000..29db276ebd --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/ObjectExamples.scala @@ -0,0 +1,23 @@ +package com.baeldung.examples + +object ObjectExamples extends App { + + import java.time._ + class Customer(val id:Int, val name:String, private var _age:Int) { + def age = this._age + def age_= (age:Int) = _age = age + } + object Customer { + def apply(id:Int, name:String, age:Int) = new Customer(id, name, age) + + def apply(id:Int, name:String, dob:LocalDate) = { + val p = Period.between(dob, LocalDate.now) + new Customer(id, name, p.getYears) + } + } + val c = Customer(1, "Varun Sharma", LocalDate.parse("1980-02-27")) + + c.age = 20 + println(c.age) + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/OptionExample.scala b/core-scala/src/main/scala/com/baeldung/examples/OptionExample.scala new file mode 100644 index 0000000000..b0d49af758 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/OptionExample.scala @@ -0,0 +1,12 @@ +package com.baeldung.examples + +object OptionExample extends App { + + def minimumEvenNumber(data:Array[Int]) = { + val evens = data.filter(_%2 == 0) + if (evens.isEmpty) None else Some(evens.min) + } + + val minEven = minimumEvenNumber(Array(21, 3, 11, 7)).getOrElse(0) + println(minEven) +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/PatternMatchingExample.scala b/core-scala/src/main/scala/com/baeldung/examples/PatternMatchingExample.scala new file mode 100644 index 0000000000..d476bed60b --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/PatternMatchingExample.scala @@ -0,0 +1,22 @@ +package com.baeldung.examples + +object PatternMatchingExample extends App { + + abstract class Item + case class Book(title:String, author:String, price:Double) extends Item + case class MusicCD(title:String, genre:String, price:Double) extends Item + + def describe(item:Item) = item match { + + case b:Book if b.price > 1000 => println(s"The book ${b.title} is expensive") + + case b:Book => println(s"The book ${b.title} is written by ${b.author}.") + + case MusicCD(title, "Jazz", _) => println(s"This is a CD of Jazz music.") + + case _ => println("Unknown Item") + + } + + describe(Book("Half Girlfriend", "Chetan Bhagat", 100)) +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/TraitExample.scala b/core-scala/src/main/scala/com/baeldung/examples/TraitExample.scala new file mode 100644 index 0000000000..0775a2bac2 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/TraitExample.scala @@ -0,0 +1,23 @@ +package com.baeldung.examples + +import java.io._ + +object TraitExample extends App { + + trait Loggable { + val logger:PrintStream + def getPrefix():String + def log(message:String) = logger.println(s"[${getPrefix()}]:${message}") + } + object CustomerService extends Loggable { + override val logger = System.out + override def getPrefix(): String = "CustomerService" + def retrieve(id:String) = { + log(s"Retrieve with id ${id} called") + // Code to retrieve Customer from DB + } + } + + CustomerService.retrieve("C100") + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/TupleExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/TupleExamples.scala new file mode 100644 index 0000000000..e9ffbd0aca --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/TupleExamples.scala @@ -0,0 +1,18 @@ +package com.baeldung.examples + +object TupleExamples extends App { + + val empSal:(String, Int) = ("David", 10000) + + def getMaxMinSalary(empSal:Array[(String, Int)]) = { + val minEmpSal = empSal.minBy(empSal => empSal._2) + val maxEmpSal = empSal.maxBy(empSal => empSal._2) + (maxEmpSal._2, minEmpSal._2) + } + val empSalArr = Array(("David", 12000), ("Maria", 15000), + ("Elisa", 11000), ("Adam", 8000)) + + val (maxSalary, minSalary) = getMaxMinSalary(empSalArr) + println("Max Salary: " + maxSalary + " and Min Salary: " + minSalary) + +} diff --git a/core-scala/src/main/scala/com/baeldung/examples/VariableDeclaration.scala b/core-scala/src/main/scala/com/baeldung/examples/VariableDeclaration.scala new file mode 100644 index 0000000000..6050b4f908 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/examples/VariableDeclaration.scala @@ -0,0 +1,24 @@ +package com.baeldung.examples + +object VariableDeclaration extends App { + + val x:Int = 0 + var friend:String = "David" + lazy val greet = "Hello" + friend + val data = Array(2, 4, 5) + + printHelloWorld() + println(sum(10, 20)) + + def printHelloWorld():Unit = { + println("Hello World") + } + + def sum(x:Int, y:Int) = x + y + + def sayGreeting(to:String, greet:String="Hi", message:String = "How are you?") = println(greet + " " + to + ", " + message) + + sayGreeting(to="David", message="How are you doing?") + sayGreeting(greet="Hello", to="Maria") + +} diff --git a/core-scala/src/test/scala/samples/junit.scala b/core-scala/src/test/scala/samples/junit.scala new file mode 100644 index 0000000000..89513d5bbc --- /dev/null +++ b/core-scala/src/test/scala/samples/junit.scala @@ -0,0 +1,17 @@ +package samples + +import org.junit._ +import Assert._ + +@Test +class AppTest { + + @Test + def testOK() = assertTrue(true) + +// @Test +// def testKO() = assertTrue(false) + +} + + diff --git a/core-scala/src/test/scala/samples/scalatest.scala b/core-scala/src/test/scala/samples/scalatest.scala new file mode 100644 index 0000000000..bd10412199 --- /dev/null +++ b/core-scala/src/test/scala/samples/scalatest.scala @@ -0,0 +1,108 @@ +/* + * Copyright 2001-2009 Artima, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package samples + +/* +ScalaTest facilitates different styles of testing by providing traits you can mix +together to get the behavior and syntax you prefer. A few examples are +included here. For more information, visit: + +http://www.scalatest.org/ + +One way to use ScalaTest is to help make JUnit or TestNG tests more +clear and concise. Here's an example: +*/ +import scala.collection._ +import org.scalatest.Assertions +import org.junit.Test + +class StackSuite extends Assertions { + + @Test def stackShouldPopValuesIinLastInFirstOutOrder() { + val stack = new mutable.ArrayStack[Int] + stack.push(1) + stack.push(2) + assert(stack.pop() === 2) + assert(stack.pop() === 1) + } + + @Test def stackShouldThrowRuntimeExceptionIfAnEmptyArrayStackIsPopped() { + val emptyStack = new mutable.ArrayStack[String] + intercept[RuntimeException] { + emptyStack.pop() + } + } +} + +/* +Here's an example of a FunSuite with Matchers mixed in: +*/ +import org.scalatest.FunSuite +import org.scalatest.Matchers + +import org.junit.runner.RunWith +import org.scalatest.junit.JUnitRunner +@RunWith(classOf[JUnitRunner]) +class ListSuite extends FunSuite with Matchers { + + test("An empty list should be empty") { + List() should be ('empty) + Nil should be ('empty) + } + + test("A non-empty list should not be empty") { + List(1, 2, 3) should not be ('empty) + List("fee", "fie", "foe", "fum") should not be ('empty) + } + + test("A list's length should equal the number of elements it contains") { + List() should have length (0) + List(1, 2) should have length (2) + List("fee", "fie", "foe", "fum") should have length (4) + } +} + +/* +ScalaTest also supports the behavior-driven development style, in which you +combine tests with text that specifies the behavior being tested. Here's +an example whose text output when run looks like: + +A Map +- should only contain keys and values that were added to it +- should report its size as the number of key/value pairs it contains +*/ +import org.scalatest.FunSpec + +class ExampleSpec extends FunSpec { + + describe("An ArrayStack") { + + it("should pop values in last-in-first-out order") { + val stack = new mutable.ArrayStack[Int] + stack.push(1) + stack.push(2) + assert(stack.pop() === 2) + assert(stack.pop() === 1) + } + + it("should throw RuntimeException if an empty array stack is popped") { + val emptyStack = new mutable.ArrayStack[Int] + intercept[RuntimeException] { + emptyStack.pop() + } + } + } +} diff --git a/core-scala/src/test/scala/samples/specs.scala b/core-scala/src/test/scala/samples/specs.scala new file mode 100644 index 0000000000..9e4dfe93bb --- /dev/null +++ b/core-scala/src/test/scala/samples/specs.scala @@ -0,0 +1,31 @@ +package samples + +import org.junit.runner.RunWith +import org.specs2.mutable._ +import org.specs2.runner._ + + +/** + * Sample specification. + * + * This specification can be executed with: scala -cp ${package}.SpecsTest + * Or using maven: mvn test + * + * For more information on how to write or run specifications, please visit: + * http://etorreborre.github.com/specs2/guide/org.specs2.guide.Runners.html + * + */ +@RunWith(classOf[JUnitRunner]) +class MySpecTest extends Specification { + "The 'Hello world' string" should { + "contain 11 characters" in { + "Hello world" must have size(11) + } + "start with 'Hello'" in { + "Hello world" must startWith("Hello") + } + "end with 'world'" in { + "Hello world" must endWith("world") + } + } +} diff --git a/core-scala/test.txt b/core-scala/test.txt new file mode 100644 index 0000000000..da431d2039 --- /dev/null +++ b/core-scala/test.txt @@ -0,0 +1,4 @@ +Hi, +This is the lines +from the test file. +Thanks. \ No newline at end of file From 63d89a6b42407c775e6e7c5079aa627640e15856 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Thu, 9 Aug 2018 02:29:46 +0530 Subject: [PATCH 010/546] adding core-scala to pom --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index a9aaff3e22..1be2bb6120 100644 --- a/pom.xml +++ b/pom.xml @@ -315,6 +315,7 @@ core-java-persistence core-kotlin core-groovy + core-scala core-java-concurrency couchbase deltaspike From f0d3a4ed4a4d0a0854b600584d937adda9f7d781 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Tue, 14 Aug 2018 11:29:29 +0530 Subject: [PATCH 011/546] BAEL-1466 Added a new module for apache-geode --- apache-geode/pom.xml | 46 ++++++ .../java/com/baeldung/geode/Customer.java | 78 ++++++++++ .../java/com/baeldung/geode/CustomerKey.java | 57 +++++++ .../baeldung/geode/functions/PrimeNumber.java | 49 ++++++ .../geode/GeodeSamplesIntegrationTest.java | 144 ++++++++++++++++++ 5 files changed, 374 insertions(+) create mode 100644 apache-geode/pom.xml create mode 100644 apache-geode/src/main/java/com/baeldung/geode/Customer.java create mode 100644 apache-geode/src/main/java/com/baeldung/geode/CustomerKey.java create mode 100644 apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java create mode 100644 apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java diff --git a/apache-geode/pom.xml b/apache-geode/pom.xml new file mode 100644 index 0000000000..a3f6604ac4 --- /dev/null +++ b/apache-geode/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + com.baeldung + apache-geode + 1.0-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + 1.6.0 + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + + + + org.apache.geode + geode-core + ${geode.core} + + + junit + junit + RELEASE + + + + \ No newline at end of file diff --git a/apache-geode/src/main/java/com/baeldung/geode/Customer.java b/apache-geode/src/main/java/com/baeldung/geode/Customer.java new file mode 100644 index 0000000000..82ee5ecaeb --- /dev/null +++ b/apache-geode/src/main/java/com/baeldung/geode/Customer.java @@ -0,0 +1,78 @@ +package com.baeldung.geode; + +import java.io.Serializable; +import java.util.Objects; + +public class Customer implements Serializable { + + private static final long serialVersionUID = -7482516011038799900L; + + private CustomerKey key; + private String firstName; + private String lastName; + private Integer age; + + public Customer() { + } + + public Customer(String firstName, String lastName, int age) { + this.firstName = firstName; + this.lastName = lastName; + this.age = age; + } + + public Customer(CustomerKey key, String firstName, String lastName, int age) { + this(firstName, lastName, age); + this.key = key; + } + + // setters and getters + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + @Override + public String toString() { + return "Customer{" + "firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", age=" + age + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Customer customer = (Customer) o; + return Objects.equals(firstName, customer.firstName) && Objects.equals(lastName, customer.lastName) && Objects.equals(age, customer.age); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, age); + } +} diff --git a/apache-geode/src/main/java/com/baeldung/geode/CustomerKey.java b/apache-geode/src/main/java/com/baeldung/geode/CustomerKey.java new file mode 100644 index 0000000000..bfa64870c0 --- /dev/null +++ b/apache-geode/src/main/java/com/baeldung/geode/CustomerKey.java @@ -0,0 +1,57 @@ +package com.baeldung.geode; + +import java.io.Serializable; + +public class CustomerKey implements Serializable { + + private static final long serialVersionUID = -3529253035303792458L; + private long id; + private String country; + + public CustomerKey(long id) { + this.id = id; + this.country = "USA"; + } + + public CustomerKey(long id, String country) { + this.id = id; + this.country = country; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + CustomerKey that = (CustomerKey) o; + + if (id != that.id) + return false; + return country != null ? country.equals(that.country) : that.country == null; + } + + @Override + public int hashCode() { + int result = (int) (id ^ (id >>> 32)); + result = 31 * result + (country != null ? country.hashCode() : 0); + return result; + } +} diff --git a/apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java b/apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java new file mode 100644 index 0000000000..411816348a --- /dev/null +++ b/apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java @@ -0,0 +1,49 @@ +package com.baeldung.geode.functions; + +import org.apache.geode.cache.Region; +import org.apache.geode.cache.execute.Function; +import org.apache.geode.cache.execute.FunctionContext; +import org.apache.geode.cache.execute.RegionFunctionContext; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +public class PrimeNumber implements Function { + + public static final String ID = PrimeNumber.class.getSimpleName(); + + @Override + public void execute(FunctionContext context) { + RegionFunctionContext regionContext = (RegionFunctionContext) context; + Region region = regionContext.getDataSet(); + + List primes = new ArrayList<>(); + Set keys = region.keySet(); + for (Integer key : keys) { + if (isPrime(key)) { + primes.add(key); + } + } + Collections.sort(primes); + + context.getResultSender() + .lastResult(primes); + } + + @Override + public String getId() { + return ID; + } + + private boolean isPrime(int number) { + int limit = (int) Math.floor(Math.sqrt(number)); + for (int divisor = 2; divisor <= limit; ++divisor) { + if (number % divisor == 0) { + return false; + } + } + return true; + } +} diff --git a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java new file mode 100644 index 0000000000..5445772259 --- /dev/null +++ b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java @@ -0,0 +1,144 @@ +package com.baeldung.geode; + +import com.baeldung.geode.functions.PrimeNumber; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.client.ClientCache; +import org.apache.geode.cache.client.ClientCacheFactory; +import org.apache.geode.cache.client.ClientRegionShortcut; +import org.apache.geode.cache.execute.Execution; +import org.apache.geode.cache.execute.FunctionService; +import org.apache.geode.cache.execute.ResultCollector; +import org.apache.geode.cache.query.*; +import org.junit.Test; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class GeodeSamplesIntegrationTest { + + @Test + public void whenSendMessageToRegion_thenMessageSavedSuccessfully() { + ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) + .create(); + Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung"); + + region.put("1", "Hello"); + region.put("2", "Baeldung"); + + assertEquals("Hello", region.get("1")); + assertEquals("Baeldung", region.get("2")); + + cache.close(); + } + + @Test + public void whenPutMultipleValuesAtOnce_thenValuesSavedSuccessfully() { + ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) + .create(); + Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung"); + + Map values = IntStream.rangeClosed(1, 5) + .mapToObj(String::valueOf) + .collect(Collectors.toMap(Function.identity(), i -> "value" + i)); + + region.putAll(values); + + IntStream.rangeClosed(1, 5) + .mapToObj(String::valueOf) + .forEach(e -> { + assertEquals("value".concat(e), region.get(e)); + }); + cache.close(); + } + + @Test + public void whenSaveCustomerDataOnPartitionedRegion_thenDataSavedCorrectly() { + ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) + .create(); + Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-partition"); + + Customer customer1 = new Customer(new CustomerKey(1l), "Gheorge", "Manuc", 36); + Customer customer2 = new Customer(new CustomerKey(2l), "Allan", "McDowell", 43); + Customer customer3 = new Customer(new CustomerKey(3l), "Alan", "McClean", 23); + Customer customer4 = new Customer(new CustomerKey(4l), "Allan", "Donald", 46); + + Map customerData = new HashMap<>(); + customerData.put(1, customer1); + customerData.put(2, customer2); + customerData.put(3, customer3); + customerData.put(4, customer4); + + region.putAll(customerData); + // assert the size on the cache server. + assertEquals(4, region.sizeOnServer()); + cache.close(); + } + + @Test + public void whenFindACustomerUsingOQL_thenCorrectCustomerObject() throws NameResolutionException, TypeMismatchException, QueryInvocationTargetException, FunctionDomainException { + ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) + .create(); + Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-oql"); + + Customer customer1 = new Customer("Gheorge", "Manuc", 36); + Customer customer2 = new Customer("Allan", "McDowell", 43); + Customer customer3 = new Customer("Alan", "McClean", 23); + Customer customer4 = new Customer("Allan", "Donald", 46); + + Map customerData = new HashMap<>(); + customerData.put(1, customer1); + customerData.put(2, customer2); + customerData.put(3, customer3); + customerData.put(4, customer4); + + region.putAll(customerData); + // assert the size on the cache server. + assertEquals(4, region.sizeOnServer()); + + QueryService queryService = cache.getQueryService(); + String query = "select * from /baeldung-oql c where c.firstName = 'Allan'"; + SelectResults queryResults = (SelectResults) queryService.newQuery(query) + .execute(); + assertEquals(2, queryResults.size()); + + cache.close(); + + } + + @Test + public void whenExecutePrimeNumberFunction_thenReturnOnlyPrimeNumbers() { + // connect to the locator using default port 10334 + ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) + .create(); + + // create a local region that matches the server region + Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-function"); + + Execution execution = FunctionService.onRegion(region); + + IntStream.rangeClosed(1, 5) + .forEach(i -> region.put(i, String.valueOf(i))); + + ResultCollector results = execution.execute(PrimeNumber.ID); + Set primes = new HashSet<>(); + List resultList = results.getResult(); + assertNotNull(resultList); + assertEquals(1, resultList.size()); + + primes.addAll((List) resultList.iterator() + .next()); + assertEquals(4, primes.size()); + cache.close(); + } + +} From b6816bdcdd66540f483403a273f2862e1820fb57 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Fri, 24 Aug 2018 23:50:40 +0530 Subject: [PATCH 012/546] BAEL-1466 Updated the Integration Tests. --- .../geode/GeodeSamplesIntegrationTest.java | 112 ++++++++++-------- 1 file changed, 64 insertions(+), 48 deletions(-) diff --git a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java index 5445772259..1eb71671a1 100644 --- a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java +++ b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java @@ -9,62 +9,93 @@ import org.apache.geode.cache.execute.Execution; import org.apache.geode.cache.execute.FunctionService; import org.apache.geode.cache.execute.ResultCollector; import org.apache.geode.cache.query.*; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import java.util.*; import java.util.function.Function; +import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; +import java.util.stream.Stream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class GeodeSamplesIntegrationTest { + ClientCache cache = null; + Region region = null; + Region partitionedRegion = null; + Region queryRegion = null; + Region functionRegion = null; + Region customKeyRegion = null; + + @Before + public void connect() { + this.cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) + .create(); + this.region = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung"); + this.partitionedRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-partition"); + this.queryRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-oql"); + this.functionRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-function"); + this.customKeyRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-custom"); + } + + @After + public void cleanup() { + this.cache.close(); + } + @Test public void whenSendMessageToRegion_thenMessageSavedSuccessfully() { - ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) - .create(); - Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung"); - region.put("1", "Hello"); - region.put("2", "Baeldung"); + this.region.put("1", "Hello"); + this.region.put("2", "Baeldung"); assertEquals("Hello", region.get("1")); assertEquals("Baeldung", region.get("2")); - cache.close(); } @Test public void whenPutMultipleValuesAtOnce_thenValuesSavedSuccessfully() { - ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) - .create(); - Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung"); - Map values = IntStream.rangeClosed(1, 5) - .mapToObj(String::valueOf) - .collect(Collectors.toMap(Function.identity(), i -> "value" + i)); + Supplier> keys = () -> Stream.of("A", "B", "C", "D", "E"); + Map values = keys.get() + .collect(Collectors.toMap(Function.identity(), String::toLowerCase)); - region.putAll(values); + this.region.putAll(values); + + keys.get() + .forEach(k -> assertEquals(k.toLowerCase(), this.region.get(k))); + + } + + @Test + public void whenPutCustomKey_thenValuesSavedSuccessfully() { + CustomerKey key = new CustomerKey(123); + Customer customer = new Customer(key, "William", "Russell", 35); + + Map customerInfo = new HashMap<>(); + customerInfo.put(key, customer); + + this.customKeyRegion.putAll(customerInfo); + + Customer storedCustomer = this.customKeyRegion.get(key); + assertEquals("William", storedCustomer.getFirstName()); + assertEquals("Russell", storedCustomer.getLastName()); - IntStream.rangeClosed(1, 5) - .mapToObj(String::valueOf) - .forEach(e -> { - assertEquals("value".concat(e), region.get(e)); - }); - cache.close(); } @Test public void whenSaveCustomerDataOnPartitionedRegion_thenDataSavedCorrectly() { - ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) - .create(); - Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung-partition"); - Customer customer1 = new Customer(new CustomerKey(1l), "Gheorge", "Manuc", 36); Customer customer2 = new Customer(new CustomerKey(2l), "Allan", "McDowell", 43); Customer customer3 = new Customer(new CustomerKey(3l), "Alan", "McClean", 23); @@ -76,18 +107,13 @@ public class GeodeSamplesIntegrationTest { customerData.put(3, customer3); customerData.put(4, customer4); - region.putAll(customerData); + this.partitionedRegion.putAll(customerData); // assert the size on the cache server. - assertEquals(4, region.sizeOnServer()); - cache.close(); + assertEquals(4, this.partitionedRegion.sizeOnServer()); } @Test public void whenFindACustomerUsingOQL_thenCorrectCustomerObject() throws NameResolutionException, TypeMismatchException, QueryInvocationTargetException, FunctionDomainException { - ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) - .create(); - Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung-oql"); Customer customer1 = new Customer("Gheorge", "Manuc", 36); Customer customer2 = new Customer("Allan", "McDowell", 43); @@ -100,34 +126,25 @@ public class GeodeSamplesIntegrationTest { customerData.put(3, customer3); customerData.put(4, customer4); - region.putAll(customerData); + this.queryRegion.putAll(customerData); // assert the size on the cache server. - assertEquals(4, region.sizeOnServer()); + assertEquals(4, this.queryRegion.sizeOnServer()); - QueryService queryService = cache.getQueryService(); + QueryService queryService = this.cache.getQueryService(); String query = "select * from /baeldung-oql c where c.firstName = 'Allan'"; SelectResults queryResults = (SelectResults) queryService.newQuery(query) .execute(); assertEquals(2, queryResults.size()); - cache.close(); - } @Test public void whenExecutePrimeNumberFunction_thenReturnOnlyPrimeNumbers() { - // connect to the locator using default port 10334 - ClientCache cache = new ClientCacheFactory().addPoolLocator("localhost", 10334) - .create(); - // create a local region that matches the server region - Region region = cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung-function"); - - Execution execution = FunctionService.onRegion(region); + Execution execution = FunctionService.onRegion(this.functionRegion); IntStream.rangeClosed(1, 5) - .forEach(i -> region.put(i, String.valueOf(i))); + .forEach(i -> this.functionRegion.put(i, String.valueOf(i))); ResultCollector results = execution.execute(PrimeNumber.ID); Set primes = new HashSet<>(); @@ -138,7 +155,6 @@ public class GeodeSamplesIntegrationTest { primes.addAll((List) resultList.iterator() .next()); assertEquals(4, primes.size()); - cache.close(); } } From eafbe5d88a73dc32c36a00bbf46a345b34ade240 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Mon, 3 Sep 2018 22:44:11 +0530 Subject: [PATCH 013/546] BAEL-1466 Updated the Integration Tests. --- .../geode/functions/CustomerWithMaxAge.java | 39 +++++++++++++++++++ .../geode/GeodeSamplesIntegrationTest.java | 14 +++++++ 2 files changed, 53 insertions(+) create mode 100644 apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java diff --git a/apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java b/apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java new file mode 100644 index 0000000000..ef729a1ac2 --- /dev/null +++ b/apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java @@ -0,0 +1,39 @@ +package com.baeldung.geode.functions; + +import com.baeldung.geode.Customer; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.execute.Function; +import org.apache.geode.cache.execute.FunctionContext; +import org.apache.geode.cache.execute.RegionFunctionContext; + +import java.util.Comparator; +import java.util.Map; +import java.util.Optional; + +public class CustomerWithMaxAge implements Function { + + public static final String ID = CustomerWithMaxAge.class.getSimpleName(); + + private static final long serialVersionUID = -6023734758827953742L; + + @Override + public void execute(FunctionContext context) { + RegionFunctionContext regionContext = (RegionFunctionContext) context; + Region region = regionContext.getDataSet(); + + Comparator ageComparator = Comparator.comparing(Customer::getAge); + + Optional customer = region.entrySet() + .stream() + .map(Map.Entry::getValue) + .max(ageComparator); + + customer.ifPresent(c -> context.getResultSender() + .lastResult(c)); + } + + @Override + public String getId() { + return ID; + } +} diff --git a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java index 1eb71671a1..9c47d099da 100644 --- a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java +++ b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java @@ -1,5 +1,6 @@ package com.baeldung.geode; +import com.baeldung.geode.functions.CustomerWithMaxAge; import com.baeldung.geode.functions.PrimeNumber; import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientCache; @@ -138,6 +139,19 @@ public class GeodeSamplesIntegrationTest { } + @Test + public void whenExecuteFindEldestCustomerFunction_thenReturnTheEldestCustomer() { + Execution execution = FunctionService.onRegion(this.queryRegion); + + ResultCollector result = execution.execute(CustomerWithMaxAge.ID); + List resultList = (List) result.getResult(); + assertNotNull(resultList); + assertEquals(1, resultList.size()); + + Customer customer = resultList.get(0); + assertEquals(Integer.valueOf(46), customer.getAge()); + } + @Test public void whenExecutePrimeNumberFunction_thenReturnOnlyPrimeNumbers() { From 334137939be5d9a9757729bf8a953a68662535b3 Mon Sep 17 00:00:00 2001 From: Simon <7910919+smic1909@users.noreply.github.com> Date: Thu, 6 Sep 2018 11:45:25 +0200 Subject: [PATCH 014/546] Fixed assignment of restTemplate Fixed assignment of restTemplate --- .../main/java/org/baeldung/web/service/BarConsumerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-resttemplate/src/main/java/org/baeldung/web/service/BarConsumerService.java b/spring-resttemplate/src/main/java/org/baeldung/web/service/BarConsumerService.java index 4188677b4f..0bf24bd480 100644 --- a/spring-resttemplate/src/main/java/org/baeldung/web/service/BarConsumerService.java +++ b/spring-resttemplate/src/main/java/org/baeldung/web/service/BarConsumerService.java @@ -14,7 +14,7 @@ public class BarConsumerService { @Autowired public BarConsumerService(RestTemplateBuilder restTemplateBuilder) { - RestTemplate restTemplate = restTemplateBuilder + restTemplate = restTemplateBuilder .errorHandler(new RestTemplateResponseErrorHandler()) .build(); } From 51a583b229141c1618279bed7653fdd61bf06c38 Mon Sep 17 00:00:00 2001 From: cror Date: Thu, 6 Sep 2018 22:25:49 +0200 Subject: [PATCH 015/546] spring-5-reactive-security: fixing EmployeeControllerIntegrationTest --- .../reactive/webflux/EmployeeControllerIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-5-reactive-security/src/test/java/com/baeldung/reactive/webflux/EmployeeControllerIntegrationTest.java b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/webflux/EmployeeControllerIntegrationTest.java index 3dc832d781..12a21ed4ef 100644 --- a/spring-5-reactive-security/src/test/java/com/baeldung/reactive/webflux/EmployeeControllerIntegrationTest.java +++ b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/webflux/EmployeeControllerIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; -import com.baeldung.reactive.actuator.Spring5ReactiveApplication; +import com.baeldung.webflux.EmployeeSpringApplication; import com.baeldung.webflux.Employee; import com.baeldung.webflux.EmployeeRepository; @@ -23,7 +23,7 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes=Spring5ReactiveApplication.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes=EmployeeSpringApplication.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class EmployeeControllerIntegrationTest { From e3a84dae5b623ed2245d35ccaf5073e5582113fa Mon Sep 17 00:00:00 2001 From: Dmytro Korniienko Date: Sun, 9 Sep 2018 13:13:17 +0300 Subject: [PATCH 016/546] BAEL-2070 Qualifier used instead of Primary to distinguish between different repository beans --- .../baeldung/dependency/exception/app/PurchaseDeptService.java | 3 ++- .../dependency/exception/repository/DressRepository.java | 3 ++- .../dependency/exception/repository/ShoeRepository.java | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/com/baeldung/dependency/exception/app/PurchaseDeptService.java b/spring-core/src/main/java/com/baeldung/dependency/exception/app/PurchaseDeptService.java index 1e6fad63aa..e0fe01acdd 100644 --- a/spring-core/src/main/java/com/baeldung/dependency/exception/app/PurchaseDeptService.java +++ b/spring-core/src/main/java/com/baeldung/dependency/exception/app/PurchaseDeptService.java @@ -1,13 +1,14 @@ package com.baeldung.dependency.exception.app; import com.baeldung.dependency.exception.repository.InventoryRepository; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; @Service public class PurchaseDeptService { private InventoryRepository repository; - public PurchaseDeptService(InventoryRepository repository) { + public PurchaseDeptService(@Qualifier("dresses") InventoryRepository repository) { this.repository = repository; } } \ No newline at end of file diff --git a/spring-core/src/main/java/com/baeldung/dependency/exception/repository/DressRepository.java b/spring-core/src/main/java/com/baeldung/dependency/exception/repository/DressRepository.java index 4a6c836143..5a1371ce04 100644 --- a/spring-core/src/main/java/com/baeldung/dependency/exception/repository/DressRepository.java +++ b/spring-core/src/main/java/com/baeldung/dependency/exception/repository/DressRepository.java @@ -1,9 +1,10 @@ package com.baeldung.dependency.exception.repository; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Repository; -@Primary +@Qualifier("dresses") @Repository public class DressRepository implements InventoryRepository { } diff --git a/spring-core/src/main/java/com/baeldung/dependency/exception/repository/ShoeRepository.java b/spring-core/src/main/java/com/baeldung/dependency/exception/repository/ShoeRepository.java index 60495914cd..227d8934b6 100644 --- a/spring-core/src/main/java/com/baeldung/dependency/exception/repository/ShoeRepository.java +++ b/spring-core/src/main/java/com/baeldung/dependency/exception/repository/ShoeRepository.java @@ -1,7 +1,9 @@ package com.baeldung.dependency.exception.repository; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Repository; +@Qualifier("shoes") @Repository public class ShoeRepository implements InventoryRepository { } From d152facd1dfbdfdb76d9c48d28f66283ebc6bd72 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Mon, 10 Sep 2018 23:25:57 +0530 Subject: [PATCH 017/546] BAEL-1466 Updated the Integration Tests. --- .../geode/functions/UpperCaseNames.java | 34 +++++++ .../geode/GeodeSamplesIntegrationTest.java | 94 ++++--------------- 2 files changed, 51 insertions(+), 77 deletions(-) create mode 100644 apache-geode/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java diff --git a/apache-geode/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java b/apache-geode/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java new file mode 100644 index 0000000000..5ff8e53da8 --- /dev/null +++ b/apache-geode/src/main/java/com/baeldung/geode/functions/UpperCaseNames.java @@ -0,0 +1,34 @@ +package com.baeldung.geode.functions; + +import com.baeldung.geode.Customer; +import com.baeldung.geode.CustomerKey; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.execute.Function; +import org.apache.geode.cache.execute.FunctionContext; +import org.apache.geode.cache.execute.RegionFunctionContext; + +import java.util.Map; + +public class UpperCaseNames implements Function { + private static final long serialVersionUID = -8946294032165677602L; + + @Override + public void execute(FunctionContext context) { + RegionFunctionContext regionContext = (RegionFunctionContext) context; + Region region = regionContext.getDataSet(); + + for (Map.Entry entry : region.entrySet()) { + Customer customer = entry.getValue(); + customer.setFirstName(customer.getFirstName() + .toUpperCase()); + } + + context.getResultSender() + .lastResult(true); + } + + @Override + public String getId() { + return getClass().getName(); + } +} diff --git a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java index 9c47d099da..eb9affde8e 100644 --- a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java +++ b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java @@ -2,6 +2,7 @@ package com.baeldung.geode; import com.baeldung.geode.functions.CustomerWithMaxAge; import com.baeldung.geode.functions.PrimeNumber; +import com.baeldung.geode.functions.UpperCaseNames; import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientCache; import org.apache.geode.cache.client.ClientCacheFactory; @@ -28,10 +29,8 @@ public class GeodeSamplesIntegrationTest { ClientCache cache = null; Region region = null; - Region partitionedRegion = null; Region queryRegion = null; - Region functionRegion = null; - Region customKeyRegion = null; + Region customerRegion = null; @Before public void connect() { @@ -39,14 +38,8 @@ public class GeodeSamplesIntegrationTest { .create(); this.region = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create("baeldung"); - this.partitionedRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung-partition"); - this.queryRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung-oql"); - this.functionRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung-function"); - this.customKeyRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) - .create("baeldung-custom"); + this.customerRegion = this.cache. createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) + .create("baeldung-customers"); } @After @@ -87,88 +80,35 @@ public class GeodeSamplesIntegrationTest { Map customerInfo = new HashMap<>(); customerInfo.put(key, customer); - this.customKeyRegion.putAll(customerInfo); + this.customerRegion.putAll(customerInfo); - Customer storedCustomer = this.customKeyRegion.get(key); + Customer storedCustomer = this.customerRegion.get(key); assertEquals("William", storedCustomer.getFirstName()); assertEquals("Russell", storedCustomer.getLastName()); } - @Test - public void whenSaveCustomerDataOnPartitionedRegion_thenDataSavedCorrectly() { - Customer customer1 = new Customer(new CustomerKey(1l), "Gheorge", "Manuc", 36); - Customer customer2 = new Customer(new CustomerKey(2l), "Allan", "McDowell", 43); - Customer customer3 = new Customer(new CustomerKey(3l), "Alan", "McClean", 23); - Customer customer4 = new Customer(new CustomerKey(4l), "Allan", "Donald", 46); - - Map customerData = new HashMap<>(); - customerData.put(1, customer1); - customerData.put(2, customer2); - customerData.put(3, customer3); - customerData.put(4, customer4); - - this.partitionedRegion.putAll(customerData); - // assert the size on the cache server. - assertEquals(4, this.partitionedRegion.sizeOnServer()); - } - @Test public void whenFindACustomerUsingOQL_thenCorrectCustomerObject() throws NameResolutionException, TypeMismatchException, QueryInvocationTargetException, FunctionDomainException { - Customer customer1 = new Customer("Gheorge", "Manuc", 36); - Customer customer2 = new Customer("Allan", "McDowell", 43); - Customer customer3 = new Customer("Alan", "McClean", 23); - Customer customer4 = new Customer("Allan", "Donald", 46); - - Map customerData = new HashMap<>(); - customerData.put(1, customer1); - customerData.put(2, customer2); - customerData.put(3, customer3); - customerData.put(4, customer4); - - this.queryRegion.putAll(customerData); - // assert the size on the cache server. - assertEquals(4, this.queryRegion.sizeOnServer()); + Map data = new HashMap<>(); + data.put(new CustomerKey(1), new Customer("Gheorge", "Manuc", 36)); + data.put(new CustomerKey(2), new Customer("Allan", "McDowell", 43)); + this.customerRegion.putAll(data); QueryService queryService = this.cache.getQueryService(); - String query = "select * from /baeldung-oql c where c.firstName = 'Allan'"; + String query = "select * from /baeldung-customers c where c.firstName = 'Allan'"; SelectResults queryResults = (SelectResults) queryService.newQuery(query) .execute(); - assertEquals(2, queryResults.size()); + assertEquals(1, queryResults.size()); } @Test - public void whenExecuteFindEldestCustomerFunction_thenReturnTheEldestCustomer() { - Execution execution = FunctionService.onRegion(this.queryRegion); - - ResultCollector result = execution.execute(CustomerWithMaxAge.ID); - List resultList = (List) result.getResult(); - assertNotNull(resultList); - assertEquals(1, resultList.size()); - - Customer customer = resultList.get(0); - assertEquals(Integer.valueOf(46), customer.getAge()); + public void whenExecuteUppercaseNames_thenCustomerNamesAreUppercased() { + Execution execution = FunctionService.onRegion(this.customerRegion); + execution.execute(UpperCaseNames.class.getName()); + Customer customer = this.customerRegion.get(new CustomerKey(1)); + assertEquals("GHEORGE", customer.getFirstName()); } - - @Test - public void whenExecutePrimeNumberFunction_thenReturnOnlyPrimeNumbers() { - - Execution execution = FunctionService.onRegion(this.functionRegion); - - IntStream.rangeClosed(1, 5) - .forEach(i -> this.functionRegion.put(i, String.valueOf(i))); - - ResultCollector results = execution.execute(PrimeNumber.ID); - Set primes = new HashSet<>(); - List resultList = results.getResult(); - assertNotNull(resultList); - assertEquals(1, resultList.size()); - - primes.addAll((List) resultList.iterator() - .next()); - assertEquals(4, primes.size()); - } - } From 9664247f4f426bea83b625a510b76ffe9068e08c Mon Sep 17 00:00:00 2001 From: Dmytro Korniienko Date: Mon, 10 Sep 2018 21:29:38 +0300 Subject: [PATCH 018/546] BAEL-2095 CrudRepository save() method --- .../baeldung/config/CustomConfiguration.java | 29 ++++++++++++++++ .../dao/repositories/InventoryRepository.java | 7 ++++ .../baeldung/domain/MerchandiseEntity.java | 34 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java create mode 100644 spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java create mode 100644 spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java b/spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java new file mode 100644 index 0000000000..5af5351d76 --- /dev/null +++ b/spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java @@ -0,0 +1,29 @@ +package com.baeldung.config; + +import com.baeldung.dao.repositories.InventoryRepository; +import com.baeldung.domain.MerchandiseEntity; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@SpringBootApplication +@EnableJpaRepositories(basePackageClasses = InventoryRepository.class) +@EntityScan(basePackageClasses = MerchandiseEntity.class) +public class CustomConfiguration { + public static void main(String[] args) { + ConfigurableApplicationContext context = SpringApplication.run(CustomConfiguration.class, args); + + InventoryRepository repo = context.getBean(InventoryRepository.class); + + MerchandiseEntity pants = new MerchandiseEntity("Pair of Pants"); + repo.save(pants); + + MerchandiseEntity shorts = new MerchandiseEntity("Pair of Shorts"); + repo.save(shorts); + + pants.setTitle("Branded Luxury Pants"); + repo.save(pants); + } +} diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java b/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java new file mode 100644 index 0000000000..a575f0b915 --- /dev/null +++ b/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java @@ -0,0 +1,7 @@ +package com.baeldung.dao.repositories; + +import com.baeldung.domain.MerchandiseEntity; +import org.springframework.data.repository.CrudRepository; + +public interface InventoryRepository extends CrudRepository { +} diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java b/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java new file mode 100644 index 0000000000..921edf1b85 --- /dev/null +++ b/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java @@ -0,0 +1,34 @@ +package com.baeldung.domain; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class MerchandiseEntity { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private String title; + + public MerchandiseEntity() { + } + + public MerchandiseEntity(String title) { + this.title = title; + } + + public Long getId() { + return id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} From 2e60aa32a251a43e3153c5aeb9609bde16995e60 Mon Sep 17 00:00:00 2001 From: Dmytro Korniienko Date: Tue, 11 Sep 2018 00:13:41 +0300 Subject: [PATCH 019/546] (REVERT) BAEL-2095 CrudRepository save() method --- .../baeldung/config/CustomConfiguration.java | 29 ---------------- .../dao/repositories/InventoryRepository.java | 7 ---- .../baeldung/domain/MerchandiseEntity.java | 34 ------------------- 3 files changed, 70 deletions(-) delete mode 100644 spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java delete mode 100644 spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java delete mode 100644 spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java b/spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java deleted file mode 100644 index 5af5351d76..0000000000 --- a/spring-data-jpa/src/main/java/com/baeldung/config/CustomConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.baeldung.config; - -import com.baeldung.dao.repositories.InventoryRepository; -import com.baeldung.domain.MerchandiseEntity; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; - -@SpringBootApplication -@EnableJpaRepositories(basePackageClasses = InventoryRepository.class) -@EntityScan(basePackageClasses = MerchandiseEntity.class) -public class CustomConfiguration { - public static void main(String[] args) { - ConfigurableApplicationContext context = SpringApplication.run(CustomConfiguration.class, args); - - InventoryRepository repo = context.getBean(InventoryRepository.class); - - MerchandiseEntity pants = new MerchandiseEntity("Pair of Pants"); - repo.save(pants); - - MerchandiseEntity shorts = new MerchandiseEntity("Pair of Shorts"); - repo.save(shorts); - - pants.setTitle("Branded Luxury Pants"); - repo.save(pants); - } -} diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java b/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java deleted file mode 100644 index a575f0b915..0000000000 --- a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.baeldung.dao.repositories; - -import com.baeldung.domain.MerchandiseEntity; -import org.springframework.data.repository.CrudRepository; - -public interface InventoryRepository extends CrudRepository { -} diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java b/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java deleted file mode 100644 index 921edf1b85..0000000000 --- a/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.baeldung.domain; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; - -@Entity -public class MerchandiseEntity { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - private String title; - - public MerchandiseEntity() { - } - - public MerchandiseEntity(String title) { - this.title = title; - } - - public Long getId() { - return id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } -} From b7b9c2baa44b6ce44e06eda6f5d582f462922b83 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Tue, 11 Sep 2018 21:14:15 +0530 Subject: [PATCH 020/546] Revert "core-scala: initial commit" This reverts commit d46873405a67addfaa69aa7855b37af9c4a3df14. --- core-scala/build.gradle | 13 -- core-scala/build.sbt | 12 -- core-scala/pom.xml | 111 ------------------ core-scala/project/Dependencies.scala | 5 - core-scala/project/build.properties | 1 - .../com/baeldung/examples/ClassExamples.scala | 31 ----- .../examples/CollectionExamples.scala | 22 ---- .../examples/ExceptionHandlingExamples.scala | 19 --- .../examples/FirstClassFunctionExamples.scala | 17 --- .../examples/LoopAndCalculationExamples.scala | 39 ------ .../scala/com/baeldung/examples/MyApp.scala | 15 --- .../baeldung/examples/ObjectExamples.scala | 23 ---- .../com/baeldung/examples/OptionExample.scala | 12 -- .../examples/PatternMatchingExample.scala | 22 ---- .../com/baeldung/examples/TraitExample.scala | 23 ---- .../com/baeldung/examples/TupleExamples.scala | 18 --- .../examples/VariableDeclaration.scala | 24 ---- core-scala/src/test/scala/samples/junit.scala | 17 --- .../src/test/scala/samples/scalatest.scala | 108 ----------------- core-scala/src/test/scala/samples/specs.scala | 31 ----- core-scala/test.txt | 4 - 21 files changed, 567 deletions(-) delete mode 100644 core-scala/build.gradle delete mode 100644 core-scala/build.sbt delete mode 100644 core-scala/pom.xml delete mode 100644 core-scala/project/Dependencies.scala delete mode 100644 core-scala/project/build.properties delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/ClassExamples.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/CollectionExamples.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/ExceptionHandlingExamples.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/FirstClassFunctionExamples.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/LoopAndCalculationExamples.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/MyApp.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/ObjectExamples.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/OptionExample.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/PatternMatchingExample.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/TraitExample.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/TupleExamples.scala delete mode 100644 core-scala/src/main/scala/com/baeldung/examples/VariableDeclaration.scala delete mode 100644 core-scala/src/test/scala/samples/junit.scala delete mode 100644 core-scala/src/test/scala/samples/scalatest.scala delete mode 100644 core-scala/src/test/scala/samples/specs.scala delete mode 100644 core-scala/test.txt diff --git a/core-scala/build.gradle b/core-scala/build.gradle deleted file mode 100644 index 05b5d5c55a..0000000000 --- a/core-scala/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -apply plugin: 'scala' - -repositories { - mavenCentral() -} - -dependencies { - compile 'org.scala-lang:scala-library:2.12.6' - testCompile 'org.scalatest:scalatest_2.12:3.0.5' - testCompile 'junit:junit:4.12' -} - - diff --git a/core-scala/build.sbt b/core-scala/build.sbt deleted file mode 100644 index 1e21f71d39..0000000000 --- a/core-scala/build.sbt +++ /dev/null @@ -1,12 +0,0 @@ -import Dependencies._ - -lazy val root = (project in file(".")). - settings( - inThisBuild(List( - organization := "com.example", - scalaVersion := "2.12.6", - version := "0.1.0-SNAPSHOT" - )), - name := "core-scala", - libraryDependencies += scalaTest % Test - ) diff --git a/core-scala/pom.xml b/core-scala/pom.xml deleted file mode 100644 index 76b6ee0d22..0000000000 --- a/core-scala/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - 4.0.0 - core-scala - 1.0-SNAPSHOT - jar - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - 1.8 - 1.8 - UTF-8 - 2.12.6 - 2.12 - 4.2.0 - - - - - org.scala-lang - scala-library - ${scala.version} - - - - - junit - junit - 4.12 - test - - - org.scalatest - scalatest_${scala.compat.version} - 3.0.5 - test - - - org.specs2 - specs2-core_${scala.compat.version} - ${spec2.version} - test - - - org.specs2 - specs2-junit_${scala.compat.version} - ${spec2.version} - test - - - - - src/main/scala - src/test/scala - - - - net.alchim31.maven - scala-maven-plugin - 3.3.2 - - - - compile - testCompile - - - - -dependencyfile - ${project.build.directory}/.scala_dependencies - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.21.0 - - - true - - - - org.scalatest - scalatest-maven-plugin - 2.0.0 - - ${project.build.directory}/surefire-reports - . - TestSuiteReport.txt - - samples.AppTest - - - - test - - test - - - - - - - diff --git a/core-scala/project/Dependencies.scala b/core-scala/project/Dependencies.scala deleted file mode 100644 index 558929deb6..0000000000 --- a/core-scala/project/Dependencies.scala +++ /dev/null @@ -1,5 +0,0 @@ -import sbt._ - -object Dependencies { - lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.5" -} diff --git a/core-scala/project/build.properties b/core-scala/project/build.properties deleted file mode 100644 index d6e35076cc..0000000000 --- a/core-scala/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.1.6 diff --git a/core-scala/src/main/scala/com/baeldung/examples/ClassExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/ClassExamples.scala deleted file mode 100644 index 75a37e2bab..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/ClassExamples.scala +++ /dev/null @@ -1,31 +0,0 @@ -package com.baeldung.examples - -object ClassExamples extends App { - - import java.time._ - class Customer(val id:Int, val name:String, dob:LocalDate) { - - private var _age = calculateAge(dob) - - def age = _age // getter - def age_= (age:Int) = _age = age //setter - - private def calculateAge(dob:LocalDate) = Period - .between(dob, LocalDate.now) - .getYears - - //override def toString: String = s"(id:${id}, name:${name}, age:${age})" - } - val c = new Customer(1, "Varun Sharma", LocalDate.parse("1980-02-27")) - println(c) - - case class Address(addressLn1:String, area:String, city:String, zip:String) - - val address=Address("102, Raycon Lotus Apartment", "AECS Layout", "Bangalore", "560037") - - val anotherAddress = address.copy(addressLn1="41/2, ITPL Road") - - println(address) - println(anotherAddress) - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/CollectionExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/CollectionExamples.scala deleted file mode 100644 index 1602516067..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/CollectionExamples.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.baeldung.examples - -object CollectionExamples extends App { - - val aList = List(5, 3, 9, 2) // create a list - val sortedAscList = aList.sorted // sort ascending - val sortedDescList = aList.sortWith(_ > _) // sort descending - val evenList = aList.filter(_%2 == 0) // filter on some condition - - val mySet = Set(10, 20, 5) // create a set - val changedSet = mySet + 50 // add an element - println(changedSet) - val changedSet2 = mySet - 20 // remove an element - println(changedSet2) - - val capitals = Map("Japan" -> "Tokyo", - "England" -> "London", - "India" -> "New Delhi") // create a map - val capitalOfJapan = capitals("Japan") // get from map - println(capitalOfJapan) - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/ExceptionHandlingExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/ExceptionHandlingExamples.scala deleted file mode 100644 index 16ec7ffdf4..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/ExceptionHandlingExamples.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.examples - -object ExceptionHandlingExamples extends App { - import java.io._ - def printLines(filename:String) = { - var reader:Option[BufferedReader] = None - try { - reader = Some(new BufferedReader(new FileReader(new File(filename)))) - reader.get.lines().forEach(println(_)) - } catch { - case e:FileNotFoundException => println(s"There was no file named ${filename}") - case e:Throwable => throw new Exception("Some error occurred", e) - } finally { - if (reader.isDefined) reader.get.close() - } - } - printLines("test.txt") - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/FirstClassFunctionExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/FirstClassFunctionExamples.scala deleted file mode 100644 index bf925f59c7..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/FirstClassFunctionExamples.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.examples - -object FirstClassFunctionExamples extends App { - - def sum(x:Double, y:Double, f:Double => Double) = f(x) + f(y) - - println(sum(3, 4, x => x*x)) // returns 25.0 - - println(sum(3, 4, x => x*x*x)) // returns 91.0 - - println(sum(3, 4, Math.pow(_, 2))) // returns 25.0 - - def max(first:Int, second:Int) = if (first > second) first else second - - println(max(10, -2)) - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/LoopAndCalculationExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/LoopAndCalculationExamples.scala deleted file mode 100644 index 17091c715d..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/LoopAndCalculationExamples.scala +++ /dev/null @@ -1,39 +0,0 @@ -package com.baeldung.examples - -object LoopAndCalculationExamples extends App { - import CalculationUtils._ - println(sumWithWhile(Array(10, 20, 30))) - println(sumWithFor(Array(10, 20, 30))) - println(checkEvenOdd((1 to 10).toArray).toList) - println(filterEvens((1 to 10).toArray).toList) -} - -object CalculationUtils { - - def sumWithWhile(values:Array[Int]) = { - var sum = 0 - var i = 0 - while ( i < values.length) { - sum += values(i) - i+=1 - } - sum - } - - def sumWithFor(values:Array[Int]) = { - var sum = 0 - for (i <- values) { - sum += i - } - sum - } - - def checkEvenOdd(values:Array[Int]) = { - for (i <- values) yield if (i%2 == 0) "Even" else "Odd" - } - - def filterEvens(values:Array[Int]) = - for (i <- values if i%2 == 0) - yield i - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/MyApp.scala b/core-scala/src/main/scala/com/baeldung/examples/MyApp.scala deleted file mode 100644 index d0861a8727..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/MyApp.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.examples - -/** - * @author ${user.name} - */ -object MyApp { - - def foo(x : Array[String]) = x.foldLeft("")((a,b) => a + b) - - def main(args : Array[String]) { - println( "Hello World!" ) - println("Number of arguments passed:" + args.length) - } - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/ObjectExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/ObjectExamples.scala deleted file mode 100644 index 29db276ebd..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/ObjectExamples.scala +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.examples - -object ObjectExamples extends App { - - import java.time._ - class Customer(val id:Int, val name:String, private var _age:Int) { - def age = this._age - def age_= (age:Int) = _age = age - } - object Customer { - def apply(id:Int, name:String, age:Int) = new Customer(id, name, age) - - def apply(id:Int, name:String, dob:LocalDate) = { - val p = Period.between(dob, LocalDate.now) - new Customer(id, name, p.getYears) - } - } - val c = Customer(1, "Varun Sharma", LocalDate.parse("1980-02-27")) - - c.age = 20 - println(c.age) - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/OptionExample.scala b/core-scala/src/main/scala/com/baeldung/examples/OptionExample.scala deleted file mode 100644 index b0d49af758..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/OptionExample.scala +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.examples - -object OptionExample extends App { - - def minimumEvenNumber(data:Array[Int]) = { - val evens = data.filter(_%2 == 0) - if (evens.isEmpty) None else Some(evens.min) - } - - val minEven = minimumEvenNumber(Array(21, 3, 11, 7)).getOrElse(0) - println(minEven) -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/PatternMatchingExample.scala b/core-scala/src/main/scala/com/baeldung/examples/PatternMatchingExample.scala deleted file mode 100644 index d476bed60b..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/PatternMatchingExample.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.baeldung.examples - -object PatternMatchingExample extends App { - - abstract class Item - case class Book(title:String, author:String, price:Double) extends Item - case class MusicCD(title:String, genre:String, price:Double) extends Item - - def describe(item:Item) = item match { - - case b:Book if b.price > 1000 => println(s"The book ${b.title} is expensive") - - case b:Book => println(s"The book ${b.title} is written by ${b.author}.") - - case MusicCD(title, "Jazz", _) => println(s"This is a CD of Jazz music.") - - case _ => println("Unknown Item") - - } - - describe(Book("Half Girlfriend", "Chetan Bhagat", 100)) -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/TraitExample.scala b/core-scala/src/main/scala/com/baeldung/examples/TraitExample.scala deleted file mode 100644 index 0775a2bac2..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/TraitExample.scala +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.examples - -import java.io._ - -object TraitExample extends App { - - trait Loggable { - val logger:PrintStream - def getPrefix():String - def log(message:String) = logger.println(s"[${getPrefix()}]:${message}") - } - object CustomerService extends Loggable { - override val logger = System.out - override def getPrefix(): String = "CustomerService" - def retrieve(id:String) = { - log(s"Retrieve with id ${id} called") - // Code to retrieve Customer from DB - } - } - - CustomerService.retrieve("C100") - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/TupleExamples.scala b/core-scala/src/main/scala/com/baeldung/examples/TupleExamples.scala deleted file mode 100644 index e9ffbd0aca..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/TupleExamples.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.examples - -object TupleExamples extends App { - - val empSal:(String, Int) = ("David", 10000) - - def getMaxMinSalary(empSal:Array[(String, Int)]) = { - val minEmpSal = empSal.minBy(empSal => empSal._2) - val maxEmpSal = empSal.maxBy(empSal => empSal._2) - (maxEmpSal._2, minEmpSal._2) - } - val empSalArr = Array(("David", 12000), ("Maria", 15000), - ("Elisa", 11000), ("Adam", 8000)) - - val (maxSalary, minSalary) = getMaxMinSalary(empSalArr) - println("Max Salary: " + maxSalary + " and Min Salary: " + minSalary) - -} diff --git a/core-scala/src/main/scala/com/baeldung/examples/VariableDeclaration.scala b/core-scala/src/main/scala/com/baeldung/examples/VariableDeclaration.scala deleted file mode 100644 index 6050b4f908..0000000000 --- a/core-scala/src/main/scala/com/baeldung/examples/VariableDeclaration.scala +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.examples - -object VariableDeclaration extends App { - - val x:Int = 0 - var friend:String = "David" - lazy val greet = "Hello" + friend - val data = Array(2, 4, 5) - - printHelloWorld() - println(sum(10, 20)) - - def printHelloWorld():Unit = { - println("Hello World") - } - - def sum(x:Int, y:Int) = x + y - - def sayGreeting(to:String, greet:String="Hi", message:String = "How are you?") = println(greet + " " + to + ", " + message) - - sayGreeting(to="David", message="How are you doing?") - sayGreeting(greet="Hello", to="Maria") - -} diff --git a/core-scala/src/test/scala/samples/junit.scala b/core-scala/src/test/scala/samples/junit.scala deleted file mode 100644 index 89513d5bbc..0000000000 --- a/core-scala/src/test/scala/samples/junit.scala +++ /dev/null @@ -1,17 +0,0 @@ -package samples - -import org.junit._ -import Assert._ - -@Test -class AppTest { - - @Test - def testOK() = assertTrue(true) - -// @Test -// def testKO() = assertTrue(false) - -} - - diff --git a/core-scala/src/test/scala/samples/scalatest.scala b/core-scala/src/test/scala/samples/scalatest.scala deleted file mode 100644 index bd10412199..0000000000 --- a/core-scala/src/test/scala/samples/scalatest.scala +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2001-2009 Artima, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package samples - -/* -ScalaTest facilitates different styles of testing by providing traits you can mix -together to get the behavior and syntax you prefer. A few examples are -included here. For more information, visit: - -http://www.scalatest.org/ - -One way to use ScalaTest is to help make JUnit or TestNG tests more -clear and concise. Here's an example: -*/ -import scala.collection._ -import org.scalatest.Assertions -import org.junit.Test - -class StackSuite extends Assertions { - - @Test def stackShouldPopValuesIinLastInFirstOutOrder() { - val stack = new mutable.ArrayStack[Int] - stack.push(1) - stack.push(2) - assert(stack.pop() === 2) - assert(stack.pop() === 1) - } - - @Test def stackShouldThrowRuntimeExceptionIfAnEmptyArrayStackIsPopped() { - val emptyStack = new mutable.ArrayStack[String] - intercept[RuntimeException] { - emptyStack.pop() - } - } -} - -/* -Here's an example of a FunSuite with Matchers mixed in: -*/ -import org.scalatest.FunSuite -import org.scalatest.Matchers - -import org.junit.runner.RunWith -import org.scalatest.junit.JUnitRunner -@RunWith(classOf[JUnitRunner]) -class ListSuite extends FunSuite with Matchers { - - test("An empty list should be empty") { - List() should be ('empty) - Nil should be ('empty) - } - - test("A non-empty list should not be empty") { - List(1, 2, 3) should not be ('empty) - List("fee", "fie", "foe", "fum") should not be ('empty) - } - - test("A list's length should equal the number of elements it contains") { - List() should have length (0) - List(1, 2) should have length (2) - List("fee", "fie", "foe", "fum") should have length (4) - } -} - -/* -ScalaTest also supports the behavior-driven development style, in which you -combine tests with text that specifies the behavior being tested. Here's -an example whose text output when run looks like: - -A Map -- should only contain keys and values that were added to it -- should report its size as the number of key/value pairs it contains -*/ -import org.scalatest.FunSpec - -class ExampleSpec extends FunSpec { - - describe("An ArrayStack") { - - it("should pop values in last-in-first-out order") { - val stack = new mutable.ArrayStack[Int] - stack.push(1) - stack.push(2) - assert(stack.pop() === 2) - assert(stack.pop() === 1) - } - - it("should throw RuntimeException if an empty array stack is popped") { - val emptyStack = new mutable.ArrayStack[Int] - intercept[RuntimeException] { - emptyStack.pop() - } - } - } -} diff --git a/core-scala/src/test/scala/samples/specs.scala b/core-scala/src/test/scala/samples/specs.scala deleted file mode 100644 index 9e4dfe93bb..0000000000 --- a/core-scala/src/test/scala/samples/specs.scala +++ /dev/null @@ -1,31 +0,0 @@ -package samples - -import org.junit.runner.RunWith -import org.specs2.mutable._ -import org.specs2.runner._ - - -/** - * Sample specification. - * - * This specification can be executed with: scala -cp ${package}.SpecsTest - * Or using maven: mvn test - * - * For more information on how to write or run specifications, please visit: - * http://etorreborre.github.com/specs2/guide/org.specs2.guide.Runners.html - * - */ -@RunWith(classOf[JUnitRunner]) -class MySpecTest extends Specification { - "The 'Hello world' string" should { - "contain 11 characters" in { - "Hello world" must have size(11) - } - "start with 'Hello'" in { - "Hello world" must startWith("Hello") - } - "end with 'world'" in { - "Hello world" must endWith("world") - } - } -} diff --git a/core-scala/test.txt b/core-scala/test.txt deleted file mode 100644 index da431d2039..0000000000 --- a/core-scala/test.txt +++ /dev/null @@ -1,4 +0,0 @@ -Hi, -This is the lines -from the test file. -Thanks. \ No newline at end of file From 6b81b95ef6919945cdcb4e9281db412f0aab90d6 Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Sat, 22 Sep 2018 17:29:16 -0300 Subject: [PATCH 021/546] Initial Commit --- javaxval/pom.xml | 127 ++++++++++-------- .../appplication/Application.java | 14 ++ .../entities/UserNotBlank.java | 22 +++ .../entities/UserNotEmpty.java | 22 +++ .../entities/UserNotNull.java | 22 +++ .../test/UserNotBlankUnitTest.java | 54 ++++++++ .../test/UserNotEmptyUnitTest.java | 47 +++++++ .../test/UserNotNullUnitTest.java | 47 +++++++ 8 files changed, 300 insertions(+), 55 deletions(-) create mode 100644 javaxval/src/main/java/org/baeldung/javabeanconstraints/appplication/Application.java create mode 100644 javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotBlank.java create mode 100644 javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotEmpty.java create mode 100644 javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotNull.java create mode 100644 javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java create mode 100644 javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java create mode 100644 javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 4d27b3e0c9..63cb4c1d1d 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -1,56 +1,73 @@ - - 4.0.0 - com.baeldung - javaxval - 0.1-SNAPSHOT - - - 1.1.0.Final - 5.3.4.Final - 3.0.0 - 2.2.6 - - - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - - javax.validation - validation-api - ${validation-api.version} - - - - org.hibernate - hibernate-validator - ${hibernate-validator.version} - - - - org.hibernate - hibernate-validator-annotation-processor - ${hibernate-validator.version} - - - - javax.el - javax.el-api - ${javax.el-api.version} - - - - org.glassfish.web - javax.el - ${javax.el.version} - - - - + + 4.0.0 + com.baeldung + javaxval + 0.1-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + javax.validation + validation-api + ${validation-api.version} + + + org.hibernate + hibernate-validator + ${hibernate-validator.version} + + + org.hibernate + hibernate-validator-annotation-processor + ${hibernate-validator.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + + + org.glassfish.web + javax.el + ${javax.el.version} + + + org.springframework + spring-context + ${org.springframework.version} + + + org.springframework + spring-test + ${org.springframework.version} + + + junit + junit + ${junit.version} + test + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + 2.0.1.Final + 6.0.7.Final + 3.0.0 + 2.2.6 + 5.0.2.RELEASE + 4.12 + 3.11.1 + \ No newline at end of file diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/appplication/Application.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/appplication/Application.java new file mode 100644 index 0000000000..c9f2ab6f98 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javabeanconstraints/appplication/Application.java @@ -0,0 +1,14 @@ +package org.baeldung.javabeanconstraints.appplication; + +import javax.validation.Validation; +import javax.validation.Validator; +import org.baeldung.javabeanconstraints.entities.UserNotBlank; + +public class Application { + + public static void main(String[] args) throws Exception { + Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); + UserNotBlank user = new UserNotBlank(" "); + validator.validate(user).stream().forEach(violation -> System.out.println(violation.getMessage())); + } +} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotBlank.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotBlank.java new file mode 100644 index 0000000000..2ea6a3af56 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotBlank.java @@ -0,0 +1,22 @@ +package org.baeldung.javabeanconstraints.entities; + +import javax.validation.constraints.NotBlank; + +public class UserNotBlank { + + @NotBlank(message = "Name is mandatory") + private final String name; + + public UserNotBlank(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return "User{" + "name=" + name + "}"; + } +} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotEmpty.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotEmpty.java new file mode 100644 index 0000000000..39e34b63d3 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotEmpty.java @@ -0,0 +1,22 @@ +package org.baeldung.javabeanconstraints.entities; + +import javax.validation.constraints.NotEmpty; + +public class UserNotEmpty { + + @NotEmpty(message = "Name is mandatory") + private final String name; + + public UserNotEmpty(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return "User{" + "name=" + name + "}"; + } +} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotNull.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotNull.java new file mode 100644 index 0000000000..598c9ba9f9 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotNull.java @@ -0,0 +1,22 @@ +package org.baeldung.javabeanconstraints.entities; + +import javax.validation.constraints.NotNull; + +public class UserNotNull { + + @NotNull(message = "Name is mandatory") + private final String name; + + public UserNotNull(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return "User{" + "name=" + name + "}"; + } +} diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java new file mode 100644 index 0000000000..081ceadfbe --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java @@ -0,0 +1,54 @@ +package org.baeldung.javabeanconstraints.test; + +import java.util.Set; +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import static org.assertj.core.api.Assertions.assertThat; +import org.baeldung.javabeanconstraints.entities.UserNotBlank; +import org.junit.BeforeClass; +import org.junit.Test; + +public class UserNotBlankUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory().getValidator(); + } + + @Test + public void whenNotBlankName_thenNoConstraintViolations() { + UserNotBlank user = new UserNotBlank("John"); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenBlankName_thenOneConstraintViolation() { + UserNotBlank user = new UserNotBlank(" "); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenEmptyName_thenOneConstraintViolation() { + UserNotBlank user = new UserNotBlank(""); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenNullName_thenOneConstraintViolation() { + UserNotBlank user = new UserNotBlank(null); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenToString_thenCorrect() { + UserNotBlank user = new UserNotBlank("John"); + assertThat(user.toString()).isEqualTo("User{name=John}"); + } +} diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java new file mode 100644 index 0000000000..1ef914607e --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java @@ -0,0 +1,47 @@ +package org.baeldung.javabeanconstraints.test; + +import java.util.Set; +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import static org.assertj.core.api.Assertions.assertThat; +import org.baeldung.javabeanconstraints.entities.UserNotEmpty; +import org.junit.BeforeClass; +import org.junit.Test; + +public class UserNotEmptyUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory().getValidator(); + } + + @Test + public void whenNotEmptyName_thenNoConstraintViolations() { + UserNotEmpty user = new UserNotEmpty("John"); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenEmptyName_thenOneConstraintViolation() { + UserNotEmpty user = new UserNotEmpty(""); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenNullName_thenOneConstraintViolation() { + UserNotEmpty user = new UserNotEmpty(null); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenToString_thenCorrect() { + UserNotEmpty user = new UserNotEmpty("John"); + assertThat(user.toString()).isEqualTo("User{name=John}"); + } +} diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java new file mode 100644 index 0000000000..252d71a4cb --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java @@ -0,0 +1,47 @@ +package org.baeldung.javabeanconstraints.test; + +import java.util.Set; +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import static org.assertj.core.api.Assertions.assertThat; +import org.baeldung.javabeanconstraints.entities.UserNotNull; +import org.junit.BeforeClass; +import org.junit.Test; + +public class UserNotNullUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory().getValidator(); + } + + @Test + public void whenNotNullName_thenNoConstraintViolations() { + UserNotNull user = new UserNotNull("John"); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenNullName_thenOneConstraintViolation() { + UserNotNull user = new UserNotNull(null); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenEmptyName_thenNoConstraintViolations() { + UserNotNull user = new UserNotNull(""); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenToString_thenCorrect() { + UserNotNull user = new UserNotNull("John"); + assertThat(user.toString()).isEqualTo("User{name=John}"); + } +} From 77b21b0a9e9acd6025ecbe2de969c9a523d856dc Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sun, 23 Sep 2018 06:53:46 +0200 Subject: [PATCH 022/546] refactor givenMultipleStream_whenInterleaved_thenInterleaved --- .../protonpack/ProtonpackUnitTest.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java b/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java index 1b64c8924a..6ec2e1b837 100644 --- a/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java +++ b/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java @@ -4,10 +4,9 @@ import com.codepoetics.protonpack.Indexed; import com.codepoetics.protonpack.StreamUtils; import com.codepoetics.protonpack.collectors.CollectorUtils; import com.codepoetics.protonpack.collectors.NonUniqueValueException; -import com.codepoetics.protonpack.selectors.Selector; +import com.codepoetics.protonpack.selectors.Selectors; import org.junit.Test; -import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.Set; @@ -92,20 +91,13 @@ public class ProtonpackUnitTest { Stream streamOfPlayers = Stream.of("Ronaldo", "Messi"); Stream streamOfLeagues = Stream.of("Serie A", "La Liga"); - AtomicInteger counter = new AtomicInteger(0); - Selector roundRobinSelector = (o) -> { - Object[] vals = (Object[]) o; - while (counter.get() >= vals.length || vals[counter.get()] == null) { - if (counter.incrementAndGet() >= vals.length) - counter.set(0); - } - return counter.getAndIncrement(); - }; - Stream interleavedStream = StreamUtils.interleave(roundRobinSelector, streamOfClubs, streamOfPlayers, - streamOfLeagues); - List interleavedList = interleavedStream.collect(Collectors.toList()); - assertThat(interleavedList).containsExactly("Juventus", "Ronaldo", "Serie A", "Barcelona", "Messi", "La Liga", - "Liverpool"); + List interleavedList = StreamUtils + .interleave(Selectors.roundRobin(), streamOfClubs, streamOfPlayers, streamOfLeagues) + .collect(Collectors.toList()); + + assertThat(interleavedList) + .hasSize(7) + .containsExactly("Juventus", "Ronaldo", "Serie A", "Barcelona", "Messi", "La Liga", "Liverpool"); } @Test From 2a2d4222bb92700d0189b30c578a673add42389a Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sun, 23 Sep 2018 07:26:49 +0200 Subject: [PATCH 023/546] Reimplement unfold --- .../protonpack/ProtonpackUnitTest.java | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java b/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java index 6ec2e1b837..bcda1162df 100644 --- a/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java +++ b/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java @@ -38,17 +38,18 @@ public class ProtonpackUnitTest { @Test public void givenMultipleStream_whenZipped_thenZipped() { - String[] clubs = { "Juventus", "Barcelona", "Liverpool", "PSG" }; - String[] players = { "Ronaldo", "Messi", "Salah" }; - Set zippedFrom2Sources = StreamUtils.zip(stream(clubs), stream(players), (club, player) -> club + " " + player) - .collect(Collectors.toSet()); + String[] clubs = {"Juventus", "Barcelona", "Liverpool", "PSG"}; + String[] players = {"Ronaldo", "Messi", "Salah"}; + Set zippedFrom2Sources = StreamUtils + .zip(stream(clubs), stream(players), (club, player) -> club + " " + player) + .collect(Collectors.toSet()); assertThat(zippedFrom2Sources).contains("Juventus Ronaldo", "Barcelona Messi", "Liverpool Salah"); - String[] leagues = { "Serie A", "La Liga", "Premier League" }; + String[] leagues = {"Serie A", "La Liga", "Premier League"}; Set zippedFrom3Sources = StreamUtils.zip(stream(clubs), stream(players), stream(leagues), - (club, player, league) -> club + " " + player + " " + league).collect(Collectors.toSet()); + (club, player, league) -> club + " " + player + " " + league).collect(Collectors.toSet()); assertThat(zippedFrom3Sources).contains("Juventus Ronaldo Serie A", "Barcelona Messi La Liga", - "Liverpool Salah Premier League"); + "Liverpool Salah Premier League"); } @Test @@ -56,7 +57,7 @@ public class ProtonpackUnitTest { Stream streamOfClubs = Stream.of("Juventus", "Barcelona", "Liverpool"); Set> zipsWithIndex = StreamUtils.zipWithIndex(streamOfClubs).collect(Collectors.toSet()); assertThat(zipsWithIndex).contains(Indexed.index(0, "Juventus"), Indexed.index(1, "Barcelona"), - Indexed.index(2, "Liverpool")); + Indexed.index(2, "Liverpool")); } @Test @@ -66,9 +67,10 @@ public class ProtonpackUnitTest { Stream streamOfLeagues = Stream.of("Serie A", "La Liga", "Premier League"); Set merged = StreamUtils.merge(() -> "", (valOne, valTwo) -> valOne + " " + valTwo, streamOfClubs, - streamOfPlayers, streamOfLeagues).collect(Collectors.toSet()); + streamOfPlayers, streamOfLeagues).collect(Collectors.toSet()); - assertThat(merged).contains(" Juventus Ronaldo Serie A", " Barcelona Messi La Liga", " Liverpool Salah Premier League", + assertThat(merged) + .contains(" Juventus Ronaldo Serie A", " Barcelona Messi La Liga", " Liverpool Salah Premier League", " PSG"); } @@ -78,7 +80,7 @@ public class ProtonpackUnitTest { Stream streamOfPlayers = Stream.of("Ronaldo", "Messi"); List> mergedListOfList = StreamUtils.mergeToList(streamOfClubs, streamOfPlayers) - .collect(Collectors.toList()); + .collect(Collectors.toList()); assertThat(mergedListOfList.get(0)).isInstanceOf(List.class); assertThat(mergedListOfList.get(0)).containsExactly("Juventus", "Ronaldo"); assertThat(mergedListOfList.get(1)).containsExactly("Barcelona", "Messi"); @@ -102,54 +104,56 @@ public class ProtonpackUnitTest { @Test public void whenSkippedUntil_thenSkippedUntil() { - Integer[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; - List skippedUntilGreaterThan5 = StreamUtils.skipUntil(stream(numbers), i -> i > 5).collect(Collectors.toList()); + Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + List skippedUntilGreaterThan5 = StreamUtils.skipUntil(stream(numbers), i -> i > 5) + .collect(Collectors.toList()); assertThat(skippedUntilGreaterThan5).containsExactly(6, 7, 8, 9, 10); List skippedUntilLessThanEquals5 = StreamUtils.skipUntil(stream(numbers), i -> i <= 5) - .collect(Collectors.toList()); + .collect(Collectors.toList()); assertThat(skippedUntilLessThanEquals5).containsExactly(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); } @Test public void whenSkippedWhile_thenSkippedWhile() { - Integer[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; List skippedWhileLessThanEquals5 = StreamUtils.skipWhile(stream(numbers), i -> i <= 5) - .collect(Collectors.toList()); + .collect(Collectors.toList()); assertThat(skippedWhileLessThanEquals5).containsExactly(6, 7, 8, 9, 10); - List skippedWhileGreaterThan5 = StreamUtils.skipWhile(stream(numbers), i -> i > 5).collect(Collectors.toList()); + List skippedWhileGreaterThan5 = StreamUtils.skipWhile(stream(numbers), i -> i > 5) + .collect(Collectors.toList()); assertThat(skippedWhileGreaterThan5).containsExactly(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); } @Test public void givenFibonacciGenerator_whenUnfolded_thenUnfolded() { - AtomicInteger lastValue = new AtomicInteger(0); - Function> fibonacciGenerator = (i) -> (i < 10) ? - Optional.of(i + lastValue.getAndSet(i)) : - Optional.empty(); + Stream unfolded = StreamUtils.unfold(2, i -> (i < 100) ? Optional.of(i * i) : Optional.empty()); - List fib = StreamUtils.unfold(1, fibonacciGenerator).collect(Collectors.toList()); - assertThat(fib).containsExactly(1, 1, 2, 3, 5, 8, 13); + assertThat(unfolded.collect(Collectors.toList())).containsExactly(2, 4, 16, 256); } @Test public void whenWindowed_thenWindowed() { - Integer[] numbers = { 1, 2, 3, 4, 5, 6, 7 }; + Integer[] numbers = {1, 2, 3, 4, 5, 6, 7}; - List> windowedWithSkip1 = StreamUtils.windowed(stream(numbers), 3, 1).collect(Collectors.toList()); - assertThat(windowedWithSkip1).containsExactly(asList(1, 2, 3), asList(2, 3, 4), asList(3, 4, 5), asList(4, 5, 6), + List> windowedWithSkip1 = StreamUtils.windowed(stream(numbers), 3, 1) + .collect(Collectors.toList()); + assertThat(windowedWithSkip1) + .containsExactly(asList(1, 2, 3), asList(2, 3, 4), asList(3, 4, 5), asList(4, 5, 6), asList(5, 6, 7)); - List> windowedWithSkip2 = StreamUtils.windowed(stream(numbers), 3, 2).collect(Collectors.toList()); + List> windowedWithSkip2 = StreamUtils.windowed(stream(numbers), 3, 2) + .collect(Collectors.toList()); assertThat(windowedWithSkip2).containsExactly(asList(1, 2, 3), asList(3, 4, 5), asList(5, 6, 7)); } @Test public void whenAggregated_thenAggregated() { - Integer[] numbers = { 1, 2, 2, 3, 4, 4, 4, 5 }; - List> aggregated = StreamUtils.aggregate(stream(numbers), (int1, int2) -> int1.compareTo(int2) == 0) - .collect(Collectors.toList()); + Integer[] numbers = {1, 2, 2, 3, 4, 4, 4, 5}; + List> aggregated = StreamUtils + .aggregate(stream(numbers), (int1, int2) -> int1.compareTo(int2) == 0) + .collect(Collectors.toList()); assertThat(aggregated).containsExactly(asList(1), asList(2, 2), asList(3), asList(4, 4, 4), asList(5)); List> aggregatedFixSize = StreamUtils.aggregate(stream(numbers), 5).collect(Collectors.toList()); @@ -158,20 +162,20 @@ public class ProtonpackUnitTest { @Test public void whenGroupedRun_thenGroupedRun() { - Integer[] numbers = { 1, 1, 2, 3, 4, 4, 5 }; + Integer[] numbers = {1, 1, 2, 3, 4, 4, 5}; List> grouped = StreamUtils.groupRuns(stream(numbers)).collect(Collectors.toList()); assertThat(grouped).containsExactly(asList(1, 1), asList(2), asList(3), asList(4, 4), asList(5)); - Integer[] numbers2 = { 1, 2, 3, 1 }; + Integer[] numbers2 = {1, 2, 3, 1}; List> grouped2 = StreamUtils.groupRuns(stream(numbers2)).collect(Collectors.toList()); assertThat(grouped2).containsExactly(asList(1), asList(2), asList(3), asList(1)); } @Test public void whenAggregatedOnListCondition_thenAggregatedOnListCondition() { - Integer[] numbers = { 1, 1, 2, 3, 4, 4, 5 }; + Integer[] numbers = {1, 1, 2, 3, 4, 4, 5}; Stream> aggregated = StreamUtils.aggregateOnListCondition(stream(numbers), - (currentList, nextInt) -> currentList.stream().mapToInt(Integer::intValue).sum() + nextInt <= 5); + (currentList, nextInt) -> currentList.stream().mapToInt(Integer::intValue).sum() + nextInt <= 5); assertThat(aggregated).containsExactly(asList(1, 1, 2), asList(3), asList(4), asList(4), asList(5)); } @@ -187,7 +191,6 @@ public class ProtonpackUnitTest { Stream singleElement = Stream.of(1); Optional unique = singleElement.collect(CollectorUtils.unique()); assertThat(unique.get()).isEqualTo(1); - } @Test @@ -197,5 +200,4 @@ public class ProtonpackUnitTest { multipleElement.collect(CollectorUtils.unique()); }); } - } From 58ad03cbe1037964cf7124a7fc188b5dfb2e168e Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sun, 23 Sep 2018 07:28:22 +0200 Subject: [PATCH 024/546] Refator tests --- .../java/com/baeldung/protonpack/ProtonpackUnitTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java b/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java index bcda1162df..371ac3a9bb 100644 --- a/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java +++ b/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java @@ -20,7 +20,6 @@ import static java.util.Arrays.stream; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -@SuppressWarnings("unchecked") public class ProtonpackUnitTest { @Test public void whenTakeWhile_thenTakenWhile() { @@ -183,14 +182,14 @@ public class ProtonpackUnitTest { public void givenProjectionFunction_whenMaxedBy_thenMaxedBy() { Stream clubs = Stream.of("Juventus", "Barcelona", "PSG"); Optional longestName = clubs.collect(CollectorUtils.maxBy(String::length)); - assertThat(longestName.get()).isEqualTo("Barcelona"); + assertThat(longestName).contains("Barcelona"); } @Test public void givenStreamOfMultipleElem_whenUniqueCollector_thenValueReturned() { Stream singleElement = Stream.of(1); Optional unique = singleElement.collect(CollectorUtils.unique()); - assertThat(unique.get()).isEqualTo(1); + assertThat(unique).contains(1); } @Test From 33d5e710845a943b08ebb6b4aada6c6bf7378d82 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Sun, 23 Sep 2018 15:26:48 +0200 Subject: [PATCH 025/546] added link --- java-strings/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java-strings/README.md b/java-strings/README.md index 233d986d98..1286f7b6c9 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -27,3 +27,4 @@ - [Compact Strings in Java 9](http://www.baeldung.com/java-9-compact-string) - [Java Check a String for Lowercase/Uppercase Letter, Special Character and Digit](https://www.baeldung.com/java-lowercase-uppercase-special-character-digit-regex) - [Convert java.util.Date to String](https://www.baeldung.com/java-util-date-to-string) +- [String Not Empty Test Assertions in Java](https://www.baeldung.com/java-assert-string-not-empty) From 81b34c7628273b45e3966c11e64528dd6899409d Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Tue, 25 Sep 2018 01:22:37 -0300 Subject: [PATCH 026/546] Update UserNotBlankUnitTest.java --- .../javabeanconstraints/test/UserNotBlankUnitTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java index 081ceadfbe..954833fef1 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java @@ -21,34 +21,43 @@ public class UserNotBlankUnitTest { @Test public void whenNotBlankName_thenNoConstraintViolations() { UserNotBlank user = new UserNotBlank("John"); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); } @Test public void whenBlankName_thenOneConstraintViolation() { UserNotBlank user = new UserNotBlank(" "); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); } @Test public void whenEmptyName_thenOneConstraintViolation() { UserNotBlank user = new UserNotBlank(""); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); } @Test public void whenNullName_thenOneConstraintViolation() { UserNotBlank user = new UserNotBlank(null); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); } @Test public void whenToString_thenCorrect() { UserNotBlank user = new UserNotBlank("John"); + assertThat(user.toString()).isEqualTo("User{name=John}"); } } From 2518a07d931c2e19394fff8464582d707e74ab61 Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Tue, 25 Sep 2018 01:23:30 -0300 Subject: [PATCH 027/546] Update UserNotEmptyUnitTest.java --- .../javabeanconstraints/test/UserNotEmptyUnitTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java index 1ef914607e..c2675ed8b6 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java @@ -21,27 +21,34 @@ public class UserNotEmptyUnitTest { @Test public void whenNotEmptyName_thenNoConstraintViolations() { UserNotEmpty user = new UserNotEmpty("John"); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); } @Test public void whenEmptyName_thenOneConstraintViolation() { UserNotEmpty user = new UserNotEmpty(""); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); } @Test public void whenNullName_thenOneConstraintViolation() { UserNotEmpty user = new UserNotEmpty(null); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); } @Test public void whenToString_thenCorrect() { UserNotEmpty user = new UserNotEmpty("John"); + assertThat(user.toString()).isEqualTo("User{name=John}"); } } From c8e54a21c016557ae806f053c47931d2b5419aa0 Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Tue, 25 Sep 2018 01:24:09 -0300 Subject: [PATCH 028/546] Update UserNotNullUnitTest.java --- .../javabeanconstraints/test/UserNotNullUnitTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java index 252d71a4cb..3dd1811947 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java @@ -21,27 +21,34 @@ public class UserNotNullUnitTest { @Test public void whenNotNullName_thenNoConstraintViolations() { UserNotNull user = new UserNotNull("John"); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); } @Test public void whenNullName_thenOneConstraintViolation() { UserNotNull user = new UserNotNull(null); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(1); } @Test public void whenEmptyName_thenNoConstraintViolations() { UserNotNull user = new UserNotNull(""); + Set> violations = validator.validate(user); + assertThat(violations.size()).isEqualTo(0); } @Test public void whenToString_thenCorrect() { UserNotNull user = new UserNotNull("John"); + assertThat(user.toString()).isEqualTo("User{name=John}"); } } From 2a7a33f71748db1ac7161de1f1bc650ca8fe9440 Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:15:03 +0530 Subject: [PATCH 029/546] BAEL-2169 --- libraries-data/ebean/pom.xml | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 libraries-data/ebean/pom.xml diff --git a/libraries-data/ebean/pom.xml b/libraries-data/ebean/pom.xml new file mode 100644 index 0000000000..2e319e1523 --- /dev/null +++ b/libraries-data/ebean/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + + com.baeldung + ebean + 0.0.1-SNAPSHOT + jar + + ebean + http://maven.apache.org + + + UTF-8 + + + + + io.ebean + ebean + 11.22.4 + + + com.h2database + h2 + 1.4.196 + + + ch.qos.logback + logback-classic + 1.2.3 + + + + + + + + io.ebean + ebean-maven-plugin + 11.11.2 + + + + main + process-classes + + debug=1 + + + enhance + + + + + + + + From 18f4728a9f4cc73a5f615ea2ec12c3229add6da3 Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:17:40 +0530 Subject: [PATCH 030/546] Create Address.java --- .../com/baeldung/ebean/model/Address.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Address.java diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Address.java b/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Address.java new file mode 100644 index 0000000000..362e27c32a --- /dev/null +++ b/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Address.java @@ -0,0 +1,42 @@ +package com.baeldung.ebean.model; + +import javax.persistence.Entity; + +@Entity +public class Address extends BaseModel{ + + public Address(String addressLine1, String addressLine2, String city) { + super(); + this.addressLine1 = addressLine1; + this.addressLine2 = addressLine2; + this.city = city; + } + + private String addressLine1; + private String addressLine2; + private String city; + + public String getAddressLine1() { + return addressLine1; + } + public void setAddressLine1(String addressLine1) { + this.addressLine1 = addressLine1; + } + public String getAddressLine2() { + return addressLine2; + } + public void setAddressLine2(String addressLine2) { + this.addressLine2 = addressLine2; + } + public String getCity() { + return city; + } + public void setCity(String city) { + this.city = city; + } + @Override + public String toString() { + return "Address [id=" + id + ", addressLine1=" + addressLine1 + ", addressLine2=" + addressLine2 + ", city=" + city + "]"; + } + +} From a9d3d8ea07a81f2b8e7e753a2bb9fbe5ceb790a9 Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:18:48 +0530 Subject: [PATCH 031/546] Add files via upload --- .../com/baeldung/ebean/model/BaseModel.java | 59 +++++++++++++++++++ .../com/baeldung/ebean/model/Customer.java | 42 +++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 libraries-data/ebean/src/main/java/com/baeldung/ebean/model/BaseModel.java create mode 100644 libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Customer.java diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/BaseModel.java b/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/BaseModel.java new file mode 100644 index 0000000000..7634df7aa0 --- /dev/null +++ b/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/BaseModel.java @@ -0,0 +1,59 @@ +package com.baeldung.ebean.model; + +import java.time.Instant; + +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.Version; + +import io.ebean.annotation.WhenCreated; +import io.ebean.annotation.WhenModified; + +@MappedSuperclass +public abstract class BaseModel { + + @Id + protected long id; + + @Version + protected long version; + + @WhenCreated + protected Instant createdOn; + + @WhenModified + protected Instant modifiedOn; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public Instant getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Instant createdOn) { + this.createdOn = createdOn; + } + + public Instant getModifiedOn() { + return modifiedOn; + } + + public void setModifiedOn(Instant modifiedOn) { + this.modifiedOn = modifiedOn; + } + + public long getVersion() { + return version; + } + + public void setVersion(long version) { + this.version = version; + } + +} diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Customer.java b/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Customer.java new file mode 100644 index 0000000000..df1db82de4 --- /dev/null +++ b/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Customer.java @@ -0,0 +1,42 @@ +package com.baeldung.ebean.model; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.OneToOne; + +@Entity +public class Customer extends BaseModel { + + public Customer(String name, Address address) { + super(); + this.name = name; + this.address = address; + } + + private String name; + + @OneToOne(cascade = CascadeType.ALL) + Address address; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } + + @Override + public String toString() { + return "Customer [id=" + id + ", name=" + name + ", address=" + address + "]"; + } + +} From 9510ca6fa1f066ad4328bfde92d4d8240d641ac5 Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:19:55 +0530 Subject: [PATCH 032/546] Create App.java --- .../main/java/com/baeldung/ebean/app/App.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App.java diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App.java b/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App.java new file mode 100644 index 0000000000..161bf1e820 --- /dev/null +++ b/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App.java @@ -0,0 +1,75 @@ +package com.baeldung.ebean.app; + +import java.util.Arrays; + +import com.baeldung.ebean.model.Address; +import com.baeldung.ebean.model.Customer; + +import io.ebean.Ebean; +import io.ebean.EbeanServer; +import io.ebean.annotation.Transactional; + +public class App { + + public static void main(String[] args) { + insertAndDeleteInsideTransaction(); + crudOperations(); + queryCustomers(); + } + + @Transactional + public static void insertAndDeleteInsideTransaction() { + + Customer c1 = getCustomer(); + EbeanServer server = Ebean.getDefaultServer(); + server.save(c1); + Customer foundC1 = server.find(Customer.class, c1.getId()); + server.delete(foundC1); + } + + public static void crudOperations() { + + Address a1 = new Address("5, Wide Street", null, "New York"); + Customer c1 = new Customer("John Wide", a1); + + EbeanServer server = Ebean.getDefaultServer(); + server.save(c1); + + c1.setName("Jane Wide"); + c1.setAddress(null); + server.save(c1); + + Customer foundC1 = Ebean.find(Customer.class, c1.getId()); + + Ebean.delete(foundC1); + } + + public static void queryCustomers() { + Address a1 = new Address("1, Big Street", null, "New York"); + Customer c1 = new Customer("Big John", a1); + + Address a2 = new Address("2, Big Street", null, "New York"); + Customer c2 = new Customer("Big John", a2); + + Address a3 = new Address("3, Big Street", null, "San Jose"); + Customer c3 = new Customer("Big Bob", a3); + + Ebean.saveAll(Arrays.asList(c1, c2, c3)); + + Customer customer = Ebean.find(Customer.class) + .select("name") + .fetch("address", "city") + .where() + .eq("city", "San Jose") + .findOne(); + + Ebean.deleteAll(Arrays.asList(c1, c2, c3)); + } + + private static Customer getCustomer() { + Address a1 = new Address("1, Big Street", null, "New York"); + Customer c1 = new Customer("Big John", a1); + return c1; + } + +} From 8b8e3f2650c36840e7a57517dccdd6740a5c7800 Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:20:22 +0530 Subject: [PATCH 033/546] Create App2.java --- .../java/com/baeldung/ebean/app/App2.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App2.java diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App2.java b/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App2.java new file mode 100644 index 0000000000..fba77007c6 --- /dev/null +++ b/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App2.java @@ -0,0 +1,26 @@ +package com.baeldung.ebean.app; + +import java.util.Properties; + +import io.ebean.EbeanServer; +import io.ebean.EbeanServerFactory; +import io.ebean.config.ServerConfig; + +public class App2 { + + public static void main(String[] args) { + ServerConfig cfg = new ServerConfig(); + cfg.setDefaultServer(true); + Properties properties = new Properties(); + properties.put("ebean.db.ddl.generate", "true"); + properties.put("ebean.db.ddl.run", "true"); + properties.put("datasource.db.username", "sa"); + properties.put("datasource.db.password", ""); + properties.put("datasource.db.databaseUrl", "jdbc:h2:mem:app2"); + properties.put("datasource.db.databaseDriver", "org.h2.Driver"); + cfg.loadFromProperties(properties); + EbeanServer server = EbeanServerFactory.create(cfg); + + } + +} From 9fcc873f6378cabf35970d31157f918be87c73be Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:20:58 +0530 Subject: [PATCH 034/546] Create application.properties --- .../ebean/src/main/resources/application.properties | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 libraries-data/ebean/src/main/resources/application.properties diff --git a/libraries-data/ebean/src/main/resources/application.properties b/libraries-data/ebean/src/main/resources/application.properties new file mode 100644 index 0000000000..9cc5cc170a --- /dev/null +++ b/libraries-data/ebean/src/main/resources/application.properties @@ -0,0 +1,7 @@ +ebean.db.ddl.generate=true +ebean.db.ddl.run=true + +datasource.db.username=sa +datasource.db.password= +datasource.db.databaseUrl=jdbc:h2:mem:customer +datasource.db.databaseDriver=org.h2.Driver From a22470ac23ebf9a50c5d5aed6e708e3f23078e19 Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:21:19 +0530 Subject: [PATCH 035/546] Create ebean.mf --- libraries-data/ebean/src/main/resources/ebean.mf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 libraries-data/ebean/src/main/resources/ebean.mf diff --git a/libraries-data/ebean/src/main/resources/ebean.mf b/libraries-data/ebean/src/main/resources/ebean.mf new file mode 100644 index 0000000000..f49fecc717 --- /dev/null +++ b/libraries-data/ebean/src/main/resources/ebean.mf @@ -0,0 +1,3 @@ +entity-packages: com.baeldung.ebean.model +transactional-packages: com.baeldung.ebean.app +querybean-packages: com.baeldung.ebean.app From 772179794686e62ebd6ffba2c3b067a6659c9185 Mon Sep 17 00:00:00 2001 From: josephine-barboza Date: Fri, 28 Sep 2018 06:21:38 +0530 Subject: [PATCH 036/546] Create logback.yml --- libraries-data/ebean/src/main/resources/logback.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 libraries-data/ebean/src/main/resources/logback.yml diff --git a/libraries-data/ebean/src/main/resources/logback.yml b/libraries-data/ebean/src/main/resources/logback.yml new file mode 100644 index 0000000000..c838a19c6c --- /dev/null +++ b/libraries-data/ebean/src/main/resources/logback.yml @@ -0,0 +1,3 @@ + + + From af526099b5cebacdaf47235ff24d0dcdd056b195 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Mon, 1 Oct 2018 11:01:14 +0530 Subject: [PATCH 037/546] BAEL-1466 Removed the Unnecessary code. --- .../geode/functions/CustomerWithMaxAge.java | 39 --------------- .../baeldung/geode/functions/PrimeNumber.java | 49 ------------------- .../geode/GeodeSamplesIntegrationTest.java | 8 +-- 3 files changed, 2 insertions(+), 94 deletions(-) delete mode 100644 apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java delete mode 100644 apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java diff --git a/apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java b/apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java deleted file mode 100644 index ef729a1ac2..0000000000 --- a/apache-geode/src/main/java/com/baeldung/geode/functions/CustomerWithMaxAge.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.baeldung.geode.functions; - -import com.baeldung.geode.Customer; -import org.apache.geode.cache.Region; -import org.apache.geode.cache.execute.Function; -import org.apache.geode.cache.execute.FunctionContext; -import org.apache.geode.cache.execute.RegionFunctionContext; - -import java.util.Comparator; -import java.util.Map; -import java.util.Optional; - -public class CustomerWithMaxAge implements Function { - - public static final String ID = CustomerWithMaxAge.class.getSimpleName(); - - private static final long serialVersionUID = -6023734758827953742L; - - @Override - public void execute(FunctionContext context) { - RegionFunctionContext regionContext = (RegionFunctionContext) context; - Region region = regionContext.getDataSet(); - - Comparator ageComparator = Comparator.comparing(Customer::getAge); - - Optional customer = region.entrySet() - .stream() - .map(Map.Entry::getValue) - .max(ageComparator); - - customer.ifPresent(c -> context.getResultSender() - .lastResult(c)); - } - - @Override - public String getId() { - return ID; - } -} diff --git a/apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java b/apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java deleted file mode 100644 index 411816348a..0000000000 --- a/apache-geode/src/main/java/com/baeldung/geode/functions/PrimeNumber.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.baeldung.geode.functions; - -import org.apache.geode.cache.Region; -import org.apache.geode.cache.execute.Function; -import org.apache.geode.cache.execute.FunctionContext; -import org.apache.geode.cache.execute.RegionFunctionContext; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -public class PrimeNumber implements Function { - - public static final String ID = PrimeNumber.class.getSimpleName(); - - @Override - public void execute(FunctionContext context) { - RegionFunctionContext regionContext = (RegionFunctionContext) context; - Region region = regionContext.getDataSet(); - - List primes = new ArrayList<>(); - Set keys = region.keySet(); - for (Integer key : keys) { - if (isPrime(key)) { - primes.add(key); - } - } - Collections.sort(primes); - - context.getResultSender() - .lastResult(primes); - } - - @Override - public String getId() { - return ID; - } - - private boolean isPrime(int number) { - int limit = (int) Math.floor(Math.sqrt(number)); - for (int divisor = 2; divisor <= limit; ++divisor) { - if (number % divisor == 0) { - return false; - } - } - return true; - } -} diff --git a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java index eb9affde8e..b96d2c9b6a 100644 --- a/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java +++ b/apache-geode/src/test/java/com/baeldung/geode/GeodeSamplesIntegrationTest.java @@ -1,7 +1,5 @@ package com.baeldung.geode; -import com.baeldung.geode.functions.CustomerWithMaxAge; -import com.baeldung.geode.functions.PrimeNumber; import com.baeldung.geode.functions.UpperCaseNames; import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientCache; @@ -9,21 +7,19 @@ import org.apache.geode.cache.client.ClientCacheFactory; import org.apache.geode.cache.client.ClientRegionShortcut; import org.apache.geode.cache.execute.Execution; import org.apache.geode.cache.execute.FunctionService; -import org.apache.geode.cache.execute.ResultCollector; import org.apache.geode.cache.query.*; import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.util.*; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; -import java.util.stream.IntStream; import java.util.stream.Stream; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; public class GeodeSamplesIntegrationTest { From f9065d21b777cc8e29da6138914fc5cd66f59803 Mon Sep 17 00:00:00 2001 From: Dmytro Korniienko Date: Mon, 1 Oct 2018 10:17:39 +0300 Subject: [PATCH 038/546] BAEL-2258 Guide to DateTimeFormatter. Tests added for various formatting patterns and styles --- .../DateTimeFormatterUnitTest.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java b/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java index 4d95bc82e1..cbb84a8783 100644 --- a/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java +++ b/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java @@ -3,11 +3,14 @@ package com.baeldung.internationalization; import org.junit.Assert; import org.junit.Test; +import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.LocalTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; +import java.time.temporal.ChronoUnit; import java.util.Locale; import java.util.TimeZone; @@ -43,4 +46,70 @@ public class DateTimeFormatterUnitTest { Assert.assertEquals("Monday, January 1, 2018 10:15:50 AM PST", formattedDateTime); Assert.assertEquals("lundi 1 janvier 2018 10 h 15 PST", frFormattedDateTime); } + + @Test + public void shoulPrintFormattedDate() { + String europeanDatePattern = "dd.MM.yyyy"; + DateTimeFormatter europeanDateFormatter = DateTimeFormatter.ofPattern(europeanDatePattern); + LocalDate summerDay = LocalDate.of(2016, 7, 31); + Assert.assertEquals("31.07.2016", europeanDateFormatter.format(summerDay)); + } + + @Test + public void shouldPrintFormattedTime24() { + String timeColonPattern = "HH:mm:ss"; + DateTimeFormatter timeColonFormatter = DateTimeFormatter.ofPattern(timeColonPattern); + LocalTime colonTime = LocalTime.of(17, 35, 50); + Assert.assertEquals("17:35:50", timeColonFormatter.format(colonTime)); + } + + @Test + public void shouldPrintFormattedTimeWithMillis() { + String timeColonPattern = "HH:mm:ss SSS"; + DateTimeFormatter timeColonFormatter = DateTimeFormatter.ofPattern(timeColonPattern); + LocalTime colonTime = LocalTime.of(17, 35, 50).plus(329, ChronoUnit.MILLIS); + Assert.assertEquals("17:35:50 329", timeColonFormatter.format(colonTime)); + } + + @Test + public void shouldPrintFormattedTimePM() { + String timeColonPattern = "hh:mm:ss a"; + DateTimeFormatter timeColonFormatter = DateTimeFormatter.ofPattern(timeColonPattern); + LocalTime colonTime = LocalTime.of(17, 35, 50); + Assert.assertEquals("05:35:50 PM", timeColonFormatter.format(colonTime)); + } + + @Test + public void shouldPrintFormattedUTCRelatedZonedDateTime() { + String newYorkDateTimePattern = "dd.MM.yyyy HH:mm z"; + DateTimeFormatter newYorkDateFormatter = DateTimeFormatter.ofPattern(newYorkDateTimePattern); + LocalDateTime summerDay = LocalDateTime.of(2016, 7, 31, 14, 15); + Assert.assertEquals("31.07.2016 14:15 UTC-04:00", newYorkDateFormatter.format(ZonedDateTime.of(summerDay, ZoneId.of("UTC-4")))); + } + + @Test + public void shouldPrintFormattedNewYorkZonedDateTime() { + String newYorkDateTimePattern = "dd.MM.yyyy HH:mm z"; + DateTimeFormatter newYorkDateFormatter = DateTimeFormatter.ofPattern(newYorkDateTimePattern); + LocalDateTime summerDay = LocalDateTime.of(2016, 7, 31, 14, 15); + Assert.assertEquals("31.07.2016 14:15 EDT", newYorkDateFormatter.format(ZonedDateTime.of(summerDay, ZoneId.of("America/New_York")))); + } + + @Test + public void shouldPrintStyledDate() { + LocalDate anotherSummerDay = LocalDate.of(2016, 8, 23); + Assert.assertEquals("Tuesday, August 23, 2016", DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL).format(anotherSummerDay)); + Assert.assertEquals("August 23, 2016", DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG).format(anotherSummerDay)); + Assert.assertEquals("Aug 23, 2016", DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM).format(anotherSummerDay)); + Assert.assertEquals("8/23/16", DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT).format(anotherSummerDay)); + } + + @Test + public void shouldPrintStyledDateTime() { + LocalDateTime anotherSummerDay = LocalDateTime.of(2016, 8, 23, 13, 12, 45); + Assert.assertEquals("Tuesday, August 23, 2016 1:12:45 PM EET", DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL).withZone(ZoneId.of("Europe/Helsinki")).format(anotherSummerDay)); + Assert.assertEquals("August 23, 2016 1:12:45 PM EET", DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG).withZone(ZoneId.of("Europe/Helsinki")).format(anotherSummerDay)); + Assert.assertEquals("Aug 23, 2016 1:12:45 PM", DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withZone(ZoneId.of("Europe/Helsinki")).format(anotherSummerDay)); + Assert.assertEquals("8/23/16 1:12 PM", DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT).withZone(ZoneId.of("Europe/Helsinki")).format(anotherSummerDay)); + } } From 8ca0e9a84711edfd712bced5b6cf659a53dd783a Mon Sep 17 00:00:00 2001 From: dupirefr Date: Mon, 1 Oct 2018 19:30:04 +0200 Subject: [PATCH 039/546] [BAEL-2183] Arrays manipulations --- .../baeldung/array/ArrayReferenceGuide.java | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/array/ArrayReferenceGuide.java diff --git a/core-java/src/main/java/com/baeldung/array/ArrayReferenceGuide.java b/core-java/src/main/java/com/baeldung/array/ArrayReferenceGuide.java new file mode 100644 index 0000000000..7d7dec85b0 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/array/ArrayReferenceGuide.java @@ -0,0 +1,159 @@ +package com.baeldung.array; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +public class ArrayReferenceGuide { + + public static void main(String[] args) { + declaration(); + + initialization(); + + access(); + + iterating(); + + varargs(); + + transformIntoList(); + + transformIntoStream(); + + sort(); + + search(); + + merge(); + } + + private static void declaration() { + int[] anArray; + int anotherArray[]; + } + + private static void initialization() { + int[] anArray = new int[10]; + anArray[0] = 10; + anArray[5] = 4; + + int[] anotherArray = new int[] {1, 2, 3, 4, 5}; + } + + private static void access() { + int[] anArray = new int[10]; + anArray[0] = 10; + anArray[5] = 4; + + System.out.println(anArray[0]); + } + + private static void iterating() { + int[] anArray = new int[] {1, 2, 3, 4, 5}; + for (int i = 0; i < anArray.length; i++) { + System.out.println(anArray[i]); + } + + for (int element : anArray) { + System.out.println(element); + } + } + + private static void varargs() { + String[] groceries = new String[] {"Milk", "Tomato", "Chips"}; + varargMethod(groceries); + varargMethod("Milk", "Tomato", "Chips"); + } + + private static void varargMethod(String... varargs) { + for (String element : varargs) { + System.out.println(element); + } + } + + private static void transformIntoList() { + Integer[] anArray = new Integer[] {1, 2, 3, 4, 5}; + + // Naïve implementation + List aList = new ArrayList<>(); // We create an empty list + for (int element : anArray) { + // We iterate over array's elements and add them to the list + aList.add(element); + } + + // Pretty implementation + aList = Arrays.asList(anArray); + + // Drawbacks + try { + aList.remove(0); + } catch (UnsupportedOperationException e) { + System.out.println(e.getMessage()); + } + + try { + aList.add(6); + } catch (UnsupportedOperationException e) { + System.out.println(e.getMessage()); + } + + int[] anotherArray = new int[] {1, 2, 3, 4, 5}; +// List anotherList = Arrays.asList(anotherArray); + } + + private static void transformIntoStream() { + int[] anArray = new int[] {1, 2, 3, 4, 5}; + IntStream aStream = Arrays.stream(anArray); + + Integer[] anotherArray = new Integer[] {1, 2, 3, 4, 5}; + Stream anotherStream = Arrays.stream(anotherArray, 2, 4); + } + + private static void sort() { + int[] anArray = new int[] {5, 2, 1, 4, 8}; + Arrays.sort(anArray); // anArray is now {1, 2, 4, 5, 8} + + Integer[] anotherArray = new Integer[] {5, 2, 1, 4, 8}; + Arrays.sort(anotherArray); // anArray is now {1, 2, 4, 5, 8} + + String[] yetAnotherArray = new String[] {"A", "E", "Z", "B", "C"}; + Arrays.sort(yetAnotherArray, 1, 3, Comparator.comparing(String::toString).reversed()); // yetAnotherArray is now {"A", "Z", "E", "B", "C"} + } + + private static void search() { + int[] anArray = new int[] {5, 2, 1, 4, 8}; + for (int i = 0; i < anArray.length; i++) { + if (anArray[i] == 4) { + System.out.println("Found at index " + i); + break; + } + } + + Arrays.sort(anArray); + int index = Arrays.binarySearch(anArray, 4); + System.out.println("Found at index " + index); + } + + private static void merge() { + int[] anArray = new int[] {5, 2, 1, 4, 8}; + int[] anotherArray = new int[] {10, 4, 9, 11, 2}; + + int[] resultArray = new int[anArray.length + anotherArray.length]; + for (int i = 0; i < resultArray.length; i++) { + resultArray[i] = (i < anArray.length ? anArray[i] : anotherArray[i - anArray.length]); + } + for (int element : resultArray) { + System.out.println(element); + } + + Arrays.setAll(resultArray, i -> (i < anArray.length ? anArray[i] : anotherArray[i - anArray.length])); + for (int element : resultArray) { + System.out.println(element); + } + } + +} From 2784b3de4c7e610081dc44b4c4fbee137821265a Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Mon, 1 Oct 2018 21:06:19 +0200 Subject: [PATCH 040/546] removed unnecessary Mockito and refactored test method name --- .../nth/root/calculator/NthRootCalculatorUnitTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java b/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java index 388bceef49..84d340ca65 100644 --- a/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java +++ b/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java @@ -7,14 +7,12 @@ import org.mockito.runners.MockitoJUnitRunner; import static org.junit.Assert.assertEquals; -@RunWith(MockitoJUnitRunner.class) public class NthRootCalculatorUnitTest { - @InjectMocks - private NthRootCalculator nthRootCalculator; + private NthRootCalculator nthRootCalculator = new NthRootCalculator(); @Test - public void giventThatTheBaseIs125_andTheExpIs3_whenCalculateIsCalled_thenTheResultIsTheCorrectOne() { + public void whenBaseIs125AndNIs3_thenNthRootIs5() { Double result = nthRootCalculator.calculate(125.0, 3.0); assertEquals(result, (Double) 5.0d); } From 6460e73eb67f514376005258d490ed742f93a60d Mon Sep 17 00:00:00 2001 From: Satyam Date: Tue, 2 Oct 2018 12:06:56 +0530 Subject: [PATCH 041/546] BAEL-2197: Initial Commit --- core-java-8/findItemsBasedOnValues/.gitignore | 1 + .../src/findItems/FindItemsBasedOnValues.java | 114 ++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 core-java-8/findItemsBasedOnValues/.gitignore create mode 100644 core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java diff --git a/core-java-8/findItemsBasedOnValues/.gitignore b/core-java-8/findItemsBasedOnValues/.gitignore new file mode 100644 index 0000000000..ae3c172604 --- /dev/null +++ b/core-java-8/findItemsBasedOnValues/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java b/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java new file mode 100644 index 0000000000..5fa15be86e --- /dev/null +++ b/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java @@ -0,0 +1,114 @@ +package findItems; + +import static org.junit.Assert.*; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; +import org.junit.Test; + +public class FindItemsBasedOnValues { + + static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yyyy"); + + public static void main(String[] args) throws ParseException { + FindItemsBasedOnValues findItems = new FindItemsBasedOnValues(); + findItems.findItemsImpl(); + } + + @Test + public void findItemsImpl() throws ParseException { + List expectedList = new ArrayList(); + Client expectedClient = new Client(1001, DATE_FORMAT.parse("01-02-2018")); + expectedList.add(expectedClient); + + List listOfCompanies = new ArrayList(); + List listOfClients = new ArrayList(); + populate(listOfCompanies, listOfClients); + + List filteredList = listOfClients.stream() + .filter(client -> listOfCompanies.stream() + .anyMatch(company -> company.getType() + .equals("eMart") && company.getProjectId() + .equals(client.getProjectId()) && company.getStart() + .after(client.getDate()) && company.getEnd() + .before(client.getDate()))) + .collect(Collectors.toList()); + + assertEquals(expectedClient.getProjectId(), filteredList.get(0) + .getProjectId()); + assertEquals(expectedClient.getDate(), filteredList.get(0) + .getDate()); + } + + private void populate(List companyList, List clientList) throws ParseException { + Company company1 = new Company(1001, DATE_FORMAT.parse("01-03-2018"), DATE_FORMAT.parse("01-01-2018"), "eMart"); + Company company2 = new Company(1002, DATE_FORMAT.parse("01-02-2018"), DATE_FORMAT.parse("01-04-2018"), "commerce"); + Company company3 = new Company(1003, DATE_FORMAT.parse("01-06-2018"), DATE_FORMAT.parse("01-02-2018"), "eMart"); + Company company4 = new Company(1004, DATE_FORMAT.parse("01-03-2018"), DATE_FORMAT.parse("01-06-2018"), "blog"); + + Collections.addAll(companyList, company1, company2, company3, company4); + + Client client1 = new Client(1001, DATE_FORMAT.parse("01-02-2018")); + Client client2 = new Client(1003, DATE_FORMAT.parse("01-04-2018")); + Client client3 = new Client(1005, DATE_FORMAT.parse("01-07-2018")); + Client client4 = new Client(1007, DATE_FORMAT.parse("01-08-2018")); + + Collections.addAll(clientList, client1, client2, client3, client4); + } +} + +class Company { + Long projectId; + Date start; + Date end; + String type; + + public Company(long projectId, Date start, Date end, String type) { + super(); + this.projectId = projectId; + this.start = start; + this.end = end; + this.type = type; + } + + public Long getProjectId() { + return projectId; + } + + public Date getStart() { + return start; + } + + public Date getEnd() { + return end; + } + + public String getType() { + return type; + } + +} + +class Client { + Long projectId; + Date date; + + public Client(long projectId, Date date) { + super(); + this.projectId = projectId; + this.date = date; + } + + public Long getProjectId() { + return projectId; + } + + public Date getDate() { + return date; + } + +} \ No newline at end of file From 7070aae38f951a23463abb3e2545bb7682ef387c Mon Sep 17 00:00:00 2001 From: Satyam Date: Wed, 3 Oct 2018 10:39:58 +0530 Subject: [PATCH 042/546] Updated Test method name --- .../src/findItems/FindItemsBasedOnValues.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java b/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java index 5fa15be86e..d6a320a8ec 100644 --- a/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java +++ b/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java @@ -16,11 +16,11 @@ public class FindItemsBasedOnValues { public static void main(String[] args) throws ParseException { FindItemsBasedOnValues findItems = new FindItemsBasedOnValues(); - findItems.findItemsImpl(); + findItems.givenListOfCompanies_thenListOfClientsIsFilteredCorrectly(); } @Test - public void findItemsImpl() throws ParseException { + public void givenListOfCompanies_thenListOfClientsIsFilteredCorrectly() throws ParseException { List expectedList = new ArrayList(); Client expectedClient = new Client(1001, DATE_FORMAT.parse("01-02-2018")); expectedList.add(expectedClient); From 7f6df18b64e5defb7909d6aa08748bf1cda41fc5 Mon Sep 17 00:00:00 2001 From: Dmytro Korniienko Date: Wed, 3 Oct 2018 23:55:24 +0300 Subject: [PATCH 043/546] BAEL-2258 Guide to DateTimeFormatter. Predefined formatters tests added --- .../internationalization/DateTimeFormatterUnitTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java b/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java index cbb84a8783..1260a6db92 100644 --- a/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java +++ b/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java @@ -48,7 +48,7 @@ public class DateTimeFormatterUnitTest { } @Test - public void shoulPrintFormattedDate() { + public void shouldPrintFormattedDate() { String europeanDatePattern = "dd.MM.yyyy"; DateTimeFormatter europeanDateFormatter = DateTimeFormatter.ofPattern(europeanDatePattern); LocalDate summerDay = LocalDate.of(2016, 7, 31); @@ -112,4 +112,11 @@ public class DateTimeFormatterUnitTest { Assert.assertEquals("Aug 23, 2016 1:12:45 PM", DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withZone(ZoneId.of("Europe/Helsinki")).format(anotherSummerDay)); Assert.assertEquals("8/23/16 1:12 PM", DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT).withZone(ZoneId.of("Europe/Helsinki")).format(anotherSummerDay)); } + + @Test + public void shouldPrintFormattedDateTimeWithPredefined() { + Assert.assertEquals("2018-03-09", DateTimeFormatter.ISO_LOCAL_DATE.format(LocalDate.of(2018, 3, 9))); + Assert.assertEquals("2018-03-09-03:00", DateTimeFormatter.ISO_OFFSET_DATE.format(LocalDate.of(2018, 3, 9).atStartOfDay(ZoneId.of("UTC-3")))); + Assert.assertEquals("Fri, 9 Mar 2018 00:00:00 -0300", DateTimeFormatter.RFC_1123_DATE_TIME.format(LocalDate.of(2018, 3, 9).atStartOfDay(ZoneId.of("UTC-3")))); + } } From 08e902cb26072d8959bbcc191a91d1737d235c7d Mon Sep 17 00:00:00 2001 From: Dmytro Korniienko Date: Thu, 4 Oct 2018 23:14:59 +0300 Subject: [PATCH 044/546] BAEL-2258 Guide to DateTimeFormatter. parse() method usage tests added --- .../DateTimeFormatterUnitTest.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java b/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java index 1260a6db92..36a5f6210b 100644 --- a/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java +++ b/core-java-8/src/test/java/com/baeldung/internationalization/DateTimeFormatterUnitTest.java @@ -9,6 +9,7 @@ import java.time.LocalTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.time.format.FormatStyle; import java.time.temporal.ChronoUnit; import java.util.Locale; @@ -119,4 +120,39 @@ public class DateTimeFormatterUnitTest { Assert.assertEquals("2018-03-09-03:00", DateTimeFormatter.ISO_OFFSET_DATE.format(LocalDate.of(2018, 3, 9).atStartOfDay(ZoneId.of("UTC-3")))); Assert.assertEquals("Fri, 9 Mar 2018 00:00:00 -0300", DateTimeFormatter.RFC_1123_DATE_TIME.format(LocalDate.of(2018, 3, 9).atStartOfDay(ZoneId.of("UTC-3")))); } + + @Test + public void shouldParseDateTime() { + Assert.assertEquals(LocalDate.of(2018, 3, 12), LocalDate.from(DateTimeFormatter.ISO_LOCAL_DATE.parse("2018-03-09")).plusDays(3)); + } + + @Test + public void shouldParseFormatStyleFull() { + ZonedDateTime dateTime = ZonedDateTime.from(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL).parse("Tuesday, August 23, 2016 1:12:45 PM EET")); + Assert.assertEquals(ZonedDateTime.of(LocalDateTime.of(2016, 8, 23, 22, 12, 45), ZoneId.of("Europe/Bucharest")), dateTime.plusHours(9)); + } + + @Test + public void shouldParseDateWithCustomFormatter() { + DateTimeFormatter europeanDateFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy"); + Assert.assertFalse(LocalDate.from(europeanDateFormatter.parse("15.08.2014")).isLeapYear()); + } + + @Test + public void shouldParseTimeWithCustomFormatter() { + DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("hh:mm:ss a"); + Assert.assertTrue(LocalTime.from(timeFormatter.parse("12:25:30 AM")).isBefore(LocalTime.NOON)); + } + + @Test + public void shouldParseZonedDateTimeWithCustomFormatter() { + DateTimeFormatter zonedFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm z"); + Assert.assertEquals(7200, ZonedDateTime.from(zonedFormatter.parse("31.07.2016 14:15 GMT+02:00")).getOffset().getTotalSeconds()); + } + + @Test(expected = DateTimeParseException.class) + public void shouldExpectAnExceptionIfDateTimeStringNotMatchPattern() { + DateTimeFormatter zonedFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm z"); + ZonedDateTime.from(zonedFormatter.parse("31.07.2016 14:15")); + } } From 382a3e789b9113f1c644de559f72c01aa8383842 Mon Sep 17 00:00:00 2001 From: TINO M THOMAS Date: Fri, 5 Oct 2018 20:20:49 +0300 Subject: [PATCH 045/546] BAEL -2251 Cache eviction in Spring Boot --- .../SpringBootMvcApplication.java | 4 ++ .../caching/CachingController.java | 17 ++++++ .../springbootmvc/caching/CachingService.java | 53 ++++++++++++++++++ .../CacheEvictAnnotationIntegrationTest.java | 44 +++++++++++++++ .../CacheManagerEvictIntegrationTest.java | 55 +++++++++++++++++++ 5 files changed, 173 insertions(+) create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java create mode 100644 spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java create mode 100644 spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java index df8f72f500..99f081c602 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java +++ b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java @@ -2,8 +2,12 @@ package com.baeldung.springbootmvc; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication +@EnableCaching +@EnableScheduling public class SpringBootMvcApplication { public static void main(String[] args) { diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java new file mode 100644 index 0000000000..390759de9b --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java @@ -0,0 +1,17 @@ +package com.baeldung.springbootmvc.caching; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class CachingController { + + @Autowired + CachingService cachingService; + + @GetMapping("clearAllCaches") + public void clearAllCaches() { + cachingService.evictAllCaches(); + } +} diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java new file mode 100644 index 0000000000..e291640bd8 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java @@ -0,0 +1,53 @@ +package com.baeldung.springbootmvc.caching; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class CachingService { + + @Autowired + CacheManager cacheManager; + + public void putToCache(String cacheName, String key, String value) { + cacheManager.getCache(cacheName).put(key, value); + } + + public String getFromCache(String cacheName, String key) { + String value = null; + if (cacheManager.getCache(cacheName).get(key) != null) { + value = cacheManager.getCache(cacheName).get(key).get().toString(); + } + return value; + } + + @CacheEvict(value = "first", key = "#cacheKey") + public void evictSingleCacheValue(String cacheKey) { + } + + @CacheEvict(value = "first", allEntries = true) + public void evictAllCacheValues() { + } + + public void evictSingleCacheValue(String cacheName, String cacheKey) { + cacheManager.getCache(cacheName).evict(cacheKey); + } + + public void evictAllCacheValues(String cacheName) { + cacheManager.getCache(cacheName).clear(); + } + + public void evictAllCaches() { + cacheManager.getCacheNames() + .parallelStream() + .forEach(cacheName -> cacheManager.getCache(cacheName).clear()); + } + + @Scheduled(fixedRate = 6000) + public void evictAllcachesAtIntervals() { + evictAllCaches(); + } +} diff --git a/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java b/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java new file mode 100644 index 0000000000..dc50d48215 --- /dev/null +++ b/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java @@ -0,0 +1,44 @@ +package com.baeldung.caching; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; + +import org.junit.Before; +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.test.context.junit4.SpringRunner; + +import com.baeldung.springbootmvc.SpringBootMvcApplication; +import com.baeldung.springbootmvc.caching.CachingService; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {SpringBootMvcApplication.class, CachingService.class}) +public class CacheEvictAnnotationIntegrationTest { + + @Autowired CachingService cachingService; + + @Before + public void before() { + cachingService.putToCache("first", "key1", "Baeldung"); + cachingService.putToCache("first", "key2", "Article"); + } + + @Test + public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { + cachingService.evictSingleCacheValue("key1"); + String key1 = cachingService.getFromCache("first", "key1"); + assertThat(key1, is(nullValue())); + } + + @Test + public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { + cachingService.evictAllCacheValues(); + String key1 = cachingService.getFromCache("first", "key1"); + String key2 = cachingService.getFromCache("first", "key2"); + assertThat(key1, is(nullValue())); + assertThat(key2, is(nullValue())); + } +} diff --git a/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java b/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java new file mode 100644 index 0000000000..7f7921fbe5 --- /dev/null +++ b/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java @@ -0,0 +1,55 @@ +package com.baeldung.caching; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; + +import org.junit.Before; +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.test.context.junit4.SpringRunner; + +import com.baeldung.springbootmvc.SpringBootMvcApplication; +import com.baeldung.springbootmvc.caching.CachingService; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {SpringBootMvcApplication.class, CachingService.class}) +public class CacheManagerEvictIntegrationTest { + + @Autowired CachingService cachingService; + + @Before + public void before() { + cachingService.putToCache("first", "key1", "Baeldung"); + cachingService.putToCache("first", "key2", "Article"); + cachingService.putToCache("second", "key", "Article"); + } + + @Test + public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { + cachingService.evictSingleCacheValue("first","key1"); + String key1 = cachingService.getFromCache("first", "key1"); + assertThat(key1, is(nullValue())); + } + + @Test + public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { + cachingService.evictAllCacheValues("first"); + String key1 = cachingService.getFromCache("first", "key1"); + String key2 = cachingService.getFromCache("first", "key2"); + assertThat(key1, is(nullValue())); + assertThat(key2, is(nullValue())); + } + + @Test + public void givenAllCaches_whenAllCacheEvictRequested_thenEmptyAllCaches() { + cachingService.evictAllCaches(); + String key1 = cachingService.getFromCache("first", "key1"); + assertThat(key1, is(nullValue())); + + String key = cachingService.getFromCache("second", "key"); + assertThat(key, is(nullValue())); + } +} From 5022d3fbf95a82d085d992c3b0a3b2f0a9bee486 Mon Sep 17 00:00:00 2001 From: Josephine Barboza Date: Sat, 6 Oct 2018 01:32:25 +0530 Subject: [PATCH 046/546] Ebean Chnages --- libraries-data/ebean/pom.xml | 59 --------- libraries-data/pom.xml | 56 +++++---- .../main/java/com/baeldung/ebean/app/App.java | 0 .../java/com/baeldung/ebean/app/App2.java | 0 .../com/baeldung/ebean/model/Address.java | 0 .../com/baeldung/ebean/model/BaseModel.java | 118 +++++++++--------- .../com/baeldung/ebean/model/Customer.java | 84 ++++++------- .../src/main/resources/application.properties | 0 .../{ebean => }/src/main/resources/ebean.mf | 0 .../src/main/resources/logback.yml | 0 10 files changed, 136 insertions(+), 181 deletions(-) delete mode 100644 libraries-data/ebean/pom.xml rename libraries-data/{ebean => }/src/main/java/com/baeldung/ebean/app/App.java (100%) rename libraries-data/{ebean => }/src/main/java/com/baeldung/ebean/app/App2.java (100%) rename libraries-data/{ebean => }/src/main/java/com/baeldung/ebean/model/Address.java (100%) rename libraries-data/{ebean => }/src/main/java/com/baeldung/ebean/model/BaseModel.java (94%) rename libraries-data/{ebean => }/src/main/java/com/baeldung/ebean/model/Customer.java (95%) rename libraries-data/{ebean => }/src/main/resources/application.properties (100%) rename libraries-data/{ebean => }/src/main/resources/ebean.mf (100%) rename libraries-data/{ebean => }/src/main/resources/logback.yml (100%) diff --git a/libraries-data/ebean/pom.xml b/libraries-data/ebean/pom.xml deleted file mode 100644 index 2e319e1523..0000000000 --- a/libraries-data/ebean/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - 4.0.0 - - com.baeldung - ebean - 0.0.1-SNAPSHOT - jar - - ebean - http://maven.apache.org - - - UTF-8 - - - - - io.ebean - ebean - 11.22.4 - - - com.h2database - h2 - 1.4.196 - - - ch.qos.logback - logback-classic - 1.2.3 - - - - - - - - io.ebean - ebean-maven-plugin - 11.11.2 - - - - main - process-classes - - debug=1 - - - enhance - - - - - - - - diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index 5b34a903ce..abbbe9c5de 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -249,6 +249,18 @@ ${awaitility.version} test + + + io.ebean + ebean + 11.22.4 + + + + ch.qos.logback + logback-classic + 1.2.3 + @@ -332,27 +344,7 @@ - - org.datanucleus - datanucleus-maven-plugin - ${datanucleus-maven-plugin.version} - - JDO - ${basedir}/datanucleus.properties - ${basedir}/log4j.properties - true - false - - - - - process-classes - - enhance - - - - + org.apache.maven.plugins @@ -380,6 +372,28 @@ + + + + io.ebean + ebean-maven-plugin + 11.11.2 + + + + main + process-classes + + debug=1 + + + enhance + + + + + + diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App.java b/libraries-data/src/main/java/com/baeldung/ebean/app/App.java similarity index 100% rename from libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App.java rename to libraries-data/src/main/java/com/baeldung/ebean/app/App.java diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App2.java b/libraries-data/src/main/java/com/baeldung/ebean/app/App2.java similarity index 100% rename from libraries-data/ebean/src/main/java/com/baeldung/ebean/app/App2.java rename to libraries-data/src/main/java/com/baeldung/ebean/app/App2.java diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Address.java b/libraries-data/src/main/java/com/baeldung/ebean/model/Address.java similarity index 100% rename from libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Address.java rename to libraries-data/src/main/java/com/baeldung/ebean/model/Address.java diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/BaseModel.java b/libraries-data/src/main/java/com/baeldung/ebean/model/BaseModel.java similarity index 94% rename from libraries-data/ebean/src/main/java/com/baeldung/ebean/model/BaseModel.java rename to libraries-data/src/main/java/com/baeldung/ebean/model/BaseModel.java index 7634df7aa0..1390507605 100644 --- a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/BaseModel.java +++ b/libraries-data/src/main/java/com/baeldung/ebean/model/BaseModel.java @@ -1,59 +1,59 @@ -package com.baeldung.ebean.model; - -import java.time.Instant; - -import javax.persistence.Id; -import javax.persistence.MappedSuperclass; -import javax.persistence.Version; - -import io.ebean.annotation.WhenCreated; -import io.ebean.annotation.WhenModified; - -@MappedSuperclass -public abstract class BaseModel { - - @Id - protected long id; - - @Version - protected long version; - - @WhenCreated - protected Instant createdOn; - - @WhenModified - protected Instant modifiedOn; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public Instant getCreatedOn() { - return createdOn; - } - - public void setCreatedOn(Instant createdOn) { - this.createdOn = createdOn; - } - - public Instant getModifiedOn() { - return modifiedOn; - } - - public void setModifiedOn(Instant modifiedOn) { - this.modifiedOn = modifiedOn; - } - - public long getVersion() { - return version; - } - - public void setVersion(long version) { - this.version = version; - } - -} +package com.baeldung.ebean.model; + +import java.time.Instant; + +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.Version; + +import io.ebean.annotation.WhenCreated; +import io.ebean.annotation.WhenModified; + +@MappedSuperclass +public abstract class BaseModel { + + @Id + protected long id; + + @Version + protected long version; + + @WhenCreated + protected Instant createdOn; + + @WhenModified + protected Instant modifiedOn; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public Instant getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Instant createdOn) { + this.createdOn = createdOn; + } + + public Instant getModifiedOn() { + return modifiedOn; + } + + public void setModifiedOn(Instant modifiedOn) { + this.modifiedOn = modifiedOn; + } + + public long getVersion() { + return version; + } + + public void setVersion(long version) { + this.version = version; + } + +} diff --git a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Customer.java b/libraries-data/src/main/java/com/baeldung/ebean/model/Customer.java similarity index 95% rename from libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Customer.java rename to libraries-data/src/main/java/com/baeldung/ebean/model/Customer.java index df1db82de4..4dd629245a 100644 --- a/libraries-data/ebean/src/main/java/com/baeldung/ebean/model/Customer.java +++ b/libraries-data/src/main/java/com/baeldung/ebean/model/Customer.java @@ -1,42 +1,42 @@ -package com.baeldung.ebean.model; - -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.OneToOne; - -@Entity -public class Customer extends BaseModel { - - public Customer(String name, Address address) { - super(); - this.name = name; - this.address = address; - } - - private String name; - - @OneToOne(cascade = CascadeType.ALL) - Address address; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Address getAddress() { - return address; - } - - public void setAddress(Address address) { - this.address = address; - } - - @Override - public String toString() { - return "Customer [id=" + id + ", name=" + name + ", address=" + address + "]"; - } - -} +package com.baeldung.ebean.model; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.OneToOne; + +@Entity +public class Customer extends BaseModel { + + public Customer(String name, Address address) { + super(); + this.name = name; + this.address = address; + } + + private String name; + + @OneToOne(cascade = CascadeType.ALL) + Address address; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } + + @Override + public String toString() { + return "Customer [id=" + id + ", name=" + name + ", address=" + address + "]"; + } + +} diff --git a/libraries-data/ebean/src/main/resources/application.properties b/libraries-data/src/main/resources/application.properties similarity index 100% rename from libraries-data/ebean/src/main/resources/application.properties rename to libraries-data/src/main/resources/application.properties diff --git a/libraries-data/ebean/src/main/resources/ebean.mf b/libraries-data/src/main/resources/ebean.mf similarity index 100% rename from libraries-data/ebean/src/main/resources/ebean.mf rename to libraries-data/src/main/resources/ebean.mf diff --git a/libraries-data/ebean/src/main/resources/logback.yml b/libraries-data/src/main/resources/logback.yml similarity index 100% rename from libraries-data/ebean/src/main/resources/logback.yml rename to libraries-data/src/main/resources/logback.yml From 62d677ed30e1337e6829a547f59a571889fc94db Mon Sep 17 00:00:00 2001 From: Josephine Barboza Date: Sun, 7 Oct 2018 13:14:31 +0530 Subject: [PATCH 047/546] BAEL-2169 Guide to Ebean --- libraries-data/pom.xml | 207 +++++++++++------- .../main/java/com/baeldung/ebean/app/App.java | 2 +- .../com/baeldung/ebean/model/Address.java | 14 +- .../com/baeldung/ebean/model/BaseModel.java | 8 +- ...pplication.properties => ebean.properties} | 0 libraries-data/src/main/resources/logback.xml | 29 ++- libraries-data/src/main/resources/logback.yml | 3 - 7 files changed, 162 insertions(+), 101 deletions(-) rename libraries-data/src/main/resources/{application.properties => ebean.properties} (100%) delete mode 100644 libraries-data/src/main/resources/logback.yml diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index abbbe9c5de..e1318fd597 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 libraries-data @@ -13,6 +14,7 @@ + com.esotericsoftware kryo @@ -99,36 +101,49 @@ org.datanucleus javax.jdo ${javax.jdo.version} + org.datanucleus datanucleus-core ${datanucleus.version} + org.datanucleus datanucleus-api-jdo ${datanucleus.version} + + org.datanucleus datanucleus-rdbms ${datanucleus.version} + org.datanucleus datanucleus-maven-plugin ${datanucleus-maven-plugin.version} + + + log4j + log4j + + org.datanucleus datanucleus-xml ${datanucleus-xml.version} + org.datanucleus datanucleus-jdo-query ${datanucleus-jdo-query.version} + @@ -141,49 +156,55 @@ hazelcast ${hazelcast.version} - + com.googlecode.jmapper-framework jmapper-core ${jmapper.version} - - - org.apache.crunch - crunch-core - ${org.apache.crunch.crunch-core.version} - - - org.apache.hadoop - hadoop-client - ${org.apache.hadoop.hadoop-client} - provided - + + + org.apache.crunch + crunch-core + ${org.apache.crunch.crunch-core.version} + + + org.apache.hadoop + hadoop-client + ${org.apache.hadoop.hadoop-client} + provided + + + log4j + log4j + + + - - commons-cli - commons-cli - 1.2 - provided - - - commons-io - commons-io - 2.1 - provided - - - commons-httpclient - commons-httpclient - 3.0.1 - provided - - - commons-codec - commons-codec - - - + + commons-cli + commons-cli + 1.2 + provided + + + commons-io + commons-io + 2.1 + provided + + + commons-httpclient + commons-httpclient + 3.0.1 + provided + + + commons-codec + commons-codec + + + org.apache.flink flink-connector-kafka-0.11_2.11 @@ -249,19 +270,32 @@ ${awaitility.version} test - - + io.ebean ebean - 11.22.4 + ${ebean.version} - + + org.slf4j + slf4j-api + ${slf4j.version} + + ch.qos.logback logback-classic - 1.2.3 + ${logback.version} + + + ch.qos.logback + logback-core + ${logback.version} + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} - @@ -280,16 +314,28 @@ - - - + + + - - + + - + @@ -344,35 +390,35 @@ - - - org.apache.maven.plugins - maven-assembly-plugin - 2.3 - - - src/main/assembly/hadoop-job.xml - - - - com.baeldung.crunch.WordCount - - - - - - make-assembly - package - - single - - - - + + + org.apache.maven.plugins + maven-assembly-plugin + 2.3 + + + src/main/assembly/hadoop-job.xml + + + + com.baeldung.crunch.WordCount + + + + + + make-assembly + package + + single + + + + - + io.ebean @@ -429,7 +475,10 @@ 5.0.4 1.6.0.1 0.15.0 - 2.2.0 + 2.2.0 + 11.22.4 + 1.7.25 + 1.0.1 diff --git a/libraries-data/src/main/java/com/baeldung/ebean/app/App.java b/libraries-data/src/main/java/com/baeldung/ebean/app/App.java index 161bf1e820..44a4fa8562 100644 --- a/libraries-data/src/main/java/com/baeldung/ebean/app/App.java +++ b/libraries-data/src/main/java/com/baeldung/ebean/app/App.java @@ -28,7 +28,7 @@ public class App { } public static void crudOperations() { - + Address a1 = new Address("5, Wide Street", null, "New York"); Customer c1 = new Customer("John Wide", a1); diff --git a/libraries-data/src/main/java/com/baeldung/ebean/model/Address.java b/libraries-data/src/main/java/com/baeldung/ebean/model/Address.java index 362e27c32a..dfcd90ffa7 100644 --- a/libraries-data/src/main/java/com/baeldung/ebean/model/Address.java +++ b/libraries-data/src/main/java/com/baeldung/ebean/model/Address.java @@ -3,7 +3,7 @@ package com.baeldung.ebean.model; import javax.persistence.Entity; @Entity -public class Address extends BaseModel{ +public class Address extends BaseModel { public Address(String addressLine1, String addressLine2, String city) { super(); @@ -11,32 +11,38 @@ public class Address extends BaseModel{ this.addressLine2 = addressLine2; this.city = city; } - + private String addressLine1; private String addressLine2; private String city; - + public String getAddressLine1() { return addressLine1; } + public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } + public String getAddressLine2() { return addressLine2; } + public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } + public String getCity() { return city; } + public void setCity(String city) { this.city = city; } + @Override public String toString() { return "Address [id=" + id + ", addressLine1=" + addressLine1 + ", addressLine2=" + addressLine2 + ", city=" + city + "]"; } - + } diff --git a/libraries-data/src/main/java/com/baeldung/ebean/model/BaseModel.java b/libraries-data/src/main/java/com/baeldung/ebean/model/BaseModel.java index 1390507605..547d5bf075 100644 --- a/libraries-data/src/main/java/com/baeldung/ebean/model/BaseModel.java +++ b/libraries-data/src/main/java/com/baeldung/ebean/model/BaseModel.java @@ -14,13 +14,13 @@ public abstract class BaseModel { @Id protected long id; - + @Version protected long version; - + @WhenCreated protected Instant createdOn; - + @WhenModified protected Instant modifiedOn; @@ -55,5 +55,5 @@ public abstract class BaseModel { public void setVersion(long version) { this.version = version; } - + } diff --git a/libraries-data/src/main/resources/application.properties b/libraries-data/src/main/resources/ebean.properties similarity index 100% rename from libraries-data/src/main/resources/application.properties rename to libraries-data/src/main/resources/ebean.properties diff --git a/libraries-data/src/main/resources/logback.xml b/libraries-data/src/main/resources/logback.xml index 7d900d8ea8..21f797ed71 100644 --- a/libraries-data/src/main/resources/logback.xml +++ b/libraries-data/src/main/resources/logback.xml @@ -1,13 +1,22 @@ - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libraries-data/src/main/resources/logback.yml b/libraries-data/src/main/resources/logback.yml deleted file mode 100644 index c838a19c6c..0000000000 --- a/libraries-data/src/main/resources/logback.yml +++ /dev/null @@ -1,3 +0,0 @@ - - - From 2d3accedcc9664364651208bca5e878e18a4d0bc Mon Sep 17 00:00:00 2001 From: Alfonso Lentini Date: Sun, 7 Oct 2018 13:08:12 +0200 Subject: [PATCH 048/546] Thread and Coroutines in Kotlin --- .../com/baeldung/thread/SimpleRunnable.kt | 8 +++ .../com/baeldung/thread/SimpleThread.kt | 8 +++ .../com/baeldung/thread/CoroutineUnitTest.kt | 68 +++++++++++++++++++ .../com/baeldung/thread/ThreadUnitTest.kt | 38 +++++++++++ 4 files changed, 122 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleRunnable.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleThread.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/thread/ThreadUnitTest.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleRunnable.kt b/core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleRunnable.kt new file mode 100644 index 0000000000..7bc0528d06 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleRunnable.kt @@ -0,0 +1,8 @@ +package com.baeldung.thread + +class SimpleRunnable: Runnable { + + override fun run() { + println("${Thread.currentThread()} has run.") + } +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleThread.kt b/core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleThread.kt new file mode 100644 index 0000000000..2b2827ae02 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/thread/SimpleThread.kt @@ -0,0 +1,8 @@ +package com.baeldung.thread + +class SimpleThread: Thread() { + + override fun run() { + println("${Thread.currentThread()} has run.") + } +} \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt new file mode 100644 index 0000000000..215fa6710f --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt @@ -0,0 +1,68 @@ +package com.baeldung.thread + +import kotlinx.coroutines.experimental.* +import org.junit.jupiter.api.Test + +class CoroutineUnitTest { + + @Test + fun whenCreateLaunchCoroutineWithoutContext_thenRun() { + + val job = launch { + println("${Thread.currentThread()} has run.") + } + + runBlocking { + job.join() + } + } + + @Test + fun whenCreateLaunchCoroutineWithDefaultContext_thenRun() { + + val job = launch(DefaultDispatcher) { + println("${Thread.currentThread()} has run.") + } + + runBlocking { + job.join() + } + } + + @Test + fun whenCreateLaunchCoroutineWithUnconfinedContext_thenRun() { + + val job = launch(Unconfined) { + println("${Thread.currentThread()} has run.") + } + + runBlocking { + job.join() + } + } + + @Test + fun whenCreateLaunchCoroutineWithDedicatedThread_thenRun() { + + val job = launch(newSingleThreadContext("dedicatedThread")) { + println("${Thread.currentThread()} has run.") + } + + runBlocking { + job.join() + } + } + + @Test + fun whenCreateAsyncCoroutine_thenRun() { + + val deferred = async(Unconfined) { + return@async "${Thread.currentThread()} has run." + } + + runBlocking { + val result = deferred.await() + println(result) + } + } +} \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/thread/ThreadUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/thread/ThreadUnitTest.kt new file mode 100644 index 0000000000..fa2f1edc36 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/thread/ThreadUnitTest.kt @@ -0,0 +1,38 @@ +package com.baeldung.thread + +import org.junit.jupiter.api.Test +import kotlin.concurrent.thread + +class ThreadUnitTest { + + @Test + fun whenCreateThread_thenRun() { + + val thread = SimpleThread() + thread.start() + } + + @Test + fun whenCreateThreadWithRunnable_thenRun() { + + val threadWithRunnable = Thread(SimpleRunnable()) + threadWithRunnable.start() + } + + @Test + fun whenCreateThreadWithSAMConversions_thenRun() { + + val thread = Thread { + println("${Thread.currentThread()} has run.") + } + thread.start() + } + + @Test + fun whenCreateThreadWithMethodExtension_thenRun() { + + thread(start = true) { + println("${Thread.currentThread()} has run.") + } + } +} \ No newline at end of file From 2a15ac494c6adc3ef8a6e987a0831dd0b6ceaadd Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Sun, 7 Oct 2018 16:38:30 -0300 Subject: [PATCH 049/546] Update pom.xml --- javaxval/pom.xml | 127 +++++++++++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 4d27b3e0c9..75e93806f4 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -1,56 +1,73 @@ - - 4.0.0 - com.baeldung - javaxval - 0.1-SNAPSHOT - - - 1.1.0.Final - 5.3.4.Final - 3.0.0 - 2.2.6 - - - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - - javax.validation - validation-api - ${validation-api.version} - - - - org.hibernate - hibernate-validator - ${hibernate-validator.version} - - - - org.hibernate - hibernate-validator-annotation-processor - ${hibernate-validator.version} - - - - javax.el - javax.el-api - ${javax.el-api.version} - - - - org.glassfish.web - javax.el - ${javax.el.version} - - - - + + 4.0.0 + com.baeldung + javaxval + 0.1-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + javax.validation + validation-api + ${validation-api.version} + + + org.hibernate + hibernate-validator + ${hibernate-validator.version} + + + org.hibernate + hibernate-validator-annotation-processor + ${hibernate-validator.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + + + org.glassfish.web + javax.el + ${javax.el.version} + + + org.springframework + spring-context + ${org.springframework.version} + + + org.springframework + spring-test + ${org.springframework.version} + + + junit + junit + ${junit.version} + test + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + 2.0.1.Final + 6.0.7.Final + 3.0.0 + 3.0.0 + 5.0.2.RELEASE + 4.12 + 3.11.1 + \ No newline at end of file From 178c9435e973dfa573e1a208f1ca1ec4719a8753 Mon Sep 17 00:00:00 2001 From: moisko Date: Mon, 30 Jul 2018 10:30:46 +0300 Subject: [PATCH 050/546] BAEL2212: implement insertion sort in imperative and recursive way --- .../insertionsort/InsertionSort.java | 41 +++++++++++++++++++ .../insertionsort/InsertionSortUnitTest.java | 26 ++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 algorithms/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java create mode 100644 algorithms/src/test/java/algorithms/insertionsort/InsertionSortUnitTest.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java b/algorithms/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java new file mode 100644 index 0000000000..02dd485cf1 --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java @@ -0,0 +1,41 @@ +package com.baeldung.algorithms.insertionsort; + +public class InsertionSort { + + public static void insertionSortImperative(int[] input) { + for (int i = 1; i < input.length; i++) { + int key = input[i]; + int j = i - 1; + while (j >= 0 && input[j] > key) { + input[j + 1] = input[j]; + j = j - 1; + } + input[j + 1] = key; + } + } + + public static void insertionSortRecursive(int[] input) { + insertionSortRecursive(input, input.length); + } + + private static void insertionSortRecursive(int[] input, int i) { + // base case + if (i <= 1) { + return; + } + + // sort the first i - 1 elements of the array + insertionSortRecursive(input, i - 1); + + // then find the correct position of the element at position i + int key = input[i - 1]; + int j = i - 2; + // shifting the elements from their position by 1 + while (j >= 0 && input[j] > key) { + input[j + 1] = input[j]; + j = j - 1; + } + // inserting the key at the appropriate position + input[j + 1] = key; + } +} diff --git a/algorithms/src/test/java/algorithms/insertionsort/InsertionSortUnitTest.java b/algorithms/src/test/java/algorithms/insertionsort/InsertionSortUnitTest.java new file mode 100644 index 0000000000..a5d19cb41d --- /dev/null +++ b/algorithms/src/test/java/algorithms/insertionsort/InsertionSortUnitTest.java @@ -0,0 +1,26 @@ +package algorithms.insertionsort; + +import com.baeldung.algorithms.insertionsort.InsertionSort; +import org.junit.Test; + +import static org.junit.Assert.assertArrayEquals; + +public class InsertionSortUnitTest { + + @Test + public void givenUnsortedArray_whenInsertionSortImperatively_thenItIsSortedInAscendingOrder() { + int[] input = {6, 2, 3, 4, 5, 1}; + InsertionSort.insertionSortImperative(input); + int[] expected = {1, 2, 3, 4, 5, 6}; + assertArrayEquals("the two arrays are not equal", expected, input); + } + + @Test + public void givenUnsortedArray_whenInsertionSortRecursively_thenItIsSortedInAscendingOrder() { + // int[] input = {6, 4, 5, 2, 3, 1}; + int[] input = {6, 4}; + InsertionSort.insertionSortRecursive(input); + int[] expected = {1, 2, 3, 4, 5, 6}; + assertArrayEquals("the two arrays are not equal", expected, input); + } +} From a5d4d9eef2bdf82bab72ac934af57dd7e95c0dae Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Mon, 8 Oct 2018 14:32:24 -0300 Subject: [PATCH 051/546] Update pom.xml --- javaxval/pom.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 85d950c445..0c7e9ed070 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -63,14 +63,11 @@ 2.0.1.Final - 6.0.7.Final + 6.0.13.Final 3.0.0 -<<<<<<< HEAD 3.0.0 -======= 2.2.6 ->>>>>>> c8e54a21c016557ae806f053c47931d2b5419aa0 - 5.0.2.RELEASE + 5.0.2.RELEASE 4.12 3.11.1 From 95fdd71e04a1756b4789a24364e6b98af0f3f217 Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Mon, 8 Oct 2018 14:38:24 -0300 Subject: [PATCH 052/546] Update pom.xml --- javaxval/pom.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 32b0878ce8..86a7e6955b 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -65,15 +65,9 @@ 2.0.1.Final 6.0.13.Final 3.0.0 -<<<<<<< HEAD 3.0.0 - 2.2.6 - 5.0.2.RELEASE -======= - 3.0.0 5.0.2.RELEASE ->>>>>>> 9060d6c3bafc0411cbc7f7234f1ff4d5b6edf535 4.12 3.11.1 - \ No newline at end of file + From 247d855422fef735fd9142b63b332973cb8a2e82 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Mon, 8 Oct 2018 20:25:36 +0200 Subject: [PATCH 053/546] added article link --- spring-cloud-data-flow/etl/README.MD | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-cloud-data-flow/etl/README.MD b/spring-cloud-data-flow/etl/README.MD index 0cbb460b01..ee9c3a19c3 100644 --- a/spring-cloud-data-flow/etl/README.MD +++ b/spring-cloud-data-flow/etl/README.MD @@ -7,3 +7,7 @@ JDBC Source - Application Starter distributed by default customer-transform - Custom application to transform the data customer-mongodb-sink - Custom application to sink the data + +# Relevant Articles + +* [ETL with Spring Cloud Data Flow](https://www.baeldung.com/spring-cloud-data-flow-etl) From 369d471b8fa5b7b4d88a214bce56bbcd451806c3 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Mon, 8 Oct 2018 20:35:36 +0200 Subject: [PATCH 054/546] added link --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index a117d1843d..65263e4d8a 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -150,3 +150,4 @@ - [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception) - [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) - [Synthetic Constructs in Java](https://www.baeldung.com/java-synthetic) +- [Calculating the nth Root in Java](https://www.baeldung.com/java-nth-root) From 8bf1a4cdf8d59328eba36d53d5716175bd97b1d6 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Mon, 8 Oct 2018 22:24:39 +0300 Subject: [PATCH 055/546] Update FinalList.java --- .../mockito/src/test/java/org/baeldung/mockito/FinalList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/FinalList.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/FinalList.java index 3824de619c..c41021f7b6 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/FinalList.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/FinalList.java @@ -1,6 +1,6 @@ package org.baeldung.mockito; -public class FinalList extends MyList { +public final class FinalList extends MyList { @Override public int size() { From 6d67e16b3978815e658a0c20d9ea6742e0ad9f73 Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Mon, 8 Oct 2018 23:37:37 -0300 Subject: [PATCH 056/546] BAEL-2253 - Difference Between @NotNull, @NotEmpty and @NotBlank Constraints in Bean Validation (#5399) * Initial Commit * Update UserNotBlankUnitTest.java * Update UserNotEmptyUnitTest.java * Update UserNotNullUnitTest.java * Update pom.xml * Update pom.xml * Update pom.xml --- javaxval/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 63cb4c1d1d..86a7e6955b 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -63,11 +63,11 @@ 2.0.1.Final - 6.0.7.Final + 6.0.13.Final 3.0.0 - 2.2.6 + 3.0.0 5.0.2.RELEASE 4.12 3.11.1 - \ No newline at end of file + From ed2a28585ce6101783fd802ded7aafce7651b7a9 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Tue, 9 Oct 2018 13:10:13 +0300 Subject: [PATCH 057/546] fix unit test --- .../algorithms/insertionsort/InsertionSortUnitTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) rename algorithms/src/test/java/{ => com/baeldung}/algorithms/insertionsort/InsertionSortUnitTest.java (66%) diff --git a/algorithms/src/test/java/algorithms/insertionsort/InsertionSortUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java similarity index 66% rename from algorithms/src/test/java/algorithms/insertionsort/InsertionSortUnitTest.java rename to algorithms/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java index a5d19cb41d..b3d7e8c534 100644 --- a/algorithms/src/test/java/algorithms/insertionsort/InsertionSortUnitTest.java +++ b/algorithms/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java @@ -1,4 +1,4 @@ -package algorithms.insertionsort; +package com.baeldung.algorithms.insertionsort; import com.baeldung.algorithms.insertionsort.InsertionSort; import org.junit.Test; @@ -8,7 +8,7 @@ import static org.junit.Assert.assertArrayEquals; public class InsertionSortUnitTest { @Test - public void givenUnsortedArray_whenInsertionSortImperatively_thenItIsSortedInAscendingOrder() { + public void givenUnsortedArray_whenInsertionSortImperative_thenSortedAsc() { int[] input = {6, 2, 3, 4, 5, 1}; InsertionSort.insertionSortImperative(input); int[] expected = {1, 2, 3, 4, 5, 6}; @@ -16,9 +16,8 @@ public class InsertionSortUnitTest { } @Test - public void givenUnsortedArray_whenInsertionSortRecursively_thenItIsSortedInAscendingOrder() { - // int[] input = {6, 4, 5, 2, 3, 1}; - int[] input = {6, 4}; + public void givenUnsortedArray_whenInsertionSortRecursive_thenSortedAsc() { + int[] input = {6, 4, 5, 2, 3, 1}; InsertionSort.insertionSortRecursive(input); int[] expected = {1, 2, 3, 4, 5, 6}; assertArrayEquals("the two arrays are not equal", expected, input); From 12c41c3531c5a00123040825a1e0ee798947b801 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 9 Oct 2018 20:40:58 +0530 Subject: [PATCH 058/546] BAEL-9148 Fix Java EE Annotations Project - Removed spring security related code from jee-7 project --- jee-7/README.md | 2 - .../springSecurity/ApplicationConfig.java | 13 ------ .../SecurityWebApplicationInitializer.java | 10 ---- .../springSecurity/SpringSecurityConfig.java | 46 ------------------- .../controller/HomeController.java | 28 ----------- .../controller/LoginController.java | 15 ------ .../main/webapp/WEB-INF/spring/security.xml | 23 ---------- jee-7/src/main/webapp/WEB-INF/views/admin.jsp | 12 ----- jee-7/src/main/webapp/WEB-INF/views/home.jsp | 26 ----------- jee-7/src/main/webapp/WEB-INF/views/login.jsp | 26 ----------- jee-7/src/main/webapp/WEB-INF/views/user.jsp | 12 ----- jee-7/src/main/webapp/WEB-INF/web.xml | 5 +- jee-7/src/main/webapp/index.jsp | 11 ----- jee-7/src/main/webapp/secure.jsp | 24 ---------- 14 files changed, 4 insertions(+), 249 deletions(-) delete mode 100755 jee-7/src/main/java/com/baeldung/springSecurity/ApplicationConfig.java delete mode 100644 jee-7/src/main/java/com/baeldung/springSecurity/SecurityWebApplicationInitializer.java delete mode 100644 jee-7/src/main/java/com/baeldung/springSecurity/SpringSecurityConfig.java delete mode 100644 jee-7/src/main/java/com/baeldung/springSecurity/controller/HomeController.java delete mode 100644 jee-7/src/main/java/com/baeldung/springSecurity/controller/LoginController.java delete mode 100644 jee-7/src/main/webapp/WEB-INF/spring/security.xml delete mode 100644 jee-7/src/main/webapp/WEB-INF/views/admin.jsp delete mode 100644 jee-7/src/main/webapp/WEB-INF/views/home.jsp delete mode 100644 jee-7/src/main/webapp/WEB-INF/views/login.jsp delete mode 100644 jee-7/src/main/webapp/WEB-INF/views/user.jsp delete mode 100644 jee-7/src/main/webapp/index.jsp delete mode 100644 jee-7/src/main/webapp/secure.jsp diff --git a/jee-7/README.md b/jee-7/README.md index f0bd65fdf2..a2493e561b 100644 --- a/jee-7/README.md +++ b/jee-7/README.md @@ -5,5 +5,3 @@ - [Introduction to JAX-WS](http://www.baeldung.com/jax-ws) - [A Guide to Java EE Web-Related Annotations](http://www.baeldung.com/javaee-web-annotations) - [Introduction to Testing with Arquillian](http://www.baeldung.com/arquillian) -- [Securing Java EE with Spring Security](http://www.baeldung.com/java-ee-spring-security) -- [A Guide to Java EE Web-Related Annotations](https://www.baeldung.com/javaee-web-annotations) \ No newline at end of file diff --git a/jee-7/src/main/java/com/baeldung/springSecurity/ApplicationConfig.java b/jee-7/src/main/java/com/baeldung/springSecurity/ApplicationConfig.java deleted file mode 100755 index f8e7982253..0000000000 --- a/jee-7/src/main/java/com/baeldung/springSecurity/ApplicationConfig.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.springSecurity; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -/** - * Application class required by JAX-RS. If you don't want to have any - * prefix in the URL, you can set the application path to "/". - */ -@ApplicationPath("/") -public class ApplicationConfig extends Application { - -} diff --git a/jee-7/src/main/java/com/baeldung/springSecurity/SecurityWebApplicationInitializer.java b/jee-7/src/main/java/com/baeldung/springSecurity/SecurityWebApplicationInitializer.java deleted file mode 100644 index e6a05f7b71..0000000000 --- a/jee-7/src/main/java/com/baeldung/springSecurity/SecurityWebApplicationInitializer.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.baeldung.springSecurity; - -import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; - -public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer { - - public SecurityWebApplicationInitializer() { - super(SpringSecurityConfig.class); - } -} diff --git a/jee-7/src/main/java/com/baeldung/springSecurity/SpringSecurityConfig.java b/jee-7/src/main/java/com/baeldung/springSecurity/SpringSecurityConfig.java deleted file mode 100644 index bda8930f36..0000000000 --- a/jee-7/src/main/java/com/baeldung/springSecurity/SpringSecurityConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.baeldung.springSecurity; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { - @Override - protected void configure(AuthenticationManagerBuilder auth) throws Exception { - auth - .inMemoryAuthentication() - .withUser("user1") - .password("user1Pass") - .roles("USER") - .and() - .withUser("admin") - .password("adminPass") - .roles("ADMIN"); - } - - @Override - protected void configure(HttpSecurity http) throws Exception { - http - .csrf() - .disable() - .authorizeRequests() - .antMatchers("/auth/login*") - .anonymous() - .antMatchers("/home/admin*") - .hasRole("ADMIN") - .anyRequest() - .authenticated() - .and() - .formLogin() - .loginPage("/auth/login") - .defaultSuccessUrl("/home", true) - .failureUrl("/auth/login?error=true") - .and() - .logout() - .logoutSuccessUrl("/auth/login"); - } -} \ No newline at end of file diff --git a/jee-7/src/main/java/com/baeldung/springSecurity/controller/HomeController.java b/jee-7/src/main/java/com/baeldung/springSecurity/controller/HomeController.java deleted file mode 100644 index 53fd9f4b81..0000000000 --- a/jee-7/src/main/java/com/baeldung/springSecurity/controller/HomeController.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.springSecurity.controller; - -import javax.mvc.annotation.Controller; -import javax.ws.rs.GET; -import javax.ws.rs.Path; - -@Path("/home") -@Controller -public class HomeController { - - @GET - public String home() { - return "home.jsp"; - } - - @GET - @Path("/user") - public String admin() { - return "user.jsp"; - } - - @GET - @Path("/admin") - public String user() { - return "admin.jsp"; - } - -} diff --git a/jee-7/src/main/java/com/baeldung/springSecurity/controller/LoginController.java b/jee-7/src/main/java/com/baeldung/springSecurity/controller/LoginController.java deleted file mode 100644 index a7e7bb471d..0000000000 --- a/jee-7/src/main/java/com/baeldung/springSecurity/controller/LoginController.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.springSecurity.controller; - -import javax.mvc.annotation.Controller; -import javax.ws.rs.GET; -import javax.ws.rs.Path; - -@Path("/auth/login") -@Controller -public class LoginController { - - @GET - public String login() { - return "login.jsp"; - } -} diff --git a/jee-7/src/main/webapp/WEB-INF/spring/security.xml b/jee-7/src/main/webapp/WEB-INF/spring/security.xml deleted file mode 100644 index 777cd9461f..0000000000 --- a/jee-7/src/main/webapp/WEB-INF/spring/security.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/jee-7/src/main/webapp/WEB-INF/views/admin.jsp b/jee-7/src/main/webapp/WEB-INF/views/admin.jsp deleted file mode 100644 index b83ea09f5b..0000000000 --- a/jee-7/src/main/webapp/WEB-INF/views/admin.jsp +++ /dev/null @@ -1,12 +0,0 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> - - - - -

Welcome to the ADMIN page

- - ">Logout - - - \ No newline at end of file diff --git a/jee-7/src/main/webapp/WEB-INF/views/home.jsp b/jee-7/src/main/webapp/WEB-INF/views/home.jsp deleted file mode 100644 index c6e129c9ce..0000000000 --- a/jee-7/src/main/webapp/WEB-INF/views/home.jsp +++ /dev/null @@ -1,26 +0,0 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> - - - - -

This is the body of the sample view

- - - This text is only visible to a user -

- ">Restricted Admin Page -

-
- - - This text is only visible to an admin -
- ">Admin Page -
-
- - ">Logout - - - \ No newline at end of file diff --git a/jee-7/src/main/webapp/WEB-INF/views/login.jsp b/jee-7/src/main/webapp/WEB-INF/views/login.jsp deleted file mode 100644 index d6f2e56f3a..0000000000 --- a/jee-7/src/main/webapp/WEB-INF/views/login.jsp +++ /dev/null @@ -1,26 +0,0 @@ - - - - -

Login

- -
- - - - - - - - - - - - - -
User:
Password:
- -
- - - \ No newline at end of file diff --git a/jee-7/src/main/webapp/WEB-INF/views/user.jsp b/jee-7/src/main/webapp/WEB-INF/views/user.jsp deleted file mode 100644 index 11b8155da7..0000000000 --- a/jee-7/src/main/webapp/WEB-INF/views/user.jsp +++ /dev/null @@ -1,12 +0,0 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> - - - - -

Welcome to the Restricted Admin page

- - ">Logout - - - \ No newline at end of file diff --git a/jee-7/src/main/webapp/WEB-INF/web.xml b/jee-7/src/main/webapp/WEB-INF/web.xml index 1bcbb96e24..e656ffc5be 100644 --- a/jee-7/src/main/webapp/WEB-INF/web.xml +++ b/jee-7/src/main/webapp/WEB-INF/web.xml @@ -1,5 +1,8 @@ - + 3.6.1 - 9 - 9 + 1.9 + 1.9 diff --git a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java b/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java new file mode 100644 index 0000000000..355fef35c6 --- /dev/null +++ b/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java @@ -0,0 +1,43 @@ +package com.baeldung.zoneddatetime; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.logging.Logger; + +import org.junit.Test; + +public class ZonedDateTimeUnitTest { + + private static final Logger log = Logger.getLogger(ZonedDateTimeUnitTest.class.getName()); + + @Test + public void testZonedDateTimeToString() { + + ZonedDateTime zonedDateTimeNow = ZonedDateTime.now(ZoneId.of("UTC")); + ZonedDateTime zonedDateTimeOf = ZonedDateTime.of(2018, 01, 01, 0, 0, 0, 0, ZoneId.of("UTC")); + + LocalDateTime localDateTime = LocalDateTime.now(); + ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, ZoneId.of("UTC")); + + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy - hh:mm:ss Z"); + String formattedString = zonedDateTime.format(formatter); + + DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("MM/dd/yyyy - hh:mm:ss z"); + String formattedString2 = zonedDateTime.format(formatter2); + + log.info(formattedString); + log.info(formattedString2); + + } + + @Test + public void testZonedDateTimeFromString() { + + ZonedDateTime zonedDateTime = ZonedDateTime.parse("2011-12-03T10:15:30+01:00", DateTimeFormatter.ISO_ZONED_DATE_TIME); + + log.info(zonedDateTime.format(DateTimeFormatter.ISO_ZONED_DATE_TIME)); + } + +} From f916c468cdc15e9c9e08aff4700fc5406a2a2133 Mon Sep 17 00:00:00 2001 From: Josephine Barboza Date: Wed, 10 Oct 2018 16:51:44 +0530 Subject: [PATCH 072/546] BAEL-2169 Guide to Ebean --- libraries-data/pom.xml | 5 ----- libraries-data/src/main/resources/logback.xml | 12 +++--------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index e1318fd597..4b9701fe68 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -416,10 +416,6 @@ - - - - io.ebean ebean-maven-plugin @@ -439,7 +435,6 @@ - diff --git a/libraries-data/src/main/resources/logback.xml b/libraries-data/src/main/resources/logback.xml index 21f797ed71..9cce5fb855 100644 --- a/libraries-data/src/main/resources/logback.xml +++ b/libraries-data/src/main/resources/logback.xml @@ -7,15 +7,9 @@ - - - - - - - - - + + + From e83b7670548f576c54fc27328b47e53175a4b645 Mon Sep 17 00:00:00 2001 From: Josephine Barboza Date: Wed, 10 Oct 2018 19:12:51 +0530 Subject: [PATCH 073/546] Updated formatting --- libraries-data/pom.xml | 119 ++++++++---------- libraries-data/src/main/resources/logback.xml | 25 ++-- 2 files changed, 65 insertions(+), 79 deletions(-) diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index 4b9701fe68..6584ca6b23 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 libraries-data @@ -14,7 +13,6 @@ - com.esotericsoftware kryo @@ -101,49 +99,36 @@ org.datanucleus javax.jdo ${javax.jdo.version} - org.datanucleus datanucleus-core ${datanucleus.version} - org.datanucleus datanucleus-api-jdo ${datanucleus.version} - - org.datanucleus datanucleus-rdbms ${datanucleus.version} - org.datanucleus datanucleus-maven-plugin ${datanucleus-maven-plugin.version} - - - log4j - log4j - - org.datanucleus datanucleus-xml ${datanucleus-xml.version} - org.datanucleus datanucleus-jdo-query ${datanucleus-jdo-query.version} - @@ -156,13 +141,13 @@ hazelcast ${hazelcast.version} - + com.googlecode.jmapper-framework jmapper-core ${jmapper.version} - + org.apache.crunch crunch-core @@ -173,12 +158,6 @@ hadoop-client ${org.apache.hadoop.hadoop-client} provided - - - log4j - log4j - - @@ -314,28 +293,16 @@ - - - + + + - - + + - + @@ -390,7 +357,27 @@ - + + org.datanucleus + datanucleus-maven-plugin + ${datanucleus-maven-plugin.version} + + JDO + ${basedir}/datanucleus.properties + ${basedir}/log4j.properties + true + false + + + + + process-classes + + enhance + + + + org.apache.maven.plugins @@ -416,25 +403,25 @@ - - io.ebean - ebean-maven-plugin - 11.11.2 - - - - main - process-classes - - debug=1 - - - enhance - - - - - + + io.ebean + ebean-maven-plugin + 11.11.2 + + + + main + process-classes + + debug=1 + + + enhance + + + + + @@ -473,7 +460,7 @@ 2.2.0 11.22.4 1.7.25 - 1.0.1 + 1.0.1 - + \ No newline at end of file diff --git a/libraries-data/src/main/resources/logback.xml b/libraries-data/src/main/resources/logback.xml index 9cce5fb855..a57d22fcb2 100644 --- a/libraries-data/src/main/resources/logback.xml +++ b/libraries-data/src/main/resources/logback.xml @@ -1,16 +1,15 @@ - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + \ No newline at end of file From 506a973c823f2d7dd0d871c27e1dd457810761b0 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 10 Oct 2018 19:43:24 +0530 Subject: [PATCH 074/546] BAEL-9148 Fix Java EE Annotations Project - Added new jee-7-security module that contains only security related code previously part of jee-7 module - Added new jee-7-security in parent pom.xml --- jee-7-security/README.md | 2 + jee-7-security/pom.xml | 102 ++++++++++++++++++ .../SecurityWebApplicationInitializer.java | 10 ++ .../springsecurity/SpringSecurityConfig.java | 46 ++++++++ .../controller/HomeController.java | 28 +++++ .../controller/LoginController.java | 16 +++ jee-7-security/src/main/resources/logback.xml | 13 +++ .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/faces-config.xml | 8 ++ .../main/webapp/WEB-INF/spring/security.xml | 23 ++++ .../src/main/webapp/WEB-INF/views/admin.jsp | 12 +++ .../src/main/webapp/WEB-INF/views/home.jsp | 26 +++++ .../src/main/webapp/WEB-INF/views/login.jsp | 26 +++++ .../src/main/webapp/WEB-INF/views/user.jsp | 12 +++ .../src/main/webapp/WEB-INF/web.xml | 71 ++++++++++++ jee-7-security/src/main/webapp/index.jsp | 11 ++ jee-7-security/src/main/webapp/secure.jsp | 24 +++++ pom.xml | 2 + 18 files changed, 432 insertions(+) create mode 100644 jee-7-security/README.md create mode 100644 jee-7-security/pom.xml create mode 100644 jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java create mode 100644 jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java create mode 100644 jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java create mode 100644 jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java create mode 100644 jee-7-security/src/main/resources/logback.xml create mode 100644 jee-7-security/src/main/webapp/WEB-INF/beans.xml create mode 100644 jee-7-security/src/main/webapp/WEB-INF/faces-config.xml create mode 100644 jee-7-security/src/main/webapp/WEB-INF/spring/security.xml create mode 100644 jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp create mode 100644 jee-7-security/src/main/webapp/WEB-INF/views/home.jsp create mode 100644 jee-7-security/src/main/webapp/WEB-INF/views/login.jsp create mode 100644 jee-7-security/src/main/webapp/WEB-INF/views/user.jsp create mode 100644 jee-7-security/src/main/webapp/WEB-INF/web.xml create mode 100644 jee-7-security/src/main/webapp/index.jsp create mode 100644 jee-7-security/src/main/webapp/secure.jsp diff --git a/jee-7-security/README.md b/jee-7-security/README.md new file mode 100644 index 0000000000..314de6d957 --- /dev/null +++ b/jee-7-security/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Securing Java EE with Spring Security](http://www.baeldung.com/java-ee-spring-security) diff --git a/jee-7-security/pom.xml b/jee-7-security/pom.xml new file mode 100644 index 0000000000..622ca19903 --- /dev/null +++ b/jee-7-security/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + jee-7-security + 1.0-SNAPSHOT + war + jee-7-security + JavaEE 7 Spring Security Application + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + javax + javaee-api + ${javaee_api.version} + provided + + + com.sun.faces + jsf-api + ${com.sun.faces.jsf.version} + + + com.sun.faces + jsf-impl + ${com.sun.faces.jsf.version} + + + javax.servlet + jstl + ${jstl.version} + + + javax.servlet + javax.servlet-api + ${javax.servlet-api.version} + + + javax.servlet.jsp + jsp-api + ${jsp-api.version} + provided + + + taglibs + standard + ${taglibs.standard.version} + + + + javax.mvc + javax.mvc-api + 1.0-pr + + + + org.springframework.security + spring-security-web + ${org.springframework.security.version} + + + + org.springframework.security + spring-security-config + ${org.springframework.security.version} + + + org.springframework.security + spring-security-taglibs + ${org.springframework.security.version} + + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + src/main/webapp + false + + + + + + + 7.0 + 2.2.14 + 2.2 + 1.1.2 + 4.2.3.RELEASE + + + diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java b/jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java new file mode 100644 index 0000000000..e3e2ed80e6 --- /dev/null +++ b/jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java @@ -0,0 +1,10 @@ +package com.baeldung.springsecurity; + +import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; + +public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer { + + public SecurityWebApplicationInitializer() { + super(SpringSecurityConfig.class); + } +} diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java b/jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java new file mode 100644 index 0000000000..70be1f91ce --- /dev/null +++ b/jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java @@ -0,0 +1,46 @@ +package com.baeldung.springsecurity; + +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; + +@Configuration +@EnableWebSecurity +public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth + .inMemoryAuthentication() + .withUser("user1") + .password("user1Pass") + .roles("USER") + .and() + .withUser("admin") + .password("adminPass") + .roles("ADMIN"); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http + .csrf() + .disable() + .authorizeRequests() + .antMatchers("/auth/login*") + .anonymous() + .antMatchers("/home/admin*") + .hasRole("ADMIN") + .anyRequest() + .authenticated() + .and() + .formLogin() + .loginPage("/auth/login") + .defaultSuccessUrl("/home", true) + .failureUrl("/auth/login?error=true") + .and() + .logout() + .logoutSuccessUrl("/auth/login"); + } +} \ No newline at end of file diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java b/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java new file mode 100644 index 0000000000..1662f38609 --- /dev/null +++ b/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java @@ -0,0 +1,28 @@ +package com.baeldung.springsecurity.controller; + +import javax.mvc.annotation.Controller; +import javax.ws.rs.GET; +import javax.ws.rs.Path; + +@Path("/home") +@Controller +public class HomeController { + + @GET + public String home() { + return "home.jsp"; + } + + @GET + @Path("/user") + public String admin() { + return "user.jsp"; + } + + @GET + @Path("/admin") + public String user() { + return "admin.jsp"; + } + +} diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java b/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java new file mode 100644 index 0000000000..a34abbfd2c --- /dev/null +++ b/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java @@ -0,0 +1,16 @@ +package com.baeldung.springsecurity.controller; + +import javax.mvc.annotation.Controller; +import javax.ws.rs.GET; +import javax.ws.rs.Path; + +@Path("/login") +@Controller +public class LoginController { + + @GET + public String login() { + System.out.println("Login"); + return "login.jsp"; + } +} diff --git a/jee-7-security/src/main/resources/logback.xml b/jee-7-security/src/main/resources/logback.xml new file mode 100644 index 0000000000..c8c077ba1d --- /dev/null +++ b/jee-7-security/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/WEB-INF/beans.xml b/jee-7-security/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jee-7-security/src/main/webapp/WEB-INF/faces-config.xml b/jee-7-security/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000000..1f4085458f --- /dev/null +++ b/jee-7-security/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/WEB-INF/spring/security.xml b/jee-7-security/src/main/webapp/WEB-INF/spring/security.xml new file mode 100644 index 0000000000..777cd9461f --- /dev/null +++ b/jee-7-security/src/main/webapp/WEB-INF/spring/security.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp b/jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp new file mode 100644 index 0000000000..b83ea09f5b --- /dev/null +++ b/jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp @@ -0,0 +1,12 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> + + + + +

Welcome to the ADMIN page

+ + ">Logout + + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/home.jsp b/jee-7-security/src/main/webapp/WEB-INF/views/home.jsp new file mode 100644 index 0000000000..c6e129c9ce --- /dev/null +++ b/jee-7-security/src/main/webapp/WEB-INF/views/home.jsp @@ -0,0 +1,26 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> + + + + +

This is the body of the sample view

+ + + This text is only visible to a user +

+ ">Restricted Admin Page +

+
+ + + This text is only visible to an admin +
+ ">Admin Page +
+
+ + ">Logout + + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/login.jsp b/jee-7-security/src/main/webapp/WEB-INF/views/login.jsp new file mode 100644 index 0000000000..d6f2e56f3a --- /dev/null +++ b/jee-7-security/src/main/webapp/WEB-INF/views/login.jsp @@ -0,0 +1,26 @@ + + + + +

Login

+ +
+ + + + + + + + + + + + + +
User:
Password:
+ +
+ + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/user.jsp b/jee-7-security/src/main/webapp/WEB-INF/views/user.jsp new file mode 100644 index 0000000000..11b8155da7 --- /dev/null +++ b/jee-7-security/src/main/webapp/WEB-INF/views/user.jsp @@ -0,0 +1,12 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> + + + + +

Welcome to the Restricted Admin page

+ + ">Logout + + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/WEB-INF/web.xml b/jee-7-security/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..e656ffc5be --- /dev/null +++ b/jee-7-security/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,71 @@ + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + Faces Servlet + *.jsf + + + javax.faces.PROJECT_STAGE + Development + + + State saving method: 'client' or 'server' (default). See JSF Specification section 2.5.2 + javax.faces.STATE_SAVING_METHOD + client + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + index.jsf + welcome.jsf + index.html + index.jsp + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/index.jsp b/jee-7-security/src/main/webapp/index.jsp new file mode 100644 index 0000000000..93fef9713d --- /dev/null +++ b/jee-7-security/src/main/webapp/index.jsp @@ -0,0 +1,11 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Index Page + + + Non-secured Index Page +
+ Login + + \ No newline at end of file diff --git a/jee-7-security/src/main/webapp/secure.jsp b/jee-7-security/src/main/webapp/secure.jsp new file mode 100644 index 0000000000..0cadd2cd4f --- /dev/null +++ b/jee-7-security/src/main/webapp/secure.jsp @@ -0,0 +1,24 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec" %> + + + + + Home Page + + +

Home Page

+ +

+ Hello
+ Roles: +

+ +
+ + +
+ + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ef34881cef..741391e09c 100644 --- a/pom.xml +++ b/pom.xml @@ -399,6 +399,7 @@ javafx jgroups jee-7 + jee-7-security jhipster jjwt jsf @@ -1303,6 +1304,7 @@ javafx jgroups jee-7 + jee-7-security jjwt jsf json-path From 6f619dec41a1ec14cc786c460fd4ab0ab58c01ae Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 10 Oct 2018 20:20:55 +0530 Subject: [PATCH 075/546] Update LoginController.java --- .../baeldung/springsecurity/controller/LoginController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java b/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java index a34abbfd2c..45d7ff3d2c 100644 --- a/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java +++ b/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java @@ -4,13 +4,12 @@ import javax.mvc.annotation.Controller; import javax.ws.rs.GET; import javax.ws.rs.Path; -@Path("/login") +@Path("/auth/login") @Controller public class LoginController { @GET public String login() { - System.out.println("Login"); return "login.jsp"; } } From af818fddbf2793ae9dcfe8e324ded960e90b4786 Mon Sep 17 00:00:00 2001 From: Josephine Barboza Date: Wed, 10 Oct 2018 21:27:08 +0530 Subject: [PATCH 076/546] Upadated pom.xml --- libraries-data/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index 6584ca6b23..bbf0c7832f 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -457,10 +457,10 @@ 5.0.4 1.6.0.1 0.15.0 - 2.2.0 + 2.2.0 11.22.4 1.7.25 - 1.0.1 + 1.0.1 - \ No newline at end of file + From 50ffa8118657386e61de03a7642033514db83cac Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 10 Oct 2018 20:04:51 +0300 Subject: [PATCH 077/546] add reactor core --- spring-data-mongodb/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index ad70d987bb..072ed7a2ac 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -34,6 +34,12 @@ ${mongodb-reactivestreams.version} + + io.projectreactor + reactor-core + ${projectreactor.version} + + io.projectreactor reactor-test @@ -109,6 +115,7 @@ 5.1.0.RELEASE 1.9.2 3.2.0.RELEASE + From 5ab63bb07b4fbbdd04932097f35d506590ec07aa Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 10 Oct 2018 20:16:49 +0300 Subject: [PATCH 078/546] fix javax el --- javaxval/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 86a7e6955b..0263fb68af 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -33,7 +33,7 @@ ${javax.el-api.version} - org.glassfish.web + org.glassfish javax.el ${javax.el.version} From 12b1a90a746a341834d831770ad905942ac1e9b8 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Wed, 10 Oct 2018 20:24:43 +0300 Subject: [PATCH 079/546] rebalancing the first and second default profiles --- pom.xml | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/pom.xml b/pom.xml index 008d0aeac3..e6618da0a2 100644 --- a/pom.xml +++ b/pom.xml @@ -526,31 +526,6 @@ spring-resttemplate - spring-security-acl - spring-security-cache-control - spring-security-client/spring-security-jsp-authentication - spring-security-client/spring-security-jsp-authorize - spring-security-client/spring-security-jsp-config - spring-security-client/spring-security-mvc - spring-security-client/spring-security-thymeleaf-authentication - spring-security-client/spring-security-thymeleaf-authorize - spring-security-client/spring-security-thymeleaf-config - spring-security-core - spring-security-mvc-boot - spring-security-mvc-custom - spring-security-mvc-digest-auth - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc-session - spring-security-mvc-socket - spring-security-openid - - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-rest - spring-security-sso - spring-security-x509 @@ -719,7 +694,33 @@ - flyway-cdi-extension + flyway-cdi-extension + + spring-security-acl + spring-security-cache-control + spring-security-client/spring-security-jsp-authentication + spring-security-client/spring-security-jsp-authorize + spring-security-client/spring-security-jsp-config + spring-security-client/spring-security-mvc + spring-security-client/spring-security-thymeleaf-authentication + spring-security-client/spring-security-thymeleaf-authorize + spring-security-client/spring-security-thymeleaf-config + spring-security-core + spring-security-mvc-boot + spring-security-mvc-custom + spring-security-mvc-digest-auth + spring-security-mvc-ldap + spring-security-mvc-login + spring-security-mvc-persisted-remember-me + spring-security-mvc-session + spring-security-mvc-socket + spring-security-openid + + spring-security-rest-basic-auth + spring-security-rest-custom + spring-security-rest + spring-security-sso + spring-security-x509 From ee1e3eea89dacdba289f9e054746f4314cda9201 Mon Sep 17 00:00:00 2001 From: DOHA Date: Wed, 10 Oct 2018 20:39:45 +0300 Subject: [PATCH 080/546] cucumber parallel features --- testing-modules/rest-testing/pom.xml | 40 ++++++++++++++++++ .../rest/cucumber/StepDefinition.java | 41 ++++++++++--------- .../test/resources/Feature/cucumber.feature | 10 +++++ 3 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature diff --git a/testing-modules/rest-testing/pom.xml b/testing-modules/rest-testing/pom.xml index 0e54980683..9bfd715682 100644 --- a/testing-modules/rest-testing/pom.xml +++ b/testing-modules/rest-testing/pom.xml @@ -106,6 +106,46 @@ true + + + + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + classes + 4 + + + + + integration-test + verify + + + + + + com.github.temyers + cucumber-jvm-parallel-plugin + 5.0.0 + + + generateRunners + generate-test-sources + + generateRunners + + + + com.baeldung.rest.cucumber + + src/test/resources/Feature/ + SCENARIO + + + + + diff --git a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java index b461da8403..35a913ae25 100644 --- a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java +++ b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/cucumber/StepDefinition.java @@ -1,19 +1,5 @@ package com.baeldung.rest.cucumber; -import com.github.tomakehurst.wiremock.WireMockServer; -import cucumber.api.java.en.Then; -import cucumber.api.java.en.When; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Scanner; - import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.configureFor; import static com.github.tomakehurst.wiremock.client.WireMock.containing; @@ -25,10 +11,27 @@ import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static com.github.tomakehurst.wiremock.client.WireMock.verify; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; +import java.io.IOException; +import java.io.InputStream; +import java.util.Scanner; + +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; + +import com.github.tomakehurst.wiremock.WireMockServer; + +import cucumber.api.java.en.Then; +import cucumber.api.java.en.When; + public class StepDefinition { private static final String CREATE_PATH = "/create"; @@ -37,20 +40,20 @@ public class StepDefinition { private final InputStream jsonInputStream = this.getClass().getClassLoader().getResourceAsStream("cucumber.json"); private final String jsonString = new Scanner(jsonInputStream, "UTF-8").useDelimiter("\\Z").next(); - private final WireMockServer wireMockServer = new WireMockServer(); + private final WireMockServer wireMockServer = new WireMockServer(options().dynamicPort()); private final CloseableHttpClient httpClient = HttpClients.createDefault(); @When("^users upload data on a project$") public void usersUploadDataOnAProject() throws IOException { wireMockServer.start(); - configureFor("localhost", 8080); + configureFor("localhost", wireMockServer.port()); stubFor(post(urlEqualTo(CREATE_PATH)) .withHeader("content-type", equalTo(APPLICATION_JSON)) .withRequestBody(containing("testing-framework")) .willReturn(aResponse().withStatus(200))); - HttpPost request = new HttpPost("http://localhost:8080/create"); + HttpPost request = new HttpPost("http://localhost:" + wireMockServer.port() + "/create"); StringEntity entity = new StringEntity(jsonString); request.addHeader("content-type", APPLICATION_JSON); request.setEntity(entity); @@ -67,11 +70,11 @@ public class StepDefinition { public void usersGetInformationOnAProject(String projectName) throws IOException { wireMockServer.start(); - configureFor("localhost", 8080); + configureFor("localhost", wireMockServer.port()); stubFor(get(urlEqualTo("/projects/cucumber")).withHeader("accept", equalTo(APPLICATION_JSON)) .willReturn(aResponse().withBody(jsonString))); - HttpGet request = new HttpGet("http://localhost:8080/projects/" + projectName.toLowerCase()); + HttpGet request = new HttpGet("http://localhost:" + wireMockServer.port() + "/projects/" + projectName.toLowerCase()); request.addHeader("accept", APPLICATION_JSON); HttpResponse httpResponse = httpClient.execute(request); String responseString = convertResponseToString(httpResponse); diff --git a/testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature b/testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature new file mode 100644 index 0000000000..99dd8249fe --- /dev/null +++ b/testing-modules/rest-testing/src/test/resources/Feature/cucumber.feature @@ -0,0 +1,10 @@ +Feature: Testing a REST API + Users should be able to submit GET and POST requests to a web service, represented by WireMock + + Scenario: Data Upload to a web service + When users upload data on a project + Then the server should handle it and return a success status + + Scenario: Data retrieval from a web service + When users want to get information on the Cucumber project + Then the requested data is returned \ No newline at end of file From dc1063cdc3a7d8e7c262107a7f24a8bf1fd6f50d Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Wed, 10 Oct 2018 16:25:37 -0300 Subject: [PATCH 081/546] Update pom.xml --- javaxval/pom.xml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 46122af06b..22f1827213 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -22,17 +22,6 @@ hibernate-validator ${hibernate-validator.version} - - org.glassfish.web - org.hibernate - hibernate-validator-annotation-processor - ${hibernate-validator.version} - - - javax.el - javax.el-api - ${javax.el-api.version} - org.glassfish javax.el @@ -69,4 +58,4 @@ 4.12 3.11.1 - \ No newline at end of file + From 26c9bdcc0d3bc2d6271b4c6ba3d0c90f8234bd96 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Wed, 10 Oct 2018 20:23:32 -0500 Subject: [PATCH 082/546] BAEL-2257: Renamed OutputStreamExamplesTest to *UnitTest --- ...tStreamExamplesTest.java => OutputStreamExamplesUnitTest.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename core-java-io/src/test/java/com/baeldung/stream/{OutputStreamExamplesTest.java => OutputStreamExamplesUnitTest.java} (100%) diff --git a/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesTest.java b/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java similarity index 100% rename from core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesTest.java rename to core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java From e908b96eef76af840997567615047664d788aad7 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Wed, 10 Oct 2018 22:09:45 -0500 Subject: [PATCH 083/546] BAEL-2257: Renamed OutputStreamExamplesTest to *UnitTest --- .../java/com/baeldung/stream/OutputStreamExamplesUnitTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java b/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java index 4ae1ce9aa7..aa949259a0 100644 --- a/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java +++ b/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java @@ -8,7 +8,7 @@ import java.io.IOException; import org.junit.Before; import org.junit.Test; -public class OutputStreamExamplesTest { +public class OutputStreamExamplesUnitTest { StringBuilder filePath = new StringBuilder(); From ef61b86af31c3d5c5186905fff2ec2046c483348 Mon Sep 17 00:00:00 2001 From: Satyam Date: Thu, 11 Oct 2018 20:55:55 +0530 Subject: [PATCH 084/546] BAEL-2197:Code rework --- .../src/findItems/FindItemsBasedOnValues.java | 111 +++++++----------- 1 file changed, 45 insertions(+), 66 deletions(-) diff --git a/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java b/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java index d6a320a8ec..a0dcdddd85 100644 --- a/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java +++ b/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java @@ -1,114 +1,93 @@ package findItems; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; + import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; + import org.junit.Test; public class FindItemsBasedOnValues { - static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yyyy"); + List EmplList = new ArrayList(); + List deptList = new ArrayList(); public static void main(String[] args) throws ParseException { FindItemsBasedOnValues findItems = new FindItemsBasedOnValues(); - findItems.givenListOfCompanies_thenListOfClientsIsFilteredCorrectly(); + findItems.givenDepartmentList_thenEmployeeListIsFilteredCorrectly(); } @Test - public void givenListOfCompanies_thenListOfClientsIsFilteredCorrectly() throws ParseException { - List expectedList = new ArrayList(); - Client expectedClient = new Client(1001, DATE_FORMAT.parse("01-02-2018")); - expectedList.add(expectedClient); + public void givenDepartmentList_thenEmployeeListIsFilteredCorrectly() { + Integer expectedId = 1002; - List listOfCompanies = new ArrayList(); - List listOfClients = new ArrayList(); - populate(listOfCompanies, listOfClients); + populate(EmplList, deptList); - List filteredList = listOfClients.stream() - .filter(client -> listOfCompanies.stream() - .anyMatch(company -> company.getType() - .equals("eMart") && company.getProjectId() - .equals(client.getProjectId()) && company.getStart() - .after(client.getDate()) && company.getEnd() - .before(client.getDate()))) + List filteredList = EmplList.stream() + .filter(empl -> deptList.stream() + .anyMatch(dept -> dept.getDepartment() + .equals("sales") && empl.getEmployeeId() + .equals(dept.getEmployeeId()))) .collect(Collectors.toList()); - assertEquals(expectedClient.getProjectId(), filteredList.get(0) - .getProjectId()); - assertEquals(expectedClient.getDate(), filteredList.get(0) - .getDate()); + assertEquals(expectedId, filteredList.get(0) + .getEmployeeId()); } - private void populate(List companyList, List clientList) throws ParseException { - Company company1 = new Company(1001, DATE_FORMAT.parse("01-03-2018"), DATE_FORMAT.parse("01-01-2018"), "eMart"); - Company company2 = new Company(1002, DATE_FORMAT.parse("01-02-2018"), DATE_FORMAT.parse("01-04-2018"), "commerce"); - Company company3 = new Company(1003, DATE_FORMAT.parse("01-06-2018"), DATE_FORMAT.parse("01-02-2018"), "eMart"); - Company company4 = new Company(1004, DATE_FORMAT.parse("01-03-2018"), DATE_FORMAT.parse("01-06-2018"), "blog"); + private void populate(List EmplList, List deptList) { + Employee employee1 = new Employee(1001, "empl1"); + Employee employee2 = new Employee(1002, "empl2"); + Employee employee3 = new Employee(1003, "empl3"); - Collections.addAll(companyList, company1, company2, company3, company4); + Collections.addAll(EmplList, employee1, employee2, employee3); - Client client1 = new Client(1001, DATE_FORMAT.parse("01-02-2018")); - Client client2 = new Client(1003, DATE_FORMAT.parse("01-04-2018")); - Client client3 = new Client(1005, DATE_FORMAT.parse("01-07-2018")); - Client client4 = new Client(1007, DATE_FORMAT.parse("01-08-2018")); + Department department1 = new Department(1002, "sales"); + Department department2 = new Department(1003, "marketing"); + Department department3 = new Department(1004, "sales"); - Collections.addAll(clientList, client1, client2, client3, client4); + Collections.addAll(deptList, department1, department2, department3); } } -class Company { - Long projectId; - Date start; - Date end; - String type; +class Employee { + Integer employeeId; + String employeeName; - public Company(long projectId, Date start, Date end, String type) { + public Employee(Integer employeeId, String employeeName) { super(); - this.projectId = projectId; - this.start = start; - this.end = end; - this.type = type; + this.employeeId = employeeId; + this.employeeName = employeeName; } - public Long getProjectId() { - return projectId; + public Integer getEmployeeId() { + return employeeId; } - public Date getStart() { - return start; - } - - public Date getEnd() { - return end; - } - - public String getType() { - return type; + public String getEmployeeName() { + return employeeName; } } -class Client { - Long projectId; - Date date; +class Department { + Integer employeeId; + String department; - public Client(long projectId, Date date) { + public Department(Integer employeeId, String department) { super(); - this.projectId = projectId; - this.date = date; + this.employeeId = employeeId; + this.department = department; } - public Long getProjectId() { - return projectId; + public Integer getEmployeeId() { + return employeeId; } - public Date getDate() { - return date; + public String getDepartment() { + return department; } } \ No newline at end of file From a915063c44f0d99966ba2e75ab8fd0e11453222a Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Thu, 11 Oct 2018 21:12:07 +0300 Subject: [PATCH 085/546] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index adb17ca7e5..8e0a5eb9ee 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,8 @@ In additional to Spring, the following technologies are in focus: `core Java`, ` Building the project ==================== To do the full build, do: `mvn install -Pdefault -Dgib.enabled=false` + + +Building a single module +==================== +To build a specific module run the command: `mvn clean install -Dgib.enabled=false` in the module directory From e1d07fcc4c0a5940c4d7f851dd35309ef92fd888 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Thu, 11 Oct 2018 20:59:40 +0200 Subject: [PATCH 086/546] added link --- core-java-8/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-8/README.md b/core-java-8/README.md index 64d423aafe..ffd629a170 100644 --- a/core-java-8/README.md +++ b/core-java-8/README.md @@ -32,3 +32,4 @@ - [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone) - [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) - [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects) +- [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic) From 8b6e6fd5542140150773353197676dbbdcab3350 Mon Sep 17 00:00:00 2001 From: Vaibhav Sahay Date: Fri, 12 Oct 2018 00:51:58 +0530 Subject: [PATCH 087/546] initial commit --- .../concurrent/evenandodd/PrintEvenOdd.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOdd.java diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOdd.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOdd.java new file mode 100644 index 0000000000..54d89382b9 --- /dev/null +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOdd.java @@ -0,0 +1,72 @@ +package com.baeldung.concurrent.evenandodd; + +public class PrintEvenOdd { + + public static void main(String... args) { + Printer print = new Printer(); + Thread t1 = new Thread(new TaskEvenOdd(print, 10, false)); + t1.setName("Odd"); + Thread t2 = new Thread(new TaskEvenOdd(print, 10, true)); + t2.setName("Even"); + t1.start(); + t2.start(); + } +} + +class TaskEvenOdd implements Runnable { + private int max; + private Printer print; + private boolean isEvenNumber; + + TaskEvenOdd(Printer print, int max, boolean isEvenNumber) { + this.print = print; + this.max = max; + this.isEvenNumber = isEvenNumber; + } + + @Override + public void run() { + int number = isEvenNumber == true ? 2 : 1; + while (number <= max) { + if (isEvenNumber) { + print.printEven(number); + } else { + print.printOdd(number); + } + number += 2; + } + } +} + +class Printer { + boolean isOdd = false; + + synchronized void printEven(int number) { + while (isOdd == false) { + try { + wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + System.out.println(Thread.currentThread() + .getName() + ":" + number); + isOdd = false; + notify(); + } + + synchronized void printOdd(int number) { + while (isOdd == true) { + try { + wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + System.out.println(Thread.currentThread() + .getName() + ":" + number); + isOdd = true; + notify(); + } + +} From 01819fe1bac8d3bf7dbd016a77a0f42a87ba16f5 Mon Sep 17 00:00:00 2001 From: Johan Janssen Date: Thu, 11 Oct 2018 21:40:30 +0200 Subject: [PATCH 088/546] BAEL-2263 Using JUnit 5 with Gradle --- gradle/junit5/build.gradle | 25 +++++++++++++ .../com/example/CalculatorJUnit4Test.java | 12 +++++++ .../com/example/CalculatorJUnit5Test.java | 36 +++++++++++++++++++ gradle/settings.gradle | 2 +- 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 gradle/junit5/build.gradle create mode 100644 gradle/junit5/src/test/java/com/example/CalculatorJUnit4Test.java create mode 100644 gradle/junit5/src/test/java/com/example/CalculatorJUnit5Test.java diff --git a/gradle/junit5/build.gradle b/gradle/junit5/build.gradle new file mode 100644 index 0000000000..5f056d8c23 --- /dev/null +++ b/gradle/junit5/build.gradle @@ -0,0 +1,25 @@ +plugins { + // Apply the java-library plugin to add support for Java Library + id 'java-library' +} + +dependencies { + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' + + // Only necessary for JUnit 3 and 4 tests + testCompileOnly 'junit:junit:4.12' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' + +} + +repositories { + jcenter() +} + +test { + useJUnitPlatform { + includeTags 'fast' + excludeTags 'slow' + } +} \ No newline at end of file diff --git a/gradle/junit5/src/test/java/com/example/CalculatorJUnit4Test.java b/gradle/junit5/src/test/java/com/example/CalculatorJUnit4Test.java new file mode 100644 index 0000000000..4cf63642ee --- /dev/null +++ b/gradle/junit5/src/test/java/com/example/CalculatorJUnit4Test.java @@ -0,0 +1,12 @@ +package com.example; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class CalculatorJUnit4Test { + @Test + public void testAdd() { + assertEquals(42, Integer.sum(19, 23)); + } +} diff --git a/gradle/junit5/src/test/java/com/example/CalculatorJUnit5Test.java b/gradle/junit5/src/test/java/com/example/CalculatorJUnit5Test.java new file mode 100644 index 0000000000..59fdb0f8ae --- /dev/null +++ b/gradle/junit5/src/test/java/com/example/CalculatorJUnit5Test.java @@ -0,0 +1,36 @@ +package com.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test;; + +public class CalculatorJUnit5Test { + + @Tag("fast") + @Test + public void testAdd() { + assertEquals(42, Integer.sum(19, 23)); + } + + @Tag("slow") + @Test + public void testAddMaxInteger() { + assertEquals(2147483646, Integer.sum(2147183646, 300000)); + } + + @Tag("fast") + @Test + public void testAddZero() { + assertEquals(21, Integer.sum(21, 0)); + } + + @Tag("fast") + @Test + public void testDivide() { + assertThrows(ArithmeticException.class, () -> { + Integer.divideUnsigned(42, 0); + }); + } +} diff --git a/gradle/settings.gradle b/gradle/settings.gradle index 38704681bd..f1d64de58a 100644 --- a/gradle/settings.gradle +++ b/gradle/settings.gradle @@ -5,6 +5,6 @@ include 'greeting-library' include 'greeting-library-java' include 'greeter' include 'gradletaskdemo' - +include 'junit5' println 'This will be executed during the initialization phase.' From cd485587573d7f9f218901c989b848ce458e731c Mon Sep 17 00:00:00 2001 From: Benoit Montuelle Date: Fri, 12 Oct 2018 00:47:56 +0200 Subject: [PATCH 089/546] Bump spring-cloud dependency version to fix class not found ServletRegistrationBean error --- spring-zuul/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-zuul/pom.xml b/spring-zuul/pom.xml index 35e419cdc7..266c20adee 100644 --- a/spring-zuul/pom.xml +++ b/spring-zuul/pom.xml @@ -38,7 +38,7 @@ - 1.2.3.RELEASE + 1.2.7.RELEASE 3.5 From f824da90ba31a87f1331a3f4c36ae0f4fffc846e Mon Sep 17 00:00:00 2001 From: Priyesh Mashelkar Date: Fri, 12 Oct 2018 05:59:44 +0100 Subject: [PATCH 090/546] Converting DOM Document to File Issue: BAEL-2167 --- .../com/baeldung/xml/XMLDocumentWriter.java | 41 +++++++++++++++ .../xml/XMLDocumentWriterUnitTest.java | 52 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 xml/src/main/java/com/baeldung/xml/XMLDocumentWriter.java create mode 100644 xml/src/test/java/com/baeldung/xml/XMLDocumentWriterUnitTest.java diff --git a/xml/src/main/java/com/baeldung/xml/XMLDocumentWriter.java b/xml/src/main/java/com/baeldung/xml/XMLDocumentWriter.java new file mode 100644 index 0000000000..e33fc5fe1d --- /dev/null +++ b/xml/src/main/java/com/baeldung/xml/XMLDocumentWriter.java @@ -0,0 +1,41 @@ +package com.baeldung.xml; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; + +public class XMLDocumentWriter { + + public void write(Document document, String fileName, boolean excludeDeclaration, boolean prettyPrint) { + try(FileWriter writer = new FileWriter(new File(fileName))) { + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + if(excludeDeclaration) { + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + } + if(prettyPrint) { + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + } + DOMSource source = new DOMSource(document); + StreamResult result = new StreamResult(writer); + transformer.transform(source, result); + } catch (IOException e) { + throw new IllegalArgumentException(e); + } catch (TransformerConfigurationException e) { + throw new IllegalStateException(e); + } catch (TransformerException e) { + throw new IllegalArgumentException(e); + } + } +} diff --git a/xml/src/test/java/com/baeldung/xml/XMLDocumentWriterUnitTest.java b/xml/src/test/java/com/baeldung/xml/XMLDocumentWriterUnitTest.java new file mode 100644 index 0000000000..68f787a054 --- /dev/null +++ b/xml/src/test/java/com/baeldung/xml/XMLDocumentWriterUnitTest.java @@ -0,0 +1,52 @@ +package com.baeldung.xml; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.apache.commons.io.FileUtils; +import org.junit.After; +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import java.io.File; + +public class XMLDocumentWriterUnitTest { + + @Test + public void givenXMLDocumentWhenWriteIsCalledThenXMLIsWrittenToFile() throws Exception { + Document document = createSampleDocument(); + new XMLDocumentWriter().write(document, "company_simple.xml", false, false); + } + + @Test + public void givenXMLDocumentWhenWriteIsCalledWithPrettyPrintThenFormattedXMLIsWrittenToFile() throws Exception { + Document document = createSampleDocument(); + new XMLDocumentWriter().write(document, "company_prettyprinted.xml", false, true); + } + + private Document createSampleDocument() throws ParserConfigurationException { + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document document = documentBuilder.newDocument(); + Element companyElement = document.createElement("Company"); + document.appendChild(companyElement); + Element departmentElement = document.createElement("Department"); + departmentElement.setAttribute("name", "Sales"); + companyElement.appendChild(departmentElement); + Element employee1 = document.createElement("Employee"); + employee1.setAttribute("name", "John Smith"); + departmentElement.appendChild(employee1); + Element employee2 = document.createElement("Employee"); + employee2.setAttribute("name", "Tim Dellor"); + departmentElement.appendChild(employee2); + return document; + } + + @After + public void cleanUp() throws Exception { + FileUtils.deleteQuietly(new File("company_simple.xml")); + FileUtils.deleteQuietly(new File("company_prettyprinted.xml")); + } +} From 44a3d36bd981f581bc97c85036fe25288744510b Mon Sep 17 00:00:00 2001 From: Andrey Shcherbakov Date: Fri, 12 Oct 2018 07:16:54 +0200 Subject: [PATCH 091/546] Implement a binary tree (#5431) * Add code for the article 'Java Primitives versus Objects' * Use JMH for benchmarking the primitive and wrapper classes * Uncomment the benchmarks and remove unused class * Add a binary search tree implementation * Add an example of how to use the binary tree class * Adjust the print statements --- .../com/baeldung/datastructures/Main.kt | 19 ++ .../com/baeldung/datastructures/Node.kt | 167 +++++++++ .../com/baeldung/datastructures/NodeTest.kt | 319 ++++++++++++++++++ 3 files changed, 505 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/datastructures/Main.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/datastructures/Node.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/datastructures/NodeTest.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Main.kt b/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Main.kt new file mode 100644 index 0000000000..4fd8aa27c7 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Main.kt @@ -0,0 +1,19 @@ +package com.baeldung.datastructures + +/** + * Example of how to use the {@link Node} class. + * + */ +fun main(args: Array) { + val tree = Node(4) + val keys = arrayOf(8, 15, 21, 3, 7, 2, 5, 10, 2, 3, 4, 6, 11) + for (key in keys) { + tree.insert(key) + } + val node = tree.find(4)!! + println("Node with value ${node.key} [left = ${node.left?.key}, right = ${node.right?.key}]") + println("Delete node with key = 3") + node.delete(3) + print("Tree content after the node elimination: ") + println(tree.visit().joinToString { it.toString() }) +} diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Node.kt b/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Node.kt new file mode 100644 index 0000000000..b81afe1e4c --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Node.kt @@ -0,0 +1,167 @@ +package com.baeldung.datastructures + +/** + * An ADT for a binary search tree. + * Note that this data type is neither immutable nor thread safe. + */ +class Node( + var key: Int, + var left: Node? = null, + var right: Node? = null) { + + /** + * Return a node with given value. If no such node exists, return null. + * @param value + */ + fun find(value: Int): Node? = when { + this.key > value -> left?.find(value) + this.key < value -> right?.find(value) + else -> this + + } + + /** + * Insert a given value into the tree. + * After insertion, the tree should contain a node with the given value. + * If the tree already contains the given value, nothing is performed. + * @param value + */ + fun insert(value: Int) { + if (value > this.key) { + if (this.right == null) { + this.right = Node(value) + } else { + this.right?.insert(value) + } + } else if (value < this.key) { + if (this.left == null) { + this.left = Node(value) + } else { + this.left?.insert(value) + } + } + } + + /** + * Delete the value from the given tree. If the tree does not contain the value, the tree remains unchanged. + * @param value + */ + fun delete(value: Int) { + when { + value > key -> scan(value, this.right, this) + value < key -> scan(value, this.left, this) + else -> removeNode(this, null) + } + } + + /** + * Scan the tree in the search of the given value. + * @param value + * @param node sub-tree that potentially might contain the sought value + * @param parent node's parent + */ + private fun scan(value: Int, node: Node?, parent: Node?) { + if (node == null) { + System.out.println("value " + value + + " seems not present in the tree.") + return + } + when { + value > node.key -> scan(value, node.right, node) + value < node.key -> scan(value, node.left, node) + value == node.key -> removeNode(node, parent) + } + + } + + /** + * Remove the node. + * + * Removal process depends on how many children the node has. + * + * @param node node that is to be removed + * @param parent parent of the node to be removed + */ + private fun removeNode(node: Node, parent: Node?) { + node.left?.let { leftChild -> + run { + node.right?.let { + removeTwoChildNode(node) + } ?: removeSingleChildNode(node, leftChild) + } + } ?: run { + node.right?.let { rightChild -> removeSingleChildNode(node, rightChild) } ?: removeNoChildNode(node, parent) + } + + + } + + /** + * Remove the node without children. + * @param node + * @param parent + */ + private fun removeNoChildNode(node: Node, parent: Node?) { + parent?.let { p -> + if (node == p.left) { + p.left = null + } else if (node == p.right) { + p.right = null + } + } ?: throw IllegalStateException( + "Can not remove the root node without child nodes") + + } + + /** + * Remove a node that has two children. + * + * The process of elimination is to find the biggest key in the left sub-tree and replace the key of the + * node that is to be deleted with that key. + */ + private fun removeTwoChildNode(node: Node) { + val leftChild = node.left!! + leftChild.right?.let { + val maxParent = findParentOfMaxChild(leftChild) + maxParent.right?.let { + node.key = it.key + maxParent.right = null + } ?: throw IllegalStateException("Node with max child must have the right child!") + + } ?: run { + node.key = leftChild.key + node.left = leftChild.left + } + + } + + /** + * Return a node whose right child contains the biggest value in the given sub-tree. + * Assume that the node n has a non-null right child. + * + * @param n + */ + private fun findParentOfMaxChild(n: Node): Node { + return n.right?.let { r -> r.right?.let { findParentOfMaxChild(r) } ?: n } + ?: throw IllegalArgumentException("Right child must be non-null") + + } + + /** + * Remove a parent that has only one child. + * Removal is effectively is just coping the data from the child parent to the parent parent. + * @param parent Node to be deleted. Assume that it has just one child + * @param child Assume it is a child of the parent + */ + private fun removeSingleChildNode(parent: Node, child: Node) { + parent.key = child.key + parent.left = child.left + parent.right = child.right + } + + fun visit(): Array { + val a = left?.visit() ?: emptyArray() + val b = right?.visit() ?: emptyArray() + return a + arrayOf(key) + b + } +} diff --git a/core-kotlin/src/test/kotlin/com/baeldung/datastructures/NodeTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/datastructures/NodeTest.kt new file mode 100644 index 0000000000..8a46c5f6ec --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/datastructures/NodeTest.kt @@ -0,0 +1,319 @@ +package com.baeldung.datastructures + +import org.junit.After +import org.junit.Assert.* +import org.junit.Before +import org.junit.Test + +class NodeTest { + + @Before + fun setUp() { + } + + @After + fun tearDown() { + } + + /** + * Test suit for finding the node by value + * Partition the tests as follows: + * 1. tree depth: 0, 1, > 1 + * 2. pivot depth location: not present, 0, 1, 2, > 2 + */ + + /** + * Find the node by value + * 1. tree depth: 0 + * 2. pivot depth location: not present + */ + @Test + fun givenDepthZero_whenPivotNotPresent_thenNull() { + val n = Node(1) + assertNull(n.find(2)) + } + + /** + * Find the node by value + * 1. tree depth: 0 + * 2. pivot depth location: 0 + */ + @Test + fun givenDepthZero_whenPivotDepthZero_thenReturnNodeItself() { + val n = Node(1) + assertEquals(n, n.find(1)) + } + + /** + * Find the node by value + * 1. tree depth: 1 + * 2. pivot depth location: not present + */ + @Test + fun givenDepthOne_whenPivotNotPresent_thenNull() { + val n = Node(1, Node(0)) + assertNull(n.find(2)) + } + + /** + * Find the node by value + * 1. tree depth: 1 + * 2. pivot depth location: not present + */ + @Test + fun givenDepthOne_whenPivotAtDepthOne_thenSuccess() { + val n = Node(1, Node(0)) + assertEquals(n.left, n.find(0) + ) + } + + @Test + fun givenDepthTwo_whenPivotAtDepth2_then_Success() { + val left = Node(1, Node(0), Node(2)) + val right = Node(5, Node(4), Node(6)) + val n = Node(3, left, right) + assertEquals(left.left, n.find(0)) + } + + + /** + * Test suit for inserting a value + * Partition the test as follows: + * 1. tree depth: 0, 1, 2, > 2 + * 2. depth to insert: 0, 1, > 1 + * 3. is duplicate: no, yes + * 4. sub-tree: left, right + */ + /** + * Test for inserting a value + * 1. tree depth: 0 + * 2. depth to insert: 1 + * 3. is duplicate: no + * 4. sub-tree: right + */ + @Test + fun givenTreeDepthZero_whenInsertNoDuplicateToRight_thenAddNode() { + val n = Node(1) + n.insert(2) + assertEquals(1, n.key) + with(n.right!!) { + assertEquals(2, key) + assertNull(left) + assertNull(right) + } + assertNull(n.left) + } + + /** + * Test for inserting a value + * 1. tree depth: 0 + * 2. depth to insert: 1 + * 3. is duplicate: no + * 4. sub-tree: right + */ + @Test + fun givenTreeDepthZero_whenInsertNoDuplicateToLeft_thenSuccess() { + val n = Node(1) + n.insert(0) + assertEquals(1, n.key) + with(n.left!!) { + assertEquals(0, key) + assertNull(left) + assertNull(right) + } + assertNull(n.right) + } + + /** + * Test for inserting a value + * 1. tree depth: 0 + * 2. depth to insert: 1 + * 3. is duplicate: yes + */ + @Test + fun givenTreeDepthZero_whenInsertDuplicate_thenSuccess() { + val n = Node(1) + n.insert(1) + assertEquals(1, n.key) + assertNull(n.right) + assertNull(n.left) + } + + + /** + * Test suit for inserting a value + * Partition the test as follows: + * 1. tree depth: 0, 1, 2, > 2 + * 2. depth to insert: 0, 1, > 1 + * 3. is duplicate: no, yes + * 4. sub-tree: left, right + */ + /** + * Test for inserting a value + * 1. tree depth: 1 + * 2. depth to insert: 1 + * 3. is duplicate: no + * 4. sub-tree: right + */ + @Test + fun givenTreeDepthOne_whenInsertNoDuplicateToRight_thenSuccess() { + val n = Node(10, Node(3)) + n.insert(15) + assertEquals(10, n.key) + with(n.right!!) { + assertEquals(15, key) + assertNull(left) + assertNull(right) + } + with(n.left!!) { + assertEquals(3, key) + assertNull(left) + assertNull(right) + } + } + + /** + * Test for inserting a value + * 1. tree depth: 1 + * 2. depth to insert: 1 + * 3. is duplicate: no + * 4. sub-tree: left + */ + @Test + fun givenTreeDepthOne_whenInsertNoDuplicateToLeft_thenAddNode() { + val n = Node(10, null, Node(15)) + n.insert(3) + assertEquals(10, n.key) + with(n.right!!) { + assertEquals(15, key) + assertNull(left) + assertNull(right) + } + with(n.left!!) { + assertEquals(3, key) + assertNull(left) + assertNull(right) + } + } + + /** + * Test for inserting a value + * 1. tree depth: 1 + * 2. depth to insert: 1 + * 3. is duplicate: yes + */ + @Test + fun givenTreeDepthOne_whenInsertDuplicate_thenNoChange() { + val n = Node(10, null, Node(15)) + n.insert(15) + assertEquals(10, n.key) + with(n.right!!) { + assertEquals(15, key) + assertNull(left) + assertNull(right) + } + assertNull(n.left) + } + + /** + * Test suit for removal + * Partition the input as follows: + * 1. tree depth: 0, 1, 2, > 2 + * 2. value to delete: absent, present + * 3. # child nodes: 0, 1, 2 + */ + /** + * Test for removal value + * 1. tree depth: 0 + * 2. value to delete: absent + */ + @Test + fun givenTreeDepthZero_whenValueAbsent_thenNoChange() { + val n = Node(1) + n.delete(0) + assertEquals(1, n.key) + assertNull(n.left) + assertNull(n.right) + } + + /** + * Test for removal + * 1. tree depth: 1 + * 2. value to delete: absent + */ + @Test + fun givenTreeDepthOne_whenValueAbsent_thenNoChange() { + val n = Node(1, Node(0), Node(2)) + n.delete(3) + assertEquals(1, n.key) + assertEquals(2, n.right!!.key) + with(n.left!!) { + assertEquals(0, key) + assertNull(left) + assertNull(right) + } + with(n.right!!) { + assertNull(left) + assertNull(right) + } + } + + /** + * Test suit for removal + * 1. tree depth: 1 + * 2. value to delete: present + * 3. # child nodes: 0 + */ + @Test + fun givenTreeDepthOne_whenNodeToDeleteHasNoChildren_thenChangeTree() { + val n = Node(1, Node(0)) + n.delete(0) + assertEquals(1, n.key) + assertNull(n.left) + assertNull(n.right) + } + + /** + * Test suit for removal + * 1. tree depth: 2 + * 2. value to delete: present + * 3. # child nodes: 1 + */ + @Test + fun givenTreeDepthTwo_whenNodeToDeleteHasOneChild_thenChangeTree() { + val n = Node(2, Node(0, null, Node(1)), Node(3)) + n.delete(0) + assertEquals(2, n.key) + with(n.right!!) { + assertEquals(3, key) + assertNull(left) + assertNull(right) + } + with(n.left!!) { + assertEquals(1, key) + assertNull(left) + assertNull(right) + } + } + + @Test + fun givenTreeDepthThree_whenNodeToDeleteHasTwoChildren_thenChangeTree() { + val l = Node(2, Node(1), Node(5, Node(4), Node(6))) + val r = Node(10, Node(9), Node(11)) + val n = Node(8, l, r) + n.delete(8) + assertEquals(6, n.key) + with(n.left!!) { + assertEquals(2, key) + assertEquals(1, left!!.key) + assertEquals(5, right!!.key) + assertEquals(4, right!!.left!!.key) + } + with(n.right!!) { + assertEquals(10, key) + assertEquals(9, left!!.key) + assertEquals(11, right!!.key) + } + } + +} From 3596d3dc34533748ce1e245270d78819fdc3e4c2 Mon Sep 17 00:00:00 2001 From: Syed Mansoor Date: Fri, 12 Oct 2018 16:55:59 +1100 Subject: [PATCH 092/546] Added project for Apache pulsar examples --- apache-pulsar/.gitignore | 8 + apache-pulsar/build.gradle | 26 +++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54413 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + apache-pulsar/gradlew | 172 ++++++++++++++++++ apache-pulsar/gradlew.bat | 84 +++++++++ .../main/java/com/baeldung/ConsumerTest.java | 48 +++++ .../main/java/com/baeldung/ProducerTest.java | 58 ++++++ .../ExclusiveSubscriptionTutorial.java | 59 ++++++ .../FailoverSubscriptionTutorial.java | 76 ++++++++ 10 files changed, 536 insertions(+) create mode 100755 apache-pulsar/.gitignore create mode 100755 apache-pulsar/build.gradle create mode 100755 apache-pulsar/gradle/wrapper/gradle-wrapper.jar create mode 100755 apache-pulsar/gradle/wrapper/gradle-wrapper.properties create mode 100755 apache-pulsar/gradlew create mode 100755 apache-pulsar/gradlew.bat create mode 100755 apache-pulsar/src/main/java/com/baeldung/ConsumerTest.java create mode 100755 apache-pulsar/src/main/java/com/baeldung/ProducerTest.java create mode 100755 apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTutorial.java create mode 100755 apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTutorial.java diff --git a/apache-pulsar/.gitignore b/apache-pulsar/.gitignore new file mode 100755 index 0000000000..1c53e03007 --- /dev/null +++ b/apache-pulsar/.gitignore @@ -0,0 +1,8 @@ +.classpath +.project +.settings +target +.idea +*.iml +.gradle/ +build/ diff --git a/apache-pulsar/build.gradle b/apache-pulsar/build.gradle new file mode 100755 index 0000000000..f3545d69b2 --- /dev/null +++ b/apache-pulsar/build.gradle @@ -0,0 +1,26 @@ +apply plugin: 'java' +ext{ + pulsarVersion = '2.1.1-incubating' +} + +repositories { + jcenter() + mavenCentral() + mavenLocal() +} + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +group = 'com.baeldung.pulsar' +archivesBaseName = 'pulsar-java-example' +version = '0.0.1' + + + + +dependencies { + compile group: 'org.apache.pulsar', name: 'pulsar-client', version: pulsarVersion + +} + diff --git a/apache-pulsar/gradle/wrapper/gradle-wrapper.jar b/apache-pulsar/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 0000000000000000000000000000000000000000..91ca28c8b802289c3a438766657a5e98f20eff03 GIT binary patch literal 54413 zcmafaV|Zr4wq`oEZQHiZj%|LijZQlLf{tz5M#r{o+fI6V=G-$g=gzrzeyqLskF}nv zRZs0&c;EUi2L_G~0s;*U0szbK}f6%Pvi zRZ#mYf6f1oqJoH`jHHCB8l!^by~4z}yc`4LEP@;Z?bO6{g9`Hk+s@(L1jC5Tq{1Yf z4E;CQvrx0-gF+peRxFC*gF=&$zNYk(w0q}U=WqXMz`tYs@0o%B{dRD+{C_6(f9t^g zhmNJQv6-#;f2)f2uc{u-#*U8W&i{|ewYN^n_1~cv|1J!}zc&$eaB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LP zkS@Q0`rpM|UsnI6B;_+vw)^iA{n0%C7N~ql@KXNonIOUIHwgYg4Dcn>OOdc=rUl>M zVEQe|u$P=Kb)TL&-2#4t^Pg0pUQ)dj%6O)#3;zwOe~`_1$@Ef`;F+l=>NlAFFbBS0 zN))`LdKnA;OjQ{B+f;z>i|wCv-CmNs46S`8X-oKRl0V+pKZ%XJWO*6G`OMOs^xG_d zj_7-p06{fybw_P;UzX^eX5Pkcrm04%9rPFa56 zyZE \(.*\)$'` + 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="" + +# 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/apache-pulsar/gradlew.bat b/apache-pulsar/gradlew.bat new file mode 100755 index 0000000000..e95643d6a2 --- /dev/null +++ b/apache-pulsar/gradlew.bat @@ -0,0 +1,84 @@ +@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= + +@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/apache-pulsar/src/main/java/com/baeldung/ConsumerTest.java b/apache-pulsar/src/main/java/com/baeldung/ConsumerTest.java new file mode 100755 index 0000000000..72dc10b542 --- /dev/null +++ b/apache-pulsar/src/main/java/com/baeldung/ConsumerTest.java @@ -0,0 +1,48 @@ +package com.baeldung; + +import java.io.IOException; + +import org.apache.pulsar.client.api.Consumer; +import org.apache.pulsar.client.api.Message; +import org.apache.pulsar.client.api.PulsarClient; +import org.apache.pulsar.client.api.SubscriptionType; + +public class ConsumerTest { + + private static final String SERVICE_URL = "pulsar://localhost:6650"; + private static final String TOPIC_NAME = "test-topic"; + private static final String SUBSCRIPTION_NAME = "test-subscription"; + + public static void main(String[] args) throws IOException { + // Create a Pulsar client instance. A single instance can be shared across many + // producers and consumer within the same application + PulsarClient client = PulsarClient.builder() + .serviceUrl(SERVICE_URL) + .build(); + + //Configure consumer specific settings. + Consumer consumer = client.newConsumer() + .topic(TOPIC_NAME) + // Allow multiple consumers to attach to the same subscription + // and get messages dispatched as a queue + .subscriptionType(SubscriptionType.Shared) + .subscriptionName(SUBSCRIPTION_NAME) + .subscribe(); + + + // Once the consumer is created, it can be used for the entire application lifecycle + System.out.println("Created consumer for the topic "+ TOPIC_NAME); + + do { + // Wait until a message is available + Message msg = consumer.receive(); + + // Extract the message as a printable string and then log + String content = new String(msg.getData()); + System.out.println("Received message '"+content+"' with ID "+msg.getMessageId()); + + // Acknowledge processing of the message so that it can be deleted + consumer.acknowledge(msg); + } while (true); + } +} diff --git a/apache-pulsar/src/main/java/com/baeldung/ProducerTest.java b/apache-pulsar/src/main/java/com/baeldung/ProducerTest.java new file mode 100755 index 0000000000..08ee0e89b9 --- /dev/null +++ b/apache-pulsar/src/main/java/com/baeldung/ProducerTest.java @@ -0,0 +1,58 @@ +package com.baeldung; + +import org.apache.pulsar.client.api.CompressionType; +import org.apache.pulsar.client.api.Message; +import org.apache.pulsar.client.api.MessageBuilder; +import org.apache.pulsar.client.api.MessageId; +import org.apache.pulsar.client.api.Producer; +import org.apache.pulsar.client.api.PulsarClient; +import org.apache.pulsar.client.api.PulsarClientException; + +import java.io.IOException; +import java.util.stream.IntStream; + +public class ProducerTest { + + private static final String SERVICE_URL = "pulsar://localhost:6650"; + private static final String TOPIC_NAME = "test-topic"; + + public static void main(String[] args) throws IOException { + // Create a Pulsar client instance. A single instance can be shared across many + // producers and consumer within the same application + PulsarClient client = PulsarClient.builder() + .serviceUrl(SERVICE_URL) + .build(); + + // Configure producer specific settings + Producer producer = client.newProducer() + // Set the topic + .topic(TOPIC_NAME) + // Enable compression + .compressionType(CompressionType.LZ4) + .create(); + + // Once the producer is created, it can be used for the entire application life-cycle + System.out.println("Created producer for the topic "+TOPIC_NAME); + + // Send 5 test messages + IntStream.range(1, 5).forEach(i -> { + String content = String.format("hi-pulsar-%d", i); + + // Build a message object + Message msg = MessageBuilder.create() + .setContent(content.getBytes()) + .build(); + + // Send each message and log message content and ID when successfully received + try { + MessageId msgId = producer.send(msg); + + System.out.println("Published message '"+content+"' with the ID "+msgId); + } catch (PulsarClientException e) { + System.out.println(e.getMessage()); + } + }); + + client.close(); + } +} diff --git a/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTutorial.java b/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTutorial.java new file mode 100755 index 0000000000..da9ff0974d --- /dev/null +++ b/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTutorial.java @@ -0,0 +1,59 @@ +package com.baeldung.subscriptions; + +import org.apache.pulsar.client.api.ConsumerBuilder; +import org.apache.pulsar.client.api.Message; +import org.apache.pulsar.client.api.MessageBuilder; +import org.apache.pulsar.client.api.Producer; +import org.apache.pulsar.client.api.PulsarClient; +import org.apache.pulsar.client.api.PulsarClientException; +import org.apache.pulsar.client.api.SubscriptionType; + +import java.util.stream.IntStream; + +public class ExclusiveSubscriptionTutorial { + private static final String SERVICE_URL = "pulsar://localhost:6650"; + private static final String TOPIC_NAME = "test-topic"; + private static final String SUBSCRIPTION_NAME = "test-subscription"; + private static final SubscriptionType SUBSCRIPTION_TYPE = SubscriptionType.Exclusive; + + public static void main(String[] args) throws PulsarClientException { + PulsarClient client = PulsarClient.builder() + .serviceUrl(SERVICE_URL) + .build(); + + Producer producer = client.newProducer() + .topic(TOPIC_NAME) + .create(); + + ConsumerBuilder consumer1 = client.newConsumer() + .topic(TOPIC_NAME) + .subscriptionName(SUBSCRIPTION_NAME) + .subscriptionType(SUBSCRIPTION_TYPE); + + ConsumerBuilder consumer2 = client.newConsumer() + .topic(TOPIC_NAME) + .subscriptionName(SUBSCRIPTION_NAME) + .subscriptionType(SUBSCRIPTION_TYPE); + + IntStream.range(0, 999).forEach(i -> { + Message msg = MessageBuilder.create() + .setContent(String.format("message-%d", i).getBytes()) + .build(); + try { + producer.send(msg); + } catch (PulsarClientException e) { + System.out.println(e.getMessage()); + } + }); + + // Consumer 1 can subscribe to the topic + consumer1.subscribe(); + + // Consumer 2 cannot due to the exclusive subscription held by consumer 1 + consumer2.subscribeAsync() + .handle((consumer, exception) -> { + System.out.println(exception.getMessage()); + return null; + }); + } +} diff --git a/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTutorial.java b/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTutorial.java new file mode 100755 index 0000000000..30351c229d --- /dev/null +++ b/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTutorial.java @@ -0,0 +1,76 @@ +package com.baeldung.subscriptions; + +import org.apache.pulsar.client.api.Consumer; +import org.apache.pulsar.client.api.ConsumerBuilder; +import org.apache.pulsar.client.api.Message; +import org.apache.pulsar.client.api.MessageBuilder; +import org.apache.pulsar.client.api.Producer; +import org.apache.pulsar.client.api.PulsarClient; +import org.apache.pulsar.client.api.PulsarClientException; +import org.apache.pulsar.client.api.SubscriptionType; + +import java.util.stream.IntStream; + +public class FailoverSubscriptionTutorial { + private static final String SERVICE_URL = "pulsar://localhost:6650"; + private static final String TOPIC_NAME = "failover-subscription-test-topic"; + private static final String SUBSCRIPTION_NAME = "test-subscription"; + private static final SubscriptionType SUBSCRIPTION_TYPE = SubscriptionType.Failover; + private static final int NUM_MSGS = 10; + + public static void main(String[] args) throws PulsarClientException { + PulsarClient client = PulsarClient.builder() + .serviceUrl(SERVICE_URL) + .build(); + + Producer producer = client.newProducer() + .topic(TOPIC_NAME) + .create(); + + ConsumerBuilder consumerBuilder = client.newConsumer() + .topic(TOPIC_NAME) + .subscriptionName(SUBSCRIPTION_NAME) + .subscriptionType(SUBSCRIPTION_TYPE); + + Consumer mainConsumer = consumerBuilder + .consumerName("consumer-a") + .messageListener((consumer, msg) -> { + System.out.println("Message received by main consumer"); + + try { + consumer.acknowledge(msg); + } catch (PulsarClientException e) { + System.out.println(e.getMessage()); + } + }) + .subscribe(); + + Consumer failoverConsumer = consumerBuilder + .consumerName("consumer-b") + .messageListener((consumer, msg) -> { + System.out.println("Message received by failover consumer"); + + try { + consumer.acknowledge(msg); + } catch (PulsarClientException e) { + System.out.println(e.getMessage()); + } + }) + .subscribe(); + + IntStream.range(0, NUM_MSGS).forEach(i -> { + Message msg = MessageBuilder.create() + .setContent(String.format("message-%d", i).getBytes()) + .build(); + try { + producer.send(msg); + + Thread.sleep(100); + + if (i > 5) mainConsumer.close(); + } catch (InterruptedException | PulsarClientException e) { + System.out.println(e.getMessage()); + } + }); + } +} From 15b7eacd4310b871769afe12a363f231fb924052 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Fri, 12 Oct 2018 10:21:35 +0300 Subject: [PATCH 093/546] cleanup work --- core-java-collections/pom.xml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/core-java-collections/pom.xml b/core-java-collections/pom.xml index 694d2da5eb..b4a6e26d13 100644 --- a/core-java-collections/pom.xml +++ b/core-java-collections/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-collections 0.1.0-SNAPSHOT jar @@ -63,11 +62,17 @@ jmh-generator-annprocess ${openjdk.jmh.version} - - org.apache.commons - commons-exec - 1.3 - + + org.apache.commons + commons-exec + 1.3 + + + + one.util + streamex + 0.6.5 + From bae7a74acd987defc018c79852b88417f8c3a931 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Fri, 12 Oct 2018 10:54:04 +0100 Subject: [PATCH 094/546] Adding files for the article BAEL-2206 --- .../interfaces/ConflictingInterfaces.kt | 23 +++++++++++++ .../interfaces/InterfaceDelegation.kt | 13 ++++++++ .../baeldung/interfaces/MultipleInterfaces.kt | 29 +++++++++++++++++ .../baeldung/interfaces/SimpleInterface.kt | 24 ++++++++++++++ .../interfaces/InterfaceExamplesUnitTest.kt | 32 +++++++++++++++++++ 5 files changed, 121 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/interfaces/ConflictingInterfaces.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/interfaces/InterfaceDelegation.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/interfaces/MultipleInterfaces.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/interfaces/SimpleInterface.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/interfaces/InterfaceExamplesUnitTest.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/interfaces/ConflictingInterfaces.kt b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/ConflictingInterfaces.kt new file mode 100644 index 0000000000..630afbdae7 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/ConflictingInterfaces.kt @@ -0,0 +1,23 @@ +package com.baeldung.interfaces + +interface BaseInterface { + fun someMethod(): String +} + +interface FirstChildInterface : BaseInterface { + override fun someMethod(): String { + return("Hello, from someMethod in FirstChildInterface") + } +} + +interface SecondChildInterface : BaseInterface { + override fun someMethod(): String { + return("Hello, from someMethod in SecondChildInterface") + } +} + +class ChildClass : FirstChildInterface, SecondChildInterface { + override fun someMethod(): String { + return super.someMethod() + } +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/interfaces/InterfaceDelegation.kt b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/InterfaceDelegation.kt new file mode 100644 index 0000000000..591fde0689 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/InterfaceDelegation.kt @@ -0,0 +1,13 @@ +package com.baeldung.interfaces + +interface MyInterface { + fun someMethod(): String +} + +class MyClass() : MyInterface { + override fun someMethod(): String { + return("Hello, World!") + } +} + +class MyDerivedClass(myInterface: MyInterface) : MyInterface by myInterface \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/interfaces/MultipleInterfaces.kt b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/MultipleInterfaces.kt new file mode 100644 index 0000000000..105a85cbb3 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/MultipleInterfaces.kt @@ -0,0 +1,29 @@ +package com.baeldung.interfaces + +interface FirstInterface { + fun someMethod(): String + + fun anotherMethod(): String { + return("Hello, from anotherMethod in FirstInterface") + } +} + +interface SecondInterface { + fun someMethod(): String { + return("Hello, from someMethod in SecondInterface") + } + + fun anotherMethod(): String { + return("Hello, from anotherMethod in SecondInterface") + } +} + +class SomeClass: FirstInterface, SecondInterface { + override fun someMethod(): String { + return("Hello, from someMethod in SomeClass") + } + + override fun anotherMethod(): String { + return("Hello, from anotherMethod in SomeClass") + } +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/interfaces/SimpleInterface.kt b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/SimpleInterface.kt new file mode 100644 index 0000000000..0758549dde --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/interfaces/SimpleInterface.kt @@ -0,0 +1,24 @@ +package com.baeldung.interfaces + +interface SimpleInterface { + val firstProp: String + val secondProp: String + get() = "Second Property" + fun firstMethod(): String + fun secondMethod(): String { + println("Hello, from: " + secondProp) + return "" + } +} + +class SimpleClass: SimpleInterface { + override val firstProp: String = "First Property" + override val secondProp: String + get() = "Second Property, Overridden!" + override fun firstMethod(): String { + return("Hello, from: " + firstProp) + } + override fun secondMethod(): String { + return("Hello, from: " + secondProp + firstProp) + } +} \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/interfaces/InterfaceExamplesUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/interfaces/InterfaceExamplesUnitTest.kt new file mode 100644 index 0000000000..96b99948b7 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/interfaces/InterfaceExamplesUnitTest.kt @@ -0,0 +1,32 @@ +package com.baeldung.interfaces + +import org.junit.Test +import kotlin.test.assertEquals + +class InterfaceExamplesUnitTest { + @Test + fun givenAnInterface_whenImplemented_thenBehavesAsOverridden() { + val simpleClass = SimpleClass() + assertEquals("Hello, from: First Property", simpleClass.firstMethod()) + assertEquals("Hello, from: Second Property, Overridden!First Property", simpleClass.secondMethod()) + } + + @Test + fun givenMultipleInterfaces_whenImplemented_thenBehavesAsOverridden() { + val someClass = SomeClass() + assertEquals("Hello, from someMethod in SomeClass", someClass.someMethod()) + assertEquals("Hello, from anotherMethod in SomeClass", someClass.anotherMethod()) + } + + @Test + fun givenConflictingInterfaces_whenImplemented_thenBehavesAsOverridden() { + val childClass = ChildClass() + assertEquals("Hello, from someMethod in SecondChildInterface", childClass.someMethod()) + } + + @Test + fun givenAnInterface_whenImplemented_thenBehavesAsDelegated() { + val myClass = MyClass() + assertEquals("Hello, World!", MyDerivedClass(myClass).someMethod()) + } +} \ No newline at end of file From fe8488a8d5e773e7e657a85c477bbfa7f3af68a0 Mon Sep 17 00:00:00 2001 From: Akash Pandey Date: Sat, 13 Oct 2018 01:20:33 +0530 Subject: [PATCH 095/546] Bael 2189: Convert Byte Array To/From hex String (#5396) * BAEL-2159: Mini Article on "Separate double into integer and decimal parts" * BAEL-2189: Tutorial to convert Byte Array to/from hex String. * BEAL-2189: Code review comments incorporated. * 1. Added validations for Non-Hex String characters in hex String. 2. Moved classes to algorithms module. 3. Renamed unit test class name ends with *UnitTest. * 1. Added validations for Non-Hex String characters in hex String. 2. Moved classes to algorithms module. 3. Renamed unit test class name ends with *UnitTest. * removed: redundant property added for local testing. --- algorithms/pom.xml | 6 + .../conversion/HexStringConverter.java | 110 +++++++++++++++ .../ByteArrayConverterUnitTest.java | 127 ++++++++++++++++++ 3 files changed, 243 insertions(+) create mode 100644 algorithms/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java create mode 100644 algorithms/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java diff --git a/algorithms/pom.xml b/algorithms/pom.xml index eda87d6c75..db4a1c2eff 100644 --- a/algorithms/pom.xml +++ b/algorithms/pom.xml @@ -17,6 +17,11 @@ commons-math3 ${commons-math3.version} + + commons-codec + commons-codec + ${commons-codec.version} + org.projectlombok lombok @@ -85,6 +90,7 @@ 3.7.0 1.0.1 3.9.0 + 1.11 \ No newline at end of file diff --git a/algorithms/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java b/algorithms/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java new file mode 100644 index 0000000000..d3e251d3fd --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java @@ -0,0 +1,110 @@ +package com.baeldung.algorithms.conversion; + +import java.math.BigInteger; + +import javax.xml.bind.DatatypeConverter; + +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Hex; + +import com.google.common.io.BaseEncoding; + +public class HexStringConverter { + + /** + * Create a byte Array from String of hexadecimal digits using Character conversion + * @param hexString - Hexadecimal digits as String + * @return Desired byte Array + */ + public byte[] decodeHexString(String hexString) { + if (hexString.length() % 2 == 1) { + throw new IllegalArgumentException("Invalid hexadecimal String supplied."); + } + byte[] bytes = new byte[hexString.length() / 2]; + + for (int i = 0; i < hexString.length(); i += 2) { + bytes[i / 2] = hexToByte(hexString.substring(i, i + 2)); + } + return bytes; + } + + /** + * Create a String of hexadecimal digits from a byte Array using Character conversion + * @param byteArray - The byte Array + * @return Desired String of hexadecimal digits in lower case + */ + public String encodeHexString(byte[] byteArray) { + StringBuffer hexStringBuffer = new StringBuffer(); + for (int i = 0; i < byteArray.length; i++) { + hexStringBuffer.append(byteToHex(byteArray[i])); + } + return hexStringBuffer.toString(); + } + + public String byteToHex(byte num) { + char[] hexDigits = new char[2]; + hexDigits[0] = Character.forDigit((num >> 4) & 0xF, 16); + hexDigits[1] = Character.forDigit((num & 0xF), 16); + return new String(hexDigits); + } + + public byte hexToByte(String hexString) { + int firstDigit = toDigit(hexString.charAt(0)); + int secondDigit = toDigit(hexString.charAt(1)); + return (byte) ((firstDigit << 4) + secondDigit); + } + + private int toDigit(char hexChar) { + int digit = Character.digit(hexChar, 16); + if(digit == -1) { + throw new IllegalArgumentException("Invalid Hexadecimal Character: "+ hexChar); + } + return digit; + } + + public String encodeUsingBigIntegerToString(byte[] bytes) { + BigInteger bigInteger = new BigInteger(1, bytes); + return bigInteger.toString(16); + } + + public String encodeUsingBigIntegerStringFormat(byte[] bytes) { + BigInteger bigInteger = new BigInteger(1, bytes); + return String.format("%0" + (bytes.length << 1) + "x", bigInteger); + } + + public byte[] decodeUsingBigInteger(String hexString) { + byte[] byteArray = new BigInteger(hexString, 16).toByteArray(); + if (byteArray[0] == 0) { + byte[] output = new byte[byteArray.length - 1]; + System.arraycopy(byteArray, 1, output, 0, output.length); + return output; + } + return byteArray; + } + + public String encodeUsingDataTypeConverter(byte[] bytes) { + return DatatypeConverter.printHexBinary(bytes); + } + + public byte[] decodeUsingDataTypeConverter(String hexString) { + return DatatypeConverter.parseHexBinary(hexString); + } + + public String encodeUsingApacheCommons(byte[] bytes) throws DecoderException { + return Hex.encodeHexString(bytes); + } + + public byte[] decodeUsingApacheCommons(String hexString) throws DecoderException { + return Hex.decodeHex(hexString); + } + + public String encodeUsingGuava(byte[] bytes) { + return BaseEncoding.base16() + .encode(bytes); + } + + public byte[] decodeUsingGuava(String hexString) { + return BaseEncoding.base16() + .decode(hexString.toUpperCase()); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java new file mode 100644 index 0000000000..be61802705 --- /dev/null +++ b/algorithms/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java @@ -0,0 +1,127 @@ +package com.baeldung.algorithms.conversion; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import org.apache.commons.codec.DecoderException; +import org.hamcrest.text.IsEqualIgnoringCase; +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.algorithms.conversion.HexStringConverter; + +public class ByteArrayConverterUnitTest { + + private HexStringConverter hexStringConverter; + + @Before + public void setup() { + hexStringConverter = new HexStringConverter(); + } + + @Test + public void shouldEncodeByteArrayToHexStringUsingBigIntegerToString() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + if(hexString.charAt(0) == '0') { + hexString = hexString.substring(1); + } + String output = hexStringConverter.encodeUsingBigIntegerToString(bytes); + assertThat(output, IsEqualIgnoringCase.equalToIgnoringCase(hexString)); + } + + @Test + public void shouldEncodeByteArrayToHexStringUsingBigIntegerStringFormat() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + String output = hexStringConverter.encodeUsingBigIntegerStringFormat(bytes); + assertThat(output, IsEqualIgnoringCase.equalToIgnoringCase(hexString)); + } + + @Test + public void shouldDecodeHexStringToByteArrayUsingBigInteger() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + byte[] output = hexStringConverter.decodeUsingBigInteger(hexString); + assertArrayEquals(bytes, output); + } + + @Test + public void shouldEncodeByteArrayToHexStringUsingCharacterConversion() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + String output = hexStringConverter.encodeHexString(bytes); + assertThat(output, IsEqualIgnoringCase.equalToIgnoringCase(hexString)); + } + + @Test + public void shouldDecodeHexStringToByteArrayUsingCharacterConversion() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + byte[] output = hexStringConverter.decodeHexString(hexString); + assertArrayEquals(bytes, output); + } + + @Test(expected=IllegalArgumentException.class) + public void shouldDecodeHexToByteWithInvalidHexCharacter() { + hexStringConverter.hexToByte("fg"); + } + + @Test + public void shouldEncodeByteArrayToHexStringDataTypeConverter() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + String output = hexStringConverter.encodeUsingDataTypeConverter(bytes); + assertThat(output, IsEqualIgnoringCase.equalToIgnoringCase(hexString)); + } + + @Test + public void shouldDecodeHexStringToByteArrayUsingDataTypeConverter() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + byte[] output = hexStringConverter.decodeUsingDataTypeConverter(hexString); + assertArrayEquals(bytes, output); + } + + @Test + public void shouldEncodeByteArrayToHexStringUsingGuava() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + String output = hexStringConverter.encodeUsingGuava(bytes); + assertThat(output, IsEqualIgnoringCase.equalToIgnoringCase(hexString)); + } + + @Test + public void shouldDecodeHexStringToByteArrayUsingGuava() { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + byte[] output = hexStringConverter.decodeUsingGuava(hexString); + assertArrayEquals(bytes, output); + } + + @Test + public void shouldEncodeByteArrayToHexStringUsingApacheCommons() throws DecoderException { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + String output = hexStringConverter.encodeUsingApacheCommons(bytes); + assertThat(output, IsEqualIgnoringCase.equalToIgnoringCase(hexString)); + } + + @Test + public void shouldDecodeHexStringToByteArrayUsingApacheCommons() throws DecoderException { + byte[] bytes = getSampleBytes(); + String hexString = getSampleHexString(); + byte[] output = hexStringConverter.decodeUsingApacheCommons(hexString); + assertArrayEquals(bytes, output); + } + + private String getSampleHexString() { + return "0af50c0e2d10"; + } + + private byte[] getSampleBytes() { + return new byte[] { 10, -11, 12, 14, 45, 16 }; + } + +} From 3c35e25015dd5e7b7943c8e77fab9b8345c37191 Mon Sep 17 00:00:00 2001 From: Rokon Uddin Ahmed Date: Sat, 13 Oct 2018 02:22:56 +0600 Subject: [PATCH 096/546] BAEL-9344 (#5435) * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.MD * Update README.md * Update README.md * Update README.md * Create README.md * Update README.md * Update README.md --- algorithms/README.md | 3 +++ aws/README.md | 2 +- core-java-9/README.md | 1 + core-java-collections/README.md | 3 +++ core-java-concurrency/README.md | 1 + core-java/README.md | 6 ++++++ core-kotlin/README.md | 2 ++ hibernate5/README.md | 1 + java-streams/README.md | 1 + java-strings/README.md | 2 ++ libraries-security/README.md | 3 +++ libraries/README.md | 2 ++ spring-5-mvc/README.md | 1 + spring-boot-bootstrap/README.md | 1 + spring-cloud/README.md | 2 ++ spring-core/README.md | 2 ++ spring-data-jpa/README.md | 1 + spring-security-mvc-boot/README.MD | 1 + testing-modules/spring-testing/README.md | 3 ++- 19 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 libraries-security/README.md diff --git a/algorithms/README.md b/algorithms/README.md index 9b3bbcdee5..9d347869bd 100644 --- a/algorithms/README.md +++ b/algorithms/README.md @@ -28,3 +28,6 @@ - [Calculate the Distance Between Two Points in Java](https://www.baeldung.com/java-distance-between-two-points) - [Find the Intersection of Two Lines in Java](https://www.baeldung.com/java-intersection-of-two-lines) - [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters) +- [Round Up to the Nearest Hundred](https://www.baeldung.com/java-round-up-nearest-hundred) +- [Merge Sort in Java](https://www.baeldung.com/java-merge-sort) +- [Calculate Percentage in Java](https://www.baeldung.com/java-calculate-percentage) diff --git a/aws/README.md b/aws/README.md index d23937a419..2c61928095 100644 --- a/aws/README.md +++ b/aws/README.md @@ -9,4 +9,4 @@ - [Integration Testing with a Local DynamoDB Instance](http://www.baeldung.com/dynamodb-local-integration-tests) - [Using the JetS3t Java Client With Amazon S3](http://www.baeldung.com/jets3t-amazon-s3) - [Managing Amazon SQS Queues in Java](http://www.baeldung.com/aws-queues-java) - +- [Guide to AWS Aurora RDS with Java](https://www.baeldung.com/aws-aurora-rds-java) diff --git a/core-java-9/README.md b/core-java-9/README.md index bf07cfcc86..38816471aa 100644 --- a/core-java-9/README.md +++ b/core-java-9/README.md @@ -26,3 +26,4 @@ - [Iterate Through a Range of Dates in Java](https://www.baeldung.com/java-iterate-date-range) - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) - [Java 9 Platform Logging API](https://www.baeldung.com/java-9-logging-api) +- [Guide to java.lang.Process API](https://www.baeldung.com/java-process-api) diff --git a/core-java-collections/README.md b/core-java-collections/README.md index d9d768961c..aef640634e 100644 --- a/core-java-collections/README.md +++ b/core-java-collections/README.md @@ -52,3 +52,6 @@ - [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance) - [Get the Key for a Value from a Java Map](https://www.baeldung.com/java-map-key-from-value) - [Time Complexity of Java Collections](https://www.baeldung.com/java-collections-complexity) +- [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) +- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) +- [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) diff --git a/core-java-concurrency/README.md b/core-java-concurrency/README.md index d775d24dff..eeb9a83748 100644 --- a/core-java-concurrency/README.md +++ b/core-java-concurrency/README.md @@ -29,3 +29,4 @@ - [A Custom Spring SecurityConfigurer](http://www.baeldung.com/spring-security-custom-configurer) - [Life Cycle of a Thread in Java](http://www.baeldung.com/java-thread-lifecycle) - [Runnable vs. Callable in Java](http://www.baeldung.com/java-runnable-callable) +- [Brief Introduction to Java Thread.yield()](https://www.baeldung.com/java-thread-yield) diff --git a/core-java/README.md b/core-java/README.md index a117d1843d..9e38dfc47d 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -150,3 +150,9 @@ - [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception) - [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) - [Synthetic Constructs in Java](https://www.baeldung.com/java-synthetic) +- [Convert Double to String, Removing Decimal Places](https://www.baeldung.com/java-double-to-string) +- [Different Ways to Capture Java Heap Dumps](https://www.baeldung.com/java-heap-dump-capture) +- [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) +- [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset) +- [Hashing a Password in Java](https://www.baeldung.com/java-password-hashing) +- [Java Switch Statement](https://www.baeldung.com/java-switch) diff --git a/core-kotlin/README.md b/core-kotlin/README.md index 7d8d5213d1..523f5b6e78 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -37,3 +37,5 @@ - [Kotlin with Ktor](https://www.baeldung.com/kotlin-ktor) - [Fuel HTTP Library with Kotlin](https://www.baeldung.com/kotlin-fuel) - [Introduction to Kovenant Library for Kotlin](https://www.baeldung.com/kotlin-kovenant) +- [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) +- [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings) diff --git a/hibernate5/README.md b/hibernate5/README.md index b90f885c78..fbf46eed50 100644 --- a/hibernate5/README.md +++ b/hibernate5/README.md @@ -16,3 +16,4 @@ - [Hibernate Entity Lifecycle](https://www.baeldung.com/hibernate-entity-lifecycle) - [Mapping A Hibernate Query to a Custom Class](https://www.baeldung.com/hibernate-query-to-custom-class) - [@JoinColumn Annotation Explained](https://www.baeldung.com/jpa-join-column) +- [Hibernate 5 Naming Strategy Configuration](https://www.baeldung.com/hibernate-naming-strategy) diff --git a/java-streams/README.md b/java-streams/README.md index 548d4b6a33..2550f08650 100644 --- a/java-streams/README.md +++ b/java-streams/README.md @@ -13,3 +13,4 @@ - [How to Iterate Over a Stream With Indices](http://www.baeldung.com/java-stream-indices) - [Primitive Type Streams in Java 8](http://www.baeldung.com/java-8-primitive-streams) - [Stream Ordering in Java](https://www.baeldung.com/java-stream-ordering) +- [Introduction to Protonpack](https://www.baeldung.com/java-protonpack) diff --git a/java-strings/README.md b/java-strings/README.md index b12fc75f30..ff833a5cda 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -31,3 +31,5 @@ - [Converting a Stack Trace to a String in Java](https://www.baeldung.com/java-stacktrace-to-string) - [Sorting a String Alphabetically in Java](https://www.baeldung.com/java-sort-string-alphabetically) - [Remove Emojis from a Java String](https://www.baeldung.com/java-string-remove-emojis) +- [String Not Empty Test Assertions in Java](https://www.baeldung.com/java-assert-string-not-empty) +- [String Performance Hints](https://www.baeldung.com/java-string-performance) diff --git a/libraries-security/README.md b/libraries-security/README.md new file mode 100644 index 0000000000..c42e91a888 --- /dev/null +++ b/libraries-security/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Guide to ScribeJava](https://www.baeldung.com/scribejava) diff --git a/libraries/README.md b/libraries/README.md index c2c4b2718a..fcf687d806 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -81,6 +81,8 @@ - [Guide to Resilience4j](http://www.baeldung.com/resilience4j) - [Parsing YAML with SnakeYAML](http://www.baeldung.com/java-snake-yaml) - [Guide to JMapper](http://www.baeldung.com/jmapper) +- [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3) +- [Exactly Once Processing in Kafka](https://www.baeldung.com/kafka-exactly-once) The libraries module contains examples related to small libraries that are relatively easy to use and does not require any separate module of its own. diff --git a/spring-5-mvc/README.md b/spring-5-mvc/README.md index 7e83077f54..fa9d48ab72 100644 --- a/spring-5-mvc/README.md +++ b/spring-5-mvc/README.md @@ -2,3 +2,4 @@ - [Spring Boot and Kotlin](http://www.baeldung.com/spring-boot-kotlin) - [Spring MVC Streaming and SSE Request Processing](https://www.baeldung.com/spring-mvc-sse-streams) - [Overview and Need for DelegatingFilterProxy in Spring](https://www.baeldung.com/spring-delegating-filter-proxy) +- [A Controller, Service and DAO Example with Spring Boot and JSF](https://www.baeldung.com/jsf-spring-boot-controller-service-dao) diff --git a/spring-boot-bootstrap/README.md b/spring-boot-bootstrap/README.md index 4b09f11714..08fdb1bdc9 100644 --- a/spring-boot-bootstrap/README.md +++ b/spring-boot-bootstrap/README.md @@ -3,3 +3,4 @@ - [Spring Boot Dependency Management with a Custom Parent](http://www.baeldung.com/spring-boot-dependency-management-custom-parent) - [Thin JARs with Spring Boot](http://www.baeldung.com/spring-boot-thin-jar) - [Deploying a Spring Boot Application to Cloud Foundry](https://www.baeldung.com/spring-boot-app-deploy-to-cloud-foundry) +- [Deploy a Spring Boot Application to Google App Engine](https://www.baeldung.com/spring-boot-google-app-engine) diff --git a/spring-cloud/README.md b/spring-cloud/README.md index 805052e4db..16bc2d110a 100644 --- a/spring-cloud/README.md +++ b/spring-cloud/README.md @@ -28,3 +28,5 @@ - [An Intro to Spring Cloud Task](http://www.baeldung.com/spring-cloud-task) - [Running Spring Boot Applications With Minikube](http://www.baeldung.com/spring-boot-minikube) - [Introduction to Netflix Archaius with Spring Cloud](https://www.baeldung.com/netflix-archaius-spring-cloud-integration) +- [An Intro to Spring Cloud Vault](https://www.baeldung.com/spring-cloud-vault) +- [Netflix Archaius with Various Database Configurations](https://www.baeldung.com/netflix-archaius-database-configurations) diff --git a/spring-core/README.md b/spring-core/README.md index c0577b4ebc..e5c359c11b 100644 --- a/spring-core/README.md +++ b/spring-core/README.md @@ -20,3 +20,5 @@ - [Controlling Bean Creation Order with @DependsOn Annotation](http://www.baeldung.com/spring-depends-on) - [Spring Autowiring of Generic Types](https://www.baeldung.com/spring-autowire-generics) - [Spring Application Context Events](https://www.baeldung.com/spring-context-events) +- [Unsatisfied Dependency in Spring](https://www.baeldung.com/spring-unsatisfied-dependency) +- [What is a Spring Bean?](https://www.baeldung.com/spring-bean) diff --git a/spring-data-jpa/README.md b/spring-data-jpa/README.md index 8817020eec..44ce240da3 100644 --- a/spring-data-jpa/README.md +++ b/spring-data-jpa/README.md @@ -14,6 +14,7 @@ - [Auditing with JPA, Hibernate, and Spring Data JPA](https://www.baeldung.com/database-auditing-jpa) - [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date) - [DDD Aggregates and @DomainEvents](https://www.baeldung.com/spring-data-ddd) +- [Spring Data – CrudRepository save() Method](https://www.baeldung.com/spring-data-crud-repository-save) ### Eclipse Config After importing the project into Eclipse, you may see the following error: diff --git a/spring-security-mvc-boot/README.MD b/spring-security-mvc-boot/README.MD index 6bd9b9295c..6f01bfdc65 100644 --- a/spring-security-mvc-boot/README.MD +++ b/spring-security-mvc-boot/README.MD @@ -11,3 +11,4 @@ The "REST With Spring" Classes: http://github.learnspringsecurity.com - [Granted Authority Versus Role in Spring Security](http://www.baeldung.com/spring-security-granted-authority-vs-role) - [Spring Data with Spring Security](https://www.baeldung.com/spring-data-security) - [Spring Security – Whitelist IP Range](https://www.baeldung.com/spring-security-whitelist-ip-range) +- [Find the Registered Spring Security Filters](https://www.baeldung.com/spring-security-registered-filters) diff --git a/testing-modules/spring-testing/README.md b/testing-modules/spring-testing/README.md index aed330d260..e22c3e84e7 100644 --- a/testing-modules/spring-testing/README.md +++ b/testing-modules/spring-testing/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: -* [Mockito.mock() vs @Mock vs @MockBean](http://www.baeldung.com/java-spring-mockito-mock-mockbean) +- [Mockito.mock() vs @Mock vs @MockBean](http://www.baeldung.com/java-spring-mockito-mock-mockbean) +- [A Quick Guide to @TestPropertySource](https://www.baeldung.com/spring-test-property-source) From ac8742cfff0f11b7e2b7f9fcae0f8a3bacaf71a3 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sat, 13 Oct 2018 01:47:27 +0300 Subject: [PATCH 097/546] fix MockitoJUnitRunner deprecated import --- .../calculator/NthRootCalculatorUnitTest.java | 6 +++--- .../app/rest/FlowerControllerUnitTest.java | 13 ++++++------ .../app/rest/MessageControllerUnitTest.java | 21 ++++++++++--------- .../creditcard/CreditCardEditorUnitTest.java | 5 +---- .../mockito/MockitoSpyIntegrationTest.java | 12 +++++------ .../mockito/MockitoVoidMethodsUnitTest.java | 18 +++++++++++----- 6 files changed, 41 insertions(+), 34 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java b/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java index 388bceef49..286dffb56a 100644 --- a/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java +++ b/core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java @@ -1,11 +1,11 @@ package com.baeldung.nth.root.calculator; +import static org.junit.Assert.assertEquals; + import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class NthRootCalculatorUnitTest { diff --git a/spring-mockito/src/test/java/com/baeldung/app/rest/FlowerControllerUnitTest.java b/spring-mockito/src/test/java/com/baeldung/app/rest/FlowerControllerUnitTest.java index f30af140af..aeec57d136 100644 --- a/spring-mockito/src/test/java/com/baeldung/app/rest/FlowerControllerUnitTest.java +++ b/spring-mockito/src/test/java/com/baeldung/app/rest/FlowerControllerUnitTest.java @@ -1,17 +1,18 @@ package com.baeldung.app.rest; -import com.baeldung.app.api.Flower; -import com.baeldung.domain.service.FlowerService; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.when; +import com.baeldung.app.api.Flower; +import com.baeldung.domain.service.FlowerService; @RunWith(MockitoJUnitRunner.class) public class FlowerControllerUnitTest { diff --git a/spring-mockito/src/test/java/com/baeldung/app/rest/MessageControllerUnitTest.java b/spring-mockito/src/test/java/com/baeldung/app/rest/MessageControllerUnitTest.java index e303c85caf..15e91d86b5 100644 --- a/spring-mockito/src/test/java/com/baeldung/app/rest/MessageControllerUnitTest.java +++ b/spring-mockito/src/test/java/com/baeldung/app/rest/MessageControllerUnitTest.java @@ -1,18 +1,19 @@ package com.baeldung.app.rest; +import static org.mockito.Mockito.times; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; + import com.baeldung.app.api.MessageApi; import com.baeldung.domain.model.Message; import com.baeldung.domain.service.MessageService; import com.baeldung.domain.util.MessageMatcher; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Matchers; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.mockito.Mockito.times; @RunWith(MockitoJUnitRunner.class) public class MessageControllerUnitTest { @@ -37,6 +38,6 @@ public class MessageControllerUnitTest { message.setTo("you"); message.setText("Hello, you!"); - Mockito.verify(messageService, times(1)).deliverMessage(Matchers.argThat(new MessageMatcher(message))); + Mockito.verify(messageService, times(1)).deliverMessage(ArgumentMatchers.argThat(new MessageMatcher(message))); } } diff --git a/spring-rest/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java b/spring-rest/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java index a84f866dfe..814efc112a 100644 --- a/spring-rest/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java +++ b/spring-rest/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java @@ -4,10 +4,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import com.baeldung.propertyeditor.creditcard.CreditCard; -import com.baeldung.propertyeditor.creditcard.CreditCardEditor; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class CreditCardEditorUnitTest { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoSpyIntegrationTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoSpyIntegrationTest.java index 206e0f4daf..118d50ea40 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoSpyIntegrationTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoSpyIntegrationTest.java @@ -1,15 +1,15 @@ package org.baeldung.mockito; +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class MockitoSpyIntegrationTest { diff --git a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVoidMethodsUnitTest.java b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVoidMethodsUnitTest.java index 49360f8d6c..b020338fd9 100644 --- a/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVoidMethodsUnitTest.java +++ b/testing-modules/mockito/src/test/java/org/baeldung/mockito/MockitoVoidMethodsUnitTest.java @@ -1,14 +1,22 @@ package org.baeldung.mockito; +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.isA; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doCallRealMethod; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.assertEquals; - -import static org.mockito.Mockito.*; import org.mockito.ArgumentCaptor; -import static org.mockito.Matchers.any; +import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; -import org.mockito.runners.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class MockitoVoidMethodsUnitTest { From 9a6ce97d4811916f3c6b0387eed50a4d88b0561e Mon Sep 17 00:00:00 2001 From: Chirag Dewan Date: Sat, 13 Oct 2018 11:24:04 +0530 Subject: [PATCH 098/546] BAEL-1708 Custom Types in Hibernate --- hibernate5/pom.xml | 7 +- .../com/baeldung/hibernate/HibernateUtil.java | 11 +- .../hibernate/customtypes/Address.java | 69 +++++++ .../hibernate/customtypes/AddressType.java | 169 ++++++++++++++++++ .../LocalDateStringJavaDescriptor.java | 51 ++++++ .../customtypes/LocalDateStringType.java | 34 ++++ .../hibernate/customtypes/OfficeEmployee.java | 88 +++++++++ .../hibernate/customtypes/PhoneNumber.java | 43 +++++ .../customtypes/PhoneNumberType.java | 98 ++++++++++ .../hibernate/customtypes/Salary.java | 39 ++++ .../customtypes/SalaryCurrencyConvertor.java | 15 ++ .../hibernate/customtypes/SalaryType.java | 161 +++++++++++++++++ .../HibernateCustomTypesUnitTest.java | 90 ++++++++++ .../hibernate-customtypes.properties | 10 ++ 14 files changed, 883 insertions(+), 2 deletions(-) create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java create mode 100644 hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java create mode 100644 hibernate5/src/test/resources/hibernate-customtypes.properties diff --git a/hibernate5/pom.xml b/hibernate5/pom.xml index 610c893bdc..748a106cca 100644 --- a/hibernate5/pom.xml +++ b/hibernate5/pom.xml @@ -44,6 +44,11 @@ mariaDB4j ${mariaDB4j.version} + + org.hibernate + hibernate-testing + 5.2.2.Final + @@ -57,7 +62,7 @@ - 5.3.2.Final + 5.3.6.Final 6.0.6 2.2.3 1.4.196 diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java b/hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java index 2212e736ab..e0d1de591b 100644 --- a/hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java +++ b/hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java @@ -5,6 +5,8 @@ import java.io.IOException; import java.net.URL; import java.util.Properties; +import com.baeldung.hibernate.customtypes.LocalDateStringType; +import com.baeldung.hibernate.customtypes.OfficeEmployee; import com.baeldung.hibernate.entities.DeptEmployee; import com.baeldung.hibernate.optimisticlocking.OptimisticLockingCourse; import com.baeldung.hibernate.optimisticlocking.OptimisticLockingStudent; @@ -18,8 +20,10 @@ import com.baeldung.hibernate.pojo.inheritance.*; import org.apache.commons.lang3.StringUtils; import org.hibernate.SessionFactory; import org.hibernate.boot.Metadata; +import org.hibernate.boot.MetadataBuilder; import org.hibernate.boot.MetadataSources; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import com.baeldung.hibernate.pojo.Course; @@ -66,6 +70,7 @@ public class HibernateUtil { private static SessionFactory makeSessionFactory(ServiceRegistry serviceRegistry) { MetadataSources metadataSources = new MetadataSources(serviceRegistry); + metadataSources.addPackage("com.baeldung.hibernate.pojo"); metadataSources.addAnnotatedClass(Employee.class); metadataSources.addAnnotatedClass(Phone.class); @@ -102,8 +107,12 @@ public class HibernateUtil { metadataSources.addAnnotatedClass(com.baeldung.hibernate.entities.Department.class); metadataSources.addAnnotatedClass(OptimisticLockingCourse.class); metadataSources.addAnnotatedClass(OptimisticLockingStudent.class); + metadataSources.addAnnotatedClass(OfficeEmployee.class); + + Metadata metadata = metadataSources.getMetadataBuilder() + .applyBasicType(LocalDateStringType.INSTANCE) + .build(); - Metadata metadata = metadataSources.buildMetadata(); return metadata.getSessionFactoryBuilder() .build(); diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java new file mode 100644 index 0000000000..d559e5a6c2 --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java @@ -0,0 +1,69 @@ +package com.baeldung.hibernate.customtypes; + +import java.util.Objects; + +public class Address { + + private String addressLine1; + private String addressLine2; + private String city; + private String country; + private int zipCode; + + public String getAddressLine1() { + return addressLine1; + } + + public String getAddressLine2() { + return addressLine2; + } + + public String getCity() { + return city; + } + + public String getCountry() { + return country; + } + + public int getZipCode() { + return zipCode; + } + + public void setAddressLine1(String addressLine1) { + this.addressLine1 = addressLine1; + } + + public void setAddressLine2(String addressLine2) { + this.addressLine2 = addressLine2; + } + + public void setCity(String city) { + this.city = city; + } + + public void setCountry(String country) { + this.country = country; + } + + public void setZipCode(int zipCode) { + this.zipCode = zipCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Address address = (Address) o; + return zipCode == address.zipCode && + Objects.equals(addressLine1, address.addressLine1) && + Objects.equals(addressLine2, address.addressLine2) && + Objects.equals(city, address.city) && + Objects.equals(country, address.country); + } + + @Override + public int hashCode() { + return Objects.hash(addressLine1, addressLine2, city, country, zipCode); + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java new file mode 100644 index 0000000000..c10c67df9a --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java @@ -0,0 +1,169 @@ +package com.baeldung.hibernate.customtypes; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.type.IntegerType; +import org.hibernate.type.StringType; +import org.hibernate.type.Type; +import org.hibernate.usertype.CompositeUserType; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.util.Objects; + +public class AddressType implements CompositeUserType { + + @Override + public String[] getPropertyNames() { + return new String[]{"addressLine1", "addressLine2", + "city", "country", "zipcode"}; + } + + @Override + public Type[] getPropertyTypes() { + return new Type[]{StringType.INSTANCE, StringType.INSTANCE, + StringType.INSTANCE, StringType.INSTANCE, IntegerType.INSTANCE}; + } + + @Override + public Object getPropertyValue(Object component, int property) throws HibernateException { + + Address empAdd = (Address) component; + + switch (property) { + case 0: + return empAdd.getAddressLine1(); + case 1: + return empAdd.getAddressLine2(); + case 2: + return empAdd.getCity(); + case 3: + return empAdd.getCountry(); + case 4: + return Integer.valueOf(empAdd.getZipCode()); + } + + throw new IllegalArgumentException(property + + " is an invalid property index for class type " + + component.getClass().getName()); + } + + @Override + public void setPropertyValue(Object component, int property, Object value) throws HibernateException { + + Address empAdd = (Address) component; + + switch (property) { + case 0: + empAdd.setAddressLine1((String) value); + case 1: + empAdd.setAddressLine2((String) value); + case 2: + empAdd.setCity((String) value); + case 3: + empAdd.setCountry((String) value); + case 4: + empAdd.setZipCode((Integer) value); + } + + throw new IllegalArgumentException(property + + " is an invalid property index for class type " + + component.getClass().getName()); + + } + + @Override + public Class returnedClass() { + return Address.class; + } + + @Override + public boolean equals(Object x, Object y) throws HibernateException { + if (x == y) + return true; + + if (Objects.isNull(x) || Objects.isNull(y)) + return false; + + return x.equals(y); + } + + @Override + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + @Override + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { + + Address empAdd = new Address(); + empAdd.setAddressLine1(rs.getString(names[0])); + + if (rs.wasNull()) + return null; + + empAdd.setAddressLine2(rs.getString(names[1])); + empAdd.setCity(rs.getString(names[2])); + empAdd.setCountry(rs.getString(names[3])); + empAdd.setZipCode(rs.getInt(names[4])); + + return empAdd; + } + + @Override + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + + if (Objects.isNull(value)) + st.setNull(index, Types.VARCHAR); + else { + + Address empAdd = (Address) value; + st.setString(index, empAdd.getAddressLine1()); + st.setString(index + 1, empAdd.getAddressLine2()); + st.setString(index + 2, empAdd.getCity()); + st.setString(index + 3, empAdd.getCountry()); + st.setInt(index + 4, empAdd.getZipCode()); + } + } + + @Override + public Object deepCopy(Object value) throws HibernateException { + + if (Objects.isNull(value)) + return null; + + Address oldEmpAdd = (Address) value; + Address newEmpAdd = new Address(); + + newEmpAdd.setAddressLine1(oldEmpAdd.getAddressLine1()); + newEmpAdd.setAddressLine2(oldEmpAdd.getAddressLine2()); + newEmpAdd.setCity(oldEmpAdd.getCity()); + newEmpAdd.setCountry(oldEmpAdd.getCountry()); + newEmpAdd.setZipCode(oldEmpAdd.getZipCode()); + + return newEmpAdd; + } + + @Override + public boolean isMutable() { + return true; + } + + @Override + public Serializable disassemble(Object value, SharedSessionContractImplementor session) throws HibernateException { + return (Serializable) deepCopy(value); + } + + @Override + public Object assemble(Serializable cached, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return deepCopy(cached); + } + + @Override + public Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return original; + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java new file mode 100644 index 0000000000..56be9e693f --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java @@ -0,0 +1,51 @@ +package com.baeldung.hibernate.customtypes; + +import org.hibernate.type.LocalDateType; +import org.hibernate.type.descriptor.WrapperOptions; +import org.hibernate.type.descriptor.java.AbstractTypeDescriptor; +import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; +import org.hibernate.type.descriptor.java.MutabilityPlan; + +import java.time.LocalDate; + +public class LocalDateStringJavaDescriptor extends AbstractTypeDescriptor { + + public static final LocalDateStringJavaDescriptor INSTANCE = new LocalDateStringJavaDescriptor(); + + public LocalDateStringJavaDescriptor() { + super(LocalDate.class, ImmutableMutabilityPlan.INSTANCE); + } + + @Override + public String toString(LocalDate value) { + return LocalDateType.FORMATTER.format(value); + } + + @Override + public LocalDate fromString(String string) { + return LocalDate.from(LocalDateType.FORMATTER.parse(string)); + } + + @Override + public X unwrap(LocalDate value, Class type, WrapperOptions options) { + + if (value == null) + return null; + + if (String.class.isAssignableFrom(type)) + return (X) LocalDateType.FORMATTER.format(value); + + throw unknownUnwrap(type); + } + + @Override + public LocalDate wrap(X value, WrapperOptions options) { + if (value == null) + return null; + + if(String.class.isInstance(value)) + return LocalDate.from(LocalDateType.FORMATTER.parse((CharSequence) value)); + + throw unknownWrap(value.getClass()); + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java new file mode 100644 index 0000000000..c8d37073e8 --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java @@ -0,0 +1,34 @@ +package com.baeldung.hibernate.customtypes; + +import org.hibernate.dialect.Dialect; +import org.hibernate.type.AbstractSingleColumnStandardBasicType; +import org.hibernate.type.DiscriminatorType; +import org.hibernate.type.descriptor.java.LocalDateJavaDescriptor; +import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; + +import java.time.LocalDate; + +public class LocalDateStringType extends AbstractSingleColumnStandardBasicType implements DiscriminatorType { + + public static final LocalDateStringType INSTANCE = new LocalDateStringType(); + + public LocalDateStringType() { + super(VarcharTypeDescriptor.INSTANCE, LocalDateStringJavaDescriptor.INSTANCE); + } + + @Override + public String getName() { + return "LocalDateString"; + } + + @Override + public LocalDate stringToObject(String xml) throws Exception { + return fromString(xml); + } + + @Override + public String objectToSQLString(LocalDate value, Dialect dialect) throws Exception { + return '\'' + toString(value) + '\''; + } + +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java new file mode 100644 index 0000000000..3ca06e4316 --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java @@ -0,0 +1,88 @@ +package com.baeldung.hibernate.customtypes; + +import com.baeldung.hibernate.pojo.Phone; +import org.hibernate.annotations.Columns; +import org.hibernate.annotations.Parameter; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import java.time.LocalDate; + +@TypeDef(name = "PhoneNumber", + typeClass = PhoneNumberType.class, + defaultForType = PhoneNumber.class) +@Entity +@Table(name = "OfficeEmployee") +public class OfficeEmployee { + + @Id + @GeneratedValue + private long id; + + @Column + @Type(type = "LocalDateString") + private LocalDate dateOfJoining; + + @Columns(columns = {@Column(name = "country_code"), + @Column(name = "city_code"), + @Column(name = "number")}) + private PhoneNumber employeeNumber; + + @Columns(columns = {@Column(name = "address_line_1"), + @Column(name = "address_line_2"), + @Column(name = "city"), @Column(name = "country"), + @Column(name = "zip_code")}) + @Type(type = "com.baeldung.hibernate.customtypes.AddressType") + private Address empAddress; + + @Type(type = "com.baeldung.hibernate.customtypes.SalaryType", + parameters = {@Parameter(name = "currency", value = "USD")}) + @Columns(columns = {@Column(name = "amount"), + @Column(name = "currency")}) + private Salary salary; + + public Salary getSalary() { + return salary; + } + + public void setSalary(Salary salary) { + this.salary = salary; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public LocalDate getDateOfJoining() { + return dateOfJoining; + } + + public void setDateOfJoining(LocalDate dateOfJoining) { + this.dateOfJoining = dateOfJoining; + } + + public PhoneNumber getEmployeeNumber() { + return employeeNumber; + } + + public void setEmployeeNumber(PhoneNumber employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public Address getEmpAddress() { + return empAddress; + } + + public void setEmpAddress(Address empAddress) { + this.empAddress = empAddress; + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java new file mode 100644 index 0000000000..0be6cbc910 --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java @@ -0,0 +1,43 @@ +package com.baeldung.hibernate.customtypes; + +import java.util.Objects; + +public final class PhoneNumber { + + private final int countryCode; + private final int cityCode; + private final int number; + + public PhoneNumber(int countryCode, int cityCode, int number) { + this.countryCode = countryCode; + this.cityCode = cityCode; + this.number = number; + } + + public int getCountryCode() { + return countryCode; + } + + public int getCityCode() { + return cityCode; + } + + public int getNumber() { + return number; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + PhoneNumber that = (PhoneNumber) o; + return countryCode == that.countryCode && + cityCode == that.cityCode && + number == that.number; + } + + @Override + public int hashCode() { + return Objects.hash(countryCode, cityCode, number); + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java new file mode 100644 index 0000000000..9f09352bec --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java @@ -0,0 +1,98 @@ +package com.baeldung.hibernate.customtypes; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.usertype.UserType; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.util.Objects; + + +public class PhoneNumberType implements UserType { + @Override + public int[] sqlTypes() { + return new int[]{Types.INTEGER, Types.INTEGER, Types.INTEGER}; + } + + @Override + public Class returnedClass() { + return PhoneNumber.class; + } + + @Override + public boolean equals(Object x, Object y) throws HibernateException { + if (x == y) + return true; + if (Objects.isNull(x) || Objects.isNull(y)) + return false; + + return x.equals(y); + } + + @Override + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + @Override + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { + int countryCode = rs.getInt(names[0]); + + if (rs.wasNull()) + return null; + + int cityCode = rs.getInt(names[1]); + int number = rs.getInt(names[2]); + PhoneNumber employeeNumber = new PhoneNumber(countryCode, cityCode, number); + + return employeeNumber; + } + + @Override + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + + if (Objects.isNull(value)) { + st.setNull(index, Types.INTEGER); + } else { + PhoneNumber employeeNumber = (PhoneNumber) value; + st.setInt(index,employeeNumber.getCountryCode()); + st.setInt(index+1,employeeNumber.getCityCode()); + st.setInt(index+2,employeeNumber.getNumber()); + } + } + + @Override + public Object deepCopy(Object value) throws HibernateException { + if (Objects.isNull(value)) + return null; + + PhoneNumber empNumber = (PhoneNumber) value; + PhoneNumber newEmpNumber = new PhoneNumber(empNumber.getCountryCode(),empNumber.getCityCode(),empNumber.getNumber()); + + return newEmpNumber; + } + + @Override + public boolean isMutable() { + return false; + } + + @Override + public Serializable disassemble(Object value) throws HibernateException { + return (Serializable) value; + } + + @Override + public Object assemble(Serializable cached, Object owner) throws HibernateException { + return cached; + } + + @Override + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return original; + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java new file mode 100644 index 0000000000..f9a7ac5902 --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java @@ -0,0 +1,39 @@ +package com.baeldung.hibernate.customtypes; + +import java.util.Objects; + +public class Salary { + + private Long amount; + private String currency; + + public Long getAmount() { + return amount; + } + + public void setAmount(Long amount) { + this.amount = amount; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Salary salary = (Salary) o; + return Objects.equals(amount, salary.amount) && + Objects.equals(currency, salary.currency); + } + + @Override + public int hashCode() { + return Objects.hash(amount, currency); + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java new file mode 100644 index 0000000000..340c697c11 --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java @@ -0,0 +1,15 @@ +package com.baeldung.hibernate.customtypes; + +public class SalaryCurrencyConvertor { + + public static Long convert(Long amount, String oldCurr, String newCurr){ + if (newCurr.equalsIgnoreCase(oldCurr)) + return amount; + + return convertTo(); + } + + private static Long convertTo() { + return 10L; + } +} diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java new file mode 100644 index 0000000000..266b85140b --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java @@ -0,0 +1,161 @@ +package com.baeldung.hibernate.customtypes; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.type.LongType; +import org.hibernate.type.StringType; +import org.hibernate.type.Type; +import org.hibernate.usertype.CompositeUserType; +import org.hibernate.usertype.DynamicParameterizedType; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.util.Objects; +import java.util.Properties; + +public class SalaryType implements CompositeUserType, DynamicParameterizedType { + + private String localCurrency; + + @Override + public String[] getPropertyNames() { + return new String[]{"amount", "currency"}; + } + + @Override + public Type[] getPropertyTypes() { + return new Type[]{LongType.INSTANCE, StringType.INSTANCE}; + } + + @Override + public Object getPropertyValue(Object component, int property) throws HibernateException { + + Salary salary = (Salary) component; + + switch (property) { + case 0: + return salary.getAmount(); + case 1: + return salary.getCurrency(); + } + + throw new IllegalArgumentException(property + + " is an invalid property index for class type " + + component.getClass().getName()); + + } + + + @Override + public void setPropertyValue(Object component, int property, Object value) throws HibernateException { + + Salary salary = (Salary) component; + + switch (property) { + case 0: + salary.setAmount((Long) value); + case 1: + salary.setCurrency((String) value); + } + + throw new IllegalArgumentException(property + + " is an invalid property index for class type " + + component.getClass().getName()); + + } + + @Override + public Class returnedClass() { + return Salary.class; + } + + @Override + public boolean equals(Object x, Object y) throws HibernateException { + + if (x == y) + return true; + + if (Objects.isNull(x) || Objects.isNull(y)) + return false; + + return x.equals(y); + + } + + @Override + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + @Override + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { + + Salary salary = new Salary(); + salary.setAmount(rs.getLong(names[0])); + + if (rs.wasNull()) + return null; + + salary.setCurrency(rs.getString(names[1])); + + return salary; + } + + @Override + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + + + if (Objects.isNull(value)) + st.setNull(index, Types.BIGINT); + else { + + Salary salary = (Salary) value; + st.setLong(index, SalaryCurrencyConvertor.convert(salary.getAmount(), + salary.getCurrency(), localCurrency)); + st.setString(index + 1, salary.getCurrency()); + } + } + + @Override + public Object deepCopy(Object value) throws HibernateException { + + if (Objects.isNull(value)) + return null; + + Salary oldSal = (Salary) value; + Salary newSal = new Salary(); + + newSal.setAmount(oldSal.getAmount()); + newSal.setCurrency(oldSal.getCurrency()); + + return newSal; + } + + @Override + public boolean isMutable() { + return true; + } + + @Override + public Serializable disassemble(Object value, SharedSessionContractImplementor session) throws HibernateException { + return (Serializable) deepCopy(value); + } + + @Override + public Object assemble(Serializable cached, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return deepCopy(cached); + } + + @Override + public Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return original; + } + + @Override + public void setParameterValues(Properties parameters) { + this.localCurrency = parameters.getProperty("currency"); + } +} diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java b/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java new file mode 100644 index 0000000000..f0179701df --- /dev/null +++ b/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java @@ -0,0 +1,90 @@ +package com.baeldung.hibernate.customtypes; + +import com.baeldung.hibernate.HibernateUtil; +import org.hibernate.SessionFactory; +import org.hibernate.query.Query; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.time.LocalDate; + +import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; + +public class HibernateCustomTypesUnitTest { + + @Test + public void givenEmployee_whenSavedWithCustomTypes_thenEntityIsSaved() throws IOException { + + final OfficeEmployee e = new OfficeEmployee(); + e.setDateOfJoining(LocalDate.now()); + + PhoneNumber number = new PhoneNumber(1, 222, 8781902); + e.setEmployeeNumber(number); + + Address empAdd = new Address(); + empAdd.setAddressLine1("Street"); + empAdd.setAddressLine2("Area"); + empAdd.setCity("City"); + empAdd.setCountry("Country"); + empAdd.setZipCode(100); + + e.setEmpAddress(empAdd); + + Salary empSalary = new Salary(); + empSalary.setAmount(1000L); + empSalary.setCurrency("USD"); + e.setSalary(empSalary); + + doInHibernate(this::sessionFactory, session -> { + session.save(e); + boolean contains = session.contains(e); + Assert.assertTrue(contains); + }); + + } + + @Test + public void givenEmployee_whenCustomTypeInQuery_thenReturnEntity() throws IOException { + + final OfficeEmployee e = new OfficeEmployee(); + e.setDateOfJoining(LocalDate.now()); + + PhoneNumber number = new PhoneNumber(1, 222, 8781902); + e.setEmployeeNumber(number); + + Address empAdd = new Address(); + empAdd.setAddressLine1("Street"); + empAdd.setAddressLine2("Area"); + empAdd.setCity("City"); + empAdd.setCountry("Country"); + empAdd.setZipCode(100); + e.setEmpAddress(empAdd); + + Salary empSalary = new Salary(); + empSalary.setAmount(1000L); + empSalary.setCurrency("USD"); + e.setSalary(empSalary); + + doInHibernate(this::sessionFactory, session -> { + session.save(e); + + Query query = session.createQuery("FROM OfficeEmployee OE WHERE OE.empAddress.zipcode = :pinCode"); + query.setParameter("pinCode",100); + int size = query.list().size(); + + Assert.assertEquals(1, size); + }); + + } + + private SessionFactory sessionFactory() { + try { + return HibernateUtil.getSessionFactory("hibernate-customtypes.properties"); + } catch (IOException e) { + e.printStackTrace(); + } + + return null; + } +} diff --git a/hibernate5/src/test/resources/hibernate-customtypes.properties b/hibernate5/src/test/resources/hibernate-customtypes.properties new file mode 100644 index 0000000000..345f3d37b0 --- /dev/null +++ b/hibernate5/src/test/resources/hibernate-customtypes.properties @@ -0,0 +1,10 @@ +hibernate.connection.driver_class=org.postgresql.Driver +hibernate.connection.url=jdbc:postgresql://localhost:5432/test +hibernate.connection.username=postgres +hibernate.connection.password=thule +hibernate.connection.autocommit=true +jdbc.password=thule + +hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect +hibernate.show_sql=true +hibernate.hbm2ddl.auto=create-drop \ No newline at end of file From 435af770b3a7538cb7debee70628aa64520546b9 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Sat, 13 Oct 2018 13:04:22 +0200 Subject: [PATCH 099/546] BAEL-2259 - Guide to EnumSet (#5423) * EnumSet * enumset operations * formatting --- .../java/com/baeldung/enumset/EnumSets.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 core-java-collections/src/main/java/com/baeldung/enumset/EnumSets.java diff --git a/core-java-collections/src/main/java/com/baeldung/enumset/EnumSets.java b/core-java-collections/src/main/java/com/baeldung/enumset/EnumSets.java new file mode 100644 index 0000000000..7b93ed8737 --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/enumset/EnumSets.java @@ -0,0 +1,45 @@ +package com.baeldung.enumset; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; + +public class EnumSets { + + public enum Color { + RED, YELLOW, GREEN, BLUE, BLACK, WHITE + } + + public static void main(String[] args) { + EnumSet allColors = EnumSet.allOf(Color.class); + System.out.println(allColors); + + EnumSet noColors = EnumSet.noneOf(Color.class); + System.out.println(noColors); + + EnumSet blackAndWhite = EnumSet.of(Color.BLACK, Color.WHITE); + System.out.println(blackAndWhite); + + EnumSet noBlackOrWhite = EnumSet.complementOf(blackAndWhite); + System.out.println(noBlackOrWhite); + + EnumSet range = EnumSet.range(Color.YELLOW, Color.BLUE); + System.out.println(range); + + EnumSet blackAndWhiteCopy = EnumSet.copyOf(EnumSet.of(Color.BLACK, Color.WHITE)); + System.out.println(blackAndWhiteCopy); + + List colorsList = new ArrayList<>(); + colorsList.add(Color.RED); + EnumSet listCopy = EnumSet.copyOf(colorsList); + System.out.println(listCopy); + + EnumSet set = EnumSet.noneOf(Color.class); + set.add(Color.RED); + set.add(Color.YELLOW); + set.contains(Color.RED); + set.forEach(System.out::println); + set.remove(Color.RED); + } + +} From 03e0627cffc0e8b674f0050951eebddeb5c2664f Mon Sep 17 00:00:00 2001 From: Kuba Date: Sat, 13 Oct 2018 17:02:22 +0200 Subject: [PATCH 100/546] BAEL-2200 Sample application for auto-configuration report. (#5335) * BAEL-2200 Sample application for auto-configuration report. * BAEL-2200 Sample application for auto-configuration report fixes. * Fix formatting. --- .../auto/configuration/AutoConfigurationDemo.java | 14 ++++++++++++++ .../src/main/resources/application.properties | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java diff --git a/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java b/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java new file mode 100644 index 0000000000..87a191554b --- /dev/null +++ b/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java @@ -0,0 +1,14 @@ +package com.baeldung.h2db.auto.configuration; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication(scanBasePackages = "com.baeldung.h2db.auto-configuration") +public class AutoConfigurationDemo { + + public static void main(String[] args) { + SpringApplication.run(AutoConfigurationDemo.class, args); + } + +} diff --git a/spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties b/spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties index 0591cc9e0f..5e425a3550 100644 --- a/spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties +++ b/spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties @@ -4,4 +4,5 @@ spring.datasource.username=sa spring.datasource.password= spring.jpa.hibernate.ddl-auto=create spring.h2.console.enabled=true -spring.h2.console.path=/h2-console \ No newline at end of file +spring.h2.console.path=/h2-console +debug=true \ No newline at end of file From b3a6a60100be49fea9925d1c17e8c02b5ff49119 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 13 Oct 2018 19:15:02 +0300 Subject: [PATCH 101/546] add txt files for zip --- core-java-io/src/main/resources/zipTest/test1.txt | 1 + core-java-io/src/main/resources/zipTest/test2.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 core-java-io/src/main/resources/zipTest/test1.txt create mode 100644 core-java-io/src/main/resources/zipTest/test2.txt diff --git a/core-java-io/src/main/resources/zipTest/test1.txt b/core-java-io/src/main/resources/zipTest/test1.txt new file mode 100644 index 0000000000..e88ded96ab --- /dev/null +++ b/core-java-io/src/main/resources/zipTest/test1.txt @@ -0,0 +1 @@ +Test1 \ No newline at end of file diff --git a/core-java-io/src/main/resources/zipTest/test2.txt b/core-java-io/src/main/resources/zipTest/test2.txt new file mode 100644 index 0000000000..da8f209890 --- /dev/null +++ b/core-java-io/src/main/resources/zipTest/test2.txt @@ -0,0 +1 @@ +Test2 \ No newline at end of file From c315ce5975b1c0e719e580a1e03e3ff7abe78396 Mon Sep 17 00:00:00 2001 From: Alfonso Lentini Date: Sat, 13 Oct 2018 18:36:01 +0200 Subject: [PATCH 102/546] new coroutone API Koltin version 1.3-RC --- .../kotlin/com/baeldung/filter/SliceTest.kt | 16 +++---- .../com/baeldung/fuel/FuelHttpUnitTest.kt | 48 +++++++------------ .../com/baeldung/kotlin/CoroutinesUnitTest.kt | 9 ++-- .../com/baeldung/thread/CoroutineUnitTest.kt | 39 +++++---------- parent-kotlin/pom.xml | 21 +++++++- 5 files changed, 61 insertions(+), 72 deletions(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt index dca167928d..db2bfed947 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt @@ -24,14 +24,14 @@ internal class SliceTest { assertIterableEquals(expected, actual) } - @Test - fun whenSlicingBeyondTheRangeOfTheArray_thenContainManyNulls() { - val original = arrayOf(12, 3, 34, 4) - val actual = original.slice(3..8) - val expected = listOf(4, null, null, null, null, null) - - assertIterableEquals(expected, actual) - } +// @Test +// fun whenSlicingBeyondTheRangeOfTheArray_thenContainManyNulls() { +// val original = arrayOf(12, 3, 34, 4) +// val actual = original.slice(3..8) +// val expected = listOf(4, null, null, null, null, null) +// +// assertIterableEquals(expected, actual) +// } @Test fun whenSlicingBeyondRangeOfArrayWithStep_thenOutOfBoundsException() { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt index f0f9267618..74b2dd9fa1 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt @@ -1,16 +1,12 @@ package com.baeldung.fuel -import awaitObjectResult -import awaitStringResponse import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.core.FuelManager -import com.github.kittinunf.fuel.core.Request import com.github.kittinunf.fuel.core.interceptors.cUrlLoggingRequestInterceptor import com.github.kittinunf.fuel.gson.responseObject import com.github.kittinunf.fuel.httpGet import com.github.kittinunf.fuel.rx.rx_object import com.google.gson.Gson -import kotlinx.coroutines.experimental.runBlocking import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import java.io.File @@ -226,32 +222,24 @@ internal class FuelHttpUnitTest { } - @Test - fun whenMakeGETRequestUsingCoroutines_thenResponseStatusCode200() { - - runBlocking { - val (request, response, result) = Fuel.get("http://httpbin.org/get").awaitStringResponse() - - result.fold({ data -> - Assertions.assertEquals(200, response.statusCode) - - }, { error -> }) - } - - } - - @Test - fun whenMakeGETRequestUsingCoroutines_thenDeserializeResponse() { - - - runBlocking { - Fuel.get("https://jsonplaceholder.typicode.com/posts?id=1").awaitObjectResult(Post.Deserializer()) - .fold({ data -> - Assertions.assertEquals(1, data.get(0).userId) - }, { error -> }) - } - - } +// @Test +// fun whenMakeGETRequestUsingCoroutines_thenResponseStatusCode200() = runBlocking { +// val (request, response, result) = Fuel.get("http://httpbin.org/get").awaitStringResponse() +// +// result.fold({ data -> +// Assertions.assertEquals(200, response.statusCode) +// +// }, { error -> }) +// } +// +// +// @Test +// fun whenMakeGETRequestUsingCoroutines_thenDeserializeResponse() = runBlocking { +// Fuel.get("https://jsonplaceholder.typicode.com/posts?id=1").awaitObjectResult(Post.Deserializer()) +// .fold({ data -> +// Assertions.assertEquals(1, data.get(0).userId) +// }, { error -> }) +// } @Test fun whenMakeGETPostRequestUsingRoutingAPI_thenDeserializeResponse() { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt index d724933654..b6f28a4903 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt @@ -1,9 +1,8 @@ package com.baeldung.kotlin -import kotlinx.coroutines.experimental.* +import kotlinx.coroutines.* import org.junit.Test import java.util.concurrent.atomic.AtomicInteger -import kotlin.coroutines.experimental.buildSequence import kotlin.system.measureTimeMillis import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -14,7 +13,7 @@ class CoroutinesTest { @Test fun givenBuildSequence_whenTakeNElements_thenShouldReturnItInALazyWay() { //given - val fibonacciSeq = buildSequence { + val fibonacciSeq = sequence { var a = 0 var b = 1 @@ -39,7 +38,7 @@ class CoroutinesTest { @Test fun givenLazySeq_whenTakeNElements_thenShouldReturnAllElements() { //given - val lazySeq = buildSequence { + val lazySeq = sequence { print("START ") for (i in 1..5) { yield(i) @@ -60,7 +59,7 @@ class CoroutinesTest { val res = mutableListOf() //when - runBlocking { + runBlocking { val promise = launch(CommonPool) { expensiveComputation(res) } res.add("Hello,") promise.join() diff --git a/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt index 215fa6710f..f87409253f 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt @@ -1,68 +1,53 @@ package com.baeldung.thread -import kotlinx.coroutines.experimental.* +import kotlinx.coroutines.* import org.junit.jupiter.api.Test class CoroutineUnitTest { @Test - fun whenCreateLaunchCoroutineWithoutContext_thenRun() { + fun whenCreateCoroutineWithLaunchWithoutContext_thenRun() = runBlocking { val job = launch { println("${Thread.currentThread()} has run.") } - runBlocking { - job.join() - } } @Test - fun whenCreateLaunchCoroutineWithDefaultContext_thenRun() { + fun whenCreateCoroutineWithLaunchWithDefaultContext_thenRun() = runBlocking { - val job = launch(DefaultDispatcher) { + val job = launch(Dispatchers.Default) { println("${Thread.currentThread()} has run.") } - - runBlocking { - job.join() - } } @Test - fun whenCreateLaunchCoroutineWithUnconfinedContext_thenRun() { + fun whenCreateCoroutineWithLaunchWithUnconfinedContext_thenRun() = runBlocking { - val job = launch(Unconfined) { + val job = launch(Dispatchers.Unconfined) { println("${Thread.currentThread()} has run.") } - - runBlocking { - job.join() - } } @Test - fun whenCreateLaunchCoroutineWithDedicatedThread_thenRun() { + fun whenCreateCoroutineWithLaunchWithDedicatedThread_thenRun() = runBlocking { val job = launch(newSingleThreadContext("dedicatedThread")) { println("${Thread.currentThread()} has run.") } - runBlocking { - job.join() - } } @Test - fun whenCreateAsyncCoroutine_thenRun() { + fun whenCreateAsyncCoroutine_thenRun() = runBlocking { - val deferred = async(Unconfined) { + val deferred = async(Dispatchers.IO) { return@async "${Thread.currentThread()} has run." } - runBlocking { - val result = deferred.await() - println(result) - } + + val result = deferred.await() + println(result) } } \ No newline at end of file diff --git a/parent-kotlin/pom.xml b/parent-kotlin/pom.xml index 7fd18e4fa4..0a04da7dc2 100644 --- a/parent-kotlin/pom.xml +++ b/parent-kotlin/pom.xml @@ -22,7 +22,18 @@ kotlin-ktor https://dl.bintray.com/kotlin/ktor/ + + kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap +
+ + + + kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap + + @@ -42,6 +53,11 @@ kotlin-stdlib-jdk8 ${kotlin.version} + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + org.jetbrains.kotlin kotlin-reflect @@ -157,6 +173,7 @@ + org.apache.maven.plugins maven-failsafe-plugin ${maven-failsafe-plugin.version} @@ -185,8 +202,8 @@ - 1.2.61 - 0.25.0 + 1.3.0-rc-146 + 0.26.1-eap13 0.9.3 3.11.0 1.2.0 From ca4b6200a74a860fc0c4cc26a47c15215584d70c Mon Sep 17 00:00:00 2001 From: Jonathan Cook Date: Sat, 13 Oct 2018 20:19:14 +0200 Subject: [PATCH 103/546] BAEL-2268 - Guide to JerseyTest (#5443) * BAEL-2268 - Guide to JerseyTest - second attempt without formatting changes * BAEL-2268 - Guide to JerseyTest - Add line break to end of file --- .../baeldung/jersey/server/model/Fruit.java | 5 +++ .../jersey/server/rest/FruitResource.java | 12 +++++++ .../GreetingsResourceIntegrationTest.java | 33 +++++++++++++++++++ .../rest/FruitResourceIntegrationTest.java | 27 +++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 jersey/src/test/java/com/baeldung/jersey/server/GreetingsResourceIntegrationTest.java diff --git a/jersey/src/main/java/com/baeldung/jersey/server/model/Fruit.java b/jersey/src/main/java/com/baeldung/jersey/server/model/Fruit.java index c55362487b..1a648290a3 100644 --- a/jersey/src/main/java/com/baeldung/jersey/server/model/Fruit.java +++ b/jersey/src/main/java/com/baeldung/jersey/server/model/Fruit.java @@ -54,4 +54,9 @@ public class Fruit { public void setSerial(String serial) { this.serial = serial; } + + @Override + public String toString() { + return "Fruit [name: " + getName() + " colour: " + getColour() + "]"; + } } diff --git a/jersey/src/main/java/com/baeldung/jersey/server/rest/FruitResource.java b/jersey/src/main/java/com/baeldung/jersey/server/rest/FruitResource.java index ee34cdd3ca..88692dcc55 100644 --- a/jersey/src/main/java/com/baeldung/jersey/server/rest/FruitResource.java +++ b/jersey/src/main/java/com/baeldung/jersey/server/rest/FruitResource.java @@ -16,6 +16,8 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; import org.glassfish.jersey.server.mvc.ErrorTemplate; import org.glassfish.jersey.server.mvc.Template; @@ -86,6 +88,16 @@ public class FruitResource { public void createFruit(@Valid Fruit fruit) { SimpleStorageService.storeFruit(fruit); } + + @POST + @Path("/created") + @Consumes(MediaType.APPLICATION_JSON) + public Response createNewFruit(@Valid Fruit fruit) { + String result = "Fruit saved : " + fruit; + return Response.status(Status.CREATED.getStatusCode()) + .entity(result) + .build(); + } @GET @Valid diff --git a/jersey/src/test/java/com/baeldung/jersey/server/GreetingsResourceIntegrationTest.java b/jersey/src/test/java/com/baeldung/jersey/server/GreetingsResourceIntegrationTest.java new file mode 100644 index 0000000000..8953f4161c --- /dev/null +++ b/jersey/src/test/java/com/baeldung/jersey/server/GreetingsResourceIntegrationTest.java @@ -0,0 +1,33 @@ +package com.baeldung.jersey.server; + +import static org.junit.Assert.assertEquals; + +import javax.ws.rs.core.Application; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.junit.Test; + +public class GreetingsResourceIntegrationTest extends JerseyTest { + + @Override + protected Application configure() { + return new ResourceConfig(Greetings.class); + } + + @Test + public void givenGetHiGreeting_whenCorrectRequest_thenResponseIsOkAndContainsHi() { + Response response = target("/greetings/hi").request() + .get(); + + assertEquals("Http Response should be 200: ", Status.OK.getStatusCode(), response.getStatus()); + assertEquals("Http Content-Type should be: ", MediaType.TEXT_HTML, response.getHeaderString(HttpHeaders.CONTENT_TYPE)); + + String content = response.readEntity(String.class); + assertEquals("Content of ressponse is: ", "hi", content); + } +} diff --git a/jersey/src/test/java/com/baeldung/jersey/server/rest/FruitResourceIntegrationTest.java b/jersey/src/test/java/com/baeldung/jersey/server/rest/FruitResourceIntegrationTest.java index 2eeb5710cb..376c8c1e75 100644 --- a/jersey/src/test/java/com/baeldung/jersey/server/rest/FruitResourceIntegrationTest.java +++ b/jersey/src/test/java/com/baeldung/jersey/server/rest/FruitResourceIntegrationTest.java @@ -10,6 +10,7 @@ import javax.ws.rs.core.Application; import javax.ws.rs.core.Form; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; import org.glassfish.jersey.test.JerseyTest; import org.glassfish.jersey.test.TestProperties; @@ -63,6 +64,15 @@ public class FruitResourceIntegrationTest extends JerseyTest { assertEquals("Http Response should be 400 ", 400, response.getStatus()); assertThat(response.readEntity(String.class), containsString("Fruit colour must not be null")); } + + @Test + public void givenCreateFruit_whenJsonIsCorrect_thenResponseCodeIsCreated() { + Response response = target("fruit/created").request() + .post(Entity.json("{\"name\":\"strawberry\",\"weight\":20}")); + + assertEquals("Http Response should be 201 ", Status.CREATED.getStatusCode(), response.getStatus()); + assertThat(response.readEntity(String.class), containsString("Fruit saved : Fruit [name: strawberry colour: null]")); + } @Test public void givenUpdateFruit_whenFormContainsBadSerialParam_thenResponseCodeIsBadRequest() { @@ -102,6 +112,23 @@ public class FruitResourceIntegrationTest extends JerseyTest { .get(String.class); assertThat(json, containsString("{\"name\":\"strawberry\",\"weight\":20}")); } + + @Test + public void givenFruitExists_whenSearching_thenResponseContainsFruitEntity() { + Fruit fruit = new Fruit(); + fruit.setName("strawberry"); + fruit.setWeight(20); + Response response = target("fruit/create").request(MediaType.APPLICATION_JSON_TYPE) + .post(Entity.entity(fruit, MediaType.APPLICATION_JSON_TYPE)); + + assertEquals("Http Response should be 204 ", 204, response.getStatus()); + + final Fruit entity = target("fruit/search/strawberry").request() + .get(Fruit.class); + + assertEquals("Fruit name: ", "strawberry", entity.getName()); + assertEquals("Fruit weight: ", Integer.valueOf(20), entity.getWeight()); + } @Test public void givenFruit_whenFruitIsInvalid_thenReponseContainsCustomExceptions() { From 1820b2c37ff5d2167e34edd3d67754b3189226c2 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 13 Oct 2018 16:29:52 +0530 Subject: [PATCH 104/546] [BAEL-9514] - Added Junit 5 @DisplayName annotation example --- .../customtestname/CustomNameUnitTest.java | 17 +++++++ .../ParameterizedUnitTest.java | 48 +++++++++++++++++++ .../suite/SelectClassesSuiteUnitTest.java | 13 +++++ .../suite/SelectPackagesSuiteUnitTest.java | 11 +++++ .../suite/childpackage1/Class1UnitTest.java | 15 ++++++ .../suite/childpackage2/Class2UnitTest.java | 14 ++++++ 6 files changed, 118 insertions(+) create mode 100644 core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java create mode 100644 core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java create mode 100644 core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java create mode 100644 core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java create mode 100644 core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java create mode 100644 core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java b/core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java new file mode 100644 index 0000000000..f04b825c89 --- /dev/null +++ b/core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java @@ -0,0 +1,17 @@ +package org.baeldung.java.customtestname; + +import static org.junit.Assert.assertNotNull; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +public class CustomNameUnitTest { + + @ParameterizedTest + @ValueSource(strings = { "Hello", "World" }) + @DisplayName("Test Method to check that the inputs are not nullable") + void givenString_TestNullOrNot(String word) { + assertNotNull(word); + } +} diff --git a/core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java b/core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java new file mode 100644 index 0000000000..af9ad870b9 --- /dev/null +++ b/core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java @@ -0,0 +1,48 @@ +package org.baeldung.java.parameterisedsource; + +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.EnumSet; +import java.util.stream.Stream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; + +import com.baeldung.enums.PizzaDeliveryStrategy; + +public class ParameterizedUnitTest { + + @ParameterizedTest + @ValueSource(strings = { "Hello", "World" }) + void givenString_TestNullOrNot(String word) { + assertNotNull(word); + } + + @ParameterizedTest + @EnumSource(value = PizzaDeliveryStrategy.class, names = {"EXPRESS", "NORMAL"}) + void givenEnum_TestContainsOrNot(PizzaDeliveryStrategy timeUnit) { + assertTrue(EnumSet.of(PizzaDeliveryStrategy.EXPRESS, PizzaDeliveryStrategy.NORMAL).contains(timeUnit)); + } + + @ParameterizedTest + @MethodSource("wordDataProvider") + void givenMethodSource_TestInputStream(String argument) { + assertNotNull(argument); + } + + static Stream wordDataProvider() { + return Stream.of("foo", "bar"); + } + + @ParameterizedTest + @CsvSource({ "1, Car", "2, House", "3, Train" }) + void givenCSVSource_TestContent(int id, String word) { + assertNotNull(id); + assertNotNull(word); + } +} diff --git a/core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java new file mode 100644 index 0000000000..220897eae7 --- /dev/null +++ b/core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java @@ -0,0 +1,13 @@ +package org.baeldung.java.suite; + +import org.baeldung.java.suite.childpackage1.Class1UnitTest; +import org.baeldung.java.suite.childpackage2.Class2UnitTest; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.runner.RunWith; + +@RunWith(JUnitPlatform.class) +@SelectClasses({Class1UnitTest.class, Class2UnitTest.class}) +public class SelectClassesSuiteUnitTest { + +} diff --git a/core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java new file mode 100644 index 0000000000..ae887ae43b --- /dev/null +++ b/core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java @@ -0,0 +1,11 @@ +package org.baeldung.java.suite; + +import org.junit.platform.runner.JUnitPlatform; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.runner.RunWith; + +@RunWith(JUnitPlatform.class) +@SelectPackages({ "org.baeldung.java.suite.childpackage1", "org.baeldung.java.suite.childpackage2" }) +public class SelectPackagesSuiteUnitTest { + +} diff --git a/core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java new file mode 100644 index 0000000000..78469cb971 --- /dev/null +++ b/core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java @@ -0,0 +1,15 @@ +package org.baeldung.java.suite.childpackage1; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.Test; + + +public class Class1UnitTest { + + @Test + public void testCase_InClass1UnitTest() { + assertTrue(true); + } + +} diff --git a/core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java new file mode 100644 index 0000000000..4463ecfad9 --- /dev/null +++ b/core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java @@ -0,0 +1,14 @@ +package org.baeldung.java.suite.childpackage2; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.Test; + +public class Class2UnitTest { + + @Test + public void testCase_InClass2UnitTest() { + assertTrue(true); + } + +} From c9f2162f984a2f36f91406c1d2b9fa431b53fad3 Mon Sep 17 00:00:00 2001 From: Shreyash Date: Sun, 14 Oct 2018 11:34:09 +0530 Subject: [PATCH 105/546] Spring Data Reactive Redis examples Issue: BAEL-1868 --- .../log4j2/${sys:logging.folder.path} | 0 persistence-modules/spring-data-redis/pom.xml | 87 +++++++++++-------- .../redis/SpringRedisReactiveApplication.java | 13 +++ .../reactive/redis/config/RedisConfig.java | 56 ++++++++++++ .../data/reactive/redis/model/Employee.java | 21 +++++ .../spring/data/redis/config/RedisConfig.java | 8 +- .../RedisKeyCommandsIntegrationTest.java | 51 +++++++++++ .../RedisTemplateListOpsIntegrationTest.java | 49 +++++++++++ .../RedisTemplateValueOpsIntegrationTest.java | 71 +++++++++++++++ .../RedisMessageListenerIntegrationTest.java | 2 +- .../StudentRepositoryIntegrationTest.java | 2 +- pom.xml | 1 + 12 files changed, 318 insertions(+), 43 deletions(-) create mode 100755 logging-modules/log4j2/${sys:logging.folder.path} create mode 100644 persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/SpringRedisReactiveApplication.java create mode 100644 persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/config/RedisConfig.java create mode 100644 persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/model/Employee.java create mode 100644 persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisKeyCommandsIntegrationTest.java create mode 100644 persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateListOpsIntegrationTest.java create mode 100644 persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateValueOpsIntegrationTest.java diff --git a/logging-modules/log4j2/${sys:logging.folder.path} b/logging-modules/log4j2/${sys:logging.folder.path} new file mode 100755 index 0000000000..e69de29bb2 diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index 5981bf41e0..bee3d683b8 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -7,17 +7,61 @@ jar + parent-boot-2 com.baeldung - parent-spring-5 0.0.1-SNAPSHOT - ../../parent-spring-5 + ../../parent-boot-2 - org.springframework.data - spring-data-redis - ${spring-data-redis} + org.springframework.boot + spring-boot-starter-data-redis-reactive + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + + + io.projectreactor + reactor-test + test + + + + org.springframework + spring-test + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.junit.jupiter + junit-jupiter-api + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.platform + junit-platform-surefire-provider + ${junit.platform.version} + test + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test @@ -33,42 +77,12 @@ jar - - org.springframework - spring-core - ${spring.version} - - - commons-logging - commons-logging - - - - - - org.springframework - spring-context - ${spring.version} - - - - org.springframework - spring-test - ${spring.version} - test - - com.lordofthejars nosqlunit-redis ${nosqlunit.version} - - org.springframework.data - spring-data-commons - ${spring-data-commons.version} - com.github.kstyrc embedded-redis @@ -77,12 +91,13 @@ - 2.0.3.RELEASE 3.2.4 2.9.0 0.10.0 2.0.3.RELEASE 0.6 + 1.0.0 + 5.0.2 diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/SpringRedisReactiveApplication.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/SpringRedisReactiveApplication.java new file mode 100644 index 0000000000..8b1f892f67 --- /dev/null +++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/SpringRedisReactiveApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.spring.data.reactive.redis; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringRedisReactiveApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringRedisReactiveApplication.class, args); + } + +} diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/config/RedisConfig.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/config/RedisConfig.java new file mode 100644 index 0000000000..d23d0092eb --- /dev/null +++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/config/RedisConfig.java @@ -0,0 +1,56 @@ +package com.baeldung.spring.data.reactive.redis.config; + + +import com.baeldung.spring.data.reactive.redis.model.Employee; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.ReactiveKeyCommands; +import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; +import org.springframework.data.redis.connection.ReactiveStringCommands; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.ReactiveRedisTemplate; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializationContext; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +import javax.annotation.PreDestroy; + +@Configuration +public class RedisConfig { + + @Autowired + RedisConnectionFactory factory; + + @Bean + public ReactiveRedisTemplate reactiveRedisTemplate(ReactiveRedisConnectionFactory factory) { + Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer<>(Employee.class); + RedisSerializationContext.RedisSerializationContextBuilder builder = RedisSerializationContext.newSerializationContext(new StringRedisSerializer()); + RedisSerializationContext context = builder.value(serializer) + .build(); + return new ReactiveRedisTemplate<>(factory, context); + } + + @Bean + public ReactiveRedisTemplate reactiveRedisTemplateString(ReactiveRedisConnectionFactory connectionFactory) { + return new ReactiveRedisTemplate<>(connectionFactory, RedisSerializationContext.string()); + } + + @Bean + public ReactiveKeyCommands keyCommands(final ReactiveRedisConnectionFactory reactiveRedisConnectionFactory) { + return reactiveRedisConnectionFactory.getReactiveConnection() + .keyCommands(); + } + + @Bean + public ReactiveStringCommands stringCommands(final ReactiveRedisConnectionFactory reactiveRedisConnectionFactory) { + return reactiveRedisConnectionFactory.getReactiveConnection() + .stringCommands(); + } + + @PreDestroy + public void cleanRedis() { + factory.getConnection() + .flushDb(); + } +} diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/model/Employee.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/model/Employee.java new file mode 100644 index 0000000000..9178f6e112 --- /dev/null +++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/reactive/redis/model/Employee.java @@ -0,0 +1,21 @@ +package com.baeldung.spring.data.reactive.redis.model; + +import java.io.Serializable; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@Data +@ToString +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode +public class Employee implements Serializable { + private static final long serialVersionUID = 1603714798906422731L; + private String id; + private String name; + private String department; +} diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java index 62a7886f46..6fdb3c5bef 100644 --- a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java +++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java @@ -1,6 +1,8 @@ package com.baeldung.spring.data.redis.config; -import org.springframework.beans.factory.annotation.Value; +import com.baeldung.spring.data.redis.queue.MessagePublisher; +import com.baeldung.spring.data.redis.queue.RedisMessagePublisher; +import com.baeldung.spring.data.redis.queue.RedisMessageSubscriber; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -13,10 +15,6 @@ import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; import org.springframework.data.redis.serializer.GenericToStringSerializer; -import com.baeldung.spring.data.redis.queue.MessagePublisher; -import com.baeldung.spring.data.redis.queue.RedisMessagePublisher; -import com.baeldung.spring.data.redis.queue.RedisMessageSubscriber; - @Configuration @ComponentScan("com.baeldung.spring.data.redis") @EnableRedisRepositories(basePackages = "com.baeldung.spring.data.redis.repo") diff --git a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisKeyCommandsIntegrationTest.java b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisKeyCommandsIntegrationTest.java new file mode 100644 index 0000000000..e48aa1e06a --- /dev/null +++ b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisKeyCommandsIntegrationTest.java @@ -0,0 +1,51 @@ +package com.baeldung.spring.data.reactive.redis.template; + + +import com.baeldung.spring.data.reactive.redis.SpringRedisReactiveApplication; +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.data.redis.connection.ReactiveKeyCommands; +import org.springframework.data.redis.connection.ReactiveStringCommands; +import org.springframework.data.redis.connection.ReactiveStringCommands.SetCommand; +import org.springframework.test.context.junit4.SpringRunner; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.nio.ByteBuffer; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringRedisReactiveApplication.class) +public class RedisKeyCommandsIntegrationTest { + + @Autowired + private ReactiveKeyCommands keyCommands; + + @Autowired + private ReactiveStringCommands stringCommands; + + @Test + public void givenFluxOfKeys_whenPerformOperations_thenPerformOperations() { + Flux keys = Flux.just("key1", "key2", "key3", "key4"); + + Flux generator = keys.map(String::getBytes) + .map(ByteBuffer::wrap) + .map(key -> SetCommand.set(key) + .value(key)); + + StepVerifier.create(stringCommands.set(generator)) + .expectNextCount(4L) + .verifyComplete(); + + Mono keyCount = keyCommands.keys(ByteBuffer.wrap("key*".getBytes())) + .flatMapMany(Flux::fromIterable) + .count(); + + StepVerifier.create(keyCount) + .expectNext(4L) + .verifyComplete(); + + } +} diff --git a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateListOpsIntegrationTest.java b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateListOpsIntegrationTest.java new file mode 100644 index 0000000000..3ebeff87b1 --- /dev/null +++ b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateListOpsIntegrationTest.java @@ -0,0 +1,49 @@ +package com.baeldung.spring.data.reactive.redis.template; + + +import com.baeldung.spring.data.reactive.redis.SpringRedisReactiveApplication; +import org.junit.Before; +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.data.redis.core.ReactiveListOperations; +import org.springframework.data.redis.core.ReactiveRedisTemplate; +import org.springframework.test.context.junit4.SpringRunner; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringRedisReactiveApplication.class) +public class RedisTemplateListOpsIntegrationTest { + + private static final String LIST_NAME = "demo_list"; + + @Autowired + private ReactiveRedisTemplate redisTemplate; + + private ReactiveListOperations reactiveListOps; + + @Before + public void setup() { + reactiveListOps = redisTemplate.opsForList(); + } + + @Test + public void givenListAndValues_whenLeftPushAndLeftPop_thenLeftPushAndLeftPop() { + Mono lPush = reactiveListOps.leftPushAll(LIST_NAME, "first", "second") + .log("Pushed"); + + StepVerifier.create(lPush) + .expectNext(2L) + .verifyComplete(); + + Mono lPop = reactiveListOps.leftPop(LIST_NAME) + .log("Popped"); + + StepVerifier.create(lPop) + .expectNext("second") + .verifyComplete(); + } + +} diff --git a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateValueOpsIntegrationTest.java b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateValueOpsIntegrationTest.java new file mode 100644 index 0000000000..9490568089 --- /dev/null +++ b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/reactive/redis/template/RedisTemplateValueOpsIntegrationTest.java @@ -0,0 +1,71 @@ +package com.baeldung.spring.data.reactive.redis.template; + + +import com.baeldung.spring.data.reactive.redis.SpringRedisReactiveApplication; +import com.baeldung.spring.data.reactive.redis.model.Employee; +import org.junit.Before; +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.data.redis.core.ReactiveRedisTemplate; +import org.springframework.data.redis.core.ReactiveValueOperations; +import org.springframework.test.context.junit4.SpringRunner; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.time.Duration; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringRedisReactiveApplication.class) +public class RedisTemplateValueOpsIntegrationTest { + + @Autowired + private ReactiveRedisTemplate redisTemplate; + + private ReactiveValueOperations reactiveValueOps; + + @Before + public void setup() { + reactiveValueOps = redisTemplate.opsForValue(); + } + + @Test + public void givenEmployee_whenSet_thenSet() { + + Mono result = reactiveValueOps.set("123", new Employee("123", "Bill", "Accounts")); + + StepVerifier.create(result) + .expectNext(true) + .verifyComplete(); + } + + @Test + public void givenEmployeeId_whenGet_thenReturnsEmployee() { + + Mono fetchedEmployee = reactiveValueOps.get("123"); + + StepVerifier.create(fetchedEmployee) + .expectNext(new Employee("123", "Bill", "Accounts")) + .verifyComplete(); + } + + @Test + public void givenEmployee_whenSetWithExpiry_thenSetsWithExpiryTime() throws InterruptedException { + + Mono result = reactiveValueOps.set("129", new Employee("129", "John", "Programming"), Duration.ofSeconds(1)); + + Mono fetchedEmployee = reactiveValueOps.get("129"); + + StepVerifier.create(result) + .expectNext(true) + .verifyComplete(); + + Thread.sleep(2000L); + + StepVerifier.create(fetchedEmployee) + .expectNextCount(0L) + .verifyComplete(); + } + +} diff --git a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/RedisMessageListenerIntegrationTest.java b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/RedisMessageListenerIntegrationTest.java index 5bc70069c5..99febb6430 100644 --- a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/RedisMessageListenerIntegrationTest.java +++ b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/RedisMessageListenerIntegrationTest.java @@ -31,7 +31,7 @@ public class RedisMessageListenerIntegrationTest { @BeforeClass public static void startRedisServer() throws IOException { - redisServer = new redis.embedded.RedisServer(6379); + redisServer = new redis.embedded.RedisServer(6380); redisServer.start(); } diff --git a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/repo/StudentRepositoryIntegrationTest.java b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/repo/StudentRepositoryIntegrationTest.java index 48832a8de9..43aadefc01 100644 --- a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/repo/StudentRepositoryIntegrationTest.java +++ b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/repo/StudentRepositoryIntegrationTest.java @@ -32,7 +32,7 @@ public class StudentRepositoryIntegrationTest { @BeforeClass public static void startRedisServer() throws IOException { - redisServer = new redis.embedded.RedisServer(6379); + redisServer = new redis.embedded.RedisServer(6380); redisServer.start(); } diff --git a/pom.xml b/pom.xml index 6c77ede1c2..28a6dd358e 100644 --- a/pom.xml +++ b/pom.xml @@ -451,6 +451,7 @@ spring-5 spring-5-data-reactive spring-5-reactive + spring-data-5-reactive/spring-5-data-reactive-redis spring-5-reactive-security spring-5-reactive-client spring-5-mvc From 79285e3cc60f28359c1429bc4ca15a4faf5a8a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Carrasquel?= Date: Sun, 14 Oct 2018 01:33:39 -0500 Subject: [PATCH 106/546] BAEL-2234 Dates difference with ZonedDateTimes (#5445) --- .../test/java/com/baeldung/date/DateDiffUnitTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/java-dates/src/test/java/com/baeldung/date/DateDiffUnitTest.java b/java-dates/src/test/java/com/baeldung/date/DateDiffUnitTest.java index 58d192bfdb..92da22cc95 100644 --- a/java-dates/src/test/java/com/baeldung/date/DateDiffUnitTest.java +++ b/java-dates/src/test/java/com/baeldung/date/DateDiffUnitTest.java @@ -51,6 +51,15 @@ public class DateDiffUnitTest { assertEquals(diff, 6); } + @Test + public void givenTwoZonedDateTimesInJava8_whenDifferentiating_thenWeGetSix() { + LocalDateTime ldt = LocalDateTime.now(); + ZonedDateTime now = ldt.atZone(ZoneId.of("America/Montreal")); + ZonedDateTime sixDaysBehind = now.withZoneSameInstant(ZoneId.of("Asia/Singapore")).minusDays(6); + long diff = ChronoUnit.DAYS.between(sixDaysBehind, now); + assertEquals(diff, 6); + } + @Test public void givenTwoDatesInJodaTime_whenDifferentiating_thenWeGetSix() { org.joda.time.LocalDate now = org.joda.time.LocalDate.now(); From e3b1152c5e05e38baa91a781727c5ed5bffd5c41 Mon Sep 17 00:00:00 2001 From: Alfonso Lentini Date: Sun, 14 Oct 2018 10:50:00 +0200 Subject: [PATCH 107/546] CommonPool deprecated --- .../com/baeldung/kotlin/CoroutinesUnitTest.kt | 14 +++++++------- .../com/baeldung/thread/CoroutineUnitTest.kt | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt index b6f28a4903..324cf1109b 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CoroutinesUnitTest.kt @@ -60,7 +60,7 @@ class CoroutinesTest { //when runBlocking { - val promise = launch(CommonPool) { expensiveComputation(res) } + val promise = launch(Dispatchers.Default) { expensiveComputation(res) } res.add("Hello,") promise.join() } @@ -84,7 +84,7 @@ class CoroutinesTest { //when val jobs = List(numberOfCoroutines) { - launch(CommonPool) { + launch(Dispatchers.Default) { delay(1L) counter.incrementAndGet() } @@ -100,7 +100,7 @@ class CoroutinesTest { fun givenCancellableJob_whenRequestForCancel_thenShouldQuit() { runBlocking { //given - val job = launch(CommonPool) { + val job = launch(Dispatchers.Default) { while (isActive) { //println("is working") } @@ -134,8 +134,8 @@ class CoroutinesTest { val delay = 1000L val time = measureTimeMillis { //given - val one = async(CommonPool) { someExpensiveComputation(delay) } - val two = async(CommonPool) { someExpensiveComputation(delay) } + val one = async(Dispatchers.Default) { someExpensiveComputation(delay) } + val two = async(Dispatchers.Default) { someExpensiveComputation(delay) } //when runBlocking { @@ -155,8 +155,8 @@ class CoroutinesTest { val delay = 1000L val time = measureTimeMillis { //given - val one = async(CommonPool, CoroutineStart.LAZY) { someExpensiveComputation(delay) } - val two = async(CommonPool, CoroutineStart.LAZY) { someExpensiveComputation(delay) } + val one = async(Dispatchers.Default, CoroutineStart.LAZY) { someExpensiveComputation(delay) } + val two = async(Dispatchers.Default, CoroutineStart.LAZY) { someExpensiveComputation(delay) } //when runBlocking { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt index f87409253f..1f1609b06b 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/thread/CoroutineUnitTest.kt @@ -46,7 +46,6 @@ class CoroutineUnitTest { return@async "${Thread.currentThread()} has run." } - val result = deferred.await() println(result) } From ee5fe8faab1b2bdc4c81d840a5545765e2f7260a Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 14 Oct 2018 15:13:39 +0530 Subject: [PATCH 108/546] [BAEL-9461] - Added code examples for difference between thenApply() and thenCompose() --- .../CompletableFutureLongRunningUnitTest.java | 20 +++++++++++++++++++ .../log4j2/${sys:logging.folder.path} | 0 2 files changed, 20 insertions(+) delete mode 100755 logging-modules/log4j2/${sys:logging.folder.path} diff --git a/core-java-concurrency/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java index 45d2ec68e4..d9cf8ae019 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/completablefuture/CompletableFutureLongRunningUnitTest.java @@ -184,5 +184,25 @@ public class CompletableFutureLongRunningUnitTest { assertEquals("Hello World", future.get()); } + + @Test + public void whenPassingTransformation_thenFunctionExecutionWithThenApply() throws InterruptedException, ExecutionException { + CompletableFuture finalResult = compute().thenApply(s -> s + 1); + assertTrue(finalResult.get() == 11); + } + + @Test + public void whenPassingPreviousStage_thenFunctionExecutionWithThenCompose() throws InterruptedException, ExecutionException { + CompletableFuture finalResult = compute().thenCompose(this::computeAnother); + assertTrue(finalResult.get() == 20); + } + + public CompletableFuture compute(){ + return CompletableFuture.supplyAsync(() -> 10); + } + + public CompletableFuture computeAnother(Integer i){ + return CompletableFuture.supplyAsync(() -> 10 + i); + } } \ No newline at end of file diff --git a/logging-modules/log4j2/${sys:logging.folder.path} b/logging-modules/log4j2/${sys:logging.folder.path} deleted file mode 100755 index e69de29bb2..0000000000 From b5dcb13c41cae9374210dfe4c178b11a242a04de Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 14 Oct 2018 18:13:40 +0530 Subject: [PATCH 109/546] [BAEL-9635] - Moved Junit vs TestNg junit code examples to junit-5 module from core-java --- .../customtestname/CustomNameUnitTest.java | 17 ------ .../ParameterizedUnitTest.java | 48 ----------------- .../suite/SelectClassesSuiteUnitTest.java | 13 ----- .../suite/SelectPackagesSuiteUnitTest.java | 11 ---- .../suite/childpackage1/Class1UnitTest.java | 15 ------ .../suite/childpackage2/Class2UnitTest.java | 14 ----- .../log4j2/${sys:logging.folder.path} | 0 pom.xml | 6 +++ .../baeldung/throwsexception/Calculator.java | 0 .../DivideByZeroException.java | 0 .../junit4vstestng/SortedUnitTest.java | 0 .../SummationServiceIntegrationTest.java | 0 .../SummationServiceIntegrationTest.java | 53 +++++++++++++++++++ .../throwsexception/CalculatorUnitTest.java | 0 14 files changed, 59 insertions(+), 118 deletions(-) delete mode 100644 core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java delete mode 100644 core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java delete mode 100644 core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java delete mode 100644 core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java delete mode 100644 core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java delete mode 100644 core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java delete mode 100755 logging-modules/log4j2/${sys:logging.folder.path} rename {core-java => testing-modules/junit-5}/src/main/java/com/baeldung/throwsexception/Calculator.java (100%) rename {core-java => testing-modules/junit-5}/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java (100%) rename {core-java => testing-modules/junit-5}/src/test/java/com/baeldung/junit4vstestng/SortedUnitTest.java (100%) rename {core-java => testing-modules/junit-5}/src/test/java/com/baeldung/junit4vstestng/SummationServiceIntegrationTest.java (100%) create mode 100644 testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java rename {core-java => testing-modules/junit-5}/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java (100%) diff --git a/core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java b/core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java deleted file mode 100644 index f04b825c89..0000000000 --- a/core-java/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung.java.customtestname; - -import static org.junit.Assert.assertNotNull; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - -public class CustomNameUnitTest { - - @ParameterizedTest - @ValueSource(strings = { "Hello", "World" }) - @DisplayName("Test Method to check that the inputs are not nullable") - void givenString_TestNullOrNot(String word) { - assertNotNull(word); - } -} diff --git a/core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java b/core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java deleted file mode 100644 index af9ad870b9..0000000000 --- a/core-java/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.baeldung.java.parameterisedsource; - -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.EnumSet; -import java.util.stream.Stream; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; -import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; -import org.junit.jupiter.params.provider.ValueSource; - -import com.baeldung.enums.PizzaDeliveryStrategy; - -public class ParameterizedUnitTest { - - @ParameterizedTest - @ValueSource(strings = { "Hello", "World" }) - void givenString_TestNullOrNot(String word) { - assertNotNull(word); - } - - @ParameterizedTest - @EnumSource(value = PizzaDeliveryStrategy.class, names = {"EXPRESS", "NORMAL"}) - void givenEnum_TestContainsOrNot(PizzaDeliveryStrategy timeUnit) { - assertTrue(EnumSet.of(PizzaDeliveryStrategy.EXPRESS, PizzaDeliveryStrategy.NORMAL).contains(timeUnit)); - } - - @ParameterizedTest - @MethodSource("wordDataProvider") - void givenMethodSource_TestInputStream(String argument) { - assertNotNull(argument); - } - - static Stream wordDataProvider() { - return Stream.of("foo", "bar"); - } - - @ParameterizedTest - @CsvSource({ "1, Car", "2, House", "3, Train" }) - void givenCSVSource_TestContent(int id, String word) { - assertNotNull(id); - assertNotNull(word); - } -} diff --git a/core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java deleted file mode 100644 index 220897eae7..0000000000 --- a/core-java/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.baeldung.java.suite; - -import org.baeldung.java.suite.childpackage1.Class1UnitTest; -import org.baeldung.java.suite.childpackage2.Class2UnitTest; -import org.junit.platform.runner.JUnitPlatform; -import org.junit.platform.suite.api.SelectClasses; -import org.junit.runner.RunWith; - -@RunWith(JUnitPlatform.class) -@SelectClasses({Class1UnitTest.class, Class2UnitTest.class}) -public class SelectClassesSuiteUnitTest { - -} diff --git a/core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java deleted file mode 100644 index ae887ae43b..0000000000 --- a/core-java/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.baeldung.java.suite; - -import org.junit.platform.runner.JUnitPlatform; -import org.junit.platform.suite.api.SelectPackages; -import org.junit.runner.RunWith; - -@RunWith(JUnitPlatform.class) -@SelectPackages({ "org.baeldung.java.suite.childpackage1", "org.baeldung.java.suite.childpackage2" }) -public class SelectPackagesSuiteUnitTest { - -} diff --git a/core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java deleted file mode 100644 index 78469cb971..0000000000 --- a/core-java/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.baeldung.java.suite.childpackage1; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.Test; - - -public class Class1UnitTest { - - @Test - public void testCase_InClass1UnitTest() { - assertTrue(true); - } - -} diff --git a/core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java b/core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java deleted file mode 100644 index 4463ecfad9..0000000000 --- a/core-java/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.java.suite.childpackage2; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.Test; - -public class Class2UnitTest { - - @Test - public void testCase_InClass2UnitTest() { - assertTrue(true); - } - -} diff --git a/logging-modules/log4j2/${sys:logging.folder.path} b/logging-modules/log4j2/${sys:logging.folder.path} deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/pom.xml b/pom.xml index 28a6dd358e..da1733d2b2 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,12 @@ ${junit-jupiter.version} test + + org.junit.jupiter + junit-jupiter-params + ${junit-jupiter.version} + test + org.junit.jupiter junit-jupiter-api diff --git a/core-java/src/main/java/com/baeldung/throwsexception/Calculator.java b/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java similarity index 100% rename from core-java/src/main/java/com/baeldung/throwsexception/Calculator.java rename to testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java diff --git a/core-java/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java b/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java rename to testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java diff --git a/core-java/src/test/java/com/baeldung/junit4vstestng/SortedUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit4vstestng/SortedUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/junit4vstestng/SortedUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit4vstestng/SortedUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/junit4vstestng/SummationServiceIntegrationTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit4vstestng/SummationServiceIntegrationTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/junit4vstestng/SummationServiceIntegrationTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit4vstestng/SummationServiceIntegrationTest.java diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java new file mode 100644 index 0000000000..92e7a6f5db --- /dev/null +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java @@ -0,0 +1,53 @@ +package com.baeldung.junit5vstestng; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class SummationServiceIntegrationTest { + private static List numbers; + + @BeforeAll + public static void initialize() { + numbers = new ArrayList<>(); + } + + @AfterAll + public static void tearDown() { + numbers = null; + } + + @BeforeEach + public void runBeforeEachTest() { + numbers.add(1); + numbers.add(2); + numbers.add(3); + } + + @AfterEach + public void runAfterEachTest() { + numbers.clear(); + } + + @Test + public void givenNumbers_sumEquals_thenCorrect() { + int sum = numbers.stream() + .reduce(0, Integer::sum); + Assert.assertEquals(6, sum); + } + + @Ignore + @Test + public void givenEmptyList_sumEqualsZero_thenCorrect() { + int sum = numbers.stream() + .reduce(0, Integer::sum); + Assert.assertEquals(6, sum); + } +} diff --git a/core-java/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java From 29cee792a889d72c211251ee31a5052bf118c7ac Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 14 Oct 2018 20:02:51 +0530 Subject: [PATCH 110/546] [BAEL-9601] - Upgraded groovy-all version in libraries module --- libraries/pom.xml | 3 ++- logging-modules/log4j2/{${sys:logging.folder.path} => ${sys} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename logging-modules/log4j2/{${sys:logging.folder.path} => ${sys} (100%) mode change 100755 => 100644 diff --git a/libraries/pom.xml b/libraries/pom.xml index 91c54b6113..6bbe8e6f1c 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -358,6 +358,7 @@ org.codehaus.groovy groovy-all + pom ${groovy.version} @@ -922,7 +923,7 @@ 2.3.0 0.9.12 1.19 - 2.4.10 + 2.5.2 1.1.0 3.9.0 2.0.4 diff --git a/logging-modules/log4j2/${sys:logging.folder.path} b/logging-modules/log4j2/${sys old mode 100755 new mode 100644 similarity index 100% rename from logging-modules/log4j2/${sys:logging.folder.path} rename to logging-modules/log4j2/${sys From 38ddcc6477ca324e248173a102be6fd63276a7d9 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 14 Oct 2018 19:26:46 +0300 Subject: [PATCH 111/546] rename test to manual --- ...{SystemsUtilsUnitTest.java => SystemsUtilsManualTest.java} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename libraries/src/test/java/com/baeldung/commons/lang3/test/{SystemsUtilsUnitTest.java => SystemsUtilsManualTest.java} (86%) diff --git a/libraries/src/test/java/com/baeldung/commons/lang3/test/SystemsUtilsUnitTest.java b/libraries/src/test/java/com/baeldung/commons/lang3/test/SystemsUtilsManualTest.java similarity index 86% rename from libraries/src/test/java/com/baeldung/commons/lang3/test/SystemsUtilsUnitTest.java rename to libraries/src/test/java/com/baeldung/commons/lang3/test/SystemsUtilsManualTest.java index 0efe97f912..cb45ebc24d 100644 --- a/libraries/src/test/java/com/baeldung/commons/lang3/test/SystemsUtilsUnitTest.java +++ b/libraries/src/test/java/com/baeldung/commons/lang3/test/SystemsUtilsManualTest.java @@ -6,8 +6,10 @@ import org.apache.commons.lang3.SystemUtils; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; -public class SystemsUtilsUnitTest { +public class SystemsUtilsManualTest { + // the paths depend on the OS and installed version of Java + @Test public void givenSystemUtilsClass_whenCalledgetJavaHome_thenCorrect() { assertThat(SystemUtils.getJavaHome()).isEqualTo(new File("/usr/lib/jvm/java-8-oracle/jre")); From 6b3803a683a729d356ad88bc0a0b982a587af9c3 Mon Sep 17 00:00:00 2001 From: elrisita Date: Sun, 14 Oct 2018 17:27:34 +0100 Subject: [PATCH 112/546] BAEL-2242 --- .../baeldung/removal/CollectionRemoveIf.java | 19 +++++ .../java/com/baeldung/removal/Iterators.java | 28 +++++++ .../removal/StreamFilterAndCollector.java | 23 ++++++ .../removal/StreamPartitioningBy.java | 28 +++++++ .../com/baeldung/removal/RemovalUnitTest.java | 77 +++++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java create mode 100644 core-java-collections/src/main/java/com/baeldung/removal/Iterators.java create mode 100644 core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java create mode 100644 core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java create mode 100644 core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java diff --git a/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java b/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java new file mode 100644 index 0000000000..2f5e91596f --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java @@ -0,0 +1,19 @@ +package com.baeldung.removal; + +import java.util.ArrayList; +import java.util.Collection; + +public class CollectionRemoveIf { + + public static void main(String args[]) { + Collection names = new ArrayList<>(); + names.add("John"); + names.add("Ana"); + names.add("Mary"); + names.add("Anthony"); + names.add("Mark"); + + names.removeIf(e -> e.startsWith("A")); + System.out.println(String.join(",", names)); + } +} diff --git a/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java b/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java new file mode 100644 index 0000000000..86b91b3fdc --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java @@ -0,0 +1,28 @@ +package com.baeldung.removal; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +public class Iterators { + + public static void main(String args[]) { + Collection names = new ArrayList<>(); + names.add("John"); + names.add("Ana"); + names.add("Mary"); + names.add("Anthony"); + names.add("Mark"); + + Iterator i = names.iterator(); + + while (i.hasNext()) { + String e = i.next(); + if (e.startsWith("A")) { + i.remove(); + } + } + + System.out.println(String.join(",", names)); + } +} diff --git a/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java b/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java new file mode 100644 index 0000000000..bf6db68bae --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java @@ -0,0 +1,23 @@ +package com.baeldung.removal; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.stream.Collectors; + +public class StreamFilterAndCollector { + + public static void main(String args[]) { + Collection names = new ArrayList<>(); + names.add("John"); + names.add("Ana"); + names.add("Mary"); + names.add("Anthony"); + names.add("Mark"); + + Collection filteredCollection = names + .stream() + .filter(e -> !e.startsWith("A")) + .collect(Collectors.toList()); + System.out.println(String.join(",", filteredCollection)); + } +} diff --git a/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java b/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java new file mode 100644 index 0000000000..c77e996616 --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java @@ -0,0 +1,28 @@ +package com.baeldung.removal; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class StreamPartitioningBy { + + public static void main(String args[]) { + Collection names = new ArrayList<>(); + names.add("John"); + names.add("Ana"); + names.add("Mary"); + names.add("Anthony"); + names.add("Mark"); + + Map> classifiedElements = names + .stream() + .collect(Collectors.partitioningBy((String e) -> !e.startsWith("A"))); + + String matching = String.join(",", classifiedElements.get(Boolean.TRUE)); + String nonMatching = String.join(",", classifiedElements.get(Boolean.FALSE)); + System.out.println("Matching elements: " + matching); + System.out.println("Non matching elements: " + nonMatching); + } +} diff --git a/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java b/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java new file mode 100644 index 0000000000..1b379f32de --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java @@ -0,0 +1,77 @@ +package com.baeldung.removal; + +import org.junit.Before; +import org.junit.Test; + +import java.util.*; +import java.util.stream.Collectors; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +public class RemovalUnitTest { + + Collection names; + Collection expected; + Collection removed; + + @Before + public void setupTestData() { + names = new ArrayList<>(); + expected = new ArrayList<>(); + removed = new ArrayList<>(); + + names.add("John"); + names.add("Ana"); + names.add("Mary"); + names.add("Anthony"); + names.add("Mark"); + + expected.add("John"); + expected.add("Mary"); + expected.add("Mark"); + + removed.add("Ana"); + removed.add("Anthony"); + } + + @Test + public void givenCollectionOfNames_whenUsingIteratorToRemoveAllNamesStartingWithLetterA_finalListShouldContainNoNamesStartingWithLetterA() { + Iterator i = names.iterator(); + + while (i.hasNext()) { + String e = i.next(); + if (e.startsWith("A")) { + i.remove(); + } + } + + assertThat(names, is(expected)); + } + + @Test + public void givenCollectionOfNames_whenUsingRemoveIfToRemoveAllNamesStartingWithLetterA_finalListShouldContainNoNamesStartingWithLetterA() { + names.removeIf(e -> e.startsWith("A")); + assertThat(names, is(expected)); + } + + @Test + public void givenCollectionOfNames_whenUsingStreamToFilterAllNamesStartingWithLetterA_finalListShouldContainNoNamesStartingWithLetterA() { + Collection filteredCollection = names + .stream() + .filter(e -> !e.startsWith("A")) + .collect(Collectors.toList()); + assertThat(filteredCollection, is(expected)); + } + + @Test + public void givenCollectionOfNames_whenUsingStreamAndPartitioningByToFindNamesThatStartWithLetterA_shouldFind3MatchingAnd2NonMatching() { + Map> classifiedElements = names + .stream() + .collect(Collectors.partitioningBy((String e) -> !e.startsWith("A"))); + + assertThat(classifiedElements.get(Boolean.TRUE), is(expected)); + assertThat(classifiedElements.get(Boolean.FALSE), is(removed)); + } + +} From 23b1323446c2c535ab8fdf3aef19761e0649bc98 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sun, 14 Oct 2018 11:37:16 -0500 Subject: [PATCH 113/546] BAEL-2200: Spring Boot auto-configuration report (#5453) * BAEL-1766: Update README * BAEL-1853: add link to article * BAEL-1801: add link to article * Added links back to articles * Add links back to articles * BAEL-1795: Update README * BAEL-1901 and BAEL-1555 add links back to article * BAEL-2026 add link back to article * BAEL-2029: add link back to article * BAEL-1898: Add link back to article * BAEL-2102 and BAEL-2131 Add links back to articles * BAEL-2132 Add link back to article * BAEL-1980: add link back to article * BAEL-2200: Display auto-configuration report in Spring Boot --- .../baeldung/h2db/auto/configuration/AutoConfigurationDemo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java b/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java index 87a191554b..8d92e18754 100644 --- a/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java +++ b/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java @@ -4,7 +4,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; -@SpringBootApplication(scanBasePackages = "com.baeldung.h2db.auto-configuration") +@SpringBootApplication public class AutoConfigurationDemo { public static void main(String[] args) { From 285219c54c3ffe993e9bb9e7819d5b4cb9802de3 Mon Sep 17 00:00:00 2001 From: fanatixan Date: Sun, 14 Oct 2018 19:08:11 +0200 Subject: [PATCH 114/546] Bael-2210 - Heap Sort (#5446) * implementing heap * Heap sort refactor --- .../main/java/com/baeldung/heapsort/Heap.java | 136 ++++++++++++++++++ .../com/baeldung/heapsort/HeapUnitTest.java | 36 +++++ 2 files changed, 172 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/heapsort/Heap.java create mode 100644 core-java/src/test/java/com/baeldung/heapsort/HeapUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/heapsort/Heap.java b/core-java/src/main/java/com/baeldung/heapsort/Heap.java new file mode 100644 index 0000000000..95e0e1d8cd --- /dev/null +++ b/core-java/src/main/java/com/baeldung/heapsort/Heap.java @@ -0,0 +1,136 @@ +package com.baeldung.heapsort; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Heap> { + + private List elements = new ArrayList<>(); + + public static > List sort(Iterable elements) { + Heap heap = of(elements); + + List result = new ArrayList<>(); + + while (!heap.isEmpty()) { + result.add(heap.pop()); + } + + return result; + } + + public static > Heap of(E... elements) { + return of(Arrays.asList(elements)); + } + + public static > Heap of(Iterable elements) { + Heap result = new Heap<>(); + for (E element : elements) { + result.add(element); + } + return result; + } + + public void add(E e) { + elements.add(e); + int elementIndex = elements.size() - 1; + while (!isRoot(elementIndex) && !isCorrectChild(elementIndex)) { + int parentIndex = parentIndex(elementIndex); + swap(elementIndex, parentIndex); + elementIndex = parentIndex; + } + } + + public E pop() { + if (isEmpty()) { + throw new IllegalStateException("You cannot pop from an empty heap"); + } + + E result = elementAt(0); + + int lasElementIndex = elements.size() - 1; + swap(0, lasElementIndex); + elements.remove(lasElementIndex); + + int elementIndex = 0; + while (!isLeaf(elementIndex) && !isCorrectParent(elementIndex)) { + int smallerChildIndex = smallerChildIndex(elementIndex); + swap(elementIndex, smallerChildIndex); + elementIndex = smallerChildIndex; + } + + return result; + } + + public boolean isEmpty() { + return elements.isEmpty(); + } + + private boolean isRoot(int index) { + return index == 0; + } + + private int smallerChildIndex(int index) { + int leftChildIndex = leftChildIndex(index); + int rightChildIndex = rightChildIndex(index); + + if (!isValidIndex(rightChildIndex)) { + return leftChildIndex; + } + + if (elementAt(leftChildIndex).compareTo(elementAt(rightChildIndex)) < 0) { + return leftChildIndex; + } + + return rightChildIndex; + } + + private boolean isLeaf(int index) { + return !isValidIndex(leftChildIndex(index)); + } + + private boolean isCorrectParent(int index) { + return isCorrect(index, leftChildIndex(index)) && isCorrect(index, rightChildIndex(index)); + } + + private boolean isCorrectChild(int index) { + return isCorrect(parentIndex(index), index); + } + + private boolean isCorrect(int parentIndex, int childIndex) { + if (!isValidIndex(parentIndex) || !isValidIndex(childIndex)) { + return true; + } + + return elementAt(parentIndex).compareTo(elementAt(childIndex)) < 0; + } + + private boolean isValidIndex(int index) { + return index < elements.size(); + } + + private void swap(int index1, int index2) { + E element1 = elementAt(index1); + E element2 = elementAt(index2); + elements.set(index1, element2); + elements.set(index2, element1); + } + + private E elementAt(int index) { + return elements.get(index); + } + + private int parentIndex(int index) { + return (index - 1) / 2; + } + + private int leftChildIndex(int index) { + return 2 * index + 1; + } + + private int rightChildIndex(int index) { + return 2 * index + 2; + } + +} diff --git a/core-java/src/test/java/com/baeldung/heapsort/HeapUnitTest.java b/core-java/src/test/java/com/baeldung/heapsort/HeapUnitTest.java new file mode 100644 index 0000000000..cc3e49b6c9 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/heapsort/HeapUnitTest.java @@ -0,0 +1,36 @@ +package com.baeldung.heapsort; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Test; + +public class HeapUnitTest { + + @Test + public void givenNotEmptyHeap_whenPopCalled_thenItShouldReturnSmallestElement() { + // given + Heap heap = Heap.of(3, 5, 1, 4, 2); + + // when + int head = heap.pop(); + + // then + assertThat(head).isEqualTo(1); + } + + @Test + public void givenNotEmptyIterable_whenSortCalled_thenItShouldReturnElementsInSortedList() { + // given + List elements = Arrays.asList(3, 5, 1, 4, 2); + + // when + List sortedElements = Heap.sort(elements); + + // then + assertThat(sortedElements).isEqualTo(Arrays.asList(1, 2, 3, 4, 5)); + } + +} From edff9132ee617922b52a12be0d8b35c4e2ffd7d2 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 14 Oct 2018 23:05:11 +0530 Subject: [PATCH 115/546] [BAEL-9635] - Added missing classes --- .../customtestname/CustomNameUnitTest.java | 17 +++++++ .../ParameterizedUnitTest.java | 45 +++++++++++++++++++ .../PizzaDeliveryStrategy.java | 6 +++ .../suite/SelectClassesSuiteUnitTest.java | 13 ++++++ .../suite/SelectPackagesSuiteUnitTest.java | 11 +++++ .../suite/childpackage1/Class1UnitTest.java | 15 +++++++ .../suite/childpackage2/Class2UnitTest.java | 14 ++++++ 7 files changed, 121 insertions(+) create mode 100644 testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java create mode 100644 testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java create mode 100644 testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java create mode 100644 testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java create mode 100644 testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java create mode 100644 testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java create mode 100644 testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java b/testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java new file mode 100644 index 0000000000..f04b825c89 --- /dev/null +++ b/testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java @@ -0,0 +1,17 @@ +package org.baeldung.java.customtestname; + +import static org.junit.Assert.assertNotNull; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +public class CustomNameUnitTest { + + @ParameterizedTest + @ValueSource(strings = { "Hello", "World" }) + @DisplayName("Test Method to check that the inputs are not nullable") + void givenString_TestNullOrNot(String word) { + assertNotNull(word); + } +} diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java b/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java new file mode 100644 index 0000000000..8d09161176 --- /dev/null +++ b/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java @@ -0,0 +1,45 @@ +package org.baeldung.java.parameterisedsource; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.EnumSet; +import java.util.stream.Stream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; + +public class ParameterizedUnitTest { + + @ParameterizedTest + @ValueSource(strings = { "Hello", "World" }) + void givenString_TestNullOrNot(String word) { + assertNotNull(word); + } + + @ParameterizedTest + @EnumSource(value = PizzaDeliveryStrategy.class, names = {"EXPRESS", "NORMAL"}) + void givenEnum_TestContainsOrNot(PizzaDeliveryStrategy timeUnit) { + assertTrue(EnumSet.of(PizzaDeliveryStrategy.EXPRESS, PizzaDeliveryStrategy.NORMAL).contains(timeUnit)); + } + + @ParameterizedTest + @MethodSource("wordDataProvider") + void givenMethodSource_TestInputStream(String argument) { + assertNotNull(argument); + } + + static Stream wordDataProvider() { + return Stream.of("foo", "bar"); + } + + @ParameterizedTest + @CsvSource({ "1, Car", "2, House", "3, Train" }) + void givenCSVSource_TestContent(int id, String word) { + assertNotNull(id); + assertNotNull(word); + } +} diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java b/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java new file mode 100644 index 0000000000..ecfc7b4627 --- /dev/null +++ b/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java @@ -0,0 +1,6 @@ +package org.baeldung.java.parameterisedsource; + +public enum PizzaDeliveryStrategy { + EXPRESS, + NORMAL; +} diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java new file mode 100644 index 0000000000..220897eae7 --- /dev/null +++ b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java @@ -0,0 +1,13 @@ +package org.baeldung.java.suite; + +import org.baeldung.java.suite.childpackage1.Class1UnitTest; +import org.baeldung.java.suite.childpackage2.Class2UnitTest; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.runner.RunWith; + +@RunWith(JUnitPlatform.class) +@SelectClasses({Class1UnitTest.class, Class2UnitTest.class}) +public class SelectClassesSuiteUnitTest { + +} diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java new file mode 100644 index 0000000000..ae887ae43b --- /dev/null +++ b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java @@ -0,0 +1,11 @@ +package org.baeldung.java.suite; + +import org.junit.platform.runner.JUnitPlatform; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.runner.RunWith; + +@RunWith(JUnitPlatform.class) +@SelectPackages({ "org.baeldung.java.suite.childpackage1", "org.baeldung.java.suite.childpackage2" }) +public class SelectPackagesSuiteUnitTest { + +} diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java new file mode 100644 index 0000000000..78469cb971 --- /dev/null +++ b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java @@ -0,0 +1,15 @@ +package org.baeldung.java.suite.childpackage1; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.Test; + + +public class Class1UnitTest { + + @Test + public void testCase_InClass1UnitTest() { + assertTrue(true); + } + +} diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java new file mode 100644 index 0000000000..4463ecfad9 --- /dev/null +++ b/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java @@ -0,0 +1,14 @@ +package org.baeldung.java.suite.childpackage2; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.Test; + +public class Class2UnitTest { + + @Test + public void testCase_InClass2UnitTest() { + assertTrue(true); + } + +} From 3a14ed0ff35556766c700a51c1d2004350db6a27 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 14 Oct 2018 23:46:10 +0530 Subject: [PATCH 116/546] [BAEL-9515] - Added latest version of spring 1.5 --- parent-boot-1/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index 7742841d07..d220b4a6b7 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-dependencies - 1.5.15.RELEASE + 1.5.16.RELEASE pom import From 5c0ea4c47d59c0d17a1f2da5f5c181426f9a6168 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 14 Oct 2018 22:39:34 +0300 Subject: [PATCH 117/546] move tests in junit-5 --- .../{throwsexception => junit5vstestng}/Calculator.java | 2 +- .../DivideByZeroException.java | 2 +- .../CalculatorUnitTest.java | 2 +- .../baeldung/junit5vstestng}/Class1UnitTest.java | 2 +- .../baeldung/junit5vstestng}/Class2UnitTest.java | 2 +- .../baeldung/junit5vstestng}/CustomNameUnitTest.java | 2 +- .../baeldung/junit5vstestng}/ParameterizedUnitTest.java | 2 +- .../baeldung/junit5vstestng}/PizzaDeliveryStrategy.java | 2 +- .../baeldung/junit5vstestng}/SelectClassesSuiteUnitTest.java | 4 +--- .../baeldung/junit5vstestng}/SelectPackagesSuiteUnitTest.java | 2 +- ...viceIntegrationTest.java => SummationServiceUnitTest.java} | 2 +- 11 files changed, 11 insertions(+), 13 deletions(-) rename testing-modules/junit-5/src/main/java/com/baeldung/{throwsexception => junit5vstestng}/Calculator.java (85%) rename testing-modules/junit-5/src/main/java/com/baeldung/{throwsexception => junit5vstestng}/DivideByZeroException.java (79%) rename testing-modules/junit-5/src/test/java/com/baeldung/{throwsexception => junit5vstestng}/CalculatorUnitTest.java (90%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite/childpackage1 => com/baeldung/junit5vstestng}/Class1UnitTest.java (81%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite/childpackage2 => com/baeldung/junit5vstestng}/Class2UnitTest.java (81%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/customtestname => com/baeldung/junit5vstestng}/CustomNameUnitTest.java (91%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/parameterisedsource => com/baeldung/junit5vstestng}/ParameterizedUnitTest.java (96%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/parameterisedsource => com/baeldung/junit5vstestng}/PizzaDeliveryStrategy.java (57%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite => com/baeldung/junit5vstestng}/SelectClassesSuiteUnitTest.java (63%) rename testing-modules/junit-5/src/test/java/{org/baeldung/java/suite => com/baeldung/junit5vstestng}/SelectPackagesSuiteUnitTest.java (89%) rename testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/{SummationServiceIntegrationTest.java => SummationServiceUnitTest.java} (96%) diff --git a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/Calculator.java similarity index 85% rename from testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java rename to testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/Calculator.java index 50dbc9c774..4ff303c031 100644 --- a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/Calculator.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/Calculator.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.junit5vstestng; public class Calculator { diff --git a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/DivideByZeroException.java similarity index 79% rename from testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java rename to testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/DivideByZeroException.java index 4413374c99..4523f46590 100644 --- a/testing-modules/junit-5/src/main/java/com/baeldung/throwsexception/DivideByZeroException.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/junit5vstestng/DivideByZeroException.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.junit5vstestng; public class DivideByZeroException extends RuntimeException { diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CalculatorUnitTest.java similarity index 90% rename from testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CalculatorUnitTest.java index ef838ed304..c563b01603 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/throwsexception/CalculatorUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CalculatorUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.junit5vstestng; import org.junit.Test; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class1UnitTest.java similarity index 81% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class1UnitTest.java index 78469cb971..09c2b9108b 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage1/Class1UnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class1UnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.suite.childpackage1; +package com.baeldung.junit5vstestng; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class2UnitTest.java similarity index 81% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class2UnitTest.java index 4463ecfad9..184ecafa1b 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/childpackage2/Class2UnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/Class2UnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.suite.childpackage2; +package com.baeldung.junit5vstestng; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CustomNameUnitTest.java similarity index 91% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CustomNameUnitTest.java index f04b825c89..9cf03ad3de 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/customtestname/CustomNameUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/CustomNameUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.customtestname; +package com.baeldung.junit5vstestng; import static org.junit.Assert.assertNotNull; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/ParameterizedUnitTest.java similarity index 96% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/ParameterizedUnitTest.java index 8d09161176..b5560650c4 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/ParameterizedUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/ParameterizedUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.parameterisedsource; +package com.baeldung.junit5vstestng; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/PizzaDeliveryStrategy.java similarity index 57% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/PizzaDeliveryStrategy.java index ecfc7b4627..7f0a0ffa20 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/parameterisedsource/PizzaDeliveryStrategy.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/PizzaDeliveryStrategy.java @@ -1,4 +1,4 @@ -package org.baeldung.java.parameterisedsource; +package com.baeldung.junit5vstestng; public enum PizzaDeliveryStrategy { EXPRESS, diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java similarity index 63% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java index 220897eae7..7b4bd746bf 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectClassesSuiteUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java @@ -1,7 +1,5 @@ -package org.baeldung.java.suite; +package com.baeldung.junit5vstestng; -import org.baeldung.java.suite.childpackage1.Class1UnitTest; -import org.baeldung.java.suite.childpackage2.Class2UnitTest; import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectClasses; import org.junit.runner.RunWith; diff --git a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java similarity index 89% rename from testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java index ae887ae43b..8f2eb2b5c5 100644 --- a/testing-modules/junit-5/src/test/java/org/baeldung/java/suite/SelectPackagesSuiteUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.suite; +package com.baeldung.junit5vstestng; import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectPackages; diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceUnitTest.java similarity index 96% rename from testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceUnitTest.java index 92e7a6f5db..a8c02e9968 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceIntegrationTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5vstestng/SummationServiceUnitTest.java @@ -11,7 +11,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -public class SummationServiceIntegrationTest { +public class SummationServiceUnitTest { private static List numbers; @BeforeAll From 2db4d4091e50024d9ae8e4280387858aa7245da3 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 14 Oct 2018 22:44:56 +0300 Subject: [PATCH 118/546] modify link --- core-java/README.md | 1 - testing-modules/junit-5/README.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java/README.md b/core-java/README.md index 9e38dfc47d..c0c3c5c0b9 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -29,7 +29,6 @@ - [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) - [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) - [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) -- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng) - [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) - [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) - [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) diff --git a/testing-modules/junit-5/README.md b/testing-modules/junit-5/README.md index 836848282b..1fbd7a4a5e 100644 --- a/testing-modules/junit-5/README.md +++ b/testing-modules/junit-5/README.md @@ -15,3 +15,4 @@ - [The Order of Tests in JUnit](http://www.baeldung.com/junit-5-test-order) - [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) - [Testing an Abstract Class With JUnit](https://www.baeldung.com/junit-test-abstract-class) +- [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng) From 6d79649b5610243216333224222bb88ce9cf6d50 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Mon, 15 Oct 2018 01:32:54 +0530 Subject: [PATCH 119/546] [BAEL-9547] - Splitted guava module and introduced guava-collections module --- guava-collections/.gitignore | 13 ++++ guava-collections/README.md | 20 ++++++ guava-collections/pom.xml | 66 ++++++++++++++++++ .../src/main/resources/logback.xml | 19 +++++ .../baeldung/guava/EvictingQueueUnitTest.java | 0 .../guava/GuavaCollectionTypesUnitTest.java | 0 .../GuavaCollectionsExamplesUnitTest.java | 0 ...avaFilterTransformCollectionsUnitTest.java | 0 .../org/baeldung/guava/GuavaMapFromSet.java | 0 .../guava/GuavaMapFromSetUnitTest.java | 0 .../guava/GuavaMapInitializeUnitTest.java | 0 .../baeldung/guava/GuavaMultiMapUnitTest.java | 0 .../guava/GuavaOrderingExamplesUnitTest.java | 0 .../baeldung/guava/GuavaOrderingUnitTest.java | 0 .../baeldung/guava/GuavaRangeMapUnitTest.java | 0 .../baeldung/guava/GuavaRangeSetUnitTest.java | 0 .../baeldung/guava/GuavaStringUnitTest.java | 0 .../guava/MinMaxPriorityQueueUnitTest.java | 0 .../hamcrest/HamcrestExamplesUnitTest.java | 0 .../CollectionApachePartitionUnitTest.java | 0 .../CollectionGuavaPartitionUnitTest.java | 0 .../java/CollectionJavaPartitionUnitTest.java | 0 .../src/test/resources/.gitignore | 13 ++++ guava-collections/src/test/resources/test.out | 1 + guava-collections/src/test/resources/test1.in | 1 + .../src/test/resources/test1_1.in | 1 + guava-collections/src/test/resources/test2.in | 4 ++ .../src/test/resources/test_copy.in | 1 + .../src/test/resources/test_le.txt | Bin 0 -> 4 bytes guava/README.md | 14 ---- guava/pom.xml | 7 -- pom.xml | 2 + 32 files changed, 141 insertions(+), 21 deletions(-) create mode 100644 guava-collections/.gitignore create mode 100644 guava-collections/README.md create mode 100644 guava-collections/pom.xml create mode 100644 guava-collections/src/main/resources/logback.xml rename {guava => guava-collections}/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaMapFromSet.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaMapFromSetUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaMapInitializeUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaRangeSetUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java (100%) create mode 100644 guava-collections/src/test/resources/.gitignore create mode 100644 guava-collections/src/test/resources/test.out create mode 100644 guava-collections/src/test/resources/test1.in create mode 100644 guava-collections/src/test/resources/test1_1.in create mode 100644 guava-collections/src/test/resources/test2.in create mode 100644 guava-collections/src/test/resources/test_copy.in create mode 100644 guava-collections/src/test/resources/test_le.txt diff --git a/guava-collections/.gitignore b/guava-collections/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/guava-collections/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/guava-collections/README.md b/guava-collections/README.md new file mode 100644 index 0000000000..eb1eb1d35c --- /dev/null +++ b/guava-collections/README.md @@ -0,0 +1,20 @@ +========= + +## Guava and Hamcrest Cookbooks and Examples + + +### Relevant Articles: +- [Guava Collections Cookbook](http://www.baeldung.com/guava-collections) +- [Guava Ordering Cookbook](http://www.baeldung.com/guava-order) +- [Hamcrest Collections Cookbook](http://www.baeldung.com/hamcrest-collections-arrays) +- [Partition a List in Java](http://www.baeldung.com/java-list-split) +- [Filtering and Transforming Collections in Guava](http://www.baeldung.com/guava-filter-and-transform-a-collection) +- [Guava – Join and Split Collections](http://www.baeldung.com/guava-joiner-and-splitter-tutorial) +- [Guava – Lists](http://www.baeldung.com/guava-lists) +- [Guava – Sets](http://www.baeldung.com/guava-sets) +- [Guava – Maps](http://www.baeldung.com/guava-maps) +- [Guide to Guava Multimap](http://www.baeldung.com/guava-multimap) +- [Guide to Guava RangeSet](http://www.baeldung.com/guava-rangeset) +- [Guide to Guava RangeMap](http://www.baeldung.com/guava-rangemap) +- [Guide to Guava MinMaxPriorityQueue and EvictingQueue](http://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) +- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) \ No newline at end of file diff --git a/guava-collections/pom.xml b/guava-collections/pom.xml new file mode 100644 index 0000000000..a717023156 --- /dev/null +++ b/guava-collections/pom.xml @@ -0,0 +1,66 @@ + + 4.0.0 + com.baeldung + guava-collections + 0.1.0-SNAPSHOT + guava-collections + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + org.hamcrest + java-hamcrest + ${java-hamcrest.version} + test + + + + + guava + + + src/main/resources + true + + + + + + + 24.0-jre + 3.5 + 4.1 + + + 3.6.1 + 2.0.0.0 + + + \ No newline at end of file diff --git a/guava-collections/src/main/resources/logback.xml b/guava-collections/src/main/resources/logback.xml new file mode 100644 index 0000000000..56af2d397e --- /dev/null +++ b/guava-collections/src/main/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guava/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMapFromSet.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaMapFromSet.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaMapFromSet.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaMapFromSet.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMapFromSetUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaMapFromSetUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaMapFromSetUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaMapFromSetUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMapInitializeUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaMapInitializeUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaMapInitializeUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaMapInitializeUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaRangeSetUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeSetUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaRangeSetUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaRangeSetUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java diff --git a/guava/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java b/guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java rename to guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java diff --git a/guava/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java b/guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java rename to guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java diff --git a/guava/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java b/guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java rename to guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java diff --git a/guava/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java b/guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java rename to guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java diff --git a/guava-collections/src/test/resources/.gitignore b/guava-collections/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/guava-collections/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/guava-collections/src/test/resources/test.out b/guava-collections/src/test/resources/test.out new file mode 100644 index 0000000000..7a79da3803 --- /dev/null +++ b/guava-collections/src/test/resources/test.out @@ -0,0 +1 @@ +John Jane Adam Tom \ No newline at end of file diff --git a/guava-collections/src/test/resources/test1.in b/guava-collections/src/test/resources/test1.in new file mode 100644 index 0000000000..70c379b63f --- /dev/null +++ b/guava-collections/src/test/resources/test1.in @@ -0,0 +1 @@ +Hello world \ No newline at end of file diff --git a/guava-collections/src/test/resources/test1_1.in b/guava-collections/src/test/resources/test1_1.in new file mode 100644 index 0000000000..8318c86b35 --- /dev/null +++ b/guava-collections/src/test/resources/test1_1.in @@ -0,0 +1 @@ +Test \ No newline at end of file diff --git a/guava-collections/src/test/resources/test2.in b/guava-collections/src/test/resources/test2.in new file mode 100644 index 0000000000..622efea9e6 --- /dev/null +++ b/guava-collections/src/test/resources/test2.in @@ -0,0 +1,4 @@ +John +Jane +Adam +Tom \ No newline at end of file diff --git a/guava-collections/src/test/resources/test_copy.in b/guava-collections/src/test/resources/test_copy.in new file mode 100644 index 0000000000..70c379b63f --- /dev/null +++ b/guava-collections/src/test/resources/test_copy.in @@ -0,0 +1 @@ +Hello world \ No newline at end of file diff --git a/guava-collections/src/test/resources/test_le.txt b/guava-collections/src/test/resources/test_le.txt new file mode 100644 index 0000000000000000000000000000000000000000..f7cc484bf45e18b3fe4dea78290abf122bedbad1 GIT binary patch literal 4 LcmYdcU|;|M0h9n` literal 0 HcmV?d00001 diff --git a/guava/README.md b/guava/README.md index fe1a347d72..7501bf08de 100644 --- a/guava/README.md +++ b/guava/README.md @@ -4,33 +4,19 @@ ### Relevant Articles: -- [Guava Collections Cookbook](http://www.baeldung.com/guava-collections) -- [Guava Ordering Cookbook](http://www.baeldung.com/guava-order) - [Guava Functional Cookbook](http://www.baeldung.com/guava-functions-predicates) -- [Hamcrest Collections Cookbook](http://www.baeldung.com/hamcrest-collections-arrays) -- [Partition a List in Java](http://www.baeldung.com/java-list-split) -- [Filtering and Transforming Collections in Guava](http://www.baeldung.com/guava-filter-and-transform-a-collection) -- [Guava – Join and Split Collections](http://www.baeldung.com/guava-joiner-and-splitter-tutorial) - [Guava – Write to File, Read from File](http://www.baeldung.com/guava-write-to-file-read-from-file) -- [Guava – Lists](http://www.baeldung.com/guava-lists) -- [Guava – Sets](http://www.baeldung.com/guava-sets) -- [Guava – Maps](http://www.baeldung.com/guava-maps) - [Guava Set + Function = Map](http://www.baeldung.com/guava-set-function-map-tutorial) - [Guide to Guava’s Ordering](http://www.baeldung.com/guava-ordering) - [Guide to Guava’s PreConditions](http://www.baeldung.com/guava-preconditions) - [Introduction to Guava CacheLoader](http://www.baeldung.com/guava-cacheloader) - [Introduction to Guava Memoizer](http://www.baeldung.com/guava-memoizer) - [Guide to Guava’s EventBus](http://www.baeldung.com/guava-eventbus) -- [Guide to Guava Multimap](http://www.baeldung.com/guava-multimap) -- [Guide to Guava RangeSet](http://www.baeldung.com/guava-rangeset) -- [Guide to Guava RangeMap](http://www.baeldung.com/guava-rangemap) - [Guide to Guava Table](http://www.baeldung.com/guava-table) - [Guide to Guava’s Reflection Utilities](http://www.baeldung.com/guava-reflection) - [Guide to Guava ClassToInstanceMap](http://www.baeldung.com/guava-class-to-instance-map) -- [Guide to Guava MinMaxPriorityQueue and EvictingQueue](http://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) - [Guide to Mathematical Utilities in Guava](http://www.baeldung.com/guava-math) - [Bloom Filter in Java using Guava](http://www.baeldung.com/guava-bloom-filter) - [Using Guava CountingOutputStream](http://www.baeldung.com/guava-counting-outputstream) - [Hamcrest Text Matchers](http://www.baeldung.com/hamcrest-text-matchers) - [Quick Guide to the Guava RateLimiter](http://www.baeldung.com/guava-rate-limiter) -- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) diff --git a/guava/pom.xml b/guava/pom.xml index 60678608dd..1d37a79ab6 100644 --- a/guava/pom.xml +++ b/guava/pom.xml @@ -14,12 +14,6 @@ - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - org.apache.commons commons-lang3 @@ -56,7 +50,6 @@ 24.0-jre 3.5 - 4.1 3.6.1 diff --git a/pom.xml b/pom.xml index 28a6dd358e..d48ec6b7cb 100644 --- a/pom.xml +++ b/pom.xml @@ -372,6 +372,7 @@ google-web-toolkit gson guava + guava-collections guava-modules/guava-18 guava-modules/guava-19 guava-modules/guava-21 @@ -1279,6 +1280,7 @@ google-cloud gson guava + guava-collections guava-modules/guava-18 guava-modules/guava-19 guava-modules/guava-21 From c882fa6e54cc7467caea98c2eeaaf16f1c58ae97 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 14 Oct 2018 23:40:39 +0300 Subject: [PATCH 120/546] fix boot logging modules --- pom.xml | 3 + spring-boot-disable-console-logging/README.md | 2 + .../disabling-console-jul/pom.xml | 8 ++- .../properties/DisablingConsoleJulApp.java | 0 .../DisabledConsoleRestController.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logging.properties | 0 .../disabling-console-log4j2/pom.xml | 8 ++- .../log4j2/xml/DisablingConsoleLog4j2App.java | 0 .../DisabledConsoleRestController.java | 0 .../src/main/resources/log4j2.xml | 0 .../disabling-console-logback/pom.xml | 10 +++- .../xml/DisablingConsoleLogbackApp.java | 0 .../DisabledConsoleRestController.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logback-spring.xml | 0 .../pom.xml | 5 +- spring-boot-logging-log4j2/README.md | 1 - spring-boot-logging-log4j2/pom.xml | 57 ++++++++++++------- .../spring-boot-logging-log4j2-app/pom.xml | 33 ----------- .../springbootlogging/LoggingController.java | 2 +- .../SpringBootLoggingApplication.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/log4j2-spring.xml | 0 .../SpringContextIntegrationTest.java | 0 25 files changed, 65 insertions(+), 64 deletions(-) create mode 100644 spring-boot-disable-console-logging/README.md rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-jul/pom.xml (85%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-jul/src/main/resources/application.properties (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-jul/src/main/resources/logging.properties (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-log4j2/pom.xml (82%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-log4j2/src/main/resources/log4j2.xml (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-logback/pom.xml (63%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-logback/src/main/resources/application.properties (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/disabling-console-logback/src/main/resources/logback-spring.xml (100%) rename {spring-boot-logging-log4j2/disabling-console-logging => spring-boot-disable-console-logging}/pom.xml (80%) delete mode 100644 spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/pom.xml rename spring-boot-logging-log4j2/{spring-boot-logging-log4j2-app => }/src/main/java/com/baeldung/springbootlogging/LoggingController.java (97%) rename spring-boot-logging-log4j2/{spring-boot-logging-log4j2-app => }/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java (100%) rename spring-boot-logging-log4j2/{spring-boot-logging-log4j2-app => }/src/main/resources/application.properties (100%) rename spring-boot-logging-log4j2/{spring-boot-logging-log4j2-app => }/src/main/resources/log4j2-spring.xml (100%) rename spring-boot-logging-log4j2/{spring-boot-logging-log4j2-app => }/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) diff --git a/pom.xml b/pom.xml index da1733d2b2..6900f902aa 100644 --- a/pom.xml +++ b/pom.xml @@ -482,6 +482,7 @@ spring-boot-mvc spring-boot-vue spring-boot-logging-log4j2 + spring-boot-disable-console-logging spring-cloud-data-flow spring-cloud spring-cloud-bus @@ -1024,6 +1025,7 @@ spring-boot-security spring-boot-mvc spring-boot-logging-log4j2 + spring-boot-disable-console-logging spring-cloud-data-flow spring-cloud spring-cloud-bus @@ -1379,6 +1381,7 @@ spring-boot-security spring-boot-mvc spring-boot-logging-log4j2 + spring-boot-disable-console-logging spring-cloud-data-flow spring-cloud spring-cloud-bus diff --git a/spring-boot-disable-console-logging/README.md b/spring-boot-disable-console-logging/README.md new file mode 100644 index 0000000000..7676bd1919 --- /dev/null +++ b/spring-boot-disable-console-logging/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Logging in Spring Boot](http://www.baeldung.com/spring-boot-logging) diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/pom.xml b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml similarity index 85% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/pom.xml rename to spring-boot-disable-console-logging/disabling-console-jul/pom.xml index c3bad74352..ceac0616e9 100644 --- a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml @@ -3,10 +3,12 @@ 4.0.0 disabling-console-jul + + - com.baeldung - disabling-console-logging - 0.0.1-SNAPSHOT + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java b/spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java rename to spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java b/spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java rename to spring-boot-disable-console-logging/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/resources/application.properties b/spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/application.properties similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/resources/application.properties rename to spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/application.properties diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/resources/logging.properties b/spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/logging.properties similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-jul/src/main/resources/logging.properties rename to spring-boot-disable-console-logging/disabling-console-jul/src/main/resources/logging.properties diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/pom.xml b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml similarity index 82% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/pom.xml rename to spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml index f9b34ec7d9..d6e9a8b5e5 100644 --- a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml @@ -3,10 +3,12 @@ 4.0.0 disabling-console-log4j2 + + - com.baeldung - disabling-console-logging - 0.0.1-SNAPSHOT + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java b/spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java rename to spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java b/spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java rename to spring-boot-disable-console-logging/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/src/main/resources/log4j2.xml b/spring-boot-disable-console-logging/disabling-console-log4j2/src/main/resources/log4j2.xml similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-log4j2/src/main/resources/log4j2.xml rename to spring-boot-disable-console-logging/disabling-console-log4j2/src/main/resources/log4j2.xml diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/pom.xml b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml similarity index 63% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/pom.xml rename to spring-boot-disable-console-logging/disabling-console-logback/pom.xml index 6f2170390b..f18066ea03 100644 --- a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml @@ -2,8 +2,16 @@ 4.0.0 com.baeldung - disabling-console-logging + spring-boot-disable-console-logging 0.0.1-SNAPSHOT disabling-console-logback + + + + org.springframework.boot + spring-boot-starter-web + + + \ No newline at end of file diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java b/spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java rename to spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java b/spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java rename to spring-boot-disable-console-logging/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/resources/application.properties b/spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/application.properties similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/resources/application.properties rename to spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/application.properties diff --git a/spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/resources/logback-spring.xml b/spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/logback-spring.xml similarity index 100% rename from spring-boot-logging-log4j2/disabling-console-logging/disabling-console-logback/src/main/resources/logback-spring.xml rename to spring-boot-disable-console-logging/disabling-console-logback/src/main/resources/logback-spring.xml diff --git a/spring-boot-logging-log4j2/disabling-console-logging/pom.xml b/spring-boot-disable-console-logging/pom.xml similarity index 80% rename from spring-boot-logging-log4j2/disabling-console-logging/pom.xml rename to spring-boot-disable-console-logging/pom.xml index 39a4a40f12..ec84372f99 100644 --- a/spring-boot-logging-log4j2/disabling-console-logging/pom.xml +++ b/spring-boot-disable-console-logging/pom.xml @@ -1,14 +1,15 @@ 4.0.0 - disabling-console-logging + spring-boot-disable-console-logging pom Projects for Disabling Spring Boot Console Logging tutorials + parent-boot-2 com.baeldung - spring-boot-logging-log4j2 0.0.1-SNAPSHOT + ../parent-boot-2 diff --git a/spring-boot-logging-log4j2/README.md b/spring-boot-logging-log4j2/README.md index 305957ed8d..7676bd1919 100644 --- a/spring-boot-logging-log4j2/README.md +++ b/spring-boot-logging-log4j2/README.md @@ -1,3 +1,2 @@ ### Relevant Articles: - [Logging in Spring Boot](http://www.baeldung.com/spring-boot-logging) -- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) diff --git a/spring-boot-logging-log4j2/pom.xml b/spring-boot-logging-log4j2/pom.xml index 7caf1e8690..7220672eaf 100644 --- a/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-logging-log4j2/pom.xml @@ -4,41 +4,58 @@ 4.0.0 spring-boot-logging-log4j2 - pom - Projects for Spring Boot Logging tutorials + jar + Demo project for Spring Boot Logging with Log4J2 + + - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 + spring-boot-starter-parent + org.springframework.boot + 2.0.5.RELEASE org.springframework.boot spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-logging + + - org.springframework.boot spring-boot-starter-test - test + + + org.springframework.boot + spring-boot-starter-log4j2 - - spring-boot-logging-log4j2-app - disabling-console-logging - - - - - org.springframework.boot - spring-boot-maven-plugin - - + + + org.apache.maven.plugins + maven-surefire-plugin + + 3 + true + + **/*IntegrationTest.java + **/*IntTest.java + **/*ManualTest.java + **/*LiveTest.java + + + + - + + + + diff --git a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/pom.xml b/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/pom.xml deleted file mode 100644 index 571794167e..0000000000 --- a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 4.0.0 - - spring-boot-logging-log4j2-app - jar - Demo project for Spring Boot Logging with Log4J2 - - - spring-boot-logging-log4j2 - com.baeldung - 0.0.1-SNAPSHOT - .. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - diff --git a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/java/com/baeldung/springbootlogging/LoggingController.java b/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java similarity index 97% rename from spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/java/com/baeldung/springbootlogging/LoggingController.java rename to spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java index 07763c8c3b..d462926616 100644 --- a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/java/com/baeldung/springbootlogging/LoggingController.java +++ b/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java @@ -32,6 +32,6 @@ public class LoggingController { loggerNative.warn("This WARN message been printed by Log4j2 without passing through SLF4J"); loggerNative.error("This ERROR message been printed by Log4j2 without passing through SLF4J"); loggerNative.fatal("This FATAL message been printed by Log4j2 without passing through SLF4J"); - return "Howdy! Check out the Logs to see the output printed directly throguh Log4j2..."; + return "Howdy! Check out the Logs to see the output printed directly through Log4j2..."; } } diff --git a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java b/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java similarity index 100% rename from spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java rename to spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java diff --git a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/resources/application.properties b/spring-boot-logging-log4j2/src/main/resources/application.properties similarity index 100% rename from spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/resources/application.properties rename to spring-boot-logging-log4j2/src/main/resources/application.properties diff --git a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/resources/log4j2-spring.xml b/spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml similarity index 100% rename from spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/main/resources/log4j2-spring.xml rename to spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml diff --git a/spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-boot-logging-log4j2/spring-boot-logging-log4j2-app/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextIntegrationTest.java From 500367de1400deb5c7d47a4ea2bafb72899af939 Mon Sep 17 00:00:00 2001 From: Syed Mansoor Date: Mon, 15 Oct 2018 12:58:06 +1100 Subject: [PATCH 121/546] Removed Gradle --- apache-pulsar/build.gradle | 26 --- .../gradle/wrapper/gradle-wrapper.jar | Bin 54413 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 - apache-pulsar/gradlew | 172 ------------------ apache-pulsar/gradlew.bat | 84 --------- apache-pulsar/pom.xml | 21 +++ ...al.java => ExclusiveSubscriptionTest.java} | 2 +- ...ial.java => FailoverSubscriptionTest.java} | 2 +- 8 files changed, 23 insertions(+), 289 deletions(-) delete mode 100755 apache-pulsar/build.gradle delete mode 100755 apache-pulsar/gradle/wrapper/gradle-wrapper.jar delete mode 100755 apache-pulsar/gradle/wrapper/gradle-wrapper.properties delete mode 100755 apache-pulsar/gradlew delete mode 100755 apache-pulsar/gradlew.bat create mode 100644 apache-pulsar/pom.xml rename apache-pulsar/src/main/java/com/baeldung/subscriptions/{ExclusiveSubscriptionTutorial.java => ExclusiveSubscriptionTest.java} (98%) mode change 100755 => 100644 rename apache-pulsar/src/main/java/com/baeldung/subscriptions/{FailoverSubscriptionTutorial.java => FailoverSubscriptionTest.java} (98%) mode change 100755 => 100644 diff --git a/apache-pulsar/build.gradle b/apache-pulsar/build.gradle deleted file mode 100755 index f3545d69b2..0000000000 --- a/apache-pulsar/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -apply plugin: 'java' -ext{ - pulsarVersion = '2.1.1-incubating' -} - -repositories { - jcenter() - mavenCentral() - mavenLocal() -} - -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -group = 'com.baeldung.pulsar' -archivesBaseName = 'pulsar-java-example' -version = '0.0.1' - - - - -dependencies { - compile group: 'org.apache.pulsar', name: 'pulsar-client', version: pulsarVersion - -} - diff --git a/apache-pulsar/gradle/wrapper/gradle-wrapper.jar b/apache-pulsar/gradle/wrapper/gradle-wrapper.jar deleted file mode 100755 index 91ca28c8b802289c3a438766657a5e98f20eff03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 54413 zcmafaV|Zr4wq`oEZQHiZj%|LijZQlLf{tz5M#r{o+fI6V=G-$g=gzrzeyqLskF}nv zRZs0&c;EUi2L_G~0s;*U0szbK}f6%Pvi zRZ#mYf6f1oqJoH`jHHCB8l!^by~4z}yc`4LEP@;Z?bO6{g9`Hk+s@(L1jC5Tq{1Yf z4E;CQvrx0-gF+peRxFC*gF=&$zNYk(w0q}U=WqXMz`tYs@0o%B{dRD+{C_6(f9t^g zhmNJQv6-#;f2)f2uc{u-#*U8W&i{|ewYN^n_1~cv|1J!}zc&$eaBy{T{cEpa46s*q zHFkD2cV;xTHFj}{*3kBt*FgS4A5SI|$F%$gB@It9FlC}D3y`sbZG{2P6gGwC$U`6O zb_cId9AhQl#A<&=x>-xDD%=Ppt$;y71@Lwsl{x943#T@8*?cbR<~d`@@}4V${+r$jICUIOzgZJy_9I zu*eA(F)$~J07zX%tmQN}1^wj+RM|9bbwhQA=xrPE*{vB_P!pPYT5{Or^m*;Qz#@Bl zRywCG_RDyM6bf~=xn}Ft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a56 zyZE \(.*\)$'` - 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="" - -# 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/apache-pulsar/gradlew.bat b/apache-pulsar/gradlew.bat deleted file mode 100755 index e95643d6a2..0000000000 --- a/apache-pulsar/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@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= - -@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/apache-pulsar/pom.xml b/apache-pulsar/pom.xml new file mode 100644 index 0000000000..da004a7638 --- /dev/null +++ b/apache-pulsar/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + com.baeldung.pulsar + pulsar-java + 0.0.1 + + + + org.apache.pulsar + pulsar-client + 2.1.1-incubating + compile + + + + 1.8 + 1.8 + + diff --git a/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTutorial.java b/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTest.java old mode 100755 new mode 100644 similarity index 98% rename from apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTutorial.java rename to apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTest.java index da9ff0974d..efb898eaf4 --- a/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTutorial.java +++ b/apache-pulsar/src/main/java/com/baeldung/subscriptions/ExclusiveSubscriptionTest.java @@ -10,7 +10,7 @@ import org.apache.pulsar.client.api.SubscriptionType; import java.util.stream.IntStream; -public class ExclusiveSubscriptionTutorial { +public class ExclusiveSubscriptionTest { private static final String SERVICE_URL = "pulsar://localhost:6650"; private static final String TOPIC_NAME = "test-topic"; private static final String SUBSCRIPTION_NAME = "test-subscription"; diff --git a/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTutorial.java b/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTest.java old mode 100755 new mode 100644 similarity index 98% rename from apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTutorial.java rename to apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTest.java index 30351c229d..545661e0c3 --- a/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTutorial.java +++ b/apache-pulsar/src/main/java/com/baeldung/subscriptions/FailoverSubscriptionTest.java @@ -11,7 +11,7 @@ import org.apache.pulsar.client.api.SubscriptionType; import java.util.stream.IntStream; -public class FailoverSubscriptionTutorial { +public class FailoverSubscriptionTest { private static final String SERVICE_URL = "pulsar://localhost:6650"; private static final String TOPIC_NAME = "failover-subscription-test-topic"; private static final String SUBSCRIPTION_NAME = "test-subscription"; From 3d51a0f86aa42ffd32ba9233af1537be9ba2353a Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sun, 14 Oct 2018 22:19:23 -0500 Subject: [PATCH 122/546] BAEL-2253 Update README (#5460) * BAEL-1766: Update README * BAEL-1853: add link to article * BAEL-1801: add link to article * Added links back to articles * Add links back to articles * BAEL-1795: Update README * BAEL-1901 and BAEL-1555 add links back to article * BAEL-2026 add link back to article * BAEL-2029: add link back to article * BAEL-1898: Add link back to article * BAEL-2102 and BAEL-2131 Add links back to articles * BAEL-2132 Add link back to article * BAEL-1980: add link back to article * BAEL-2200: Display auto-configuration report in Spring Boot * BAEL-2253: Add link back to article --- javaxval/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/javaxval/README.md b/javaxval/README.md index 3153546c7d..3a975022ad 100644 --- a/javaxval/README.md +++ b/javaxval/README.md @@ -9,3 +9,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Java Bean Validation Basics](http://www.baeldung.com/javax-validation) - [Validating Container Elements with Bean Validation 2.0](http://www.baeldung.com/bean-validation-container-elements) - [Method Constraints with Bean Validation 2.0](http://www.baeldung.com/javax-validation-method-constraints) +- [Difference Between @NotNull, @NotEmpty, and @NotBlank Constraints in Bean Validation](https://www.baeldung.com/java-bean-validation-not-null-empty-blank) From 23c7fb4adefb98f7c4b5cacf3560f4c8daad39ea Mon Sep 17 00:00:00 2001 From: Puneet Dewan Date: Mon, 15 Oct 2018 22:50:53 +0800 Subject: [PATCH 123/546] [BAEL-2248] Add Controller Method to accept form data Add Test method in RestTemplateBasicLiveTest --- .../web/controller/FooController.java | 17 +++++++++------- .../client/RestTemplateBasicLiveTest.java | 20 ++++++++++++++++++- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooController.java b/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooController.java index bf26eb3292..e8cb218258 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooController.java +++ b/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooController.java @@ -5,13 +5,9 @@ import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import org.baeldung.web.dto.Foo; import org.baeldung.web.dto.FooProtos; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.*; @Controller public class FooController { @@ -47,7 +43,7 @@ public class FooController { } @RequestMapping(method = RequestMethod.POST, value = "/foos/new") - @ResponseStatus(HttpStatus.OK) + @ResponseStatus(HttpStatus.CREATED) @ResponseBody public Foo createFoo(@RequestBody final Foo foo) { return foo; @@ -60,4 +56,11 @@ public class FooController { return id; } + @RequestMapping(method = RequestMethod.POST, value = "/foos/form") + @ResponseStatus(HttpStatus.CREATED) + @ResponseBody + public String submitFoo(@RequestParam("id") String id) { + return id; + } + } diff --git a/spring-resttemplate/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java b/spring-resttemplate/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java index 7bcaab6a07..143aa079d5 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java @@ -26,6 +26,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RequestCallback; import org.springframework.web.client.RestTemplate; @@ -213,7 +215,23 @@ public class RestTemplateBasicLiveTest { } } - // + @Test + public void givenFooService_whenFormSubmit_thenResourceIsCreated() { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + + MultiValueMap map= new LinkedMultiValueMap<>(); + map.add("id", "1"); + + HttpEntity> request = new HttpEntity<>(map, headers); + + ResponseEntity response = restTemplate.postForEntity( fooResourceUrl+"/form", request , String.class); + + assertThat(response.getStatusCode(), is(HttpStatus.CREATED)); + final String fooResponse = response.getBody(); + assertThat(fooResponse, notNullValue()); + assertThat(fooResponse, is("1")); + } private HttpHeaders prepareBasicAuthHeaders() { final HttpHeaders headers = new HttpHeaders(); From eeb5e0892b759661283d187bb800cdce6d6844a9 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Mon, 15 Oct 2018 21:40:00 +0200 Subject: [PATCH 124/546] removed unnecessary Mockito and refactored test method name --- .../FindItemsBasedOnOtherStreamUnitTest.java | 180 +++++++++--------- 1 file changed, 88 insertions(+), 92 deletions(-) rename core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java => core-java-collections/src/test/java/com/baeldung/findItems/FindItemsBasedOnOtherStreamUnitTest.java (63%) diff --git a/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java b/core-java-collections/src/test/java/com/baeldung/findItems/FindItemsBasedOnOtherStreamUnitTest.java similarity index 63% rename from core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java rename to core-java-collections/src/test/java/com/baeldung/findItems/FindItemsBasedOnOtherStreamUnitTest.java index a0dcdddd85..326ea9fbe4 100644 --- a/core-java-8/findItemsBasedOnValues/src/findItems/FindItemsBasedOnValues.java +++ b/core-java-collections/src/test/java/com/baeldung/findItems/FindItemsBasedOnOtherStreamUnitTest.java @@ -1,93 +1,89 @@ -package findItems; - -import static org.junit.Assert.assertEquals; - -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import org.junit.Test; - -public class FindItemsBasedOnValues { - - List EmplList = new ArrayList(); - List deptList = new ArrayList(); - - public static void main(String[] args) throws ParseException { - FindItemsBasedOnValues findItems = new FindItemsBasedOnValues(); - findItems.givenDepartmentList_thenEmployeeListIsFilteredCorrectly(); - } - - @Test - public void givenDepartmentList_thenEmployeeListIsFilteredCorrectly() { - Integer expectedId = 1002; - - populate(EmplList, deptList); - - List filteredList = EmplList.stream() - .filter(empl -> deptList.stream() - .anyMatch(dept -> dept.getDepartment() - .equals("sales") && empl.getEmployeeId() - .equals(dept.getEmployeeId()))) - .collect(Collectors.toList()); - - assertEquals(expectedId, filteredList.get(0) - .getEmployeeId()); - } - - private void populate(List EmplList, List deptList) { - Employee employee1 = new Employee(1001, "empl1"); - Employee employee2 = new Employee(1002, "empl2"); - Employee employee3 = new Employee(1003, "empl3"); - - Collections.addAll(EmplList, employee1, employee2, employee3); - - Department department1 = new Department(1002, "sales"); - Department department2 = new Department(1003, "marketing"); - Department department3 = new Department(1004, "sales"); - - Collections.addAll(deptList, department1, department2, department3); - } -} - -class Employee { - Integer employeeId; - String employeeName; - - public Employee(Integer employeeId, String employeeName) { - super(); - this.employeeId = employeeId; - this.employeeName = employeeName; - } - - public Integer getEmployeeId() { - return employeeId; - } - - public String getEmployeeName() { - return employeeName; - } - -} - -class Department { - Integer employeeId; - String department; - - public Department(Integer employeeId, String department) { - super(); - this.employeeId = employeeId; - this.department = department; - } - - public Integer getEmployeeId() { - return employeeId; - } - - public String getDepartment() { - return department; - } - +package com.baeldung.findItems; + +import static org.junit.Assert.assertEquals; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.Test; + +public class FindItemsBasedOnOtherStreamUnitTest { + + private List employeeList = new ArrayList(); + + private List departmentList = new ArrayList(); + + @Test + public void givenDepartmentList_thenEmployeeListIsFilteredCorrectly() { + Integer expectedId = 1002; + + populate(employeeList, departmentList); + + List filteredList = employeeList.stream() + .filter(empl -> departmentList.stream() + .anyMatch(dept -> dept.getDepartment() + .equals("sales") && empl.getEmployeeId() + .equals(dept.getEmployeeId()))) + .collect(Collectors.toList()); + + assertEquals(expectedId, filteredList.get(0) + .getEmployeeId()); + } + + private void populate(List EmplList, List deptList) { + Employee employee1 = new Employee(1001, "empl1"); + Employee employee2 = new Employee(1002, "empl2"); + Employee employee3 = new Employee(1003, "empl3"); + + Collections.addAll(EmplList, employee1, employee2, employee3); + + Department department1 = new Department(1002, "sales"); + Department department2 = new Department(1003, "marketing"); + Department department3 = new Department(1004, "sales"); + + Collections.addAll(deptList, department1, department2, department3); + } +} + +class Employee { + private Integer employeeId; + private String employeeName; + + Employee(Integer employeeId, String employeeName) { + super(); + this.employeeId = employeeId; + this.employeeName = employeeName; + } + + Integer getEmployeeId() { + return employeeId; + } + + public String getEmployeeName() { + return employeeName; + } + +} + +class Department { + private Integer employeeId; + private String department; + + Department(Integer employeeId, String department) { + super(); + this.employeeId = employeeId; + this.department = department; + } + + Integer getEmployeeId() { + return employeeId; + } + + String getDepartment() { + return department; + } + } \ No newline at end of file From 8cfa575f5d80ae73bafa9abe4bc4253dbe72db90 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Mon, 15 Oct 2018 21:40:50 +0200 Subject: [PATCH 125/546] removed unneccessary folder --- core-java-8/findItemsBasedOnValues/.gitignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 core-java-8/findItemsBasedOnValues/.gitignore diff --git a/core-java-8/findItemsBasedOnValues/.gitignore b/core-java-8/findItemsBasedOnValues/.gitignore deleted file mode 100644 index ae3c172604..0000000000 --- a/core-java-8/findItemsBasedOnValues/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ From 0d91f704c289cd8d5cb8b37aaddcff105eb4d142 Mon Sep 17 00:00:00 2001 From: Rahul Srivastava Date: Tue, 16 Oct 2018 01:57:52 +0530 Subject: [PATCH 126/546] Giving proper indentation --- .../main/java/com/baeldung/hexagonal/architecture/Car.java | 2 +- .../com/baeldung/hexagonal/architecture/FordAdapter.java | 5 ----- .../com/baeldung/hexagonal/architecture/HondaAdapter.java | 7 +------ 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java index 79e5ddd061..ebc5f78193 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java +++ b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java @@ -5,6 +5,7 @@ import lombok.Data; @AllArgsConstructor @Data public class Car { + String manufacturerName; String fuleType; String modelNo; @@ -31,5 +32,4 @@ public class Car { public void enableChildLock() { //Enable child lock in the car } - } diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java index 75e83e5dce..7f4248c17e 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java @@ -8,25 +8,21 @@ public class FordAdapter implements ManufacturingPort { @Override public void manufacturingMethodology(Car car) { // Process for manufacturing ford car - } @Override public void manufacturingLocation(String location) { // Location at which ford manufacturing will take place - } @Override public void logoForTheCar(Car car) { // Put ford logo on the car - } @Override public void timeToMarketForTheCar(Car car) { // Find time to market for a particular ford car model - } @Override @@ -44,5 +40,4 @@ public class FordAdapter implements ManufacturingPort { public void fordEngineFuelTest(Car car) { //Do engine test for ford } - } diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java index 7b6bac1aa6..d6773d9b6a 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java @@ -7,26 +7,22 @@ public class HondaAdapter implements ManufacturingPort { @Override public void manufacturingMethodology(Car car) { - // Process for manufacturing honda car - + // Process for manufacturing honda car } @Override public void manufacturingLocation(String location) { // Location at which honda manufacturing will take place - } @Override public void logoForTheCar(Car car) { // Put honda logo on the car - } @Override public void timeToMarketForTheCar(Car car) { // Find time to market for a particular honda car model - } @Override @@ -44,5 +40,4 @@ public class HondaAdapter implements ManufacturingPort { public void carCrashAndSafetyTest(Car car) { //Do car crash test got honda car } - } \ No newline at end of file From 5e791c56a1a5e8165a332c0f9ac83358a0706441 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Mon, 15 Oct 2018 23:12:19 +0200 Subject: [PATCH 127/546] removed unneccessary folder --- .../com/baeldung/modulo/ModuloUnitTest.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 core-java/src/test/java/com/baeldung/modulo/ModuloUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/modulo/ModuloUnitTest.java b/core-java/src/test/java/com/baeldung/modulo/ModuloUnitTest.java new file mode 100644 index 0000000000..8b3685adf3 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/modulo/ModuloUnitTest.java @@ -0,0 +1,54 @@ +package com.baeldung.modulo; + +import org.junit.Test; +import static org.assertj.core.api.Java6Assertions.*; + +public class ModuloUnitTest { + + @Test + public void whenIntegerDivision_thenLosesRemainder(){ + assertThat(11 / 4).isEqualTo(2); + } + + @Test + public void whenDoubleDivision_thenKeepsRemainder(){ + assertThat(11 / 4.0).isEqualTo(2.75); + } + + @Test + public void whenModulo_thenReturnsRemainder(){ + assertThat(11 % 4).isEqualTo(3); + } + + @Test(expected = ArithmeticException.class) + public void whenDivisionByZero_thenArithmeticException(){ + double result = 1 / 0; + } + + @Test(expected = ArithmeticException.class) + public void whenModuloByZero_thenArithmeticException(){ + double result = 1 % 0; + } + + @Test + public void whenDivisorIsOddAndModulusIs2_thenResultIs1(){ + assertThat(3 % 2).isEqualTo(1); + } + + @Test + public void whenDivisorIsEvenAndModulusIs2_thenResultIs0(){ + assertThat(4 % 2).isEqualTo(0); + } + + @Test + public void whenItemsIsAddedToCircularQueue_thenNoArrayIndexOutOfBounds(){ + int QUEUE_CAPACITY= 10; + int[] circularQueue = new int[QUEUE_CAPACITY]; + int itemsInserted = 0; + for (int value = 0; value < 1000; value++) { + int writeIndex = ++itemsInserted % QUEUE_CAPACITY; + circularQueue[writeIndex] = value; + } + } + +} From 45194b5edc1b18ca785aeaf62e0530cc4ed21293 Mon Sep 17 00:00:00 2001 From: rozagerardo Date: Tue, 16 Oct 2018 02:22:19 -0300 Subject: [PATCH 128/546] [BAEL-1502] spring-5-reactive | Validation for Functional Endpoints (#5437) * Added validation for functional endpoints scenarios: * validating in handler explicitly * created abstract handler with validation steps * using validation handlers with two implementations * * added annotated entity to be used with springvalidator * * added tests and cleaning the code slightly --- .../FunctionalValidationsApplication.java | 12 ++ .../handlers/AbstractValidationHandler.java | 45 +++++++ .../handlers/FunctionalHandler.java | 43 +++++++ ...notatedRequestEntityValidationHandler.java | 30 +++++ .../CustomRequestEntityValidationHandler.java | 37 ++++++ .../impl/OtherEntityValidationHandler.java | 28 +++++ .../model/AnnotatedRequestEntity.java | 23 ++++ .../functional/model/CustomRequestEntity.java | 17 +++ .../functional/model/OtherEntity.java | 17 +++ .../routers/ValidationsRouters.java | 29 +++++ .../CustomRequestEntityValidator.java | 29 +++++ .../validators/OtherEntityValidator.java | 27 +++++ ...FunctionalEndpointValidationsLiveTest.java | 111 ++++++++++++++++++ 13 files changed, 448 insertions(+) create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/FunctionalValidationsApplication.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/AbstractValidationHandler.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/FunctionalHandler.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/AnnotatedRequestEntityValidationHandler.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/CustomRequestEntityValidationHandler.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/OtherEntityValidationHandler.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/AnnotatedRequestEntity.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/CustomRequestEntity.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/OtherEntity.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/routers/ValidationsRouters.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/CustomRequestEntityValidator.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/OtherEntityValidator.java create mode 100644 spring-5-reactive/src/test/java/com/baeldung/validations/functional/FunctionalEndpointValidationsLiveTest.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/FunctionalValidationsApplication.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/FunctionalValidationsApplication.java new file mode 100644 index 0000000000..e548e33c85 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/FunctionalValidationsApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.validations.functional; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class FunctionalValidationsApplication { + + public static void main(String[] args) { + SpringApplication.run(FunctionalValidationsApplication.class, args); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/AbstractValidationHandler.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/AbstractValidationHandler.java new file mode 100644 index 0000000000..f34c1ee8d8 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/AbstractValidationHandler.java @@ -0,0 +1,45 @@ +package com.baeldung.validations.functional.handlers; + +import org.springframework.http.HttpStatus; +import org.springframework.validation.BeanPropertyBindingResult; +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; +import org.springframework.web.server.ResponseStatusException; + +import reactor.core.publisher.Mono; + +public abstract class AbstractValidationHandler { + + private final Class validationClass; + + private final U validator; + + protected AbstractValidationHandler(Class clazz, U validator) { + this.validationClass = clazz; + this.validator = validator; + } + + abstract protected Mono processBody(T validBody, final ServerRequest originalRequest); + + public final Mono handleRequest(final ServerRequest request) { + return request.bodyToMono(this.validationClass) + .flatMap(body -> { + Errors errors = new BeanPropertyBindingResult(body, this.validationClass.getName()); + this.validator.validate(body, errors); + + if (errors == null || errors.getAllErrors() + .isEmpty()) { + return processBody(body, request); + } else { + return onValidationErrors(errors, body, request); + } + }); + } + + protected Mono onValidationErrors(Errors errors, T invalidBody, final ServerRequest request) { + throw new ResponseStatusException(HttpStatus.BAD_REQUEST, errors.getAllErrors() + .toString()); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/FunctionalHandler.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/FunctionalHandler.java new file mode 100644 index 0000000000..d7e3bd0bc0 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/FunctionalHandler.java @@ -0,0 +1,43 @@ +package com.baeldung.validations.functional.handlers; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.validation.BeanPropertyBindingResult; +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; +import org.springframework.web.server.ResponseStatusException; + +import com.baeldung.validations.functional.model.CustomRequestEntity; +import com.baeldung.validations.functional.validators.CustomRequestEntityValidator; + +import reactor.core.publisher.Mono; + +@Component +public class FunctionalHandler { + + public Mono handleRequest(final ServerRequest request) { + Validator validator = new CustomRequestEntityValidator(); + Mono responseBody = request.bodyToMono(CustomRequestEntity.class) + .map(body -> { + Errors errors = new BeanPropertyBindingResult(body, CustomRequestEntity.class.getName()); + validator.validate(body, errors); + + if (errors == null || errors.getAllErrors() + .isEmpty()) { + return String.format("Hi, %s [%s]!", body.getName(), body.getCode()); + + } else { + throw new ResponseStatusException(HttpStatus.BAD_REQUEST, errors.getAllErrors() + .toString()); + } + + }); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(responseBody, String.class); + + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/AnnotatedRequestEntityValidationHandler.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/AnnotatedRequestEntityValidationHandler.java new file mode 100644 index 0000000000..2011679741 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/AnnotatedRequestEntityValidationHandler.java @@ -0,0 +1,30 @@ +package com.baeldung.validations.functional.handlers.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.validation.Validator; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import com.baeldung.validations.functional.handlers.AbstractValidationHandler; +import com.baeldung.validations.functional.model.AnnotatedRequestEntity; + +import reactor.core.publisher.Mono; + +@Component +public class AnnotatedRequestEntityValidationHandler extends AbstractValidationHandler { + + private AnnotatedRequestEntityValidationHandler(@Autowired Validator validator) { + super(AnnotatedRequestEntity.class, validator); + } + + @Override + protected Mono processBody(AnnotatedRequestEntity validBody, ServerRequest originalRequest) { + String responseBody = String.format("Hi, %s. Password: %s!", validBody.getUser(), validBody.getPassword()); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(Mono.just(responseBody), String.class); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/CustomRequestEntityValidationHandler.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/CustomRequestEntityValidationHandler.java new file mode 100644 index 0000000000..34630c60b2 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/CustomRequestEntityValidationHandler.java @@ -0,0 +1,37 @@ +package com.baeldung.validations.functional.handlers.impl; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.validation.Errors; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import com.baeldung.validations.functional.handlers.AbstractValidationHandler; +import com.baeldung.validations.functional.model.CustomRequestEntity; +import com.baeldung.validations.functional.validators.CustomRequestEntityValidator; + +import reactor.core.publisher.Mono; + +@Component +public class CustomRequestEntityValidationHandler extends AbstractValidationHandler { + + private CustomRequestEntityValidationHandler() { + super(CustomRequestEntity.class, new CustomRequestEntityValidator()); + } + + @Override + protected Mono processBody(CustomRequestEntity validBody, ServerRequest originalRequest) { + String responseBody = String.format("Hi, %s [%s]!", validBody.getName(), validBody.getCode()); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(Mono.just(responseBody), String.class); + } + + @Override + protected Mono onValidationErrors(Errors errors, CustomRequestEntity invalidBody, final ServerRequest request) { + return ServerResponse.badRequest() + .contentType(MediaType.APPLICATION_JSON) + .body(Mono.just(String.format("Custom message showing the errors: %s", errors.getAllErrors() + .toString())), String.class); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/OtherEntityValidationHandler.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/OtherEntityValidationHandler.java new file mode 100644 index 0000000000..0196287d13 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/handlers/impl/OtherEntityValidationHandler.java @@ -0,0 +1,28 @@ +package com.baeldung.validations.functional.handlers.impl; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import com.baeldung.validations.functional.handlers.AbstractValidationHandler; +import com.baeldung.validations.functional.model.OtherEntity; +import com.baeldung.validations.functional.validators.OtherEntityValidator; + +import reactor.core.publisher.Mono; + +@Component +public class OtherEntityValidationHandler extends AbstractValidationHandler { + + private OtherEntityValidationHandler() { + super(OtherEntity.class, new OtherEntityValidator()); + } + + @Override + protected Mono processBody(OtherEntity validBody, ServerRequest originalRequest) { + String responseBody = String.format("Other object with item %s and quantity %s!", validBody.getItem(), validBody.getQuantity()); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(Mono.just(responseBody), String.class); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/AnnotatedRequestEntity.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/AnnotatedRequestEntity.java new file mode 100644 index 0000000000..992f07481c --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/AnnotatedRequestEntity.java @@ -0,0 +1,23 @@ +package com.baeldung.validations.functional.model; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter +public class AnnotatedRequestEntity { + @NotNull + private String user; + + @NotNull + @Size(min = 4, max = 7) + private String password; + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/CustomRequestEntity.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/CustomRequestEntity.java new file mode 100644 index 0000000000..ed459f121b --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/CustomRequestEntity.java @@ -0,0 +1,17 @@ +package com.baeldung.validations.functional.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter +public class CustomRequestEntity { + + private String name; + private String code; + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/OtherEntity.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/OtherEntity.java new file mode 100644 index 0000000000..78667cb13d --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/model/OtherEntity.java @@ -0,0 +1,17 @@ +package com.baeldung.validations.functional.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter +public class OtherEntity { + + private String item; + private Integer quantity; + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/routers/ValidationsRouters.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/routers/ValidationsRouters.java new file mode 100644 index 0000000000..efbdbe3f99 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/routers/ValidationsRouters.java @@ -0,0 +1,29 @@ +package com.baeldung.validations.functional.routers; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import com.baeldung.validations.functional.handlers.FunctionalHandler; +import com.baeldung.validations.functional.handlers.impl.AnnotatedRequestEntityValidationHandler; +import com.baeldung.validations.functional.handlers.impl.CustomRequestEntityValidationHandler; +import com.baeldung.validations.functional.handlers.impl.OtherEntityValidationHandler; + +@Configuration +public class ValidationsRouters { + + @Bean + public RouterFunction responseHeaderRoute(@Autowired CustomRequestEntityValidationHandler dryHandler, + @Autowired FunctionalHandler complexHandler, + @Autowired OtherEntityValidationHandler otherHandler, + @Autowired AnnotatedRequestEntityValidationHandler annotatedEntityHandler) { + return RouterFunctions.route(RequestPredicates.POST("/complex-handler-functional-validation"), complexHandler::handleRequest) + .andRoute(RequestPredicates.POST("/dry-functional-validation"), dryHandler::handleRequest) + .andRoute(RequestPredicates.POST("/other-dry-functional-validation"), otherHandler::handleRequest) + .andRoute(RequestPredicates.POST("/annotated-functional-validation"), annotatedEntityHandler::handleRequest); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/CustomRequestEntityValidator.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/CustomRequestEntityValidator.java new file mode 100644 index 0000000000..085d477318 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/CustomRequestEntityValidator.java @@ -0,0 +1,29 @@ +package com.baeldung.validations.functional.validators; + +import org.springframework.validation.Errors; +import org.springframework.validation.ValidationUtils; +import org.springframework.validation.Validator; + +import com.baeldung.validations.functional.model.CustomRequestEntity; + +public class CustomRequestEntityValidator implements Validator { + + private static final int MINIMUM_CODE_LENGTH = 6; + + @Override + public boolean supports(Class clazz) { + return CustomRequestEntity.class.isAssignableFrom(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "field.required"); + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "code", "field.required"); + CustomRequestEntity request = (CustomRequestEntity) target; + if (request.getCode() != null && request.getCode() + .trim() + .length() < MINIMUM_CODE_LENGTH) { + errors.rejectValue("code", "field.min.length", new Object[] { Integer.valueOf(MINIMUM_CODE_LENGTH) }, "The code must be at least [" + MINIMUM_CODE_LENGTH + "] characters in length."); + } + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/OtherEntityValidator.java b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/OtherEntityValidator.java new file mode 100644 index 0000000000..18c2c28cfe --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/validations/functional/validators/OtherEntityValidator.java @@ -0,0 +1,27 @@ +package com.baeldung.validations.functional.validators; + +import org.springframework.validation.Errors; +import org.springframework.validation.ValidationUtils; +import org.springframework.validation.Validator; + +import com.baeldung.validations.functional.model.OtherEntity; + +public class OtherEntityValidator implements Validator { + + private static final int MIN_ITEM_QUANTITY = 1; + + @Override + public boolean supports(Class clazz) { + return OtherEntity.class.isAssignableFrom(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "item", "field.required"); + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "quantity", "field.required"); + OtherEntity request = (OtherEntity) target; + if (request.getQuantity() != null && request.getQuantity() < MIN_ITEM_QUANTITY) { + errors.rejectValue("quantity", "field.min.length", new Object[] { Integer.valueOf(MIN_ITEM_QUANTITY) }, "There must be at least one item"); + } + } +} diff --git a/spring-5-reactive/src/test/java/com/baeldung/validations/functional/FunctionalEndpointValidationsLiveTest.java b/spring-5-reactive/src/test/java/com/baeldung/validations/functional/FunctionalEndpointValidationsLiveTest.java new file mode 100644 index 0000000000..5fe764bf8f --- /dev/null +++ b/spring-5-reactive/src/test/java/com/baeldung/validations/functional/FunctionalEndpointValidationsLiveTest.java @@ -0,0 +1,111 @@ +package com.baeldung.validations.functional; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.WebTestClient; +import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec; + +import com.baeldung.validations.functional.model.AnnotatedRequestEntity; +import com.baeldung.validations.functional.model.CustomRequestEntity; + +import reactor.core.publisher.Mono; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class FunctionalEndpointValidationsLiveTest { + + private static final String BASE_URL = "http://localhost:8080"; + private static final String COMPLEX_EP_URL = BASE_URL + "/complex-handler-functional-validation"; + private static final String DRY_EP_URL = BASE_URL + "/dry-functional-validation"; + private static final String ANNOTATIONS_EP_URL = BASE_URL + "/annotated-functional-validation"; + + private static WebTestClient client; + + @BeforeAll + public static void setup() { + client = WebTestClient.bindToServer() + .baseUrl(BASE_URL) + .build(); + } + + @Test + public void whenRequestingDryEPWithInvalidBody_thenObtainBadRequest() { + CustomRequestEntity body = new CustomRequestEntity("name", "123"); + + ResponseSpec response = client.post() + .uri(DRY_EP_URL) + .body(Mono.just(body), CustomRequestEntity.class) + .exchange(); + + response.expectStatus() + .isBadRequest(); + } + + @Test + public void whenRequestingComplexEPWithInvalidBody_thenObtainBadRequest() { + CustomRequestEntity body = new CustomRequestEntity("name", "123"); + + ResponseSpec response = client.post() + .uri(COMPLEX_EP_URL) + .body(Mono.just(body), CustomRequestEntity.class) + .exchange(); + + response.expectStatus() + .isBadRequest(); + } + + @Test + public void whenRequestingAnnotatedEPWithInvalidBody_thenObtainBadRequest() { + AnnotatedRequestEntity body = new AnnotatedRequestEntity("user", "passwordlongerthan7digits"); + + ResponseSpec response = client.post() + .uri(ANNOTATIONS_EP_URL) + .body(Mono.just(body), AnnotatedRequestEntity.class) + .exchange(); + + response.expectStatus() + .isBadRequest(); + } + + @Test + public void whenRequestingDryEPWithValidBody_thenObtainBadRequest() { + CustomRequestEntity body = new CustomRequestEntity("name", "1234567"); + + ResponseSpec response = client.post() + .uri(DRY_EP_URL) + .body(Mono.just(body), CustomRequestEntity.class) + .exchange(); + + response.expectStatus() + .isOk(); + } + + @Test + public void whenRequestingComplexEPWithValidBody_thenObtainBadRequest() { + CustomRequestEntity body = new CustomRequestEntity("name", "1234567"); + + ResponseSpec response = client.post() + .uri(COMPLEX_EP_URL) + .body(Mono.just(body), CustomRequestEntity.class) + .exchange(); + + response.expectStatus() + .isOk(); + } + + @Test + public void whenRequestingAnnotatedEPWithValidBody_thenObtainBadRequest() { + AnnotatedRequestEntity body = new AnnotatedRequestEntity("user", "12345"); + + ResponseSpec response = client.post() + .uri(ANNOTATIONS_EP_URL) + .body(Mono.just(body), AnnotatedRequestEntity.class) + .exchange(); + + response.expectStatus() + .isOk(); + } +} From fcef80587c4f3fd38c77e2055a218b6c11890952 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Tue, 16 Oct 2018 20:49:12 +0530 Subject: [PATCH 129/546] BAEL-2221 --- .../org/baeldung/web/dto/EmployeeDto.java | 38 ++++++++++ .../java/org/baeldung/web/model/Employee.java | 53 ++++++++++++++ .../baeldung/web/service/EmployeeService.java | 51 ++++++++++++++ .../java/org/baeldung/SpringTestConfig.java | 19 +++++ ...eServiceMockRestServiceServerUnitTest.java | 70 +++++++++++++++++++ .../web/service/EmployeeServiceUnitTest.java | 49 +++++++++++++ .../src/test/resources/logback-test.xml | 23 ++++++ 7 files changed, 303 insertions(+) create mode 100644 spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java create mode 100644 spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java create mode 100644 spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java create mode 100644 spring-resttemplate/src/test/java/org/baeldung/SpringTestConfig.java create mode 100644 spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java create mode 100644 spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java create mode 100644 spring-resttemplate/src/test/resources/logback-test.xml diff --git a/spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java b/spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java new file mode 100644 index 0000000000..44c8ba5074 --- /dev/null +++ b/spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java @@ -0,0 +1,38 @@ +package org.baeldung.web.dto; + +import java.util.Date; + +public class EmployeeDto { + + private String id; + private String name; + private Double salary; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getSalary() { + return salary; + } + + public void setSalary(Double salary) { + this.salary = salary; + } + + @Override public String toString() { + return "EmployeeDto{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", salary=" + salary + '}'; + } +} diff --git a/spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java b/spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java new file mode 100644 index 0000000000..0981cc2da1 --- /dev/null +++ b/spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java @@ -0,0 +1,53 @@ +package org.baeldung.web.model; + +import java.util.Date; +import java.util.Objects; + +public class Employee { + + private String id; + private String name; + private Double salary; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getSalary() { + return salary; + } + + public void setSalary(Double salary) { + this.salary = salary; + } + + @Override public String toString() { + return "Employee{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", salary=" + salary + '}'; + } + + @Override public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Employee employee = (Employee) o; + return Objects.equals(id, employee.id) && Objects.equals(name, employee.name) && Objects.equals(salary, employee.salary); + } + + @Override public int hashCode() { + + return Objects.hash(id, name, salary); + } +} diff --git a/spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java b/spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java new file mode 100644 index 0000000000..3a0222cb6c --- /dev/null +++ b/spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java @@ -0,0 +1,51 @@ +package org.baeldung.web.service; + +import org.baeldung.web.dto.EmployeeDto; +import org.baeldung.web.model.Employee; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +@Service +public class EmployeeService { + + static final String EMP_URL_PREFIX = "http://localhost:8080/employee"; + static final String URL_SEP = "/"; + + private static final Logger logger = LoggerFactory.getLogger(EmployeeService.class); + + @Autowired + private RestTemplate restTemplate; + + public EmployeeDto getEmployee(String id) throws Exception { + + Employee emp = null; + try { + + ResponseEntity resp = restTemplate.getForEntity(EMP_URL_PREFIX + + URL_SEP + id, Employee.class); + + if (resp == null || resp.getStatusCode() != HttpStatus.OK + || resp.getBody() == null) { + + throw new Exception("Employee details could not be fetched."); + } + + emp = resp.getBody(); + + EmployeeDto dto = new EmployeeDto(); + dto.setId(emp.getId()); + dto.setName(emp.getName()); + dto.setSalary(emp.getSalary()); + return dto; + + } catch (Exception e) { + logger.error("Error occurred while fetching employee details", e); + throw new Exception("Error occurred while fetching employee details", e); + } + } +} diff --git a/spring-resttemplate/src/test/java/org/baeldung/SpringTestConfig.java b/spring-resttemplate/src/test/java/org/baeldung/SpringTestConfig.java new file mode 100644 index 0000000000..7c4bbb4e5e --- /dev/null +++ b/spring-resttemplate/src/test/java/org/baeldung/SpringTestConfig.java @@ -0,0 +1,19 @@ +package org.baeldung; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; + +@Configuration +@EnableAutoConfiguration +@ComponentScan("org.baeldung") +public class SpringTestConfig { + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } + +} diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java new file mode 100644 index 0000000000..7c2f535fae --- /dev/null +++ b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java @@ -0,0 +1,70 @@ +package org.baeldung.web.service; + +import java.net.URI; + +import org.baeldung.SpringTestConfig; +import org.baeldung.web.dto.EmployeeDto; +import org.baeldung.web.model.Employee; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.client.MockRestServiceServer; +import org.springframework.test.web.client.match.MockRestRequestMatchers; +import org.springframework.test.web.client.response.MockRestResponseCreators; +import org.springframework.web.client.RestTemplate; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@RunWith(SpringRunner.class) +@ContextConfiguration(classes = SpringTestConfig.class) +public class EmployeeServiceMockRestServiceServerUnitTest { + + private static final Logger logger = LoggerFactory.getLogger(EmployeeServiceMockRestServiceServerUnitTest.class); + + @Autowired + EmployeeService empService; + + @Autowired + RestTemplate restTemplate; + + MockRestServiceServer mockServer; + + ObjectMapper mapper = new ObjectMapper(); + + @Before + public void initMocks() { + mockServer = MockRestServiceServer.createServer(restTemplate); + } + + @Test + public void givenMockingIsDoneByMockRestServiceServer_whenGetIsCalled_shouldReturnMockedObject() throws Exception { + String id = "E001"; + Employee emp = new Employee(); + emp.setId(id); + emp.setName("Eric Simmons"); + emp.setSalary(10000.00d); + //employeeDao.create(emp); + + mockServer.expect(MockRestRequestMatchers.requestTo(new URI(EmployeeService.EMP_URL_PREFIX + + EmployeeService.URL_SEP + id))) + .andExpect(MockRestRequestMatchers.method(HttpMethod.GET)) + .andRespond(MockRestResponseCreators.withStatus(HttpStatus.OK) + .contentType(MediaType.APPLICATION_JSON) + .body(mapper.writeValueAsString(emp))); + + EmployeeDto employeeDto = empService.getEmployee(id); + logger.info("Employee received as: {}", employeeDto); + Assert.assertEquals(emp.getName(), employeeDto.getName()); + Assert.assertEquals(emp.getId(), employeeDto.getId()); + } + +} diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java new file mode 100644 index 0000000000..aa323dd685 --- /dev/null +++ b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java @@ -0,0 +1,49 @@ +package org.baeldung.web.service; + +import org.baeldung.web.dto.EmployeeDto; +import org.baeldung.web.model.Employee; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; + +public class EmployeeServiceUnitTest { + + private static final Logger logger = LoggerFactory.getLogger(EmployeeServiceUnitTest.class); + + @Mock + RestTemplate restTemplate; + + @Spy + @InjectMocks + EmployeeService empService = new EmployeeService(); + + @Before + public void initMocks() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void givenMockingIsDoneByMockito_whenGetIsCalled_shouldReturnMockedObject() throws Exception { + String id = "E001"; + Employee emp = new Employee(); + emp.setId(id); + emp.setName("Eric Simmons"); + emp.setSalary(10000.00d); + Mockito + .when(restTemplate.getForEntity(EmployeeService.EMP_URL_PREFIX + + EmployeeService.URL_SEP + id, Employee.class)) + .thenReturn(new ResponseEntity(emp, HttpStatus.OK)); + + EmployeeDto employeeDto = empService.getEmployee(id); + logger.info("Employee received as: {}", employeeDto); + Assert.assertEquals(emp.getName(), employeeDto.getName()); + Assert.assertEquals(emp.getSalary(), employeeDto.getSalary()); + } + +} diff --git a/spring-resttemplate/src/test/resources/logback-test.xml b/spring-resttemplate/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..9f48d36486 --- /dev/null +++ b/spring-resttemplate/src/test/resources/logback-test.xml @@ -0,0 +1,23 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + \ No newline at end of file From 9713832dc6c5e92a62acf2b454f923f0f35d2731 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Tue, 16 Oct 2018 21:01:06 +0530 Subject: [PATCH 130/546] BAEL-2221 --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9fde092896..beb10b3287 100644 --- a/pom.xml +++ b/pom.xml @@ -361,7 +361,6 @@ core-kotlin kotlin-libraries core-groovy - core-scala core-java-concurrency core-java-concurrency-collections couchbase From 201c3a75c89827e3b848dcb730657739129a56ee Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 16 Oct 2018 23:22:04 +0530 Subject: [PATCH 131/546] BAEL-9467 Update Spring Security article - Migrated module to inherit from spring-5 and spring-security-5 - Relevant changes and fixes in code for upgraded spring-security module --- spring-security-rest/pom.xml | 21 ++--- .../org/baeldung/persistence/model/Foo.java | 2 + ...uestAwareAuthenticationSuccessHandler.java | 7 +- .../RestAuthenticationEntryPoint.java | 6 +- .../org/baeldung/spring/ClientWebConfig.java | 11 +-- .../baeldung/spring/SecurityJavaConfig.java | 77 ++++++++++--------- .../org/baeldung/spring/SwaggerConfig.java | 15 +++- .../java/org/baeldung/spring/WebConfig.java | 9 +-- .../web/controller/AsyncController.java | 4 +- .../web/controller/CustomerController.java | 4 +- .../web/controller/FooController.java | 11 --- .../web/service/AsyncServiceImpl.java | 6 +- .../src/main/resources/webSecurityConfig.xml | 6 +- 13 files changed, 84 insertions(+), 95 deletions(-) diff --git a/spring-security-rest/pom.xml b/spring-security-rest/pom.xml index 57ce5ddb92..70967ce214 100644 --- a/spring-security-rest/pom.xml +++ b/spring-security-rest/pom.xml @@ -2,7 +2,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-security-rest 0.1-SNAPSHOT spring-security-rest @@ -10,9 +9,9 @@ com.baeldung - parent-spring-4 + parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-4 + ../parent-spring-5 @@ -195,13 +194,6 @@ - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - org.codehaus.cargo cargo-maven2-plugin @@ -282,17 +274,17 @@ - 4.2.6.RELEASE - 0.21.0.RELEASE + 5.1.0.RELEASE + 0.25.0.RELEASE 3.1.0 1.1.0.Final 1.2 - 2.8.5 + 2.9.2 - 19.0 + 26.0-jre 3.5 1.3.2 @@ -303,7 +295,6 @@ 2.9.2 - 2.6 1.6.1 diff --git a/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java b/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java index 1941e2aa51..05a7c7b9a0 100644 --- a/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java +++ b/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java @@ -6,6 +6,8 @@ import javax.validation.constraints.Size; public class Foo implements Serializable { + private static final long serialVersionUID = -5422285893276747592L; + private long id; @Size(min = 5, max = 14) diff --git a/spring-security-rest/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java b/spring-security-rest/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java index f4b8e7f5ac..6018264632 100644 --- a/spring-security-rest/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java +++ b/spring-security-rest/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java @@ -11,8 +11,10 @@ import org.springframework.security.web.authentication.SimpleUrlAuthenticationSu import org.springframework.security.web.savedrequest.HttpSessionRequestCache; import org.springframework.security.web.savedrequest.RequestCache; import org.springframework.security.web.savedrequest.SavedRequest; +import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; +@Component public class MySavedRequestAwareAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { private RequestCache requestCache = new HttpSessionRequestCache(); @@ -33,11 +35,6 @@ public class MySavedRequestAwareAuthenticationSuccessHandler extends SimpleUrlAu } clearAuthenticationAttributes(request); - - // Use the DefaultSavedRequest URL - // final String targetUrl = savedRequest.getRedirectUrl(); - // logger.debug("Redirecting to DefaultSavedRequest Url: " + targetUrl); - // getRedirectStrategy().sendRedirect(request, response, targetUrl); } public void setRequestCache(final RequestCache requestCache) { diff --git a/spring-security-rest/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java b/spring-security-rest/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java index 77aa32ff97..e448e6537f 100644 --- a/spring-security-rest/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java +++ b/spring-security-rest/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java @@ -16,7 +16,11 @@ import org.springframework.stereotype.Component; public final class RestAuthenticationEntryPoint implements AuthenticationEntryPoint { @Override - public void commence(final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException { + public void commence( + final HttpServletRequest request, + final HttpServletResponse response, + final AuthenticationException authException) throws IOException { + response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); } diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java b/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java index 601ba66330..8e20358a5a 100644 --- a/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java +++ b/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java @@ -2,16 +2,9 @@ package org.baeldung.spring; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @EnableWebMvc @Configuration -public class ClientWebConfig extends WebMvcConfigurerAdapter { - - public ClientWebConfig() { - super(); - } - - // API - +public class ClientWebConfig implements WebMvcConfigurer { } \ No newline at end of file diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java b/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java index c3e738297a..d5111f9b20 100644 --- a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java +++ b/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java @@ -1,6 +1,7 @@ package org.baeldung.spring; import org.baeldung.security.MySavedRequestAwareAuthenticationSuccessHandler; +import org.baeldung.security.RestAuthenticationEntryPoint; import org.baeldung.web.error.CustomAccessDeniedHandler; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -12,6 +13,8 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; @Configuration @@ -20,59 +23,61 @@ import org.springframework.security.web.authentication.SimpleUrlAuthenticationFa @ComponentScan("org.baeldung.security") public class SecurityJavaConfig extends WebSecurityConfigurerAdapter { + @Autowired + private PasswordEncoder encoder; + @Autowired private CustomAccessDeniedHandler accessDeniedHandler; - // @Autowired - // private RestAuthenticationEntryPoint restAuthenticationEntryPoint; + @Autowired + private RestAuthenticationEntryPoint restAuthenticationEntryPoint; - // @Autowired - // private MySavedRequestAwareAuthenticationSuccessHandler authenticationSuccessHandler; + @Autowired + private MySavedRequestAwareAuthenticationSuccessHandler mySuccessHandler; + + private SimpleUrlAuthenticationFailureHandler myFailureHandler = new SimpleUrlAuthenticationFailureHandler(); public SecurityJavaConfig() { super(); SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL); } - // - @Override protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - auth.inMemoryAuthentication().withUser("temporary").password("temporary").roles("ADMIN").and().withUser("user").password("userPass").roles("USER"); + auth.inMemoryAuthentication() + .withUser("admin").password(encoder.encode("adminPass")).roles("ADMIN") + .and() + .withUser("user").password(encoder.encode("userPass")).roles("USER"); } @Override - protected void configure(final HttpSecurity http) throws Exception {// @formatter:off - http - .csrf().disable() - .authorizeRequests() - .and() - .exceptionHandling().accessDeniedHandler(accessDeniedHandler) - // .authenticationEntryPoint(restAuthenticationEntryPoint) - .and() - .authorizeRequests() - .antMatchers("/api/csrfAttacker*").permitAll() - .antMatchers("/api/customer/**").permitAll() - .antMatchers("/api/foos/**").authenticated() - .antMatchers("/api/async/**").permitAll() - .antMatchers("/api/admin/**").hasRole("ADMIN") - .and() - .httpBasic() -// .and() -// .successHandler(authenticationSuccessHandler) -// .failureHandler(new SimpleUrlAuthenticationFailureHandler()) - .and() - .logout(); - } // @formatter:on - - @Bean - public MySavedRequestAwareAuthenticationSuccessHandler mySuccessHandler() { - return new MySavedRequestAwareAuthenticationSuccessHandler(); + protected void configure(final HttpSecurity http) throws Exception { + http.csrf().disable() + .authorizeRequests() + .and() + .exceptionHandling() + .accessDeniedHandler(accessDeniedHandler) + .authenticationEntryPoint(restAuthenticationEntryPoint) + .and() + .authorizeRequests() + .antMatchers("/api/csrfAttacker*").permitAll() + .antMatchers("/api/customer/**").permitAll() + .antMatchers("/api/foos/**").authenticated() + .antMatchers("/api/async/**").permitAll() + .antMatchers("/api/admin/**").hasRole("ADMIN") + .and() + .formLogin() + .successHandler(mySuccessHandler) + .failureHandler(myFailureHandler) + .and() + .httpBasic() + .and() + .logout(); } - + @Bean - public SimpleUrlAuthenticationFailureHandler myFailureHandler() { - return new SimpleUrlAuthenticationFailureHandler(); + public PasswordEncoder encoder() { + return new BCryptPasswordEncoder(); } } \ No newline at end of file diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/SwaggerConfig.java b/spring-security-rest/src/main/java/org/baeldung/spring/SwaggerConfig.java index bcf6657eee..aa00e8455e 100644 --- a/spring-security-rest/src/main/java/org/baeldung/spring/SwaggerConfig.java +++ b/spring-security-rest/src/main/java/org/baeldung/spring/SwaggerConfig.java @@ -24,8 +24,19 @@ public class SwaggerConfig { @Bean public Docket api() { - return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage("org.baeldung.web.controller")).paths(PathSelectors.ant("/foos/*")).build().apiInfo(apiInfo()).useDefaultResponseMessages(false) - .globalResponseMessage(RequestMethod.GET, newArrayList(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build(), new ResponseMessageBuilder().code(403).message("Forbidden!!!!!").build())); + return new Docket(DocumentationType.SWAGGER_2).select() + .apis(RequestHandlerSelectors.basePackage("org.baeldung.web.controller")) + .paths(PathSelectors.ant("/foos/*")) + .build() + .apiInfo(apiInfo()) + .useDefaultResponseMessages(false) + .globalResponseMessage(RequestMethod.GET, newArrayList(new ResponseMessageBuilder().code(500) + .message("500 message") + .responseModel(new ModelRef("Error")) + .build(), + new ResponseMessageBuilder().code(403) + .message("Forbidden!!!!!") + .build())); } private ApiInfo apiInfo() { diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java b/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java index 92a3c548a2..dba07dc4e5 100644 --- a/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java +++ b/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java @@ -8,18 +8,14 @@ import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.view.InternalResourceViewResolver; @Configuration @ComponentScan("org.baeldung.web") @EnableWebMvc @EnableAsync -public class WebConfig extends WebMvcConfigurerAdapter { - - public WebConfig() { - super(); - } +public class WebConfig implements WebMvcConfigurer { @Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { @@ -38,7 +34,6 @@ public class WebConfig extends WebMvcConfigurerAdapter { @Override public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); registry.addViewController("/csrfAttacker.html"); } diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java b/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java index 456eeaaeac..f6f1c392cb 100644 --- a/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java +++ b/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java @@ -24,9 +24,9 @@ public class AsyncController { @RequestMapping(method = RequestMethod.GET, value = "/async") @ResponseBody public Object standardProcessing() throws Exception { - log.info("Outside the @Async logic - before the async call: " + SecurityContextHolder.getContext().getAuthentication().getPrincipal()); + log.info("Outside the @Async logic - before the async call: {}", SecurityContextHolder.getContext().getAuthentication().getPrincipal()); asyncService.asyncCall(); - log.info("Inside the @Async logic - after the async call: " + SecurityContextHolder.getContext().getAuthentication().getPrincipal()); + log.info("Inside the @Async logic - after the async call: {}", SecurityContextHolder.getContext().getAuthentication().getPrincipal()); return SecurityContextHolder.getContext().getAuthentication().getPrincipal(); } diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomerController.java b/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomerController.java index b8f67960f5..e1db105d18 100644 --- a/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomerController.java +++ b/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomerController.java @@ -48,7 +48,7 @@ public class CustomerController { } Link link =linkTo(methodOn(CustomerController.class).getOrdersForCustomer(customerId)).withSelfRel(); - Resources result = new Resources(orders,link); + Resources result = new Resources<>(orders,link); return result; } @@ -67,7 +67,7 @@ public class CustomerController { } Link link =linkTo(CustomerController.class).withSelfRel(); - Resources result = new Resources(allCustomers,link); + Resources result = new Resources<>(allCustomers,link); return result; } diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java index 3b9e5d25c0..f914f82215 100644 --- a/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java +++ b/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java @@ -7,8 +7,6 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import org.baeldung.persistence.model.Foo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; @@ -25,17 +23,9 @@ import com.google.common.collect.Lists; @RequestMapping(value = "/foos") public class FooController { - @Autowired - private ApplicationEventPublisher eventPublisher; - - public FooController() { - super(); - } - // API // read - single - @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public Foo findById(@PathVariable("id") final Long id, final UriComponentsBuilder uriBuilder, final HttpServletResponse response) { @@ -43,7 +33,6 @@ public class FooController { } // read - multiple - @RequestMapping(method = RequestMethod.GET) @ResponseBody public List findAll() { diff --git a/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java b/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java index caaaa8e0dc..d6d7f53dd7 100644 --- a/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java +++ b/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java @@ -17,18 +17,18 @@ public class AsyncServiceImpl implements AsyncService { @Async @Override public void asyncCall() { - log.info("Inside the @Async logic: " + SecurityContextHolder.getContext().getAuthentication().getPrincipal()); + log.info("Inside the @Async logic: {}", SecurityContextHolder.getContext().getAuthentication().getPrincipal()); } @Override public Callable checkIfPrincipalPropagated() { Object before = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - log.info("Before new thread: " + before); + log.info("Before new thread: {}", before); return new Callable() { public Boolean call() throws Exception { Object after = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - log.info("New thread: " + after); + log.info("New thread: {}", after); return before == after; } }; diff --git a/spring-security-rest/src/main/resources/webSecurityConfig.xml b/spring-security-rest/src/main/resources/webSecurityConfig.xml index 4bb208a195..54bd0f91b9 100644 --- a/spring-security-rest/src/main/resources/webSecurityConfig.xml +++ b/spring-security-rest/src/main/resources/webSecurityConfig.xml @@ -9,6 +9,8 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd"> + + + @@ -44,5 +46,5 @@ - +--> \ No newline at end of file From 8ef39f81b42964da6914eeaa1259c18f4435cdd0 Mon Sep 17 00:00:00 2001 From: DOHA Date: Tue, 16 Oct 2018 23:04:15 +0300 Subject: [PATCH 132/546] string to byte array --- .../base64/StringToByteArrayUnitTest.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java diff --git a/java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java b/java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java new file mode 100644 index 0000000000..5bb97e111a --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java @@ -0,0 +1,60 @@ +package com.baeldung.java8.base64; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Base64; + +import javax.xml.bind.DatatypeConverter; + +import org.junit.Test; + +public class StringToByteArrayUnitTest { + + @Test + public void whenConvertStringToByteArrayUsingStringClass_thenOk() { + final String originalInput = "test input"; + byte[] result = originalInput.getBytes(); + System.out.println(Arrays.toString(result)); + + assertEquals(originalInput.length(), result.length); + } + + @Test + public void givenCharset_whenConvertStringToByteArrayUsingStringClass_thenOk() throws UnsupportedEncodingException { + final String originalInput = "test input"; + byte[] result = originalInput.getBytes(StandardCharsets.UTF_16); + System.out.println(Arrays.toString(result)); + + assertTrue(originalInput.length() < result.length); + } + + @Test + public void whenConvertStringToByteArrayUsingBase64Decoder_thenOk() { + final String originalInput = "dGVzdCBpbnB1dA=="; + byte[] result = Base64.getDecoder().decode(originalInput); + + assertEquals("test input", new String(result)); + } + + @Test + public void whenConvertStringToByteArrayUsingDatatypeConverter_thenOk() { + final String originalInput = "dGVzdCBpbnB1dA=="; + byte[] result = DatatypeConverter.parseBase64Binary(originalInput); + + assertEquals("test input", new String(result)); + } + + @Test + public void whenConvertStringToByteArray_thenOk(){ + String originalInput = "7465737420696E707574"; + byte[] result = DatatypeConverter.parseHexBinary(originalInput); + System.out.println(Arrays.toString(result)); + + assertEquals("test input", new String(result)); + } + +} From 99a840fd03c3ea72bdb0abf34a98d65b85d27f04 Mon Sep 17 00:00:00 2001 From: DomWos Date: Sat, 13 Oct 2018 23:55:53 +0200 Subject: [PATCH 133/546] BAEL-1463: Apache Storm Introduction --- libraries-data/pom.xml | 6 ++ .../com/baeldung/storm/TopologyRunner.java | 34 ++++++++++ .../baeldung/storm/bolt/AggregatingBolt.java | 39 ++++++++++++ .../baeldung/storm/bolt/FileWritingBolt.java | 63 +++++++++++++++++++ .../baeldung/storm/bolt/FilteringBolt.java | 22 +++++++ .../com/baeldung/storm/bolt/PrintingBolt.java | 18 ++++++ .../storm/model/AggregatedWindow.java | 16 +++++ .../java/com/baeldung/storm/model/User.java | 40 ++++++++++++ .../storm/serialization/UserSerializer.java | 30 +++++++++ .../baeldung/storm/spout/RandomIntSpout.java | 35 +++++++++++ .../storm/spout/RandomNumberSpout.java | 40 ++++++++++++ 11 files changed, 343 insertions(+) create mode 100644 libraries-data/src/main/java/com/baeldung/storm/TopologyRunner.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/bolt/PrintingBolt.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/model/AggregatedWindow.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/model/User.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/serialization/UserSerializer.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java create mode 100644 libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index bbf0c7832f..54d24edbf6 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -259,6 +259,11 @@ slf4j-api ${slf4j.version} + + org.apache.storm + storm-core + ${storm.version} + ch.qos.logback @@ -432,6 +437,7 @@ + 1.2.2 4.0.1 1.4.196 16.5.1 diff --git a/libraries-data/src/main/java/com/baeldung/storm/TopologyRunner.java b/libraries-data/src/main/java/com/baeldung/storm/TopologyRunner.java new file mode 100644 index 0000000000..326f53c0b8 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/TopologyRunner.java @@ -0,0 +1,34 @@ +package com.baeldung.storm; + +import com.baeldung.storm.bolt.AggregatingBolt; +import com.baeldung.storm.bolt.FileWritingBolt; +import com.baeldung.storm.bolt.FilteringBolt; +import com.baeldung.storm.bolt.PrintingBolt; +import com.baeldung.storm.spout.RandomNumberSpout; +import org.apache.storm.Config; +import org.apache.storm.LocalCluster; +import org.apache.storm.topology.TopologyBuilder; +import org.apache.storm.topology.base.BaseWindowedBolt; + +public class TopologyRunner { + public static void main(String[] args) { + runTopology(); + } + + public static void runTopology() { + String filePath = "./src/main/resources/operations.txt"; + TopologyBuilder builder = new TopologyBuilder(); + builder.setSpout("randomNumberSpout", new RandomNumberSpout()); + builder.setBolt("filteringBolt", new FilteringBolt()).shuffleGrouping("randomNumberSpout"); + builder.setBolt("aggregatingBolt", new AggregatingBolt() + .withTimestampField("timestamp") + .withLag(BaseWindowedBolt.Duration.seconds(1)) + .withWindow(BaseWindowedBolt.Duration.seconds(5))).shuffleGrouping("filteringBolt"); + builder.setBolt("fileBolt", new FileWritingBolt(filePath)).shuffleGrouping("aggregatingBolt"); + + Config config = new Config(); + config.setDebug(false); + LocalCluster cluster = new LocalCluster(); + cluster.submitTopology("Test", config, builder.createTopology()); + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java new file mode 100644 index 0000000000..555ba7e692 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java @@ -0,0 +1,39 @@ +package com.baeldung.storm.bolt; + +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseWindowedBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; +import org.apache.storm.tuple.Values; +import org.apache.storm.windowing.TupleWindow; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; + +public class AggregatingBolt extends BaseWindowedBolt { + OutputCollector outputCollector; + @Override + public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { + this.outputCollector = collector; + } + + @Override + public void declareOutputFields(OutputFieldsDeclarer declarer) { + declarer.declare(new Fields("sumOfOperations", "beginningTimestamp", "endTimestamp")); + } + + @Override + public void execute(TupleWindow tupleWindow) { + List tuples = tupleWindow.get(); + tuples.sort(Comparator.comparing(a -> a.getLongByField("timestamp"))); + //This is safe since the window is calculated basing on Tuple's timestamp, thus it can't really be empty + Long beginningTimestamp = tuples.get(0).getLongByField("timestamp"); + Long endTimestamp = tuples.get(tuples.size() - 1).getLongByField("timestamp"); + int sumOfOperations = tuples.stream().mapToInt(tuple -> tuple.getIntegerByField("operation")).sum(); + Values values = new Values(sumOfOperations, beginningTimestamp, endTimestamp); + outputCollector.emit(values); + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java new file mode 100644 index 0000000000..a35ff3aaf5 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java @@ -0,0 +1,63 @@ +package com.baeldung.storm.bolt; + +import com.baeldung.storm.model.AggregatedWindow; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichBolt; +import org.apache.storm.tuple.Tuple; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Map; + +public class FileWritingBolt extends BaseRichBolt { + public static Logger logger = LoggerFactory.getLogger(FileWritingBolt.class); + BufferedWriter writer; + String filePath; + ObjectMapper objectMapper; + @Override + public void prepare(Map map, TopologyContext topologyContext, OutputCollector outputCollector) { + objectMapper = new ObjectMapper(); + objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); + try { + writer = new BufferedWriter(new FileWriter(filePath)); + } catch (IOException e) { + logger.error("Failed to open a file for writing.", e); + } + } + + @Override + public void execute(Tuple tuple) { + int sumOfOperations = tuple.getIntegerByField("sumOfOperations"); + long beginningTimestamp = tuple.getLongByField("beginningTimestamp"); + long endTimestamp = tuple.getLongByField("endTimestamp"); + + if(sumOfOperations > 200) { + AggregatedWindow aggregatedWindow = new AggregatedWindow(sumOfOperations, beginningTimestamp, endTimestamp); + try { + writer.write(objectMapper.writeValueAsString(aggregatedWindow)); + writer.write("\n"); + writer.flush(); + } catch (IOException e) { + logger.error("Failed to write data to file.", e); + } + } + } + + public FileWritingBolt(String filePath) { + this.filePath = filePath; + } + + @Override + public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { + + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java new file mode 100644 index 0000000000..a2e80deb33 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java @@ -0,0 +1,22 @@ +package com.baeldung.storm.bolt; + +import org.apache.storm.topology.BasicOutputCollector; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseBasicBolt; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Tuple; + +public class FilteringBolt extends BaseBasicBolt { + @Override + public void execute(Tuple tuple, BasicOutputCollector basicOutputCollector) { + int operation = tuple.getIntegerByField("operation"); + if(operation >= 0 ) { + basicOutputCollector.emit(tuple.getValues()); + } + } + + @Override + public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { + outputFieldsDeclarer.declare(new Fields("operation", "timestamp")); + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/PrintingBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/PrintingBolt.java new file mode 100644 index 0000000000..efd2c9b1d9 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/PrintingBolt.java @@ -0,0 +1,18 @@ +package com.baeldung.storm.bolt; + +import org.apache.storm.topology.BasicOutputCollector; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseBasicBolt; +import org.apache.storm.tuple.Tuple; + +public class PrintingBolt extends BaseBasicBolt { + @Override + public void execute(Tuple tuple, BasicOutputCollector basicOutputCollector) { + System.out.println(tuple); + } + + @Override + public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { + + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/model/AggregatedWindow.java b/libraries-data/src/main/java/com/baeldung/storm/model/AggregatedWindow.java new file mode 100644 index 0000000000..beaf54d34c --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/model/AggregatedWindow.java @@ -0,0 +1,16 @@ +package com.baeldung.storm.model; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +@JsonSerialize +public class AggregatedWindow { + int sumOfOperations; + long beginningTimestamp; + long endTimestamp; + + public AggregatedWindow(int sumOfOperations, long beginningTimestamp, long endTimestamp) { + this.sumOfOperations = sumOfOperations; + this.beginningTimestamp = beginningTimestamp; + this.endTimestamp = endTimestamp; + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/model/User.java b/libraries-data/src/main/java/com/baeldung/storm/model/User.java new file mode 100644 index 0000000000..62b9ac639b --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/model/User.java @@ -0,0 +1,40 @@ +package com.baeldung.storm.model; + +public class User { + String username; + String password; + String email; + int age; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/serialization/UserSerializer.java b/libraries-data/src/main/java/com/baeldung/storm/serialization/UserSerializer.java new file mode 100644 index 0000000000..6199a203da --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/serialization/UserSerializer.java @@ -0,0 +1,30 @@ +package com.baeldung.storm.serialization; + + +import com.baeldung.storm.model.User; +import com.esotericsoftware.kryo.Kryo; +import com.esotericsoftware.kryo.Serializer; +import com.esotericsoftware.kryo.io.Input; +import com.esotericsoftware.kryo.io.Output; + +public class UserSerializer extends Serializer{ + @Override + public void write(Kryo kryo, Output output, User user) { + output.writeString(user.getEmail()); + output.writeString(user.getUsername()); + output.write(user.getAge()); + } + + @Override + public User read(Kryo kryo, Input input, Class aClass) { + User user = new User(); + String email = input.readString(); + String name = input.readString(); + int age = input.read(); + user.setAge(age); + user.setEmail(email); + user.setUsername(name); + + return user; + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java new file mode 100644 index 0000000000..669eb4f897 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java @@ -0,0 +1,35 @@ +package com.baeldung.storm.spout; + +import org.apache.storm.spout.SpoutOutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichSpout; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Values; +import org.apache.storm.utils.Utils; + +import java.util.Map; +import java.util.Random; + +public class RandomIntSpout extends BaseRichSpout { + + Random random; + SpoutOutputCollector outputCollector; + + @Override + public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) { + random = new Random(); + outputCollector = spoutOutputCollector; + } + + @Override + public void nextTuple() { + Utils.sleep(1000); + outputCollector.emit(new Values(random.nextInt(), System.currentTimeMillis())); + } + + @Override + public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { + outputFieldsDeclarer.declare(new Fields("randomInt", "timestamp")); + } +} diff --git a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java new file mode 100644 index 0000000000..5d7d3cc53e --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java @@ -0,0 +1,40 @@ +package com.baeldung.storm.spout; + +import org.apache.storm.spout.SpoutOutputCollector; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; +import org.apache.storm.topology.OutputFieldsDeclarer; +import org.apache.storm.topology.base.BaseRichSpout; +import org.apache.storm.tuple.Fields; +import org.apache.storm.tuple.Values; +import org.apache.storm.utils.Utils; + +import java.util.Map; +import java.util.Random; + +public class RandomNumberSpout extends BaseRichSpout { + Random random; + SpoutOutputCollector collector; + + @Override + public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) { + random = new Random(); + collector = spoutOutputCollector; + } + + @Override + public void nextTuple() { + Utils.sleep(1000); + //This will select random int from the range (-1000, 1000) + int operation = random.nextInt(1000 + 1 + 1000) - 1000; + long timestamp = System.currentTimeMillis(); + + Values values = new Values(operation, timestamp); + collector.emit(values); + } + + @Override + public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { + outputFieldsDeclarer.declare(new Fields("operation", "timestamp")); + } +} From a0a393cdfc7e9e080e812f041bbf5a0f1fa127fb Mon Sep 17 00:00:00 2001 From: DomWos Date: Tue, 16 Oct 2018 10:39:18 +0200 Subject: [PATCH 134/546] BAEL-1463: Privatize Everything. --- .../java/com/baeldung/storm/bolt/AggregatingBolt.java | 2 +- .../java/com/baeldung/storm/bolt/FileWritingBolt.java | 7 +++---- .../src/main/java/com/baeldung/storm/model/User.java | 8 ++++---- .../java/com/baeldung/storm/spout/RandomIntSpout.java | 4 ++-- .../java/com/baeldung/storm/spout/RandomNumberSpout.java | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java index 555ba7e692..c7263cd8d5 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/AggregatingBolt.java @@ -14,7 +14,7 @@ import java.util.List; import java.util.Map; public class AggregatingBolt extends BaseWindowedBolt { - OutputCollector outputCollector; + private OutputCollector outputCollector; @Override public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.outputCollector = collector; diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java index a35ff3aaf5..40ed72164d 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java @@ -4,7 +4,6 @@ import com.baeldung.storm.model.AggregatedWindow; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; import org.apache.storm.task.OutputCollector; import org.apache.storm.task.TopologyContext; import org.apache.storm.topology.OutputFieldsDeclarer; @@ -20,9 +19,9 @@ import java.util.Map; public class FileWritingBolt extends BaseRichBolt { public static Logger logger = LoggerFactory.getLogger(FileWritingBolt.class); - BufferedWriter writer; - String filePath; - ObjectMapper objectMapper; + private BufferedWriter writer; + private String filePath; + private ObjectMapper objectMapper; @Override public void prepare(Map map, TopologyContext topologyContext, OutputCollector outputCollector) { objectMapper = new ObjectMapper(); diff --git a/libraries-data/src/main/java/com/baeldung/storm/model/User.java b/libraries-data/src/main/java/com/baeldung/storm/model/User.java index 62b9ac639b..eafbf0e1eb 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/model/User.java +++ b/libraries-data/src/main/java/com/baeldung/storm/model/User.java @@ -1,10 +1,10 @@ package com.baeldung.storm.model; public class User { - String username; - String password; - String email; - int age; + private String username; + private String password; + private String email; + private int age; public String getUsername() { return username; diff --git a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java index 669eb4f897..4a8ef76598 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java +++ b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomIntSpout.java @@ -13,8 +13,8 @@ import java.util.Random; public class RandomIntSpout extends BaseRichSpout { - Random random; - SpoutOutputCollector outputCollector; + private Random random; + private SpoutOutputCollector outputCollector; @Override public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) { diff --git a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java index 5d7d3cc53e..371a61720a 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java +++ b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java @@ -13,8 +13,8 @@ import java.util.Map; import java.util.Random; public class RandomNumberSpout extends BaseRichSpout { - Random random; - SpoutOutputCollector collector; + private Random random; + private SpoutOutputCollector collector; @Override public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) { From da052c96d30997706a49ebca75e1cb05b02136b7 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Wed, 17 Oct 2018 18:11:30 +0530 Subject: [PATCH 135/546] BAEL-2221 --- ...eServiceMockRestServiceServerUnitTest.java | 33 +++++++++++-------- .../web/service/EmployeeServiceUnitTest.java | 7 ++-- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java index 7c2f535fae..f04b0fbc2b 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java @@ -17,9 +17,13 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.client.ExpectedCount; import org.springframework.test.web.client.MockRestServiceServer; -import org.springframework.test.web.client.match.MockRestRequestMatchers; -import org.springframework.test.web.client.response.MockRestResponseCreators; + +import static org.baeldung.web.service.EmployeeService.EMP_URL_PREFIX; +import static org.baeldung.web.service.EmployeeService.URL_SEP; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; +import static org.springframework.test.web.client.response.MockRestResponseCreators.*; import org.springframework.web.client.RestTemplate; import com.fasterxml.jackson.databind.ObjectMapper; @@ -31,14 +35,14 @@ public class EmployeeServiceMockRestServiceServerUnitTest { private static final Logger logger = LoggerFactory.getLogger(EmployeeServiceMockRestServiceServerUnitTest.class); @Autowired - EmployeeService empService; + private EmployeeService empService; @Autowired - RestTemplate restTemplate; + private RestTemplate restTemplate; - MockRestServiceServer mockServer; + private MockRestServiceServer mockServer; - ObjectMapper mapper = new ObjectMapper(); + private ObjectMapper mapper = new ObjectMapper(); @Before public void initMocks() { @@ -52,17 +56,20 @@ public class EmployeeServiceMockRestServiceServerUnitTest { emp.setId(id); emp.setName("Eric Simmons"); emp.setSalary(10000.00d); - //employeeDao.create(emp); - mockServer.expect(MockRestRequestMatchers.requestTo(new URI(EmployeeService.EMP_URL_PREFIX - + EmployeeService.URL_SEP + id))) - .andExpect(MockRestRequestMatchers.method(HttpMethod.GET)) - .andRespond(MockRestResponseCreators.withStatus(HttpStatus.OK) - .contentType(MediaType.APPLICATION_JSON) - .body(mapper.writeValueAsString(emp))); + String fullUri = new StringBuilder().append(EMP_URL_PREFIX).append(URL_SEP) + .append(id).toString(); + + mockServer.expect(ExpectedCount.once(), requestTo(new URI(fullUri))) + .andExpect(method(HttpMethod.GET)) + .andRespond(withStatus(HttpStatus.OK) + .contentType(MediaType.APPLICATION_JSON) + .body(mapper.writeValueAsString(emp))); EmployeeDto employeeDto = empService.getEmployee(id); logger.info("Employee received as: {}", employeeDto); + + mockServer.verify(); Assert.assertEquals(emp.getName(), employeeDto.getName()); Assert.assertEquals(emp.getId(), employeeDto.getId()); } diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java index aa323dd685..ac714bf6db 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java @@ -17,14 +17,13 @@ public class EmployeeServiceUnitTest { private static final Logger logger = LoggerFactory.getLogger(EmployeeServiceUnitTest.class); @Mock - RestTemplate restTemplate; + private RestTemplate restTemplate; - @Spy @InjectMocks - EmployeeService empService = new EmployeeService(); + private EmployeeService empService = new EmployeeService(); @Before - public void initMocks() { + public void setup() { MockitoAnnotations.initMocks(this); } From 2f01b4305630a8b3d1d3b124f9b2fd30a77d2f4f Mon Sep 17 00:00:00 2001 From: azrairshad Date: Wed, 17 Oct 2018 10:06:37 -0400 Subject: [PATCH 136/546] BAEL-1547: Request method not supported - 405, examples. (#5464) --- .../controller/RequestMethodController.java | 25 +++++++++++++++++ .../exception/InvalidRequestException.java | 26 ++++++++++++++++++ .../spring/service/EmployeeService.java | 12 +++++++++ .../spring/service/EmployeeServiceImpl.java | 27 +++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 spring-mvc-simple/src/main/java/com/baeldung/spring/controller/RequestMethodController.java create mode 100644 spring-mvc-simple/src/main/java/com/baeldung/spring/exception/InvalidRequestException.java create mode 100644 spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeService.java create mode 100644 spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeServiceImpl.java diff --git a/spring-mvc-simple/src/main/java/com/baeldung/spring/controller/RequestMethodController.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/controller/RequestMethodController.java new file mode 100644 index 0000000000..03cf729ddf --- /dev/null +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/controller/RequestMethodController.java @@ -0,0 +1,25 @@ +package com.baeldung.spring.controller; + +import com.baeldung.spring.domain.Employee; +import com.baeldung.spring.exception.InvalidRequestException; +import com.baeldung.spring.service.EmployeeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping(value="/api") +public class RequestMethodController { + + @Autowired + EmployeeService service; + + @RequestMapping(value = "/employees", produces = "application/json", method={RequestMethod.GET,RequestMethod.POST}) + public List findEmployees() + throws InvalidRequestException { + return service.getEmployeeList(); + } +} diff --git a/spring-mvc-simple/src/main/java/com/baeldung/spring/exception/InvalidRequestException.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/exception/InvalidRequestException.java new file mode 100644 index 0000000000..4dcbe86735 --- /dev/null +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/exception/InvalidRequestException.java @@ -0,0 +1,26 @@ +package com.baeldung.spring.exception; + +public class InvalidRequestException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 4088649120307193208L; + + public InvalidRequestException() { + super(); + } + + public InvalidRequestException(final String message, final Throwable cause) { + super(message, cause); + } + + public InvalidRequestException(final String message) { + super(message); + } + + public InvalidRequestException(final Throwable cause) { + super(cause); + } + +} diff --git a/spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeService.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeService.java new file mode 100644 index 0000000000..4d87352c42 --- /dev/null +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeService.java @@ -0,0 +1,12 @@ +package com.baeldung.spring.service; + +import com.baeldung.spring.domain.Employee; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public interface EmployeeService { + + List getEmployeeList(); +} diff --git a/spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeServiceImpl.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeServiceImpl.java new file mode 100644 index 0000000000..18f2d70795 --- /dev/null +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/service/EmployeeServiceImpl.java @@ -0,0 +1,27 @@ +package com.baeldung.spring.service; + +import com.baeldung.spring.domain.Employee; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class EmployeeServiceImpl implements EmployeeService{ + + @Override + public List getEmployeeList() { + List employeeList = new ArrayList<>(); + employeeList.add(createEmployee(100L, "Steve Martin", "333-777-999")); + employeeList.add(createEmployee(200L, "Adam Schawn", "444-111-777")); + return employeeList; + } + + private Employee createEmployee(long id, String name, String contactNumber) { + Employee employee = new Employee(); + employee.setId(id); + employee.setName(name); + employee.setContactNumber(contactNumber); + return employee; + } +} From 6cabd68be52d97a55a7d0e71b757dd50344c0289 Mon Sep 17 00:00:00 2001 From: shreyasm Date: Wed, 17 Oct 2018 19:39:26 +0530 Subject: [PATCH 137/546] BAEL-2000 - Shreyas Mahajan - Adding a project for demonstrating Spring Boot Jib Maven Plugin (#5375) * BAEL-2000 - Shreyas Mahajan - Adding a project for demonstrating Spring Boot Jib Maven Plugin * BAEL-2000 - Shreyas Mahajan - Incorporating the changes * BAEL-2000 - Shreyas Mahajan - Renaming the module from spring-boot-jib to jib --- jib/pom.xml | 57 +++++++++++++++++++ .../main/java/com/baeldung/Application.java | 12 ++++ jib/src/main/java/com/baeldung/Greeting.java | 20 +++++++ .../java/com/baeldung/GreetingController.java | 20 +++++++ 4 files changed, 109 insertions(+) create mode 100644 jib/pom.xml create mode 100644 jib/src/main/java/com/baeldung/Application.java create mode 100644 jib/src/main/java/com/baeldung/Greeting.java create mode 100644 jib/src/main/java/com/baeldung/GreetingController.java diff --git a/jib/pom.xml b/jib/pom.xml new file mode 100644 index 0000000000..e71250f157 --- /dev/null +++ b/jib/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + jib + 0.1-SNAPSHOT + jib + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-web + + + + + 1.8 + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + com.google.cloud.tools + jib-maven-plugin + 0.9.10 + + + registry.hub.docker.com/baeldungjib/jib-spring-boot-app + + + + + + + + + spring-releases + https://repo.spring.io/libs-release + + + + + spring-releases + https://repo.spring.io/libs-release + + + diff --git a/jib/src/main/java/com/baeldung/Application.java b/jib/src/main/java/com/baeldung/Application.java new file mode 100644 index 0000000000..8c087476bf --- /dev/null +++ b/jib/src/main/java/com/baeldung/Application.java @@ -0,0 +1,12 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} \ No newline at end of file diff --git a/jib/src/main/java/com/baeldung/Greeting.java b/jib/src/main/java/com/baeldung/Greeting.java new file mode 100644 index 0000000000..62834d9752 --- /dev/null +++ b/jib/src/main/java/com/baeldung/Greeting.java @@ -0,0 +1,20 @@ +package com.baeldung; + +public class Greeting { + + private final long id; + private final String content; + + public Greeting(long id, String content) { + this.id = id; + this.content = content; + } + + public long getId() { + return id; + } + + public String getContent() { + return content; + } +} \ No newline at end of file diff --git a/jib/src/main/java/com/baeldung/GreetingController.java b/jib/src/main/java/com/baeldung/GreetingController.java new file mode 100644 index 0000000000..0b082b0001 --- /dev/null +++ b/jib/src/main/java/com/baeldung/GreetingController.java @@ -0,0 +1,20 @@ +package com.baeldung; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.concurrent.atomic.AtomicLong; + +@RestController +public class GreetingController { + + private static final String template = "Hello Docker, %s!"; + private final AtomicLong counter = new AtomicLong(); + + @GetMapping("/greeting") + public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) { + return new Greeting(counter.incrementAndGet(), + String.format(template, name)); + } +} \ No newline at end of file From 580ac4772dd4c0587b22719bedbe64fb7c006ddb Mon Sep 17 00:00:00 2001 From: "stone.shi" <10189895@qq.com> Date: Wed, 17 Oct 2018 22:16:13 +0800 Subject: [PATCH 138/546] correct java main method signature, otherwise performance can't be run in IDE --- .../benchmark/MappingFrameworksPerformance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/performance-tests/src/test/java/com/baeldung/performancetests/benchmark/MappingFrameworksPerformance.java b/performance-tests/src/test/java/com/baeldung/performancetests/benchmark/MappingFrameworksPerformance.java index e781f1fca1..1c9e4c5dc4 100644 --- a/performance-tests/src/test/java/com/baeldung/performancetests/benchmark/MappingFrameworksPerformance.java +++ b/performance-tests/src/test/java/com/baeldung/performancetests/benchmark/MappingFrameworksPerformance.java @@ -97,7 +97,7 @@ public class MappingFrameworksPerformance { sourceCode = new SourceCode("This is source code!"); } - public void main(String[] args) throws IOException, RunnerException { + public static void main(String[] args) throws IOException, RunnerException { org.openjdk.jmh.Main.main(args); } From 99d309b8c23e6810ef47e42a3513ef08633bd6ce Mon Sep 17 00:00:00 2001 From: Felipe Santiago Corro Date: Wed, 17 Oct 2018 14:29:47 -0300 Subject: [PATCH 139/546] BAEL-2237 Using Jackson to parse XML and return JSON (#5478) --- .../jackson/xmlToJson/XmlToJsonUnitTest.java | 43 +++++++------------ 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/jackson/src/test/java/com/baeldung/jackson/xmlToJson/XmlToJsonUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/xmlToJson/XmlToJsonUnitTest.java index 295bb9d6e8..6329a8ed2f 100644 --- a/jackson/src/test/java/com/baeldung/jackson/xmlToJson/XmlToJsonUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/xmlToJson/XmlToJsonUnitTest.java @@ -1,7 +1,5 @@ package com.baeldung.jackson.xmlToJson; - -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.xml.XmlMapper; @@ -14,43 +12,32 @@ import java.io.IOException; public class XmlToJsonUnitTest { @Test - public void givenAnXML_whenUseDataBidingToConvertToJSON_thenReturnDataOK() { + public void givenAnXML_whenUseDataBidingToConvertToJSON_thenReturnDataOK() throws IOException{ String flowerXML = "PoppyRED9"; - try { - XmlMapper xmlMapper = new XmlMapper(); - Flower poppy = xmlMapper.readValue(flowerXML, Flower.class); + XmlMapper xmlMapper = new XmlMapper(); + Flower poppy = xmlMapper.readValue(flowerXML, Flower.class); - assertEquals(poppy.getName(), "Poppy"); - assertEquals(poppy.getColor(), Color.RED); - assertEquals(poppy.getPetals(), new Integer(9)); + assertEquals(poppy.getName(), "Poppy"); + assertEquals(poppy.getColor(), Color.RED); + assertEquals(poppy.getPetals(), new Integer(9)); - ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(poppy); + ObjectMapper mapper = new ObjectMapper(); + String json = mapper.writeValueAsString(poppy); - assertEquals(json, "{\"name\":\"Poppy\",\"color\":\"RED\",\"petals\":9}"); - System.out.println(json); - } catch(IOException e) { - e.printStackTrace(); - } + assertEquals(json, "{\"name\":\"Poppy\",\"color\":\"RED\",\"petals\":9}"); } @Test - public void givenAnXML_whenUseATreeConvertToJSON_thenReturnDataOK() { + public void givenAnXML_whenUseATreeConvertToJSON_thenReturnDataOK() throws IOException { String flowerXML = "PoppyRED9"; - try { - XmlMapper xmlMapper = new XmlMapper(); - JsonNode node = xmlMapper.readTree(flowerXML.getBytes()); + XmlMapper xmlMapper = new XmlMapper(); + JsonNode node = xmlMapper.readTree(flowerXML.getBytes()); - ObjectMapper jsonMapper = new ObjectMapper(); - String json = jsonMapper.writeValueAsString(node); + ObjectMapper jsonMapper = new ObjectMapper(); + String json = jsonMapper.writeValueAsString(node); - System.out.println(json); - - assertEquals(json, "{\"name\":\"Poppy\",\"color\":\"RED\",\"petals\":\"9\"}"); - } catch(IOException e) { - e.printStackTrace(); - } + assertEquals(json, "{\"name\":\"Poppy\",\"color\":\"RED\",\"petals\":\"9\"}"); } } From ad0eb1ee7d7fe65aeeeba426034d83ad04716797 Mon Sep 17 00:00:00 2001 From: vizsoro Date: Wed, 17 Oct 2018 20:02:53 +0200 Subject: [PATCH 140/546] bael-2195 lombok builder default --- lombok/pom.xml | 1 + .../lombok/builder/defaultvalue/Pojo.java | 17 +++++++++++++ .../BuilderWithDefaultValueUnitTest.java | 25 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 lombok/src/main/java/com/baeldung/lombok/builder/defaultvalue/Pojo.java create mode 100644 lombok/src/test/java/com/baeldung/lombok/builder/defaultvalue/BuilderWithDefaultValueUnitTest.java diff --git a/lombok/pom.xml b/lombok/pom.xml index eba140122a..7ad2e3dc83 100644 --- a/lombok/pom.xml +++ b/lombok/pom.xml @@ -59,6 +59,7 @@ ${project.basedir}/src/main/java + ${project.build.directory}/delombok false skip diff --git a/lombok/src/main/java/com/baeldung/lombok/builder/defaultvalue/Pojo.java b/lombok/src/main/java/com/baeldung/lombok/builder/defaultvalue/Pojo.java new file mode 100644 index 0000000000..feaade9cd5 --- /dev/null +++ b/lombok/src/main/java/com/baeldung/lombok/builder/defaultvalue/Pojo.java @@ -0,0 +1,17 @@ +package com.baeldung.lombok.builder.defaultvalue; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +public class Pojo { + private String name = "foo"; + private boolean original = true; +} diff --git a/lombok/src/test/java/com/baeldung/lombok/builder/defaultvalue/BuilderWithDefaultValueUnitTest.java b/lombok/src/test/java/com/baeldung/lombok/builder/defaultvalue/BuilderWithDefaultValueUnitTest.java new file mode 100644 index 0000000000..d9184f605c --- /dev/null +++ b/lombok/src/test/java/com/baeldung/lombok/builder/defaultvalue/BuilderWithDefaultValueUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.lombok.builder.defaultvalue; + +import org.junit.Assert; +import org.junit.Test; + +public class BuilderWithDefaultValueUnitTest { + + @Test + public void givenBuilderWithDefaultValue_ThanDefaultValueIsPresent() { + Pojo build = new Pojo().toBuilder() + .build(); + Assert.assertEquals("foo", build.getName()); + Assert.assertTrue(build.isOriginal()); + } + + @Test + public void givenBuilderWithDefaultValue_NoArgsWorksAlso() { + Pojo build = new Pojo().toBuilder() + .build(); + Pojo pojo = new Pojo(); + Assert.assertEquals(build.getName(), pojo.getName()); + Assert.assertTrue(build.isOriginal() == pojo.isOriginal()); + } + +} From 03065a43e9f0652a6d64778d651779712ffcda05 Mon Sep 17 00:00:00 2001 From: fanatixan Date: Wed, 17 Oct 2018 21:54:35 +0200 Subject: [PATCH 141/546] moving heap sort from core-java to algorithms (#5475) --- .../src/main/java/com/baeldung/algorithms}/heapsort/Heap.java | 2 +- .../java/com/baeldung/algorithms}/heapsort/HeapUnitTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename {core-java/src/main/java/com/baeldung => algorithms/src/main/java/com/baeldung/algorithms}/heapsort/Heap.java (98%) rename {core-java/src/test/java/com/baeldung => algorithms/src/test/java/com/baeldung/algorithms}/heapsort/HeapUnitTest.java (95%) diff --git a/core-java/src/main/java/com/baeldung/heapsort/Heap.java b/algorithms/src/main/java/com/baeldung/algorithms/heapsort/Heap.java similarity index 98% rename from core-java/src/main/java/com/baeldung/heapsort/Heap.java rename to algorithms/src/main/java/com/baeldung/algorithms/heapsort/Heap.java index 95e0e1d8cd..8c98e4fc5c 100644 --- a/core-java/src/main/java/com/baeldung/heapsort/Heap.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/heapsort/Heap.java @@ -1,4 +1,4 @@ -package com.baeldung.heapsort; +package com.baeldung.algorithms.heapsort; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java/src/test/java/com/baeldung/heapsort/HeapUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java similarity index 95% rename from core-java/src/test/java/com/baeldung/heapsort/HeapUnitTest.java rename to algorithms/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java index cc3e49b6c9..96e4936eaf 100644 --- a/core-java/src/test/java/com/baeldung/heapsort/HeapUnitTest.java +++ b/algorithms/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.heapsort; +package com.baeldung.algorithms.heapsort; import static org.assertj.core.api.Assertions.assertThat; From 831cdf2bd6a3f256e5fd5080536269c6b9657bbd Mon Sep 17 00:00:00 2001 From: Paul van Gool Date: Wed, 17 Oct 2018 13:00:14 -0700 Subject: [PATCH 142/546] BAEL-1215: Introduction to the Suanshu math library (#5469) * BAEL-1215: Introduction to the Suanshu math library * Updated examples based on feedback. --- libraries/pom.xml | 13 ++ .../com/baeldung/suanshu/SuanShuMath.java | 142 ++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 libraries/src/main/java/com/baeldung/suanshu/SuanShuMath.java diff --git a/libraries/pom.xml b/libraries/pom.xml index 6bbe8e6f1c..8ffd33272d 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -711,6 +711,12 @@ ${snakeyaml.version} + + com.numericalmethod + suanshu + ${suanshu.version} + + @@ -731,6 +737,12 @@ Apache Staging https://repository.apache.org/content/groups/staging + + nm-repo + Numerical Method's Maven Repository + http://repo.numericalmethod.com/maven/ + default + @@ -835,6 +847,7 @@ + 4.0.0 1.21 1.23.0 0.1.0 diff --git a/libraries/src/main/java/com/baeldung/suanshu/SuanShuMath.java b/libraries/src/main/java/com/baeldung/suanshu/SuanShuMath.java new file mode 100644 index 0000000000..46af24692d --- /dev/null +++ b/libraries/src/main/java/com/baeldung/suanshu/SuanShuMath.java @@ -0,0 +1,142 @@ +package com.baeldung.suanshu; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.numericalmethod.suanshu.algebra.linear.matrix.doubles.Matrix; +import com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector; +import com.numericalmethod.suanshu.algebra.linear.vector.doubles.dense.DenseVector; +import com.numericalmethod.suanshu.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix; +import com.numericalmethod.suanshu.algebra.linear.matrix.doubles.operation.Inverse; +import com.numericalmethod.suanshu.analysis.function.polynomial.Polynomial; +import com.numericalmethod.suanshu.analysis.function.polynomial.root.PolyRoot; +import com.numericalmethod.suanshu.analysis.function.polynomial.root.PolyRootSolver; +import com.numericalmethod.suanshu.number.complex.Complex; + +class SuanShuMath { + + private static final Logger log = LoggerFactory.getLogger(SuanShuMath.class); + + public static void main(String[] args) throws Exception { + SuanShuMath math = new SuanShuMath(); + + math.addingVectors(); + math.scaleVector(); + math.innerProductVectors(); + math.addingIncorrectVectors(); + + math.addingMatrices(); + math.multiplyMatrices(); + math.multiplyIncorrectMatrices(); + math.inverseMatrix(); + + Polynomial p = math.createPolynomial(); + math.evaluatePolynomial(p); + math.solvePolynomial(); + } + + public void addingVectors() throws Exception { + Vector v1 = new DenseVector(new double[]{1, 2, 3, 4, 5}); + Vector v2 = new DenseVector(new double[]{5, 4, 3, 2, 1}); + Vector v3 = v1.add(v2); + log.info("Adding vectors: {}", v3); + } + + public void scaleVector() throws Exception { + Vector v1 = new DenseVector(new double[]{1, 2, 3, 4, 5}); + Vector v2 = v1.scaled(2.0); + log.info("Scaling a vector: {}", v2); + } + + public void innerProductVectors() throws Exception { + Vector v1 = new DenseVector(new double[]{1, 2, 3, 4, 5}); + Vector v2 = new DenseVector(new double[]{5, 4, 3, 2, 1}); + double inner = v1.innerProduct(v2); + log.info("Vector inner product: {}", inner); + } + + public void addingIncorrectVectors() throws Exception { + Vector v1 = new DenseVector(new double[]{1, 2, 3}); + Vector v2 = new DenseVector(new double[]{5, 4}); + Vector v3 = v1.add(v2); + log.info("Adding vectors: {}", v3); + } + + public void addingMatrices() throws Exception { + Matrix m1 = new DenseMatrix(new double[][]{ + {1, 2, 3}, + {4, 5, 6} + }); + + Matrix m2 = new DenseMatrix(new double[][]{ + {3, 2, 1}, + {6, 5, 4} + }); + + Matrix m3 = m1.add(m2); + log.info("Adding matrices: {}", m3); + } + + public void multiplyMatrices() throws Exception { + Matrix m1 = new DenseMatrix(new double[][]{ + {1, 2, 3}, + {4, 5, 6} + }); + + Matrix m2 = new DenseMatrix(new double[][]{ + {1, 4}, + {2, 5}, + {3, 6} + }); + + Matrix m3 = m1.multiply(m2); + log.info("Multiplying matrices: {}", m3); + } + + public void multiplyIncorrectMatrices() throws Exception { + Matrix m1 = new DenseMatrix(new double[][]{ + {1, 2, 3}, + {4, 5, 6} + }); + + Matrix m2 = new DenseMatrix(new double[][]{ + {3, 2, 1}, + {6, 5, 4} + }); + + Matrix m3 = m1.multiply(m2); + log.info("Multiplying matrices: {}", m3); + } + + public void inverseMatrix() { + Matrix m1 = new DenseMatrix(new double[][]{ + {1, 2}, + {3, 4} + }); + + Inverse m2 = new Inverse(m1); + log.info("Inverting a matrix: {}", m2); + log.info("Verifying a matrix inverse: {}", m1.multiply(m2)); + } + + public Polynomial createPolynomial() { + return new Polynomial(new double[]{3, -5, 1}); + } + + public void evaluatePolynomial(Polynomial p) { + // Evaluate using a real number + log.info("Evaluating a polynomial using a real number: {}", p.evaluate(5)); + // Evaluate using a complex number + log.info("Evaluating a polynomial using a complex number: {}", p.evaluate(new Complex(1, 2))); + } + + public void solvePolynomial() { + Polynomial p = new Polynomial(new double[]{2, 2, -4}); + PolyRootSolver solver = new PolyRoot(); + List roots = solver.solve(p); + log.info("Finding polynomial roots: {}", roots); + } + +} From 8c3598b441a3e5f0ba2e3ab887c3d1633ce23638 Mon Sep 17 00:00:00 2001 From: the-java-guy <39062630+the-java-guy@users.noreply.github.com> Date: Thu, 18 Oct 2018 09:41:25 +0530 Subject: [PATCH 143/546] BAEL - 2166 (#5379) * Bean Object, server side and client side example for event streaming example * BAEL-1628 Access a File from the Classpath in a Spring Application * inputstream retrieval added * Removed files related to evaluation article * + Aligning code to the article. Removed Utility methods and classes * Precommit fix * PMD fixes * Code Review changes Refactored : whenResourceUtils_thenReadSuccessful * BAEL-1934 * +indentation correction in pom.xml * synced with master * Precommit : rebase * BAEL-1782 * BAEL - 2166 : Password Generation * Removed unnecessary javaDoc * Segregated utility method --- java-strings/pom.xml | 12 +- .../password/RandomPasswordGenerator.java | 152 ++++++++++++++++++ .../password/StringPasswordUnitTest.java | 64 ++++++++ 3 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 java-strings/src/main/java/com/baeldung/string/password/RandomPasswordGenerator.java create mode 100644 java-strings/src/test/java/com/baeldung/string/password/StringPasswordUnitTest.java diff --git a/java-strings/pom.xml b/java-strings/pom.xml index b1ba49b33a..a43490ce5c 100644 --- a/java-strings/pom.xml +++ b/java-strings/pom.xml @@ -68,7 +68,17 @@ emoji-java 4.0.0 - + + + org.passay + passay + 1.3.1 + + + org.apache.commons + commons-text + 1.4 + diff --git a/java-strings/src/main/java/com/baeldung/string/password/RandomPasswordGenerator.java b/java-strings/src/main/java/com/baeldung/string/password/RandomPasswordGenerator.java new file mode 100644 index 0000000000..46af4d7c51 --- /dev/null +++ b/java-strings/src/main/java/com/baeldung/string/password/RandomPasswordGenerator.java @@ -0,0 +1,152 @@ +package com.baeldung.string.password; + +import java.security.SecureRandom; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.text.RandomStringGenerator; +import org.passay.CharacterData; +import org.passay.CharacterRule; +import org.passay.EnglishCharacterData; +import org.passay.PasswordGenerator; + +public class RandomPasswordGenerator { + + /** + * Special characters allowed in password. + */ + public static final String ALLOWED_SPL_CHARACTERS = "!@#$%^&*()_+"; + + public static final String ERROR_CODE = "ERRONEOUS_SPECIAL_CHARS"; + + Random random = new SecureRandom(); + + public String generatePassayPassword() { + PasswordGenerator gen = new PasswordGenerator(); + CharacterData lowerCaseChars = EnglishCharacterData.LowerCase; + CharacterRule lowerCaseRule = new CharacterRule(lowerCaseChars); + lowerCaseRule.setNumberOfCharacters(2); + CharacterData upperCaseChars = EnglishCharacterData.UpperCase; + CharacterRule upperCaseRule = new CharacterRule(upperCaseChars); + upperCaseRule.setNumberOfCharacters(2); + CharacterData digitChars = EnglishCharacterData.Digit; + CharacterRule digitRule = new CharacterRule(digitChars); + digitRule.setNumberOfCharacters(2); + CharacterData specialChars = new CharacterData() { + public String getErrorCode() { + return ERROR_CODE; + } + + public String getCharacters() { + return ALLOWED_SPL_CHARACTERS; + } + }; + CharacterRule splCharRule = new CharacterRule(specialChars); + splCharRule.setNumberOfCharacters(2); + String password = gen.generatePassword(10, splCharRule, lowerCaseRule, upperCaseRule, digitRule); + return password; + } + + public String generateCommonTextPassword() { + String pwString = generateRandomSpecialCharacters(2).concat(generateRandomNumbers(2)) + .concat(generateRandomAlphabet(2, true)) + .concat(generateRandomAlphabet(2, false)) + .concat(generateRandomCharacters(2)); + List pwChars = pwString.chars() + .mapToObj(data -> (char) data) + .collect(Collectors.toList()); + Collections.shuffle(pwChars); + String password = pwChars.stream() + .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append) + .toString(); + return password; + } + + public String generateCommonsLang3Password() { + String upperCaseLetters = RandomStringUtils.random(2, 65, 90, true, true); + String lowerCaseLetters = RandomStringUtils.random(2, 97, 122, true, true); + String numbers = RandomStringUtils.randomNumeric(2); + String specialChar = RandomStringUtils.random(2, 33, 47, false, false); + String totalChars = RandomStringUtils.randomAlphanumeric(2); + String combinedChars = upperCaseLetters.concat(lowerCaseLetters) + .concat(numbers) + .concat(specialChar) + .concat(totalChars); + List pwdChars = combinedChars.chars() + .mapToObj(c -> (char) c) + .collect(Collectors.toList()); + Collections.shuffle(pwdChars); + String password = pwdChars.stream() + .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append) + .toString(); + return password; + } + + public String generateSecureRandomPassword() { + Stream pwdStream = Stream.concat(getRandomNumbers(2), Stream.concat(getRandomSpecialChars(2), Stream.concat(getRandomAlphabets(2, true), getRandomAlphabets(4, false)))); + List charList = pwdStream.collect(Collectors.toList()); + Collections.shuffle(charList); + String password = charList.stream() + .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append) + .toString(); + return password; + } + + public String generateRandomSpecialCharacters(int length) { + RandomStringGenerator pwdGenerator = new RandomStringGenerator.Builder().withinRange(33, 45) + .build(); + return pwdGenerator.generate(length); + } + + public String generateRandomNumbers(int length) { + RandomStringGenerator pwdGenerator = new RandomStringGenerator.Builder().withinRange(48, 57) + .build(); + return pwdGenerator.generate(length); + } + + public String generateRandomCharacters(int length) { + RandomStringGenerator pwdGenerator = new RandomStringGenerator.Builder().withinRange(48, 57) + .build(); + return pwdGenerator.generate(length); + } + + public String generateRandomAlphabet(int length, boolean lowerCase) { + int low; + int hi; + if (lowerCase) { + low = 97; + hi = 122; + } else { + low = 65; + hi = 90; + } + RandomStringGenerator pwdGenerator = new RandomStringGenerator.Builder().withinRange(low, hi) + .build(); + return pwdGenerator.generate(length); + } + + public Stream getRandomAlphabets(int count, boolean upperCase) { + IntStream characters = null; + if (upperCase) { + characters = random.ints(count, 65, 90); + } else { + characters = random.ints(count, 97, 122); + } + return characters.mapToObj(data -> (char) data); + } + + public Stream getRandomNumbers(int count) { + IntStream numbers = random.ints(count, 48, 57); + return numbers.mapToObj(data -> (char) data); + } + + public Stream getRandomSpecialChars(int count) { + IntStream specialChars = random.ints(count, 33, 45); + return specialChars.mapToObj(data -> (char) data); + } +} diff --git a/java-strings/src/test/java/com/baeldung/string/password/StringPasswordUnitTest.java b/java-strings/src/test/java/com/baeldung/string/password/StringPasswordUnitTest.java new file mode 100644 index 0000000000..bfd4b0fe8e --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/string/password/StringPasswordUnitTest.java @@ -0,0 +1,64 @@ +package com.baeldung.string.password; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Examples of passwords conforming to various specifications, using different libraries. + * + */ +public class StringPasswordUnitTest { + + RandomPasswordGenerator passGen = new RandomPasswordGenerator(); + + @Test + public void whenPasswordGeneratedUsingPassay_thenSuccessful() { + String password = passGen.generatePassayPassword(); + int specialCharCount = 0; + for (char c : password.toCharArray()) { + if (c >= 33 || c <= 47) { + specialCharCount++; + } + } + assertTrue("Password validation failed in Passay", specialCharCount >= 2); + } + + @Test + public void whenPasswordGeneratedUsingCommonsText_thenSuccessful() { + RandomPasswordGenerator passGen = new RandomPasswordGenerator(); + String password = passGen.generateCommonTextPassword(); + int lowerCaseCount = 0; + for (char c : password.toCharArray()) { + if (c >= 97 || c <= 122) { + lowerCaseCount++; + } + } + assertTrue("Password validation failed in commons-text ", lowerCaseCount >= 2); + } + + @Test + public void whenPasswordGeneratedUsingCommonsLang3_thenSuccessful() { + String password = passGen.generateCommonsLang3Password(); + int numCount = 0; + for (char c : password.toCharArray()) { + if (c >= 48 || c <= 57) { + numCount++; + } + } + assertTrue("Password validation failed in commons-lang3", numCount >= 2); + } + + @Test + public void whenPasswordGeneratedUsingSecureRandom_thenSuccessful() { + String password = passGen.generateSecureRandomPassword(); + int specialCharCount = 0; + for (char c : password.toCharArray()) { + if (c >= 33 || c <= 47) { + specialCharCount++; + } + } + assertTrue("Password validation failed in Secure Random", specialCharCount >= 2); + } + +} From a982f70f28391c406e5aadcd96207f4efde98599 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Thu, 18 Oct 2018 19:49:28 +0530 Subject: [PATCH 144/546] Update pom.xml --- spring-security-rest/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-security-rest/pom.xml b/spring-security-rest/pom.xml index 70967ce214..ef16f2201b 100644 --- a/spring-security-rest/pom.xml +++ b/spring-security-rest/pom.xml @@ -297,5 +297,4 @@ 1.6.1 - From ef3614a5a01812d0db40b1561948f06b2d1dfd17 Mon Sep 17 00:00:00 2001 From: mstefanec <42640465+mstefanec@users.noreply.github.com> Date: Thu, 18 Oct 2018 17:47:27 +0200 Subject: [PATCH 145/546] Programatical sequences in project reactor (#5482) * Added programatically creating sequences in project reactor * Added programatically creating sequences in project reactor --- .../baeldung/reactor/ItemProducerCreate.java | 44 ++++++++++++++ .../reactor/NetworTrafficProducerPush.java | 34 +++++++++++ .../reactor/ProgramaticSequences.java | 58 +++++++++++++++++++ .../baeldung/reactor/StatelessGenerate.java | 24 ++++++++ 4 files changed, 160 insertions(+) create mode 100644 reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java create mode 100644 reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java create mode 100644 reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java create mode 100644 reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java diff --git a/reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java b/reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java new file mode 100644 index 0000000000..6078f8ef0b --- /dev/null +++ b/reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java @@ -0,0 +1,44 @@ +package com.baeldung.reactor; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import reactor.core.publisher.Flux; + +public class ItemProducerCreate { + + Logger logger = LoggerFactory.getLogger(NetworTrafficProducerPush.class); + + Consumer> listener; + + public void create() { + Flux articlesFlux = Flux.create((sink) -> { + ItemProducerCreate.this.listener = (items) -> { + items.stream() + .forEach(article -> sink.next(article)); + }; + }); + articlesFlux.subscribe(ItemProducerCreate.this.logger::info); + } + + public static void main(String[] args) { + ItemProducerCreate producer = new ItemProducerCreate(); + producer.create(); + + new Thread(new Runnable() { + + @Override + public void run() { + List items = new ArrayList<>(); + items.add("Item 1"); + items.add("Item 2"); + items.add("Item 3"); + producer.listener.accept(items); + } + }).start(); + } +} diff --git a/reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java b/reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java new file mode 100644 index 0000000000..807ceae84d --- /dev/null +++ b/reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java @@ -0,0 +1,34 @@ +package com.baeldung.reactor; + +import java.util.function.Consumer; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.FluxSink.OverflowStrategy; + +public class NetworTrafficProducerPush { + + Logger logger = LoggerFactory.getLogger(NetworTrafficProducerPush.class); + + Consumer listener; + + public void subscribe(Consumer consumer) { + Flux flux = Flux.push(sink -> { + NetworTrafficProducerPush.this.listener = (t) -> sink.next(t); + }, OverflowStrategy.DROP); + flux.subscribe(consumer); + } + + public void onPacket(String packet) { + listener.accept(packet); + } + + public static void main(String[] args) { + NetworTrafficProducerPush trafficProducer = new NetworTrafficProducerPush(); + trafficProducer.subscribe(trafficProducer.logger::info); + trafficProducer.onPacket("Packet[A18]"); + } + +} diff --git a/reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java b/reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java new file mode 100644 index 0000000000..b52def377d --- /dev/null +++ b/reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java @@ -0,0 +1,58 @@ +package com.baeldung.reactor; + +import java.util.concurrent.atomic.AtomicInteger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import reactor.core.publisher.Flux; + +public class ProgramaticSequences { + + Logger logger = LoggerFactory.getLogger(ProgramaticSequences.class); + + public void statefullImutableGenerate() { + Flux flux = Flux.generate(() -> 1, (state, sink) -> { + sink.next("2 + " + state + " = " + 2 + state); + if (state == 101) + sink.complete(); + return state + 1; + }); + + flux.subscribe(logger::info); + } + + public void statefullMutableGenerate() { + Flux flux = Flux.generate(AtomicInteger::new, (state, sink) -> { + int i = state.getAndIncrement(); + sink.next("2 + " + state + " = " + 2 + state); + if (i == 101) + sink.complete(); + return state; + }); + + flux.subscribe(logger::info); + } + + public void handle() { + Flux elephants = Flux.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + .handle((i, sink) -> { + String animal = "Elephant nr " + i; + if (i % 2 == 0) { + sink.next(animal); + } + }); + + elephants.subscribe(logger::info); + } + + public static void main(String[] args) { + ProgramaticSequences ps = new ProgramaticSequences(); + + ps.statefullImutableGenerate(); + ps.statefullMutableGenerate(); + ps.handle(); + + } + +} diff --git a/reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java b/reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java new file mode 100644 index 0000000000..c82f8e160b --- /dev/null +++ b/reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java @@ -0,0 +1,24 @@ +package com.baeldung.reactor; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import reactor.core.publisher.Flux; + +public class StatelessGenerate { + + Logger logger = LoggerFactory.getLogger(StatelessGenerate.class); + + public void statelessGenerate() { + Flux flux = Flux.generate((sink) -> { + sink.next("hallo"); + }); + flux.subscribe(logger::info); + } + + public static void main(String[] args) { + StatelessGenerate ps = new StatelessGenerate(); + ps.statelessGenerate(); + } + +} From c1e522d38c9db01136c27efde516471c9be4f280 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Thu, 18 Oct 2018 21:26:37 +0530 Subject: [PATCH 146/546] BAEL-9654 Activating multiple profiles for Travis CI (#5483) -Modified travis.yml to execute both default-first and default-second profile --- .travis.yml | 2 +- pom.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e2d690b4e..683422dc97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ before_install: - echo "MAVEN_OPTS='-Xmx2048M -Xss128M -XX:+CMSClassUnloadingEnabled -XX:+UseG1GC -XX:-UseGCOverheadLimit'" > ~/.mavenrc install: skip -script: travis_wait 60 mvn -q install -Pdefault +script: travis_wait 60 mvn -q install -Pdefault-first,default-second sudo: required diff --git a/pom.xml b/pom.xml index beb10b3287..a0c54f4b8a 100644 --- a/pom.xml +++ b/pom.xml @@ -458,7 +458,6 @@ spring-5 spring-5-data-reactive spring-5-reactive - spring-data-5-reactive/spring-5-data-reactive-redis spring-5-reactive-security spring-5-reactive-client spring-5-mvc From cb9ffa4a4ac026386a398f502421bdb03af589a5 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Thu, 18 Oct 2018 21:16:33 +0200 Subject: [PATCH 147/546] Update README.md --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index 9e38dfc47d..84c91c5f6e 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -156,3 +156,4 @@ - [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset) - [Hashing a Password in Java](https://www.baeldung.com/java-password-hashing) - [Java Switch Statement](https://www.baeldung.com/java-switch) +- [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) From 6fd52ad66c9c6c29cea89f55084e1ed5f7ac6252 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Thu, 18 Oct 2018 22:59:29 +0300 Subject: [PATCH 148/546] Update StringToByteArrayUnitTest.java --- .../com/baeldung/java8/base64/StringToByteArrayUnitTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java b/java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java index 5bb97e111a..c5f7051c25 100644 --- a/java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java +++ b/java-strings/src/test/java/com/baeldung/java8/base64/StringToByteArrayUnitTest.java @@ -56,5 +56,4 @@ public class StringToByteArrayUnitTest { assertEquals("test input", new String(result)); } - } From 8caaf775568fee31ae5ad0b9e511b79d8bb30cc7 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Thu, 18 Oct 2018 21:55:28 -0500 Subject: [PATCH 149/546] BAEL-2200 and BAEL-2287 README updates (#5487) * BAEL-1766: Update README * BAEL-1853: add link to article * BAEL-1801: add link to article * Added links back to articles * Add links back to articles * BAEL-1795: Update README * BAEL-1901 and BAEL-1555 add links back to article * BAEL-2026 add link back to article * BAEL-2029: add link back to article * BAEL-1898: Add link back to article * BAEL-2102 and BAEL-2131 Add links back to articles * BAEL-2132 Add link back to article * BAEL-1980: add link back to article * BAEL-2200: Display auto-configuration report in Spring Boot * BAEL-2253: Add link back to article * BAEL-2200 BAEL-2287 Add links back to articles --- core-java-collections/README.md | 1 + spring-boot/README.MD | 1 + 2 files changed, 2 insertions(+) diff --git a/core-java-collections/README.md b/core-java-collections/README.md index aef640634e..e366232f74 100644 --- a/core-java-collections/README.md +++ b/core-java-collections/README.md @@ -55,3 +55,4 @@ - [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) - [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) - [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) +- [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections) diff --git a/spring-boot/README.MD b/spring-boot/README.MD index 192c4f9fed..aed2d2c5f8 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -34,3 +34,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Introduction to Chaos Monkey](https://www.baeldung.com/spring-boot-chaos-monkey) - [Spring Component Scanning](https://www.baeldung.com/spring-component-scanning) - [Load Spring Boot Properties From a JSON File](https://www.baeldung.com/spring-boot-json-properties) +- [Display Auto-Configuration Report in Spring Boot](https://www.baeldung.com/spring-boot-auto-configuration-report) From 361448cc396f2508cca8b66e80f25f549ee8bde9 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Fri, 19 Oct 2018 12:23:39 +0530 Subject: [PATCH 150/546] [BAEL-9547] - Moved 3 articles from guava to guava-collections --- guava-collections/README.md | 5 ++++- .../java/org/baeldung/guava/ClassToInstanceMapUnitTest.java | 0 .../src/test/java/org/baeldung/guava/GuavaTableUnitTest.java | 0 guava/README.md | 3 --- 4 files changed, 4 insertions(+), 4 deletions(-) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java (100%) rename {guava => guava-collections}/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java (100%) diff --git a/guava-collections/README.md b/guava-collections/README.md index eb1eb1d35c..fc9cf549c3 100644 --- a/guava-collections/README.md +++ b/guava-collections/README.md @@ -17,4 +17,7 @@ - [Guide to Guava RangeSet](http://www.baeldung.com/guava-rangeset) - [Guide to Guava RangeMap](http://www.baeldung.com/guava-rangemap) - [Guide to Guava MinMaxPriorityQueue and EvictingQueue](http://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) -- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) \ No newline at end of file +- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) +- [Guava Set + Function = Map](http://www.baeldung.com/guava-set-function-map-tutorial) +- [Guide to Guava Table](http://www.baeldung.com/guava-table) +- [Guide to Guava ClassToInstanceMap](http://www.baeldung.com/guava-class-to-instance-map) \ No newline at end of file diff --git a/guava/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java diff --git a/guava/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java similarity index 100% rename from guava/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java rename to guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java diff --git a/guava/README.md b/guava/README.md index 7501bf08de..56e6aff50c 100644 --- a/guava/README.md +++ b/guava/README.md @@ -6,15 +6,12 @@ ### Relevant Articles: - [Guava Functional Cookbook](http://www.baeldung.com/guava-functions-predicates) - [Guava – Write to File, Read from File](http://www.baeldung.com/guava-write-to-file-read-from-file) -- [Guava Set + Function = Map](http://www.baeldung.com/guava-set-function-map-tutorial) - [Guide to Guava’s Ordering](http://www.baeldung.com/guava-ordering) - [Guide to Guava’s PreConditions](http://www.baeldung.com/guava-preconditions) - [Introduction to Guava CacheLoader](http://www.baeldung.com/guava-cacheloader) - [Introduction to Guava Memoizer](http://www.baeldung.com/guava-memoizer) - [Guide to Guava’s EventBus](http://www.baeldung.com/guava-eventbus) -- [Guide to Guava Table](http://www.baeldung.com/guava-table) - [Guide to Guava’s Reflection Utilities](http://www.baeldung.com/guava-reflection) -- [Guide to Guava ClassToInstanceMap](http://www.baeldung.com/guava-class-to-instance-map) - [Guide to Mathematical Utilities in Guava](http://www.baeldung.com/guava-math) - [Bloom Filter in Java using Guava](http://www.baeldung.com/guava-bloom-filter) - [Using Guava CountingOutputStream](http://www.baeldung.com/guava-counting-outputstream) From e2d1f25dc57c34efaf6929e7d933bfa3b482888e Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 19 Oct 2018 19:37:21 +0530 Subject: [PATCH 151/546] BAEL-9467 Update Spring Security article - Upgraded xml schema versions to latest --- spring-security-rest/src/main/resources/webSecurityConfig.xml | 4 ++-- spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-security-rest/src/main/resources/webSecurityConfig.xml b/spring-security-rest/src/main/resources/webSecurityConfig.xml index 54bd0f91b9..edd3cba39c 100644 --- a/spring-security-rest/src/main/resources/webSecurityConfig.xml +++ b/spring-security-rest/src/main/resources/webSecurityConfig.xml @@ -5,9 +5,9 @@ xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation=" http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security-4.2.xsd + http://www.springframework.org/schema/security/spring-security.xsd http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-4.2.xsd"> + http://www.springframework.org/schema/beans/spring-beans.xsd"> core-java core-java-collections + java-collections-conversions + java-collections-maps core-java-io core-java-8 java-streams @@ -1270,6 +1272,8 @@ java-strings core-java-collections + java-collections-conversions + java-collections-maps core-java-io core-java-8 java-streams From 0b210ac086ca8d064f7a0a1f3c92c73ae5ad04a2 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 20 Oct 2018 01:23:54 +0530 Subject: [PATCH 158/546] [BAEL-9515] - Added spring boot version property for artifact and plugin dependency --- parent-boot-1/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index d220b4a6b7..0f1086fa31 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-dependencies - 1.5.16.RELEASE + ${spring-boot.version} pom import @@ -42,7 +42,7 @@ org.springframework.boot spring-boot-maven-plugin - 1.5.15.RELEASE + ${spring-boot.version} @@ -50,6 +50,7 @@ 3.1.0 + 1.5.16.RELEASE \ No newline at end of file From dc0cf74266999e940a08e3cfb70e2e034e04388c Mon Sep 17 00:00:00 2001 From: amit2103 Date: Mon, 15 Oct 2018 00:05:22 +0530 Subject: [PATCH 159/546] [BAEL-9516] - Added latest version of spring 2 --- parent-boot-2/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index de6cb5d068..b014181d65 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-dependencies - 2.0.4.RELEASE + 2.0.5.RELEASE pom import From 296e9c03cc84c278f30381817695563a0a51c4e3 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 20 Oct 2018 01:33:02 +0530 Subject: [PATCH 160/546] [BAEL-9516] - Added spring boot version property for artifact and plugin dependency --- parent-boot-2/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index b014181d65..ba98898987 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-dependencies - 2.0.5.RELEASE + ${spring-boot.version} pom import @@ -41,7 +41,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.0.4.RELEASE + ${spring-boot.version} @@ -73,6 +73,7 @@ 3.1.0 1.0.11.RELEASE + 2.0.5.RELEASE \ No newline at end of file From 2404312d20387c11599e7b23c428fb23947e24b9 Mon Sep 17 00:00:00 2001 From: Adam InTae Gerard Date: Fri, 19 Oct 2018 21:29:05 -0700 Subject: [PATCH 161/546] BAEL-1909 (#5366) --- spring-5-reactive/README.md | 1 + spring-5-reactive/pom.xml | 22 +++++++ .../com/baeldung/websession/Application.java | 15 +++++ .../websession/configuration/RedisConfig.java | 17 ++++++ .../configuration/SessionConfig.java | 20 +++++++ .../configuration/WebFluxConfig.java | 20 +++++++ .../configuration/WebFluxSecurityConfig.java | 58 +++++++++++++++++++ .../controller/SessionController.java | 42 ++++++++++++++ .../websession/transfer/CustomResponse.java | 31 ++++++++++ 9 files changed, 226 insertions(+) create mode 100644 spring-5-reactive/src/main/java/com/baeldung/websession/Application.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/websession/configuration/RedisConfig.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/websession/configuration/SessionConfig.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/websession/controller/SessionController.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/websession/transfer/CustomResponse.java diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 7977fd820f..1431554882 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -14,3 +14,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring Webflux and CORS](http://www.baeldung.com/spring-webflux-cors) - [Handling Errors in Spring WebFlux](http://www.baeldung.com/spring-webflux-errors) - [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) +- [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/a-guide-to-spring-session-reactive-support-websession/) \ No newline at end of file diff --git a/spring-5-reactive/pom.xml b/spring-5-reactive/pom.xml index 5f455c3906..e903b57c4e 100644 --- a/spring-5-reactive/pom.xml +++ b/spring-5-reactive/pom.xml @@ -76,6 +76,28 @@ test + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.session + spring-session-core + + + org.springframework.session + spring-session-data-redis + + org.apache.commons commons-collections4 diff --git a/spring-5-reactive/src/main/java/com/baeldung/websession/Application.java b/spring-5-reactive/src/main/java/com/baeldung/websession/Application.java new file mode 100644 index 0000000000..667ef29658 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/websession/Application.java @@ -0,0 +1,15 @@ +package com.baeldung.websession; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"com.baeldung"}) +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} \ No newline at end of file diff --git a/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/RedisConfig.java b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/RedisConfig.java new file mode 100644 index 0000000000..aa85cf9fd9 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/RedisConfig.java @@ -0,0 +1,17 @@ +package com.baeldung.websession.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.session.data.redis.config.annotation.web.server.EnableRedisWebSession; + +@Configuration +//@EnableRedisWebSession +public class RedisConfig { +/** + @Bean + public LettuceConnectionFactory redisConnectionFactory() { + return new LettuceConnectionFactory(); + } +*/ +} \ No newline at end of file diff --git a/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/SessionConfig.java b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/SessionConfig.java new file mode 100644 index 0000000000..7cb2ff680e --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/SessionConfig.java @@ -0,0 +1,20 @@ +package com.baeldung.websession.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.session.ReactiveMapSessionRepository; +import org.springframework.session.ReactiveSessionRepository; +import org.springframework.session.config.annotation.web.server.EnableSpringWebSession; + +import java.util.concurrent.ConcurrentHashMap; + +@Configuration +@EnableSpringWebSession +public class SessionConfig { + + @Bean + public ReactiveSessionRepository reactiveSessionRepository() { + return new ReactiveMapSessionRepository(new ConcurrentHashMap<>()); + } + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java new file mode 100644 index 0000000000..964b544916 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxConfig.java @@ -0,0 +1,20 @@ +package com.baeldung.websession.configuration; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.config.EnableWebFlux; +import org.springframework.web.reactive.config.ResourceHandlerRegistry; +import org.springframework.web.reactive.config.WebFluxConfigurer; + +@Configuration +@EnableWebFlux +public class WebFluxConfig implements ApplicationContextAware, WebFluxConfigurer { + + private ApplicationContext context; + + @Override + public void setApplicationContext(ApplicationContext context) { + this.context = context; + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java new file mode 100644 index 0000000000..452bcac8ab --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/websession/configuration/WebFluxSecurityConfig.java @@ -0,0 +1,58 @@ +package com.baeldung.websession.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.server.SecurityWebFilterChain; +import org.springframework.security.web.server.context.WebSessionServerSecurityContextRepository; + +@Configuration +@EnableWebFluxSecurity +public class WebFluxSecurityConfig { + + @Bean + public MapReactiveUserDetailsService userDetailsService() { + UserDetails admin = User + .withUsername("admin") + .password(encoder().encode("password")) + .roles("ADMIN") + .build(); + + UserDetails user = User + .withUsername("user") + .password(encoder().encode("password")) + .roles("USER") + .build(); + + return new MapReactiveUserDetailsService(admin, user); + } + + @Bean + public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { + http + .authorizeExchange() + .anyExchange().authenticated() + .and() + .httpBasic() + .securityContextRepository(new WebSessionServerSecurityContextRepository()) + .and() + .formLogin(); + + http + .csrf().disable(); + + return http.build(); + + } + + @Bean + public PasswordEncoder encoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/websession/controller/SessionController.java b/spring-5-reactive/src/main/java/com/baeldung/websession/controller/SessionController.java new file mode 100644 index 0000000000..b91a050322 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/websession/controller/SessionController.java @@ -0,0 +1,42 @@ +package com.baeldung.websession.controller; + +import com.baeldung.websession.transfer.CustomResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.server.WebSession; +import reactor.core.publisher.Mono; + +@RestController +public class SessionController { + + @GetMapping("/websession/test") + public Mono testWebSessionByParam( + @RequestParam(value = "id") int id, + @RequestParam(value = "note") String note, + WebSession session) { + + session.getAttributes().put("id", id); + session.getAttributes().put("note", note); + + CustomResponse r = new CustomResponse(); + r.setId((int) session.getAttributes().get("id")); + r.setNote((String) session.getAttributes().get("note")); + + return Mono.just(r); + } + + @GetMapping("/websession") + public Mono getSession(WebSession session) { + + session.getAttributes().putIfAbsent("id", 0); + session.getAttributes().putIfAbsent("note", "Howdy Cosmic Spheroid!"); + + CustomResponse r = new CustomResponse(); + r.setId((int) session.getAttributes().get("id")); + r.setNote((String) session.getAttributes().get("note")); + + return Mono.just(r); + } + +} \ No newline at end of file diff --git a/spring-5-reactive/src/main/java/com/baeldung/websession/transfer/CustomResponse.java b/spring-5-reactive/src/main/java/com/baeldung/websession/transfer/CustomResponse.java new file mode 100644 index 0000000000..2d562de157 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/websession/transfer/CustomResponse.java @@ -0,0 +1,31 @@ +package com.baeldung.websession.transfer; + +public class CustomResponse { + + private int id; + private String note; + + public CustomResponse() {} + + public CustomResponse(int id, String note) { + this.id = id; + this.note = note; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + +} From 21a3a43788075ec30d1868cdabc65b8ef0ceb2df Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 20 Oct 2018 11:27:08 +0530 Subject: [PATCH 162/546] [BAEL-9538] - Move persistence-related modules into the persistence folder --- .../core-java-persistence}/README.md | 0 .../core-java-persistence}/pom.xml | 140 ++++----- .../connectionpool/BasicConnectionPool.java | 0 .../connectionpool/C3poDataSource.java | 0 .../connectionpool/ConnectionPool.java | 0 .../connectionpool/DBCPDataSource.java | 0 .../connectionpool/HikariCPDataSource.java | 0 .../com/baeldung/jdbc/BatchProcessing.java | 0 .../main/java/com/baeldung/jdbc/Employee.java | 0 .../jdbcrowset/DatabaseConfiguration.java | 0 .../baeldung/jdbcrowset/ExampleListener.java | 0 .../baeldung/jdbcrowset/FilterExample.java | 0 .../jdbcrowset/JdbcRowsetApplication.java | 0 .../src/main/resources/logback.xml | 0 .../BasicConnectionPoolUnitTest.java | 134 ++++---- .../C3poDataSourceUnitTest.java | 24 +- .../DBCPDataSourceUnitTest.java | 24 +- .../HikariCPDataSourceUnitTest.java | 24 +- .../jdbc/BatchProcessingLiveTest.java | 0 .../java/com/baeldung/jdbc/JdbcLiveTest.java | 0 .../jdbcrowset/JdbcRowSetLiveTest.java | 0 .../deltaspike}/.gitignore | 0 .../deltaspike}/README.md | 0 .../deltaspike}/pom.xml | 1 + .../baeldung/controller/MemberController.java | 0 .../baeldung/data/EntityManagerProducer.java | 0 .../baeldung/data/MemberListProducer.java | 0 .../java/baeldung/data/MemberRepository.java | 0 .../data/QueryDslRepositoryExtension.java | 0 .../java/baeldung/data/QueryDslSupport.java | 0 .../data/SecondaryEntityManagerProducer.java | 0 .../data/SecondaryEntityManagerResolver.java | 0 .../data/SecondaryPersistenceUnit.java | 0 .../baeldung/data/SimpleUserRepository.java | 0 .../java/baeldung/data/UserRepository.java | 0 .../src/main/java/baeldung/model/Address.java | 0 .../src/main/java/baeldung/model/Member.java | 0 .../src/main/java/baeldung/model/User.java | 0 .../java/baeldung/rest/JaxRsActivator.java | 0 .../rest/MemberResourceRESTService.java | 0 .../baeldung/service/MemberRegistration.java | 0 .../main/java/baeldung/util/Resources.java | 0 .../META-INF/apache-deltaspike.properties | 0 .../src/main/resources/META-INF/beans.xml | 0 .../main/resources/META-INF/persistence.xml | 0 .../deltaspike}/src/main/resources/import.sql | 0 .../src/main/resources/logback.xml | 0 .../webapp/WEB-INF/baeldung-jee7-seed-ds.xml | 0 .../baeldung-jee7-seed-secondary-ds.xml | 0 .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/faces-config.xml | 0 .../webapp/WEB-INF/templates/default.xhtml | 0 .../deltaspike}/src/main/webapp/index.html | 0 .../deltaspike}/src/main/webapp/index.xhtml | 0 .../src/main/webapp/resources/css/screen.css | 0 .../main/webapp/resources/gfx/asidebkg.png | Bin .../webapp/resources/gfx/bkg-blkheader.png | Bin .../webapp/resources/gfx/dualbrand_logo.png | Bin .../main/webapp/resources/gfx/headerbkg.png | Bin .../webapp/resources/gfx/wildfly_400x130.jpg | Bin .../test/java/baeldung/ValidatorProducer.java | 0 .../data/TestEntityManagerProducer.java | 0 .../test/MemberRegistrationLiveTest.java | 0 .../test/SimpleUserRepositoryUnitTest.java | 0 .../baeldung/test/UserRepositoryUnitTest.java | 0 .../META-INF/apache-deltaspike.properties | 0 .../src/test/resources/META-INF/beans.xml | 0 .../test/resources/META-INF/persistence.xml | 0 .../src/test/resources/arquillian.xml | 0 .../deltaspike}/src/test/resources/import.sql | 0 .../src/test/resources/test-ds.xml | 0 .../src/test/resources/test-secondary-ds.xml | 0 .../influxdb}/README.md | 0 .../influxdb}/pom.xml | 1 + .../com/baeldung/influxdb/MemoryPoint.java | 0 .../influxdb}/src/main/resources/logback.xml | 0 .../influxdb/InfluxDBConnectionLiveTest.java | 0 .../influxdb}/src/test/resources/logback.xml | 0 .../orientdb}/.gitignore | 0 .../orientdb}/.mvn/wrapper/maven-wrapper.jar | Bin .../.mvn/wrapper/maven-wrapper.properties | 0 .../orientdb}/README.md | 0 .../orientdb}/mvnw | 0 .../orientdb}/mvnw.cmd | 0 .../orientdb}/pom.xml | 1 + .../java/com/baeldung/orientdb/Author.java | 0 .../orientdb}/src/main/resources/logback.xml | 0 .../orientdb/OrientDBDocumentAPILiveTest.java | 0 .../orientdb/OrientDBGraphAPILiveTest.java | 0 .../orientdb/OrientDBObjectAPILiveTest.java | 0 .../spring-boot-persistence}/.gitignore | 10 +- .../.mvn/wrapper/maven-wrapper.properties | 0 .../spring-boot-persistence}/README.MD | 0 .../spring-boot-persistence}/mvnw | 0 .../spring-boot-persistence}/mvnw.cmd | 290 +++++++++--------- .../spring-boot-persistence}/pom.xml | 150 ++++----- .../main/java/com/baeldung/Application.java | 0 .../com/baeldung/boot/config/H2JpaConfig.java | 0 .../java/com/baeldung/domain/Country.java | 0 .../main/java/com/baeldung/domain/User.java | 0 .../baeldung/repository/UserRepository.java | 0 .../SpringBootConsoleApplication.java | 44 +-- .../application/entities/Customer.java | 106 +++---- .../repositories/CustomerRepository.java | 24 +- .../runners/CommandLineCrudRunner.java | 74 ++--- .../baeldung/boot/domain/GenericEntity.java | 0 .../repository/GenericEntityRepository.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/data.sql | 0 .../src/main/resources/logback.xml | 0 .../persistence-generic-entity.properties | 0 .../src/main/resources/schema.sql | 0 .../baeldung/SpringBootH2IntegrationTest.java | 0 .../SpringBootJPAIntegrationTest.java | 0 .../SpringBootProfileIntegrationTest.java | 0 .../UserRepositoryIntegrationTest.java | 0 ...otTomcatConnectionPoolIntegrationTest.java | 44 +-- .../config/H2TestProfileJPAConfig.java | 0 .../src/test/resources/application.properties | 0 .../test/resources/import_active_users.sql | 0 .../test/resources/import_inactive_users.sql | 0 .../src/test/resources/migrated_users.sql | 0 .../spring-data-elasticsearch}/README.md | 0 .../spring-data-elasticsearch}/pom.xml | 2 +- .../com/baeldung/elasticsearch/Person.java | 0 .../spring/data/es/config/Config.java | 0 .../spring/data/es/model/Article.java | 0 .../baeldung/spring/data/es/model/Author.java | 0 .../data/es/repository/ArticleRepository.java | 0 .../data/es/service/ArticleService.java | 0 .../data/es/service/ArticleServiceImpl.java | 0 .../src/main/resources/log4j2.properties | 0 .../ElasticSearchManualTest.java | 0 .../GeoQueriesIntegrationTest.java | 0 .../data/es/ElasticSearchIntegrationTest.java | 0 .../es/ElasticSearchQueryIntegrationTest.java | 0 .../SpringContextIntegrationTest.java | 0 .../spring-data-jpa}/README.md | 0 .../spring-data-jpa}/pom.xml | 9 +- .../main/java/com/baeldung/Application.java | 0 .../config/PersistenceConfiguration.java | 0 .../PersistenceProductConfiguration.java | 0 .../config/PersistenceUserConfiguration.java | 0 .../main/java/com/baeldung/dao/IFooDao.java | 0 .../dao/repositories/ArticleRepository.java | 0 .../repositories/CustomItemRepository.java | 0 .../CustomItemTypeRepository.java | 0 .../dao/repositories/ExtendedRepository.java | 0 .../ExtendedStudentRepository.java | 0 .../dao/repositories/IBarCrudRepository.java | 0 .../dao/repositories/InventoryRepository.java | 0 .../dao/repositories/ItemTypeRepository.java | 0 .../dao/repositories/LocationRepository.java | 0 .../ReadOnlyLocationRepository.java | 0 .../dao/repositories/StoreRepository.java | 0 .../impl/CustomItemRepositoryImpl.java | 0 .../impl/CustomItemTypeRepositoryImpl.java | 0 .../impl/ExtendedRepositoryImpl.java | 0 .../product/ProductRepository.java | 0 .../user/PossessionRepository.java | 0 .../dao/repositories/user/UserRepository.java | 0 .../com/baeldung/ddd/event/Aggregate.java | 0 .../com/baeldung/ddd/event/Aggregate2.java | 0 .../ddd/event/Aggregate2Repository.java | 0 .../com/baeldung/ddd/event/Aggregate3.java | 0 .../ddd/event/Aggregate3Repository.java | 0 .../ddd/event/AggregateRepository.java | 0 .../com/baeldung/ddd/event/DddConfig.java | 0 .../com/baeldung/ddd/event/DomainEvent.java | 0 .../com/baeldung/ddd/event/DomainService.java | 0 .../java/com/baeldung/domain/Article.java | 0 .../main/java/com/baeldung/domain/Bar.java | 0 .../main/java/com/baeldung/domain/Foo.java | 0 .../main/java/com/baeldung/domain/Item.java | 162 +++++----- .../java/com/baeldung/domain/ItemType.java | 92 +++--- .../main/java/com/baeldung/domain/KVTag.java | 0 .../java/com/baeldung/domain/Location.java | 110 +++---- .../baeldung/domain/MerchandiseEntity.java | 0 .../java/com/baeldung/domain/SkillTag.java | 0 .../main/java/com/baeldung/domain/Store.java | 152 ++++----- .../java/com/baeldung/domain/Student.java | 0 .../com/baeldung/domain/product/Product.java | 0 .../com/baeldung/domain/user/Possession.java | 0 .../java/com/baeldung/domain/user/User.java | 0 .../com/baeldung/services/IBarService.java | 0 .../com/baeldung/services/IFooService.java | 0 .../com/baeldung/services/IOperations.java | 0 .../services/impl/AbstractService.java | 0 .../impl/AbstractSpringDataJpaService.java | 0 .../impl/BarSpringDataJpaService.java | 0 .../baeldung/services/impl/FooService.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/ddd.properties | 0 .../src/main/resources/logback.xml | 0 .../persistence-multiple-db.properties | 0 .../src/main/resources/persistence.properties | 0 .../ArticleRepositoryIntegrationTest.java | 0 ...endedStudentRepositoryIntegrationTest.java | 0 .../InventoryRepositoryIntegrationTest.java | 0 .../JpaRepositoriesIntegrationTest.java | 0 .../UserRepositoryIntegrationTest.java | 0 .../Aggregate2EventsIntegrationTest.java | 0 .../Aggregate3EventsIntegrationTest.java | 0 .../event/AggregateEventsIntegrationTest.java | 0 .../baeldung/ddd/event/TestEventHandler.java | 0 ...ractServicePersistenceIntegrationTest.java | 0 .../FooServicePersistenceIntegrationTest.java | 0 .../JpaMultipleDBIntegrationTest.java | 0 .../SpringDataJPABarAuditIntegrationTest.java | 0 .../test/java/com/baeldung/util/IDUtil.java | 0 .../SpringContextIntegrationTest.java | 0 .../src/test/resources/import_entities.sql | 0 .../spring-data-keyvalue}/README.md | 0 .../spring-data-keyvalue}/pom.xml | 2 +- .../spring/data/keyvalue/Configurations.java | 0 .../SpringDataKeyValueApplication.java | 0 .../repositories/EmployeeRepository.java | 0 .../keyvalue/services/EmployeeService.java | 0 .../EmployeeServicesWithKeyValueTemplate.java | 0 .../impl/EmployeeServicesWithRepository.java | 0 .../spring/data/keyvalue/vo/Employee.java | 0 .../src/main/resources/logback.xml | 0 ...WithKeyValueRepositoryIntegrationTest.java | 0 ...ServicesWithRepositoryIntegrationTest.java | 0 .../SpringContextIntegrationTest.java | 0 .../spring-data-mongodb}/README.md | 0 .../spring-data-mongodb}/pom.xml | 2 +- .../com/baeldung/annotation/CascadeSave.java | 0 .../java/com/baeldung/config/MongoConfig.java | 0 .../baeldung/config/MongoReactiveConfig.java | 0 .../baeldung/config/SimpleMongoConfig.java | 0 .../converter/UserWriterConverter.java | 0 .../com/baeldung/event/CascadeCallback.java | 0 .../event/CascadeSaveMongoEventListener.java | 0 .../com/baeldung/event/FieldCallback.java | 0 .../UserCascadeSaveMongoEventListener.java | 0 .../java/com/baeldung/model/EmailAddress.java | 0 .../main/java/com/baeldung/model/User.java | 0 .../reactive/repository/UserRepository.java | 0 .../baeldung/repository/UserRepository.java | 0 .../src/main/resources/logback.xml | 0 .../src/main/resources/mongoConfig.xml | 0 .../src/main/resources/test.png | Bin .../aggregation/ZipsAggregationLiveTest.java | 0 .../aggregation/model/StatePopulation.java | 0 .../com/baeldung/gridfs/GridFSLiveTest.java | 0 .../mongotemplate/DocumentQueryLiveTest.java | 0 .../MongoTemplateProjectionLiveTest.java | 0 .../MongoTemplateQueryLiveTest.java | 0 .../repository/BaseQueryLiveTest.java | 0 .../baeldung/repository/DSLQueryLiveTest.java | 0 .../repository/JSONQueryLiveTest.java | 0 .../repository/QueryMethodsLiveTest.java | 0 .../repository/UserRepositoryLiveTest.java | 0 .../UserRepositoryProjectionLiveTest.java | 0 ...ngoTransactionReactiveIntegrationTest.java | 0 ...ngoTransactionTemplateIntegrationTest.java | 0 .../MongoTransactionalIntegrationTest.java | 0 .../SpringContextIntegrationTest.java | 0 .../src/test/resources/zips.json | 0 .../spring-hibernate3}/README.md | 0 .../spring/PersistenceConfigHibernate3.java | 162 +++++----- .../src/main/resources/logback.xml | 0 ...nateExceptionScen1MainIntegrationTest.java | 86 +++--- ...nateExceptionScen2MainIntegrationTest.java | 90 +++--- .../spring-hibernate4}/.gitignore | 0 .../spring-hibernate4}/README.md | 0 .../spring-hibernate4}/pom.xml | 1 + .../hibernate/criteria/model/Item.java | 0 .../hibernate/fetching/model/OrderDetail.java | 0 .../hibernate/fetching/model/UserEager.java | 0 .../hibernate/fetching/model/UserLazy.java | 0 .../fetching/util/HibernateUtil.java | 0 .../fetching/view/FetchingAppView.java | 0 .../config/HibernateAnnotationUtil.java | 0 .../HibernateOneToManyAnnotationMain.java | 0 .../hibernate/oneToMany/model/Cart.java | 0 .../hibernate/oneToMany/model/Items.java | 0 .../persistence/dao/IBarAuditableDao.java | 0 .../persistence/dao/IBarCrudRepository.java | 0 .../com/baeldung/persistence/dao/IBarDao.java | 0 .../baeldung/persistence/dao/IChildDao.java | 0 .../persistence/dao/IFooAuditableDao.java | 0 .../com/baeldung/persistence/dao/IFooDao.java | 0 .../baeldung/persistence/dao/IParentDao.java | 0 .../persistence/dao/common/AbstractDao.java | 0 .../common/AbstractHibernateAuditableDao.java | 0 .../dao/common/AbstractHibernateDao.java | 0 .../dao/common/AbstractJpaDao.java | 0 .../dao/common/GenericHibernateDao.java | 0 .../dao/common/IAuditOperations.java | 0 .../persistence/dao/common/IGenericDao.java | 0 .../persistence/dao/common/IOperations.java | 0 .../persistence/dao/impl/BarAuditableDao.java | 0 .../baeldung/persistence/dao/impl/BarDao.java | 0 .../persistence/dao/impl/BarJpaDao.java | 0 .../persistence/dao/impl/ChildDao.java | 0 .../persistence/dao/impl/FooAuditableDao.java | 0 .../baeldung/persistence/dao/impl/FooDao.java | 0 .../persistence/dao/impl/ParentDao.java | 0 .../com/baeldung/persistence/model/Bar.java | 0 .../com/baeldung/persistence/model/Child.java | 0 .../com/baeldung/persistence/model/Foo.java | 0 .../baeldung/persistence/model/Parent.java | 0 .../baeldung/persistence/model/Person.java | 0 .../service/IBarAuditableService.java | 0 .../persistence/service/IBarService.java | 0 .../persistence/service/IChildService.java | 0 .../service/IFooAuditableService.java | 0 .../persistence/service/IFooService.java | 0 .../persistence/service/IParentService.java | 0 .../AbstractHibernateAuditableService.java | 0 .../common/AbstractHibernateService.java | 0 .../service/common/AbstractJpaService.java | 0 .../service/common/AbstractService.java | 0 .../common/AbstractSpringDataJpaService.java | 0 .../service/impl/BarAuditableService.java | 0 .../service/impl/BarJpaService.java | 0 .../persistence/service/impl/BarService.java | 0 .../service/impl/BarSpringDataJpaService.java | 0 .../service/impl/ChildService.java | 0 .../service/impl/FooAuditableService.java | 0 .../persistence/service/impl/FooService.java | 0 .../service/impl/ParentService.java | 0 .../baeldung/spring/PersistenceConfig.java | 0 .../baeldung/spring/PersistenceXmlConfig.java | 0 .../src/main/resources/fetching.cfg.xml | 0 .../src/main/resources/fetchingLazy.cfg.xml | 0 .../resources/fetching_create_queries.sql | 0 .../resources/hibernate-annotation.cfg.xml | 0 .../src/main/resources/hibernate4Config.xml | 0 .../src/main/resources/immutable.cfg.xml | 0 .../src/main/resources/insert_statements.sql | 0 .../src/main/resources/logback.xml | 0 .../src/main/resources/one_to_many.sql | 0 .../resources/persistence-mysql.properties | 0 .../src/main/resources/stored_procedure.sql | 38 +-- .../src/main/resources/webSecurityConfig.xml | 0 .../HibernateFetchingIntegrationTest.java | 0 ...neToManyAnnotationMainIntegrationTest.java | 0 .../persistence/IntegrationTestSuite.java | 0 .../persistence/audit/AuditTestSuite.java | 0 .../EnversFooBarAuditIntegrationTest.java | 0 .../audit/JPABarAuditIntegrationTest.java | 0 .../SpringDataJPABarAuditIntegrationTest.java | 0 .../persistence/hibernate/FooFixtures.java | 0 ...oPaginationPersistenceIntegrationTest.java | 0 .../FooSortingPersistenceIntegrationTest.java | 0 .../save/SaveMethodsIntegrationTest.java | 0 ...erviceBasicPersistenceIntegrationTest.java | 0 .../FooServicePersistenceIntegrationTest.java | 0 .../service/FooStoredProceduresLiveTest.java | 242 +++++++-------- ...rentServicePersistenceIntegrationTest.java | 0 .../spring/config/PersistenceTestConfig.java | 0 .../SpringContextIntegrationTest.java | 0 .../src/test/resources/.gitignore | 0 .../src/test/resources/fetching.cfg.xml | 0 .../src/test/resources/fetchingLazy.cfg.xml | 0 .../test/resources/persistence-h2.properties | 0 pom.xml | 60 ++-- 360 files changed, 1153 insertions(+), 1148 deletions(-) rename {core-java-persistence => persistence-modules/core-java-persistence}/README.md (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/pom.xml (95%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/connectionpool/BasicConnectionPool.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/connectionpool/C3poDataSource.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/connectionpool/ConnectionPool.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/connectionpool/DBCPDataSource.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/connectionpool/HikariCPDataSource.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/jdbc/BatchProcessing.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/jdbc/Employee.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/jdbcrowset/DatabaseConfiguration.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/jdbcrowset/ExampleListener.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/jdbcrowset/FilterExample.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/java/com/baeldung/jdbcrowset/JdbcRowsetApplication.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/main/resources/logback.xml (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/test/java/com/baeldung/connectionpool/BasicConnectionPoolUnitTest.java (97%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java (96%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/test/java/com/baeldung/connectionpool/DBCPDataSourceUnitTest.java (96%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/test/java/com/baeldung/connectionpool/HikariCPDataSourceUnitTest.java (96%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/test/java/com/baeldung/jdbc/BatchProcessingLiveTest.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/test/java/com/baeldung/jdbc/JdbcLiveTest.java (100%) rename {core-java-persistence => persistence-modules/core-java-persistence}/src/test/java/com/baeldung/jdbcrowset/JdbcRowSetLiveTest.java (100%) rename {deltaspike => persistence-modules/deltaspike}/.gitignore (100%) rename {deltaspike => persistence-modules/deltaspike}/README.md (100%) rename {deltaspike => persistence-modules/deltaspike}/pom.xml (99%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/controller/MemberController.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/EntityManagerProducer.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/MemberListProducer.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/MemberRepository.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/QueryDslRepositoryExtension.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/QueryDslSupport.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/SecondaryEntityManagerProducer.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/SecondaryEntityManagerResolver.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/SecondaryPersistenceUnit.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/SimpleUserRepository.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/data/UserRepository.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/model/Address.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/model/Member.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/model/User.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/rest/JaxRsActivator.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/rest/MemberResourceRESTService.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/service/MemberRegistration.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/java/baeldung/util/Resources.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/resources/META-INF/apache-deltaspike.properties (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/resources/META-INF/beans.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/resources/META-INF/persistence.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/resources/import.sql (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/resources/logback.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/WEB-INF/baeldung-jee7-seed-ds.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/WEB-INF/baeldung-jee7-seed-secondary-ds.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/WEB-INF/beans.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/WEB-INF/faces-config.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/WEB-INF/templates/default.xhtml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/index.html (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/index.xhtml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/resources/css/screen.css (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/resources/gfx/asidebkg.png (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/resources/gfx/bkg-blkheader.png (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/resources/gfx/dualbrand_logo.png (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/resources/gfx/headerbkg.png (100%) rename {deltaspike => persistence-modules/deltaspike}/src/main/webapp/resources/gfx/wildfly_400x130.jpg (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/java/baeldung/ValidatorProducer.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/java/baeldung/data/TestEntityManagerProducer.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/java/baeldung/test/MemberRegistrationLiveTest.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/java/baeldung/test/SimpleUserRepositoryUnitTest.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/java/baeldung/test/UserRepositoryUnitTest.java (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/resources/META-INF/apache-deltaspike.properties (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/resources/META-INF/beans.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/resources/META-INF/persistence.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/resources/arquillian.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/resources/import.sql (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/resources/test-ds.xml (100%) rename {deltaspike => persistence-modules/deltaspike}/src/test/resources/test-secondary-ds.xml (100%) rename {influxdb => persistence-modules/influxdb}/README.md (100%) rename {influxdb => persistence-modules/influxdb}/pom.xml (96%) rename {influxdb => persistence-modules/influxdb}/src/main/java/com/baeldung/influxdb/MemoryPoint.java (100%) rename {influxdb => persistence-modules/influxdb}/src/main/resources/logback.xml (100%) rename {influxdb => persistence-modules/influxdb}/src/test/java/com/baeldung/influxdb/InfluxDBConnectionLiveTest.java (100%) rename {influxdb => persistence-modules/influxdb}/src/test/resources/logback.xml (100%) rename {orientdb => persistence-modules/orientdb}/.gitignore (100%) rename {orientdb => persistence-modules/orientdb}/.mvn/wrapper/maven-wrapper.jar (100%) rename {orientdb => persistence-modules/orientdb}/.mvn/wrapper/maven-wrapper.properties (100%) rename {orientdb => persistence-modules/orientdb}/README.md (100%) rename {orientdb => persistence-modules/orientdb}/mvnw (100%) mode change 100755 => 100644 rename {orientdb => persistence-modules/orientdb}/mvnw.cmd (100%) rename {orientdb => persistence-modules/orientdb}/pom.xml (97%) rename {orientdb => persistence-modules/orientdb}/src/main/java/com/baeldung/orientdb/Author.java (100%) rename {orientdb => persistence-modules/orientdb}/src/main/resources/logback.xml (100%) rename {orientdb => persistence-modules/orientdb}/src/test/java/com/baeldung/orientdb/OrientDBDocumentAPILiveTest.java (100%) rename {orientdb => persistence-modules/orientdb}/src/test/java/com/baeldung/orientdb/OrientDBGraphAPILiveTest.java (100%) rename {orientdb => persistence-modules/orientdb}/src/test/java/com/baeldung/orientdb/OrientDBObjectAPILiveTest.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/.gitignore (89%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/.mvn/wrapper/maven-wrapper.properties (100%) mode change 100755 => 100644 rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/README.MD (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/mvnw (100%) mode change 100755 => 100644 rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/mvnw.cmd (97%) mode change 100755 => 100644 rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/pom.xml (93%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/Application.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/boot/config/H2JpaConfig.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/domain/Country.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/domain/User.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/repository/UserRepository.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/tomcatconnectionpool/application/SpringBootConsoleApplication.java (97%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/tomcatconnectionpool/application/entities/Customer.java (95%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/tomcatconnectionpool/application/repositories/CustomerRepository.java (97%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/com/baeldung/tomcatconnectionpool/application/runners/CommandLineCrudRunner.java (97%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/org/baeldung/boot/domain/GenericEntity.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/resources/application.properties (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/resources/data.sql (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/resources/logback.xml (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/resources/persistence-generic-entity.properties (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/main/resources/schema.sql (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/java/com/baeldung/SpringBootH2IntegrationTest.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/java/com/baeldung/repository/UserRepositoryIntegrationTest.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/java/com/baeldung/tomcatconnectionpool/test/application/SpringBootTomcatConnectionPoolIntegrationTest.java (97%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/java/org/baeldung/config/H2TestProfileJPAConfig.java (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/resources/application.properties (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/resources/import_active_users.sql (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/resources/import_inactive_users.sql (100%) rename {spring-boot-persistence => persistence-modules/spring-boot-persistence}/src/test/resources/migrated_users.sql (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/README.md (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/pom.xml (98%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/java/com/baeldung/elasticsearch/Person.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/java/com/baeldung/spring/data/es/config/Config.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/java/com/baeldung/spring/data/es/model/Article.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/java/com/baeldung/spring/data/es/model/Author.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/java/com/baeldung/spring/data/es/repository/ArticleRepository.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/java/com/baeldung/spring/data/es/service/ArticleService.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/java/com/baeldung/spring/data/es/service/ArticleServiceImpl.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/main/resources/log4j2.properties (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/test/java/com/baeldung/elasticsearch/ElasticSearchManualTest.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/test/java/com/baeldung/elasticsearch/GeoQueriesIntegrationTest.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/test/java/com/baeldung/spring/data/es/ElasticSearchIntegrationTest.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/test/java/com/baeldung/spring/data/es/ElasticSearchQueryIntegrationTest.java (100%) rename {spring-data-elasticsearch => persistence-modules/spring-data-elasticsearch}/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/README.md (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/pom.xml (96%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/Application.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/config/PersistenceConfiguration.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/config/PersistenceProductConfiguration.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/config/PersistenceUserConfiguration.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/IFooDao.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/ArticleRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/CustomItemRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/CustomItemTypeRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/ExtendedRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/ExtendedStudentRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/IBarCrudRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/ItemTypeRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/LocationRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/ReadOnlyLocationRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/StoreRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/impl/CustomItemRepositoryImpl.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/impl/CustomItemTypeRepositoryImpl.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/impl/ExtendedRepositoryImpl.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/product/ProductRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/user/PossessionRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/dao/repositories/user/UserRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/Aggregate.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/Aggregate2.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/Aggregate2Repository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/Aggregate3.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/Aggregate3Repository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/AggregateRepository.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/DddConfig.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/DomainEvent.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/ddd/event/DomainService.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/Article.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/Bar.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/Foo.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/Item.java (94%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/ItemType.java (94%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/KVTag.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/Location.java (95%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/MerchandiseEntity.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/SkillTag.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/Store.java (95%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/Student.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/product/Product.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/user/Possession.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/domain/user/User.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/services/IBarService.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/services/IFooService.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/services/IOperations.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/services/impl/AbstractService.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/services/impl/AbstractSpringDataJpaService.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/services/impl/BarSpringDataJpaService.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/java/com/baeldung/services/impl/FooService.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/resources/application.properties (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/resources/ddd.properties (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/resources/logback.xml (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/resources/persistence-multiple-db.properties (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/main/resources/persistence.properties (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/dao/repositories/ArticleRepositoryIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/dao/repositories/ExtendedStudentRepositoryIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/dao/repositories/InventoryRepositoryIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/dao/repositories/JpaRepositoriesIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/dao/repositories/UserRepositoryIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/ddd/event/Aggregate2EventsIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/ddd/event/Aggregate3EventsIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/ddd/event/AggregateEventsIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/ddd/event/TestEventHandler.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/services/AbstractServicePersistenceIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/services/FooServicePersistenceIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/services/JpaMultipleDBIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/services/SpringDataJPABarAuditIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/com/baeldung/util/IDUtil.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-data-jpa => persistence-modules/spring-data-jpa}/src/test/resources/import_entities.sql (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/README.md (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/pom.xml (94%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/java/com/baeldung/spring/data/keyvalue/Configurations.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/java/com/baeldung/spring/data/keyvalue/SpringDataKeyValueApplication.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/java/com/baeldung/spring/data/keyvalue/repositories/EmployeeRepository.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/java/com/baeldung/spring/data/keyvalue/services/EmployeeService.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithRepository.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/java/com/baeldung/spring/data/keyvalue/vo/Employee.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/main/resources/logback.xml (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithKeyValueRepositoryIntegrationTest.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithRepositoryIntegrationTest.java (100%) rename {spring-data-keyvalue => persistence-modules/spring-data-keyvalue}/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/README.md (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/pom.xml (98%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/annotation/CascadeSave.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/config/MongoConfig.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/config/MongoReactiveConfig.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/config/SimpleMongoConfig.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/converter/UserWriterConverter.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/event/CascadeCallback.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/event/CascadeSaveMongoEventListener.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/event/FieldCallback.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/event/UserCascadeSaveMongoEventListener.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/model/EmailAddress.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/model/User.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/reactive/repository/UserRepository.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/java/com/baeldung/repository/UserRepository.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/resources/logback.xml (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/resources/mongoConfig.xml (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/main/resources/test.png (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/aggregation/ZipsAggregationLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/aggregation/model/StatePopulation.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/gridfs/GridFSLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/mongotemplate/DocumentQueryLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/repository/BaseQueryLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/repository/DSLQueryLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/repository/JSONQueryLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/repository/QueryMethodsLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/repository/UserRepositoryLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/repository/UserRepositoryProjectionLiveTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/transaction/MongoTransactionReactiveIntegrationTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/transaction/MongoTransactionTemplateIntegrationTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/com/baeldung/transaction/MongoTransactionalIntegrationTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-data-mongodb => persistence-modules/spring-data-mongodb}/src/test/resources/zips.json (100%) rename {spring-hibernate3 => persistence-modules/spring-hibernate3}/README.md (100%) rename {spring-hibernate3 => persistence-modules/spring-hibernate3}/src/main/java/org/baeldung/spring/PersistenceConfigHibernate3.java (97%) rename {spring-hibernate3 => persistence-modules/spring-hibernate3}/src/main/resources/logback.xml (100%) rename {spring-hibernate3 => persistence-modules/spring-hibernate3}/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen1MainIntegrationTest.java (97%) rename {spring-hibernate3 => persistence-modules/spring-hibernate3}/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen2MainIntegrationTest.java (97%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/.gitignore (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/README.md (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/pom.xml (99%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/criteria/model/Item.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/oneToMany/config/HibernateAnnotationUtil.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMain.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/oneToMany/model/Cart.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/hibernate/oneToMany/model/Items.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/IBarDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/IChildDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/IFooDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/IParentDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/common/IOperations.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/model/Bar.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/model/Child.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/model/Foo.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/model/Parent.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/model/Person.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/IBarService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/IChildService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/IFooService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/IParentService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/common/AbstractService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/BarService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/ChildService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/FooService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/persistence/service/impl/ParentService.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/spring/PersistenceConfig.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/fetching.cfg.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/fetchingLazy.cfg.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/fetching_create_queries.sql (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/hibernate-annotation.cfg.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/hibernate4Config.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/immutable.cfg.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/insert_statements.sql (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/logback.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/one_to_many.sql (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/persistence-mysql.properties (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/stored_procedure.sql (95%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/main/resources/webSecurityConfig.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMainIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java (97%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/resources/.gitignore (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/resources/fetching.cfg.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/resources/fetchingLazy.cfg.xml (100%) rename {spring-hibernate4 => persistence-modules/spring-hibernate4}/src/test/resources/persistence-h2.properties (100%) diff --git a/core-java-persistence/README.md b/persistence-modules/core-java-persistence/README.md similarity index 100% rename from core-java-persistence/README.md rename to persistence-modules/core-java-persistence/README.md diff --git a/core-java-persistence/pom.xml b/persistence-modules/core-java-persistence/pom.xml similarity index 95% rename from core-java-persistence/pom.xml rename to persistence-modules/core-java-persistence/pom.xml index 7279fd763b..f012d60ee6 100644 --- a/core-java-persistence/pom.xml +++ b/persistence-modules/core-java-persistence/pom.xml @@ -1,71 +1,71 @@ - - 4.0.0 - com.baeldung.core-java-persistence - core-java-persistence - 0.1.0-SNAPSHOT - jar - core-java-persistence - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - org.assertj - assertj-core - ${assertj-core.version} - test - - - com.h2database - h2 - ${h2database.version} - - - org.apache.commons - commons-dbcp2 - ${commons-dbcp2.version} - - - com.zaxxer - HikariCP - ${HikariCP.version} - - - com.mchange - c3p0 - ${c3p0.version} - - - org.springframework - spring-web - ${springframework.spring-web.version} - - - org.springframework.boot - spring-boot-starter - ${springframework.boot.spring-boot-starter.version} - - - - core-java-persistence - - - src/main/resources - true - - - - - 3.10.0 - 1.4.197 - 2.4.0 - 3.2.0 - 0.9.5.2 - 1.5.8.RELEASE - 4.3.4.RELEASE - + + 4.0.0 + com.baeldung.core-java-persistence + core-java-persistence + 0.1.0-SNAPSHOT + jar + core-java-persistence + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + com.h2database + h2 + ${h2database.version} + + + org.apache.commons + commons-dbcp2 + ${commons-dbcp2.version} + + + com.zaxxer + HikariCP + ${HikariCP.version} + + + com.mchange + c3p0 + ${c3p0.version} + + + org.springframework + spring-web + ${springframework.spring-web.version} + + + org.springframework.boot + spring-boot-starter + ${springframework.boot.spring-boot-starter.version} + + + + core-java-persistence + + + src/main/resources + true + + + + + 3.10.0 + 1.4.197 + 2.4.0 + 3.2.0 + 0.9.5.2 + 1.5.8.RELEASE + 4.3.4.RELEASE + \ No newline at end of file diff --git a/core-java-persistence/src/main/java/com/baeldung/connectionpool/BasicConnectionPool.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/BasicConnectionPool.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/connectionpool/BasicConnectionPool.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/BasicConnectionPool.java diff --git a/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3poDataSource.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3poDataSource.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/connectionpool/C3poDataSource.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3poDataSource.java diff --git a/core-java-persistence/src/main/java/com/baeldung/connectionpool/ConnectionPool.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/ConnectionPool.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/connectionpool/ConnectionPool.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/ConnectionPool.java diff --git a/core-java-persistence/src/main/java/com/baeldung/connectionpool/DBCPDataSource.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/DBCPDataSource.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/connectionpool/DBCPDataSource.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/DBCPDataSource.java diff --git a/core-java-persistence/src/main/java/com/baeldung/connectionpool/HikariCPDataSource.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/HikariCPDataSource.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/connectionpool/HikariCPDataSource.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/HikariCPDataSource.java diff --git a/core-java-persistence/src/main/java/com/baeldung/jdbc/BatchProcessing.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbc/BatchProcessing.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/jdbc/BatchProcessing.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbc/BatchProcessing.java diff --git a/core-java-persistence/src/main/java/com/baeldung/jdbc/Employee.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbc/Employee.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/jdbc/Employee.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbc/Employee.java diff --git a/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/DatabaseConfiguration.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/DatabaseConfiguration.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/jdbcrowset/DatabaseConfiguration.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/DatabaseConfiguration.java diff --git a/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/ExampleListener.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/ExampleListener.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/jdbcrowset/ExampleListener.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/ExampleListener.java diff --git a/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/FilterExample.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/FilterExample.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/jdbcrowset/FilterExample.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/FilterExample.java diff --git a/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/JdbcRowsetApplication.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/JdbcRowsetApplication.java similarity index 100% rename from core-java-persistence/src/main/java/com/baeldung/jdbcrowset/JdbcRowsetApplication.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/jdbcrowset/JdbcRowsetApplication.java diff --git a/core-java-persistence/src/main/resources/logback.xml b/persistence-modules/core-java-persistence/src/main/resources/logback.xml similarity index 100% rename from core-java-persistence/src/main/resources/logback.xml rename to persistence-modules/core-java-persistence/src/main/resources/logback.xml diff --git a/core-java-persistence/src/test/java/com/baeldung/connectionpool/BasicConnectionPoolUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/BasicConnectionPoolUnitTest.java similarity index 97% rename from core-java-persistence/src/test/java/com/baeldung/connectionpool/BasicConnectionPoolUnitTest.java rename to persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/BasicConnectionPoolUnitTest.java index 479cd0db25..3b3c9870fb 100644 --- a/core-java-persistence/src/test/java/com/baeldung/connectionpool/BasicConnectionPoolUnitTest.java +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/BasicConnectionPoolUnitTest.java @@ -1,67 +1,67 @@ -package com.baeldung.connectionpool; - -import java.sql.Connection; -import java.sql.SQLException; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.junit.BeforeClass; -import org.junit.Test; - -public class BasicConnectionPoolUnitTest { - - private static ConnectionPool connectionPool; - - @BeforeClass - public static void setUpBasicConnectionPoolInstance() throws SQLException { - connectionPool = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password"); - } - - @Test - public void givenBasicConnectionPoolInstance_whenCalledgetConnection_thenCorrect() throws Exception { - assertTrue(connectionPool.getConnection().isValid(1)); - } - - @Test - public void givenBasicConnectionPoolInstance_whenCalledreleaseConnection_thenCorrect() throws Exception { - Connection connection = connectionPool.getConnection(); - assertThat(connectionPool.releaseConnection(connection)).isTrue(); - } - - @Test - public void givenBasicConnectionPoolInstance_whenCalledgetUrl_thenCorrect() { - assertThat(connectionPool.getUrl()).isEqualTo("jdbc:h2:mem:test"); - } - - @Test - public void givenBasicConnectionPoolInstance_whenCalledgetUser_thenCorrect() { - assertThat(connectionPool.getUser()).isEqualTo("user"); - } - - @Test - public void givenBasicConnectionPoolInstance_whenCalledgetPassword_thenCorrect() { - assertThat(connectionPool.getPassword()).isEqualTo("password"); - } - - @Test(expected = RuntimeException.class) - public void givenBasicConnectionPoolInstance_whenAskedForMoreThanMax_thenError() throws Exception { - // this test needs to be independent so it doesn't share the same connection pool as other tests - ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password"); - final int MAX_POOL_SIZE = 20; - for (int i = 0; i < MAX_POOL_SIZE + 1; i++) { - cp.getConnection(); - } - fail(); - } - - @Test - public void givenBasicConnectionPoolInstance_whenSutdown_thenEmpty() throws Exception { - ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password"); - assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(10); - - ((BasicConnectionPool) cp).shutdown(); - assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(0); - } -} +package com.baeldung.connectionpool; + +import java.sql.Connection; +import java.sql.SQLException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; + +public class BasicConnectionPoolUnitTest { + + private static ConnectionPool connectionPool; + + @BeforeClass + public static void setUpBasicConnectionPoolInstance() throws SQLException { + connectionPool = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password"); + } + + @Test + public void givenBasicConnectionPoolInstance_whenCalledgetConnection_thenCorrect() throws Exception { + assertTrue(connectionPool.getConnection().isValid(1)); + } + + @Test + public void givenBasicConnectionPoolInstance_whenCalledreleaseConnection_thenCorrect() throws Exception { + Connection connection = connectionPool.getConnection(); + assertThat(connectionPool.releaseConnection(connection)).isTrue(); + } + + @Test + public void givenBasicConnectionPoolInstance_whenCalledgetUrl_thenCorrect() { + assertThat(connectionPool.getUrl()).isEqualTo("jdbc:h2:mem:test"); + } + + @Test + public void givenBasicConnectionPoolInstance_whenCalledgetUser_thenCorrect() { + assertThat(connectionPool.getUser()).isEqualTo("user"); + } + + @Test + public void givenBasicConnectionPoolInstance_whenCalledgetPassword_thenCorrect() { + assertThat(connectionPool.getPassword()).isEqualTo("password"); + } + + @Test(expected = RuntimeException.class) + public void givenBasicConnectionPoolInstance_whenAskedForMoreThanMax_thenError() throws Exception { + // this test needs to be independent so it doesn't share the same connection pool as other tests + ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password"); + final int MAX_POOL_SIZE = 20; + for (int i = 0; i < MAX_POOL_SIZE + 1; i++) { + cp.getConnection(); + } + fail(); + } + + @Test + public void givenBasicConnectionPoolInstance_whenSutdown_thenEmpty() throws Exception { + ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password"); + assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(10); + + ((BasicConnectionPool) cp).shutdown(); + assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(0); + } +} diff --git a/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java similarity index 96% rename from core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java rename to persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java index a07fa9e74b..acad9fe5e4 100644 --- a/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java @@ -1,13 +1,13 @@ -package com.baeldung.connectionpool; - -import java.sql.SQLException; -import static org.junit.Assert.assertTrue; -import org.junit.Test; - -public class C3poDataSourceUnitTest { - - @Test - public void givenC3poDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException { - assertTrue(C3poDataSource.getConnection().isValid(1)); - } +package com.baeldung.connectionpool; + +import java.sql.SQLException; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class C3poDataSourceUnitTest { + + @Test + public void givenC3poDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException { + assertTrue(C3poDataSource.getConnection().isValid(1)); + } } \ No newline at end of file diff --git a/core-java-persistence/src/test/java/com/baeldung/connectionpool/DBCPDataSourceUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/DBCPDataSourceUnitTest.java similarity index 96% rename from core-java-persistence/src/test/java/com/baeldung/connectionpool/DBCPDataSourceUnitTest.java rename to persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/DBCPDataSourceUnitTest.java index 43aaf330b6..4882d2af73 100644 --- a/core-java-persistence/src/test/java/com/baeldung/connectionpool/DBCPDataSourceUnitTest.java +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/DBCPDataSourceUnitTest.java @@ -1,13 +1,13 @@ -package com.baeldung.connectionpool; - -import java.sql.SQLException; -import static org.junit.Assert.assertTrue; -import org.junit.Test; - -public class DBCPDataSourceUnitTest { - - @Test - public void givenDBCPDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException { - assertTrue(DBCPDataSource.getConnection().isValid(1)); - } +package com.baeldung.connectionpool; + +import java.sql.SQLException; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class DBCPDataSourceUnitTest { + + @Test + public void givenDBCPDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException { + assertTrue(DBCPDataSource.getConnection().isValid(1)); + } } \ No newline at end of file diff --git a/core-java-persistence/src/test/java/com/baeldung/connectionpool/HikariCPDataSourceUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/HikariCPDataSourceUnitTest.java similarity index 96% rename from core-java-persistence/src/test/java/com/baeldung/connectionpool/HikariCPDataSourceUnitTest.java rename to persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/HikariCPDataSourceUnitTest.java index b20ce70efd..885743ab2b 100644 --- a/core-java-persistence/src/test/java/com/baeldung/connectionpool/HikariCPDataSourceUnitTest.java +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/HikariCPDataSourceUnitTest.java @@ -1,13 +1,13 @@ -package com.baeldung.connectionpool; - -import java.sql.SQLException; -import static org.junit.Assert.assertTrue; -import org.junit.Test; - -public class HikariCPDataSourceUnitTest { - - @Test - public void givenHikariDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException { - assertTrue(HikariCPDataSource.getConnection().isValid(1)); - } +package com.baeldung.connectionpool; + +import java.sql.SQLException; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class HikariCPDataSourceUnitTest { + + @Test + public void givenHikariDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException { + assertTrue(HikariCPDataSource.getConnection().isValid(1)); + } } \ No newline at end of file diff --git a/core-java-persistence/src/test/java/com/baeldung/jdbc/BatchProcessingLiveTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbc/BatchProcessingLiveTest.java similarity index 100% rename from core-java-persistence/src/test/java/com/baeldung/jdbc/BatchProcessingLiveTest.java rename to persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbc/BatchProcessingLiveTest.java diff --git a/core-java-persistence/src/test/java/com/baeldung/jdbc/JdbcLiveTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbc/JdbcLiveTest.java similarity index 100% rename from core-java-persistence/src/test/java/com/baeldung/jdbc/JdbcLiveTest.java rename to persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbc/JdbcLiveTest.java diff --git a/core-java-persistence/src/test/java/com/baeldung/jdbcrowset/JdbcRowSetLiveTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbcrowset/JdbcRowSetLiveTest.java similarity index 100% rename from core-java-persistence/src/test/java/com/baeldung/jdbcrowset/JdbcRowSetLiveTest.java rename to persistence-modules/core-java-persistence/src/test/java/com/baeldung/jdbcrowset/JdbcRowSetLiveTest.java diff --git a/deltaspike/.gitignore b/persistence-modules/deltaspike/.gitignore similarity index 100% rename from deltaspike/.gitignore rename to persistence-modules/deltaspike/.gitignore diff --git a/deltaspike/README.md b/persistence-modules/deltaspike/README.md similarity index 100% rename from deltaspike/README.md rename to persistence-modules/deltaspike/README.md diff --git a/deltaspike/pom.xml b/persistence-modules/deltaspike/pom.xml similarity index 99% rename from deltaspike/pom.xml rename to persistence-modules/deltaspike/pom.xml index 8ab3e3fd80..b798d2f39e 100644 --- a/deltaspike/pom.xml +++ b/persistence-modules/deltaspike/pom.xml @@ -14,6 +14,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../ diff --git a/deltaspike/src/main/java/baeldung/controller/MemberController.java b/persistence-modules/deltaspike/src/main/java/baeldung/controller/MemberController.java similarity index 100% rename from deltaspike/src/main/java/baeldung/controller/MemberController.java rename to persistence-modules/deltaspike/src/main/java/baeldung/controller/MemberController.java diff --git a/deltaspike/src/main/java/baeldung/data/EntityManagerProducer.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/EntityManagerProducer.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/EntityManagerProducer.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/EntityManagerProducer.java diff --git a/deltaspike/src/main/java/baeldung/data/MemberListProducer.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/MemberListProducer.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/MemberListProducer.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/MemberListProducer.java diff --git a/deltaspike/src/main/java/baeldung/data/MemberRepository.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/MemberRepository.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/MemberRepository.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/MemberRepository.java diff --git a/deltaspike/src/main/java/baeldung/data/QueryDslRepositoryExtension.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/QueryDslRepositoryExtension.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/QueryDslRepositoryExtension.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/QueryDslRepositoryExtension.java diff --git a/deltaspike/src/main/java/baeldung/data/QueryDslSupport.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/QueryDslSupport.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/QueryDslSupport.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/QueryDslSupport.java diff --git a/deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerProducer.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerProducer.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerProducer.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerProducer.java diff --git a/deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerResolver.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerResolver.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerResolver.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/SecondaryEntityManagerResolver.java diff --git a/deltaspike/src/main/java/baeldung/data/SecondaryPersistenceUnit.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/SecondaryPersistenceUnit.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/SecondaryPersistenceUnit.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/SecondaryPersistenceUnit.java diff --git a/deltaspike/src/main/java/baeldung/data/SimpleUserRepository.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/SimpleUserRepository.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/SimpleUserRepository.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/SimpleUserRepository.java diff --git a/deltaspike/src/main/java/baeldung/data/UserRepository.java b/persistence-modules/deltaspike/src/main/java/baeldung/data/UserRepository.java similarity index 100% rename from deltaspike/src/main/java/baeldung/data/UserRepository.java rename to persistence-modules/deltaspike/src/main/java/baeldung/data/UserRepository.java diff --git a/deltaspike/src/main/java/baeldung/model/Address.java b/persistence-modules/deltaspike/src/main/java/baeldung/model/Address.java similarity index 100% rename from deltaspike/src/main/java/baeldung/model/Address.java rename to persistence-modules/deltaspike/src/main/java/baeldung/model/Address.java diff --git a/deltaspike/src/main/java/baeldung/model/Member.java b/persistence-modules/deltaspike/src/main/java/baeldung/model/Member.java similarity index 100% rename from deltaspike/src/main/java/baeldung/model/Member.java rename to persistence-modules/deltaspike/src/main/java/baeldung/model/Member.java diff --git a/deltaspike/src/main/java/baeldung/model/User.java b/persistence-modules/deltaspike/src/main/java/baeldung/model/User.java similarity index 100% rename from deltaspike/src/main/java/baeldung/model/User.java rename to persistence-modules/deltaspike/src/main/java/baeldung/model/User.java diff --git a/deltaspike/src/main/java/baeldung/rest/JaxRsActivator.java b/persistence-modules/deltaspike/src/main/java/baeldung/rest/JaxRsActivator.java similarity index 100% rename from deltaspike/src/main/java/baeldung/rest/JaxRsActivator.java rename to persistence-modules/deltaspike/src/main/java/baeldung/rest/JaxRsActivator.java diff --git a/deltaspike/src/main/java/baeldung/rest/MemberResourceRESTService.java b/persistence-modules/deltaspike/src/main/java/baeldung/rest/MemberResourceRESTService.java similarity index 100% rename from deltaspike/src/main/java/baeldung/rest/MemberResourceRESTService.java rename to persistence-modules/deltaspike/src/main/java/baeldung/rest/MemberResourceRESTService.java diff --git a/deltaspike/src/main/java/baeldung/service/MemberRegistration.java b/persistence-modules/deltaspike/src/main/java/baeldung/service/MemberRegistration.java similarity index 100% rename from deltaspike/src/main/java/baeldung/service/MemberRegistration.java rename to persistence-modules/deltaspike/src/main/java/baeldung/service/MemberRegistration.java diff --git a/deltaspike/src/main/java/baeldung/util/Resources.java b/persistence-modules/deltaspike/src/main/java/baeldung/util/Resources.java similarity index 100% rename from deltaspike/src/main/java/baeldung/util/Resources.java rename to persistence-modules/deltaspike/src/main/java/baeldung/util/Resources.java diff --git a/deltaspike/src/main/resources/META-INF/apache-deltaspike.properties b/persistence-modules/deltaspike/src/main/resources/META-INF/apache-deltaspike.properties similarity index 100% rename from deltaspike/src/main/resources/META-INF/apache-deltaspike.properties rename to persistence-modules/deltaspike/src/main/resources/META-INF/apache-deltaspike.properties diff --git a/deltaspike/src/main/resources/META-INF/beans.xml b/persistence-modules/deltaspike/src/main/resources/META-INF/beans.xml similarity index 100% rename from deltaspike/src/main/resources/META-INF/beans.xml rename to persistence-modules/deltaspike/src/main/resources/META-INF/beans.xml diff --git a/deltaspike/src/main/resources/META-INF/persistence.xml b/persistence-modules/deltaspike/src/main/resources/META-INF/persistence.xml similarity index 100% rename from deltaspike/src/main/resources/META-INF/persistence.xml rename to persistence-modules/deltaspike/src/main/resources/META-INF/persistence.xml diff --git a/deltaspike/src/main/resources/import.sql b/persistence-modules/deltaspike/src/main/resources/import.sql similarity index 100% rename from deltaspike/src/main/resources/import.sql rename to persistence-modules/deltaspike/src/main/resources/import.sql diff --git a/deltaspike/src/main/resources/logback.xml b/persistence-modules/deltaspike/src/main/resources/logback.xml similarity index 100% rename from deltaspike/src/main/resources/logback.xml rename to persistence-modules/deltaspike/src/main/resources/logback.xml diff --git a/deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-ds.xml b/persistence-modules/deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-ds.xml similarity index 100% rename from deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-ds.xml rename to persistence-modules/deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-ds.xml diff --git a/deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-secondary-ds.xml b/persistence-modules/deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-secondary-ds.xml similarity index 100% rename from deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-secondary-ds.xml rename to persistence-modules/deltaspike/src/main/webapp/WEB-INF/baeldung-jee7-seed-secondary-ds.xml diff --git a/deltaspike/src/main/webapp/WEB-INF/beans.xml b/persistence-modules/deltaspike/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from deltaspike/src/main/webapp/WEB-INF/beans.xml rename to persistence-modules/deltaspike/src/main/webapp/WEB-INF/beans.xml diff --git a/deltaspike/src/main/webapp/WEB-INF/faces-config.xml b/persistence-modules/deltaspike/src/main/webapp/WEB-INF/faces-config.xml similarity index 100% rename from deltaspike/src/main/webapp/WEB-INF/faces-config.xml rename to persistence-modules/deltaspike/src/main/webapp/WEB-INF/faces-config.xml diff --git a/deltaspike/src/main/webapp/WEB-INF/templates/default.xhtml b/persistence-modules/deltaspike/src/main/webapp/WEB-INF/templates/default.xhtml similarity index 100% rename from deltaspike/src/main/webapp/WEB-INF/templates/default.xhtml rename to persistence-modules/deltaspike/src/main/webapp/WEB-INF/templates/default.xhtml diff --git a/deltaspike/src/main/webapp/index.html b/persistence-modules/deltaspike/src/main/webapp/index.html similarity index 100% rename from deltaspike/src/main/webapp/index.html rename to persistence-modules/deltaspike/src/main/webapp/index.html diff --git a/deltaspike/src/main/webapp/index.xhtml b/persistence-modules/deltaspike/src/main/webapp/index.xhtml similarity index 100% rename from deltaspike/src/main/webapp/index.xhtml rename to persistence-modules/deltaspike/src/main/webapp/index.xhtml diff --git a/deltaspike/src/main/webapp/resources/css/screen.css b/persistence-modules/deltaspike/src/main/webapp/resources/css/screen.css similarity index 100% rename from deltaspike/src/main/webapp/resources/css/screen.css rename to persistence-modules/deltaspike/src/main/webapp/resources/css/screen.css diff --git a/deltaspike/src/main/webapp/resources/gfx/asidebkg.png b/persistence-modules/deltaspike/src/main/webapp/resources/gfx/asidebkg.png similarity index 100% rename from deltaspike/src/main/webapp/resources/gfx/asidebkg.png rename to persistence-modules/deltaspike/src/main/webapp/resources/gfx/asidebkg.png diff --git a/deltaspike/src/main/webapp/resources/gfx/bkg-blkheader.png b/persistence-modules/deltaspike/src/main/webapp/resources/gfx/bkg-blkheader.png similarity index 100% rename from deltaspike/src/main/webapp/resources/gfx/bkg-blkheader.png rename to persistence-modules/deltaspike/src/main/webapp/resources/gfx/bkg-blkheader.png diff --git a/deltaspike/src/main/webapp/resources/gfx/dualbrand_logo.png b/persistence-modules/deltaspike/src/main/webapp/resources/gfx/dualbrand_logo.png similarity index 100% rename from deltaspike/src/main/webapp/resources/gfx/dualbrand_logo.png rename to persistence-modules/deltaspike/src/main/webapp/resources/gfx/dualbrand_logo.png diff --git a/deltaspike/src/main/webapp/resources/gfx/headerbkg.png b/persistence-modules/deltaspike/src/main/webapp/resources/gfx/headerbkg.png similarity index 100% rename from deltaspike/src/main/webapp/resources/gfx/headerbkg.png rename to persistence-modules/deltaspike/src/main/webapp/resources/gfx/headerbkg.png diff --git a/deltaspike/src/main/webapp/resources/gfx/wildfly_400x130.jpg b/persistence-modules/deltaspike/src/main/webapp/resources/gfx/wildfly_400x130.jpg similarity index 100% rename from deltaspike/src/main/webapp/resources/gfx/wildfly_400x130.jpg rename to persistence-modules/deltaspike/src/main/webapp/resources/gfx/wildfly_400x130.jpg diff --git a/deltaspike/src/test/java/baeldung/ValidatorProducer.java b/persistence-modules/deltaspike/src/test/java/baeldung/ValidatorProducer.java similarity index 100% rename from deltaspike/src/test/java/baeldung/ValidatorProducer.java rename to persistence-modules/deltaspike/src/test/java/baeldung/ValidatorProducer.java diff --git a/deltaspike/src/test/java/baeldung/data/TestEntityManagerProducer.java b/persistence-modules/deltaspike/src/test/java/baeldung/data/TestEntityManagerProducer.java similarity index 100% rename from deltaspike/src/test/java/baeldung/data/TestEntityManagerProducer.java rename to persistence-modules/deltaspike/src/test/java/baeldung/data/TestEntityManagerProducer.java diff --git a/deltaspike/src/test/java/baeldung/test/MemberRegistrationLiveTest.java b/persistence-modules/deltaspike/src/test/java/baeldung/test/MemberRegistrationLiveTest.java similarity index 100% rename from deltaspike/src/test/java/baeldung/test/MemberRegistrationLiveTest.java rename to persistence-modules/deltaspike/src/test/java/baeldung/test/MemberRegistrationLiveTest.java diff --git a/deltaspike/src/test/java/baeldung/test/SimpleUserRepositoryUnitTest.java b/persistence-modules/deltaspike/src/test/java/baeldung/test/SimpleUserRepositoryUnitTest.java similarity index 100% rename from deltaspike/src/test/java/baeldung/test/SimpleUserRepositoryUnitTest.java rename to persistence-modules/deltaspike/src/test/java/baeldung/test/SimpleUserRepositoryUnitTest.java diff --git a/deltaspike/src/test/java/baeldung/test/UserRepositoryUnitTest.java b/persistence-modules/deltaspike/src/test/java/baeldung/test/UserRepositoryUnitTest.java similarity index 100% rename from deltaspike/src/test/java/baeldung/test/UserRepositoryUnitTest.java rename to persistence-modules/deltaspike/src/test/java/baeldung/test/UserRepositoryUnitTest.java diff --git a/deltaspike/src/test/resources/META-INF/apache-deltaspike.properties b/persistence-modules/deltaspike/src/test/resources/META-INF/apache-deltaspike.properties similarity index 100% rename from deltaspike/src/test/resources/META-INF/apache-deltaspike.properties rename to persistence-modules/deltaspike/src/test/resources/META-INF/apache-deltaspike.properties diff --git a/deltaspike/src/test/resources/META-INF/beans.xml b/persistence-modules/deltaspike/src/test/resources/META-INF/beans.xml similarity index 100% rename from deltaspike/src/test/resources/META-INF/beans.xml rename to persistence-modules/deltaspike/src/test/resources/META-INF/beans.xml diff --git a/deltaspike/src/test/resources/META-INF/persistence.xml b/persistence-modules/deltaspike/src/test/resources/META-INF/persistence.xml similarity index 100% rename from deltaspike/src/test/resources/META-INF/persistence.xml rename to persistence-modules/deltaspike/src/test/resources/META-INF/persistence.xml diff --git a/deltaspike/src/test/resources/arquillian.xml b/persistence-modules/deltaspike/src/test/resources/arquillian.xml similarity index 100% rename from deltaspike/src/test/resources/arquillian.xml rename to persistence-modules/deltaspike/src/test/resources/arquillian.xml diff --git a/deltaspike/src/test/resources/import.sql b/persistence-modules/deltaspike/src/test/resources/import.sql similarity index 100% rename from deltaspike/src/test/resources/import.sql rename to persistence-modules/deltaspike/src/test/resources/import.sql diff --git a/deltaspike/src/test/resources/test-ds.xml b/persistence-modules/deltaspike/src/test/resources/test-ds.xml similarity index 100% rename from deltaspike/src/test/resources/test-ds.xml rename to persistence-modules/deltaspike/src/test/resources/test-ds.xml diff --git a/deltaspike/src/test/resources/test-secondary-ds.xml b/persistence-modules/deltaspike/src/test/resources/test-secondary-ds.xml similarity index 100% rename from deltaspike/src/test/resources/test-secondary-ds.xml rename to persistence-modules/deltaspike/src/test/resources/test-secondary-ds.xml diff --git a/influxdb/README.md b/persistence-modules/influxdb/README.md similarity index 100% rename from influxdb/README.md rename to persistence-modules/influxdb/README.md diff --git a/influxdb/pom.xml b/persistence-modules/influxdb/pom.xml similarity index 96% rename from influxdb/pom.xml rename to persistence-modules/influxdb/pom.xml index 5bb94bb6e2..5043d61897 100644 --- a/influxdb/pom.xml +++ b/persistence-modules/influxdb/pom.xml @@ -12,6 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../ diff --git a/influxdb/src/main/java/com/baeldung/influxdb/MemoryPoint.java b/persistence-modules/influxdb/src/main/java/com/baeldung/influxdb/MemoryPoint.java similarity index 100% rename from influxdb/src/main/java/com/baeldung/influxdb/MemoryPoint.java rename to persistence-modules/influxdb/src/main/java/com/baeldung/influxdb/MemoryPoint.java diff --git a/influxdb/src/main/resources/logback.xml b/persistence-modules/influxdb/src/main/resources/logback.xml similarity index 100% rename from influxdb/src/main/resources/logback.xml rename to persistence-modules/influxdb/src/main/resources/logback.xml diff --git a/influxdb/src/test/java/com/baeldung/influxdb/InfluxDBConnectionLiveTest.java b/persistence-modules/influxdb/src/test/java/com/baeldung/influxdb/InfluxDBConnectionLiveTest.java similarity index 100% rename from influxdb/src/test/java/com/baeldung/influxdb/InfluxDBConnectionLiveTest.java rename to persistence-modules/influxdb/src/test/java/com/baeldung/influxdb/InfluxDBConnectionLiveTest.java diff --git a/influxdb/src/test/resources/logback.xml b/persistence-modules/influxdb/src/test/resources/logback.xml similarity index 100% rename from influxdb/src/test/resources/logback.xml rename to persistence-modules/influxdb/src/test/resources/logback.xml diff --git a/orientdb/.gitignore b/persistence-modules/orientdb/.gitignore similarity index 100% rename from orientdb/.gitignore rename to persistence-modules/orientdb/.gitignore diff --git a/orientdb/.mvn/wrapper/maven-wrapper.jar b/persistence-modules/orientdb/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from orientdb/.mvn/wrapper/maven-wrapper.jar rename to persistence-modules/orientdb/.mvn/wrapper/maven-wrapper.jar diff --git a/orientdb/.mvn/wrapper/maven-wrapper.properties b/persistence-modules/orientdb/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from orientdb/.mvn/wrapper/maven-wrapper.properties rename to persistence-modules/orientdb/.mvn/wrapper/maven-wrapper.properties diff --git a/orientdb/README.md b/persistence-modules/orientdb/README.md similarity index 100% rename from orientdb/README.md rename to persistence-modules/orientdb/README.md diff --git a/orientdb/mvnw b/persistence-modules/orientdb/mvnw old mode 100755 new mode 100644 similarity index 100% rename from orientdb/mvnw rename to persistence-modules/orientdb/mvnw diff --git a/orientdb/mvnw.cmd b/persistence-modules/orientdb/mvnw.cmd similarity index 100% rename from orientdb/mvnw.cmd rename to persistence-modules/orientdb/mvnw.cmd diff --git a/orientdb/pom.xml b/persistence-modules/orientdb/pom.xml similarity index 97% rename from orientdb/pom.xml rename to persistence-modules/orientdb/pom.xml index e1c7ac42bb..e4bc9a0585 100644 --- a/orientdb/pom.xml +++ b/persistence-modules/orientdb/pom.xml @@ -12,6 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../ diff --git a/orientdb/src/main/java/com/baeldung/orientdb/Author.java b/persistence-modules/orientdb/src/main/java/com/baeldung/orientdb/Author.java similarity index 100% rename from orientdb/src/main/java/com/baeldung/orientdb/Author.java rename to persistence-modules/orientdb/src/main/java/com/baeldung/orientdb/Author.java diff --git a/orientdb/src/main/resources/logback.xml b/persistence-modules/orientdb/src/main/resources/logback.xml similarity index 100% rename from orientdb/src/main/resources/logback.xml rename to persistence-modules/orientdb/src/main/resources/logback.xml diff --git a/orientdb/src/test/java/com/baeldung/orientdb/OrientDBDocumentAPILiveTest.java b/persistence-modules/orientdb/src/test/java/com/baeldung/orientdb/OrientDBDocumentAPILiveTest.java similarity index 100% rename from orientdb/src/test/java/com/baeldung/orientdb/OrientDBDocumentAPILiveTest.java rename to persistence-modules/orientdb/src/test/java/com/baeldung/orientdb/OrientDBDocumentAPILiveTest.java diff --git a/orientdb/src/test/java/com/baeldung/orientdb/OrientDBGraphAPILiveTest.java b/persistence-modules/orientdb/src/test/java/com/baeldung/orientdb/OrientDBGraphAPILiveTest.java similarity index 100% rename from orientdb/src/test/java/com/baeldung/orientdb/OrientDBGraphAPILiveTest.java rename to persistence-modules/orientdb/src/test/java/com/baeldung/orientdb/OrientDBGraphAPILiveTest.java diff --git a/orientdb/src/test/java/com/baeldung/orientdb/OrientDBObjectAPILiveTest.java b/persistence-modules/orientdb/src/test/java/com/baeldung/orientdb/OrientDBObjectAPILiveTest.java similarity index 100% rename from orientdb/src/test/java/com/baeldung/orientdb/OrientDBObjectAPILiveTest.java rename to persistence-modules/orientdb/src/test/java/com/baeldung/orientdb/OrientDBObjectAPILiveTest.java diff --git a/spring-boot-persistence/.gitignore b/persistence-modules/spring-boot-persistence/.gitignore similarity index 89% rename from spring-boot-persistence/.gitignore rename to persistence-modules/spring-boot-persistence/.gitignore index 88e3308e9d..da7c2c5c0a 100644 --- a/spring-boot-persistence/.gitignore +++ b/persistence-modules/spring-boot-persistence/.gitignore @@ -1,5 +1,5 @@ -/target/ -.settings/ -.classpath -.project - +/target/ +.settings/ +.classpath +.project + diff --git a/spring-boot-persistence/.mvn/wrapper/maven-wrapper.properties b/persistence-modules/spring-boot-persistence/.mvn/wrapper/maven-wrapper.properties old mode 100755 new mode 100644 similarity index 100% rename from spring-boot-persistence/.mvn/wrapper/maven-wrapper.properties rename to persistence-modules/spring-boot-persistence/.mvn/wrapper/maven-wrapper.properties diff --git a/spring-boot-persistence/README.MD b/persistence-modules/spring-boot-persistence/README.MD similarity index 100% rename from spring-boot-persistence/README.MD rename to persistence-modules/spring-boot-persistence/README.MD diff --git a/spring-boot-persistence/mvnw b/persistence-modules/spring-boot-persistence/mvnw old mode 100755 new mode 100644 similarity index 100% rename from spring-boot-persistence/mvnw rename to persistence-modules/spring-boot-persistence/mvnw diff --git a/spring-boot-persistence/mvnw.cmd b/persistence-modules/spring-boot-persistence/mvnw.cmd old mode 100755 new mode 100644 similarity index 97% rename from spring-boot-persistence/mvnw.cmd rename to persistence-modules/spring-boot-persistence/mvnw.cmd index 4f0b068a03..6a6eec39ba --- a/spring-boot-persistence/mvnw.cmd +++ b/persistence-modules/spring-boot-persistence/mvnw.cmd @@ -1,145 +1,145 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" - -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml similarity index 93% rename from spring-boot-persistence/pom.xml rename to persistence-modules/spring-boot-persistence/pom.xml index 08989edfa9..b34e33e38a 100644 --- a/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -1,75 +1,75 @@ - - - 4.0.0 - - com.baeldung - spring-boot-persistence - 0.1.0 - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - com.zaxxer - HikariCP - - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.tomcat - tomcat-jdbc - ${tomcat-jdbc.version} - - - mysql - mysql-connector-java - ${mysql-connector-java.version} - - - com.h2database - h2 - ${h2database.version} - runtime - - - - - UTF-8 - 1.8 - 8.0.12 - 9.0.10 - 1.4.197 - - - - spring-boot-persistence - - - src/main/resources - true - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - + + + 4.0.0 + + com.baeldung + spring-boot-persistence + 0.1.0 + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.zaxxer + HikariCP + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.tomcat + tomcat-jdbc + ${tomcat-jdbc.version} + + + mysql + mysql-connector-java + ${mysql-connector-java.version} + + + com.h2database + h2 + ${h2database.version} + runtime + + + + + UTF-8 + 1.8 + 8.0.12 + 9.0.10 + 1.4.197 + + + + spring-boot-persistence + + + src/main/resources + true + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/spring-boot-persistence/src/main/java/com/baeldung/Application.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/Application.java similarity index 100% rename from spring-boot-persistence/src/main/java/com/baeldung/Application.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/Application.java diff --git a/spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java similarity index 100% rename from spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java diff --git a/spring-boot-persistence/src/main/java/com/baeldung/domain/Country.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/domain/Country.java similarity index 100% rename from spring-boot-persistence/src/main/java/com/baeldung/domain/Country.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/domain/Country.java diff --git a/spring-boot-persistence/src/main/java/com/baeldung/domain/User.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/domain/User.java similarity index 100% rename from spring-boot-persistence/src/main/java/com/baeldung/domain/User.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/domain/User.java diff --git a/spring-boot-persistence/src/main/java/com/baeldung/repository/UserRepository.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/repository/UserRepository.java similarity index 100% rename from spring-boot-persistence/src/main/java/com/baeldung/repository/UserRepository.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/repository/UserRepository.java diff --git a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/SpringBootConsoleApplication.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/SpringBootConsoleApplication.java similarity index 97% rename from spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/SpringBootConsoleApplication.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/SpringBootConsoleApplication.java index ff37442cd4..5be61b972f 100644 --- a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/SpringBootConsoleApplication.java +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/SpringBootConsoleApplication.java @@ -1,22 +1,22 @@ -package com.baeldung.tomcatconnectionpool.application; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -@SpringBootApplication -@EnableAutoConfiguration -@ComponentScan(basePackages={"com.baeldung.tomcatconnectionpool.application"}) -@EnableJpaRepositories(basePackages="com.baeldung.tomcatconnectionpool.application.repositories") -@EnableTransactionManagement -@EntityScan(basePackages="com.baeldung.tomcatconnectionpool.application.entities") -public class SpringBootConsoleApplication { - - public static void main(String[] args) { - SpringApplication.run(SpringBootConsoleApplication.class); - } -} +package com.baeldung.tomcatconnectionpool.application; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +@EnableAutoConfiguration +@ComponentScan(basePackages={"com.baeldung.tomcatconnectionpool.application"}) +@EnableJpaRepositories(basePackages="com.baeldung.tomcatconnectionpool.application.repositories") +@EnableTransactionManagement +@EntityScan(basePackages="com.baeldung.tomcatconnectionpool.application.entities") +public class SpringBootConsoleApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringBootConsoleApplication.class); + } +} diff --git a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/entities/Customer.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/entities/Customer.java similarity index 95% rename from spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/entities/Customer.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/entities/Customer.java index 4003d5aca9..712506eb98 100644 --- a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/entities/Customer.java +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/entities/Customer.java @@ -1,53 +1,53 @@ -package com.baeldung.tomcatconnectionpool.application.entities; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "customers") -public class Customer { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - @Column(name = "first_name") - private String firstName; - @Column(name = "last_name") - private String lastName; - - public Customer() {} - - public Customer(String firstName, String lastName) { - this.firstName = firstName; - this.lastName = lastName; - } - - public long getId() { - return id; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - @Override - public String toString() { - return "Customer{" + "id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + '}'; - } -} +package com.baeldung.tomcatconnectionpool.application.entities; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "customers") +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + @Column(name = "first_name") + private String firstName; + @Column(name = "last_name") + private String lastName; + + public Customer() {} + + public Customer(String firstName, String lastName) { + this.firstName = firstName; + this.lastName = lastName; + } + + public long getId() { + return id; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + @Override + public String toString() { + return "Customer{" + "id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + '}'; + } +} diff --git a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/repositories/CustomerRepository.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/repositories/CustomerRepository.java similarity index 97% rename from spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/repositories/CustomerRepository.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/repositories/CustomerRepository.java index 770906439c..c461243cf8 100644 --- a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/repositories/CustomerRepository.java +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/repositories/CustomerRepository.java @@ -1,12 +1,12 @@ -package com.baeldung.tomcatconnectionpool.application.repositories; - -import com.baeldung.tomcatconnectionpool.application.entities.Customer; -import java.util.List; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface CustomerRepository extends CrudRepository { - - List findByLastName(String lastName); -} +package com.baeldung.tomcatconnectionpool.application.repositories; + +import com.baeldung.tomcatconnectionpool.application.entities.Customer; +import java.util.List; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CustomerRepository extends CrudRepository { + + List findByLastName(String lastName); +} diff --git a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/runners/CommandLineCrudRunner.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/runners/CommandLineCrudRunner.java similarity index 97% rename from spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/runners/CommandLineCrudRunner.java rename to persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/runners/CommandLineCrudRunner.java index 9666bac5a5..722c7582a1 100644 --- a/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/runners/CommandLineCrudRunner.java +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/tomcatconnectionpool/application/runners/CommandLineCrudRunner.java @@ -1,37 +1,37 @@ -package com.baeldung.tomcatconnectionpool.application.runners; - -import com.baeldung.tomcatconnectionpool.application.entities.Customer; -import com.baeldung.tomcatconnectionpool.application.repositories.CustomerRepository; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Component; - -@Component -public class CommandLineCrudRunner implements CommandLineRunner { - - private static final Logger logger = LoggerFactory.getLogger(CommandLineCrudRunner.class); - - @Autowired - private CustomerRepository customerRepository; - - @Override - public void run(String... args) throws Exception { - customerRepository.save(new Customer("John", "Doe")); - customerRepository.save(new Customer("Jennifer", "Wilson")); - - logger.info("Customers found with findAll():"); - customerRepository.findAll().forEach(c -> logger.info(c.toString())); - - logger.info("Customer found with findById(1L):"); - Customer customer = customerRepository.findById(1L) - .orElseGet(() -> new Customer("Non-existing customer", "")); - logger.info(customer.toString()); - - logger.info("Customer found with findByLastName('Wilson'):"); - customerRepository.findByLastName("Wilson").forEach(c -> { - logger.info(c.toString()); - }); - } -} +package com.baeldung.tomcatconnectionpool.application.runners; + +import com.baeldung.tomcatconnectionpool.application.entities.Customer; +import com.baeldung.tomcatconnectionpool.application.repositories.CustomerRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; + +@Component +public class CommandLineCrudRunner implements CommandLineRunner { + + private static final Logger logger = LoggerFactory.getLogger(CommandLineCrudRunner.class); + + @Autowired + private CustomerRepository customerRepository; + + @Override + public void run(String... args) throws Exception { + customerRepository.save(new Customer("John", "Doe")); + customerRepository.save(new Customer("Jennifer", "Wilson")); + + logger.info("Customers found with findAll():"); + customerRepository.findAll().forEach(c -> logger.info(c.toString())); + + logger.info("Customer found with findById(1L):"); + Customer customer = customerRepository.findById(1L) + .orElseGet(() -> new Customer("Non-existing customer", "")); + logger.info(customer.toString()); + + logger.info("Customer found with findByLastName('Wilson'):"); + customerRepository.findByLastName("Wilson").forEach(c -> { + logger.info(c.toString()); + }); + } +} diff --git a/spring-boot-persistence/src/main/java/org/baeldung/boot/domain/GenericEntity.java b/persistence-modules/spring-boot-persistence/src/main/java/org/baeldung/boot/domain/GenericEntity.java similarity index 100% rename from spring-boot-persistence/src/main/java/org/baeldung/boot/domain/GenericEntity.java rename to persistence-modules/spring-boot-persistence/src/main/java/org/baeldung/boot/domain/GenericEntity.java diff --git a/spring-boot-persistence/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java b/persistence-modules/spring-boot-persistence/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java similarity index 100% rename from spring-boot-persistence/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java rename to persistence-modules/spring-boot-persistence/src/main/java/org/baeldung/boot/repository/GenericEntityRepository.java diff --git a/spring-boot-persistence/src/main/resources/application.properties b/persistence-modules/spring-boot-persistence/src/main/resources/application.properties similarity index 100% rename from spring-boot-persistence/src/main/resources/application.properties rename to persistence-modules/spring-boot-persistence/src/main/resources/application.properties diff --git a/spring-boot-persistence/src/main/resources/data.sql b/persistence-modules/spring-boot-persistence/src/main/resources/data.sql similarity index 100% rename from spring-boot-persistence/src/main/resources/data.sql rename to persistence-modules/spring-boot-persistence/src/main/resources/data.sql diff --git a/spring-boot-persistence/src/main/resources/logback.xml b/persistence-modules/spring-boot-persistence/src/main/resources/logback.xml similarity index 100% rename from spring-boot-persistence/src/main/resources/logback.xml rename to persistence-modules/spring-boot-persistence/src/main/resources/logback.xml diff --git a/spring-boot-persistence/src/main/resources/persistence-generic-entity.properties b/persistence-modules/spring-boot-persistence/src/main/resources/persistence-generic-entity.properties similarity index 100% rename from spring-boot-persistence/src/main/resources/persistence-generic-entity.properties rename to persistence-modules/spring-boot-persistence/src/main/resources/persistence-generic-entity.properties diff --git a/spring-boot-persistence/src/main/resources/schema.sql b/persistence-modules/spring-boot-persistence/src/main/resources/schema.sql similarity index 100% rename from spring-boot-persistence/src/main/resources/schema.sql rename to persistence-modules/spring-boot-persistence/src/main/resources/schema.sql diff --git a/spring-boot-persistence/src/test/java/com/baeldung/SpringBootH2IntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootH2IntegrationTest.java similarity index 100% rename from spring-boot-persistence/src/test/java/com/baeldung/SpringBootH2IntegrationTest.java rename to persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootH2IntegrationTest.java diff --git a/spring-boot-persistence/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java similarity index 100% rename from spring-boot-persistence/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java rename to persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootJPAIntegrationTest.java diff --git a/spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java similarity index 100% rename from spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java rename to persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java diff --git a/spring-boot-persistence/src/test/java/com/baeldung/repository/UserRepositoryIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/repository/UserRepositoryIntegrationTest.java similarity index 100% rename from spring-boot-persistence/src/test/java/com/baeldung/repository/UserRepositoryIntegrationTest.java rename to persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/repository/UserRepositoryIntegrationTest.java diff --git a/spring-boot-persistence/src/test/java/com/baeldung/tomcatconnectionpool/test/application/SpringBootTomcatConnectionPoolIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/tomcatconnectionpool/test/application/SpringBootTomcatConnectionPoolIntegrationTest.java similarity index 97% rename from spring-boot-persistence/src/test/java/com/baeldung/tomcatconnectionpool/test/application/SpringBootTomcatConnectionPoolIntegrationTest.java rename to persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/tomcatconnectionpool/test/application/SpringBootTomcatConnectionPoolIntegrationTest.java index c68e137fb0..eb000bbc09 100644 --- a/spring-boot-persistence/src/test/java/com/baeldung/tomcatconnectionpool/test/application/SpringBootTomcatConnectionPoolIntegrationTest.java +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/tomcatconnectionpool/test/application/SpringBootTomcatConnectionPoolIntegrationTest.java @@ -1,22 +1,22 @@ -package com.baeldung.tomcatconnectionpool.test.application; - -import javax.sql.DataSource; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.junit4.SpringRunner; -import static org.assertj.core.api.Assertions.*; -import org.springframework.boot.test.context.SpringBootTest; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class SpringBootTomcatConnectionPoolIntegrationTest { - - @Autowired - private DataSource dataSource; - - @Test - public void givenTomcatConnectionPoolInstance_whenCheckedPoolClassName_thenCorrect() { - assertThat(dataSource.getClass().getName()).isEqualTo("org.apache.tomcat.jdbc.pool.DataSource"); - } -} +package com.baeldung.tomcatconnectionpool.test.application; + +import javax.sql.DataSource; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.junit4.SpringRunner; +import static org.assertj.core.api.Assertions.*; +import org.springframework.boot.test.context.SpringBootTest; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SpringBootTomcatConnectionPoolIntegrationTest { + + @Autowired + private DataSource dataSource; + + @Test + public void givenTomcatConnectionPoolInstance_whenCheckedPoolClassName_thenCorrect() { + assertThat(dataSource.getClass().getName()).isEqualTo("org.apache.tomcat.jdbc.pool.DataSource"); + } +} diff --git a/spring-boot-persistence/src/test/java/org/baeldung/config/H2TestProfileJPAConfig.java b/persistence-modules/spring-boot-persistence/src/test/java/org/baeldung/config/H2TestProfileJPAConfig.java similarity index 100% rename from spring-boot-persistence/src/test/java/org/baeldung/config/H2TestProfileJPAConfig.java rename to persistence-modules/spring-boot-persistence/src/test/java/org/baeldung/config/H2TestProfileJPAConfig.java diff --git a/spring-boot-persistence/src/test/resources/application.properties b/persistence-modules/spring-boot-persistence/src/test/resources/application.properties similarity index 100% rename from spring-boot-persistence/src/test/resources/application.properties rename to persistence-modules/spring-boot-persistence/src/test/resources/application.properties diff --git a/spring-boot-persistence/src/test/resources/import_active_users.sql b/persistence-modules/spring-boot-persistence/src/test/resources/import_active_users.sql similarity index 100% rename from spring-boot-persistence/src/test/resources/import_active_users.sql rename to persistence-modules/spring-boot-persistence/src/test/resources/import_active_users.sql diff --git a/spring-boot-persistence/src/test/resources/import_inactive_users.sql b/persistence-modules/spring-boot-persistence/src/test/resources/import_inactive_users.sql similarity index 100% rename from spring-boot-persistence/src/test/resources/import_inactive_users.sql rename to persistence-modules/spring-boot-persistence/src/test/resources/import_inactive_users.sql diff --git a/spring-boot-persistence/src/test/resources/migrated_users.sql b/persistence-modules/spring-boot-persistence/src/test/resources/migrated_users.sql similarity index 100% rename from spring-boot-persistence/src/test/resources/migrated_users.sql rename to persistence-modules/spring-boot-persistence/src/test/resources/migrated_users.sql diff --git a/spring-data-elasticsearch/README.md b/persistence-modules/spring-data-elasticsearch/README.md similarity index 100% rename from spring-data-elasticsearch/README.md rename to persistence-modules/spring-data-elasticsearch/README.md diff --git a/spring-data-elasticsearch/pom.xml b/persistence-modules/spring-data-elasticsearch/pom.xml similarity index 98% rename from spring-data-elasticsearch/pom.xml rename to persistence-modules/spring-data-elasticsearch/pom.xml index 99d8a70807..ee9e71a1cb 100644 --- a/spring-data-elasticsearch/pom.xml +++ b/persistence-modules/spring-data-elasticsearch/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/spring-data-elasticsearch/src/main/java/com/baeldung/elasticsearch/Person.java b/persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/elasticsearch/Person.java similarity index 100% rename from spring-data-elasticsearch/src/main/java/com/baeldung/elasticsearch/Person.java rename to persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/elasticsearch/Person.java diff --git a/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/config/Config.java b/persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/config/Config.java similarity index 100% rename from spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/config/Config.java rename to persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/config/Config.java diff --git a/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Article.java b/persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Article.java similarity index 100% rename from spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Article.java rename to persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Article.java diff --git a/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Author.java b/persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Author.java similarity index 100% rename from spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Author.java rename to persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/model/Author.java diff --git a/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/repository/ArticleRepository.java b/persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/repository/ArticleRepository.java similarity index 100% rename from spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/repository/ArticleRepository.java rename to persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/repository/ArticleRepository.java diff --git a/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleService.java b/persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleService.java similarity index 100% rename from spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleService.java rename to persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleService.java diff --git a/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleServiceImpl.java b/persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleServiceImpl.java similarity index 100% rename from spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleServiceImpl.java rename to persistence-modules/spring-data-elasticsearch/src/main/java/com/baeldung/spring/data/es/service/ArticleServiceImpl.java diff --git a/spring-data-elasticsearch/src/main/resources/log4j2.properties b/persistence-modules/spring-data-elasticsearch/src/main/resources/log4j2.properties similarity index 100% rename from spring-data-elasticsearch/src/main/resources/log4j2.properties rename to persistence-modules/spring-data-elasticsearch/src/main/resources/log4j2.properties diff --git a/spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/ElasticSearchManualTest.java b/persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/ElasticSearchManualTest.java similarity index 100% rename from spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/ElasticSearchManualTest.java rename to persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/ElasticSearchManualTest.java diff --git a/spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/GeoQueriesIntegrationTest.java b/persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/GeoQueriesIntegrationTest.java similarity index 100% rename from spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/GeoQueriesIntegrationTest.java rename to persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/elasticsearch/GeoQueriesIntegrationTest.java diff --git a/spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchIntegrationTest.java b/persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchIntegrationTest.java similarity index 100% rename from spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchIntegrationTest.java rename to persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchIntegrationTest.java diff --git a/spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchQueryIntegrationTest.java b/persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchQueryIntegrationTest.java similarity index 100% rename from spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchQueryIntegrationTest.java rename to persistence-modules/spring-data-elasticsearch/src/test/java/com/baeldung/spring/data/es/ElasticSearchQueryIntegrationTest.java diff --git a/spring-data-elasticsearch/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/persistence-modules/spring-data-elasticsearch/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-data-elasticsearch/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to persistence-modules/spring-data-elasticsearch/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-data-jpa/README.md b/persistence-modules/spring-data-jpa/README.md similarity index 100% rename from spring-data-jpa/README.md rename to persistence-modules/spring-data-jpa/README.md diff --git a/spring-data-jpa/pom.xml b/persistence-modules/spring-data-jpa/pom.xml similarity index 96% rename from spring-data-jpa/pom.xml rename to persistence-modules/spring-data-jpa/pom.xml index 8691ce1f09..643210ab89 100644 --- a/spring-data-jpa/pom.xml +++ b/persistence-modules/spring-data-jpa/pom.xml @@ -2,15 +2,16 @@ + 4.0.0 + com.baeldung + spring-data-jpa + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 - 4.0.0 - - spring-data-jpa diff --git a/spring-data-jpa/src/main/java/com/baeldung/Application.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/Application.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/Application.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/Application.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceConfiguration.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceConfiguration.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/config/PersistenceConfiguration.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceConfiguration.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceProductConfiguration.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceProductConfiguration.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/config/PersistenceProductConfiguration.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceProductConfiguration.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceUserConfiguration.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceUserConfiguration.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/config/PersistenceUserConfiguration.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/config/PersistenceUserConfiguration.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/IFooDao.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/IFooDao.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/IFooDao.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/IFooDao.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ArticleRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ArticleRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ArticleRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ArticleRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemTypeRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemTypeRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemTypeRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/CustomItemTypeRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedStudentRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedStudentRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedStudentRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ExtendedStudentRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/IBarCrudRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/IBarCrudRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/IBarCrudRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/IBarCrudRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/InventoryRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ItemTypeRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ItemTypeRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ItemTypeRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ItemTypeRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/LocationRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/LocationRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/LocationRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/LocationRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ReadOnlyLocationRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ReadOnlyLocationRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ReadOnlyLocationRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/ReadOnlyLocationRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/StoreRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/StoreRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/StoreRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/StoreRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemRepositoryImpl.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemRepositoryImpl.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemRepositoryImpl.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemRepositoryImpl.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemTypeRepositoryImpl.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemTypeRepositoryImpl.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemTypeRepositoryImpl.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/CustomItemTypeRepositoryImpl.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/ExtendedRepositoryImpl.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/ExtendedRepositoryImpl.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/ExtendedRepositoryImpl.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/impl/ExtendedRepositoryImpl.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/product/ProductRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/product/ProductRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/product/ProductRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/product/ProductRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/PossessionRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/PossessionRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/PossessionRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/PossessionRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/UserRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/UserRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/UserRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/user/UserRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2Repository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2Repository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2Repository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate2Repository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3Repository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3Repository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3Repository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/Aggregate3Repository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/AggregateRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/AggregateRepository.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/AggregateRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/AggregateRepository.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DddConfig.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DddConfig.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/DddConfig.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DddConfig.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainEvent.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainEvent.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainEvent.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainEvent.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainService.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainService.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainService.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/ddd/event/DomainService.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/Article.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Article.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/Article.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Article.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/Bar.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Bar.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/Bar.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Bar.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/Foo.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Foo.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/Foo.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Foo.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/Item.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Item.java similarity index 94% rename from spring-data-jpa/src/main/java/com/baeldung/domain/Item.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Item.java index 97ce14d92d..1e58fb25ba 100644 --- a/spring-data-jpa/src/main/java/com/baeldung/domain/Item.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Item.java @@ -1,81 +1,81 @@ -package com.baeldung.domain; - -import java.math.BigDecimal; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.ManyToOne; - -@Entity -public class Item { - - private String color; - private String grade; - - @Id - private Long id; - - @ManyToOne - private ItemType itemType; - - private String name; - private BigDecimal price; - @ManyToOne - private Store store; - - public String getColor() { - return color; - } - - public String getGrade() { - return grade; - } - - public Long getId() { - return id; - } - - public ItemType getItemType() { - return itemType; - } - - public String getName() { - return name; - } - - public BigDecimal getPrice() { - return price; - } - - public Store getStore() { - return store; - } - - public void setColor(String color) { - this.color = color; - } - - public void setGrade(String grade) { - this.grade = grade; - } - - public void setId(Long id) { - this.id = id; - } - - public void setItemType(ItemType itemType) { - this.itemType = itemType; - } - - public void setName(String name) { - this.name = name; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public void setStore(Store store) { - this.store = store; - } -} +package com.baeldung.domain; + +import java.math.BigDecimal; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.ManyToOne; + +@Entity +public class Item { + + private String color; + private String grade; + + @Id + private Long id; + + @ManyToOne + private ItemType itemType; + + private String name; + private BigDecimal price; + @ManyToOne + private Store store; + + public String getColor() { + return color; + } + + public String getGrade() { + return grade; + } + + public Long getId() { + return id; + } + + public ItemType getItemType() { + return itemType; + } + + public String getName() { + return name; + } + + public BigDecimal getPrice() { + return price; + } + + public Store getStore() { + return store; + } + + public void setColor(String color) { + this.color = color; + } + + public void setGrade(String grade) { + this.grade = grade; + } + + public void setId(Long id) { + this.id = id; + } + + public void setItemType(ItemType itemType) { + this.itemType = itemType; + } + + public void setName(String name) { + this.name = name; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public void setStore(Store store) { + this.store = store; + } +} diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/ItemType.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/ItemType.java similarity index 94% rename from spring-data-jpa/src/main/java/com/baeldung/domain/ItemType.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/ItemType.java index 412079c2ae..b0349e0471 100644 --- a/spring-data-jpa/src/main/java/com/baeldung/domain/ItemType.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/ItemType.java @@ -1,46 +1,46 @@ -package com.baeldung.domain; - -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; - -@Entity -public class ItemType { - - @Id - private Long id; - @OneToMany(cascade = CascadeType.ALL) - @JoinColumn(name = "ITEM_TYPE_ID") - private List items = new ArrayList<>(); - - private String name; - - public Long getId() { - return id; - } - - public List getItems() { - return items; - } - - public String getName() { - return name; - } - - public void setId(Long id) { - this.id = id; - } - - public void setItems(List items) { - this.items = items; - } - - public void setName(String name) { - this.name = name; - } -} +package com.baeldung.domain; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; + +@Entity +public class ItemType { + + @Id + private Long id; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "ITEM_TYPE_ID") + private List items = new ArrayList<>(); + + private String name; + + public Long getId() { + return id; + } + + public List getItems() { + return items; + } + + public String getName() { + return name; + } + + public void setId(Long id) { + this.id = id; + } + + public void setItems(List items) { + this.items = items; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/KVTag.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/KVTag.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/KVTag.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/KVTag.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/Location.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Location.java similarity index 95% rename from spring-data-jpa/src/main/java/com/baeldung/domain/Location.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Location.java index 2178d378eb..4ca7295986 100644 --- a/spring-data-jpa/src/main/java/com/baeldung/domain/Location.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Location.java @@ -1,55 +1,55 @@ -package com.baeldung.domain; - -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; - -@Entity -public class Location { - - private String city; - private String country; - @Id - private Long id; - - @OneToMany(cascade = CascadeType.ALL) - @JoinColumn(name = "LOCATION_ID") - private List stores = new ArrayList<>(); - - public String getCity() { - return city; - } - - public String getCountry() { - return country; - } - - public Long getId() { - return id; - } - - public List getStores() { - return stores; - } - - public void setCity(String city) { - this.city = city; - } - - public void setCountry(String country) { - this.country = country; - } - - public void setId(Long id) { - this.id = id; - } - - public void setStores(List stores) { - this.stores = stores; - } -} +package com.baeldung.domain; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; + +@Entity +public class Location { + + private String city; + private String country; + @Id + private Long id; + + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "LOCATION_ID") + private List stores = new ArrayList<>(); + + public String getCity() { + return city; + } + + public String getCountry() { + return country; + } + + public Long getId() { + return id; + } + + public List getStores() { + return stores; + } + + public void setCity(String city) { + this.city = city; + } + + public void setCountry(String country) { + this.country = country; + } + + public void setId(Long id) { + this.id = id; + } + + public void setStores(List stores) { + this.stores = stores; + } +} diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/MerchandiseEntity.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/SkillTag.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/SkillTag.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/SkillTag.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/SkillTag.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/Store.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Store.java similarity index 95% rename from spring-data-jpa/src/main/java/com/baeldung/domain/Store.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Store.java index e04684c479..4172051c71 100644 --- a/spring-data-jpa/src/main/java/com/baeldung/domain/Store.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Store.java @@ -1,76 +1,76 @@ -package com.baeldung.domain; - -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; - -@Entity -public class Store { - - private Boolean active; - @Id - private Long id; - @OneToMany(cascade = CascadeType.ALL) - @JoinColumn(name = "STORE_ID") - private List items = new ArrayList<>(); - private Long itemsSold; - - @ManyToOne - private Location location; - - private String name; - - public Boolean getActive() { - return active; - } - - public Long getId() { - return id; - } - - public List getItems() { - return items; - } - - public Long getItemsSold() { - return itemsSold; - } - - public Location getLocation() { - return location; - } - - public String getName() { - return name; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public void setId(Long id) { - this.id = id; - } - - public void setItems(List items) { - this.items = items; - } - - public void setItemsSold(Long itemsSold) { - this.itemsSold = itemsSold; - } - - public void setLocation(Location location) { - this.location = location; - } - - public void setName(String name) { - this.name = name; - } -} +package com.baeldung.domain; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; + +@Entity +public class Store { + + private Boolean active; + @Id + private Long id; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "STORE_ID") + private List items = new ArrayList<>(); + private Long itemsSold; + + @ManyToOne + private Location location; + + private String name; + + public Boolean getActive() { + return active; + } + + public Long getId() { + return id; + } + + public List getItems() { + return items; + } + + public Long getItemsSold() { + return itemsSold; + } + + public Location getLocation() { + return location; + } + + public String getName() { + return name; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public void setId(Long id) { + this.id = id; + } + + public void setItems(List items) { + this.items = items; + } + + public void setItemsSold(Long itemsSold) { + this.itemsSold = itemsSold; + } + + public void setLocation(Location location) { + this.location = location; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/Student.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Student.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/Student.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/Student.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/product/Product.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/product/Product.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/product/Product.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/product/Product.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/user/Possession.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/user/Possession.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/user/Possession.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/user/Possession.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/domain/user/User.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/user/User.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/domain/user/User.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/domain/user/User.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/services/IBarService.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/IBarService.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/services/IBarService.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/IBarService.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/services/IFooService.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/IFooService.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/services/IFooService.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/IFooService.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/services/IOperations.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/IOperations.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/services/IOperations.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/IOperations.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractService.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractService.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractService.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractService.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractSpringDataJpaService.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractSpringDataJpaService.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractSpringDataJpaService.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/AbstractSpringDataJpaService.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/services/impl/BarSpringDataJpaService.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/BarSpringDataJpaService.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/services/impl/BarSpringDataJpaService.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/BarSpringDataJpaService.java diff --git a/spring-data-jpa/src/main/java/com/baeldung/services/impl/FooService.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/FooService.java similarity index 100% rename from spring-data-jpa/src/main/java/com/baeldung/services/impl/FooService.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/services/impl/FooService.java diff --git a/spring-data-jpa/src/main/resources/application.properties b/persistence-modules/spring-data-jpa/src/main/resources/application.properties similarity index 100% rename from spring-data-jpa/src/main/resources/application.properties rename to persistence-modules/spring-data-jpa/src/main/resources/application.properties diff --git a/spring-data-jpa/src/main/resources/ddd.properties b/persistence-modules/spring-data-jpa/src/main/resources/ddd.properties similarity index 100% rename from spring-data-jpa/src/main/resources/ddd.properties rename to persistence-modules/spring-data-jpa/src/main/resources/ddd.properties diff --git a/spring-data-jpa/src/main/resources/logback.xml b/persistence-modules/spring-data-jpa/src/main/resources/logback.xml similarity index 100% rename from spring-data-jpa/src/main/resources/logback.xml rename to persistence-modules/spring-data-jpa/src/main/resources/logback.xml diff --git a/spring-data-jpa/src/main/resources/persistence-multiple-db.properties b/persistence-modules/spring-data-jpa/src/main/resources/persistence-multiple-db.properties similarity index 100% rename from spring-data-jpa/src/main/resources/persistence-multiple-db.properties rename to persistence-modules/spring-data-jpa/src/main/resources/persistence-multiple-db.properties diff --git a/spring-data-jpa/src/main/resources/persistence.properties b/persistence-modules/spring-data-jpa/src/main/resources/persistence.properties similarity index 100% rename from spring-data-jpa/src/main/resources/persistence.properties rename to persistence-modules/spring-data-jpa/src/main/resources/persistence.properties diff --git a/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ArticleRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ArticleRepositoryIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ArticleRepositoryIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ArticleRepositoryIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ExtendedStudentRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ExtendedStudentRepositoryIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ExtendedStudentRepositoryIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/ExtendedStudentRepositoryIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/InventoryRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/InventoryRepositoryIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/dao/repositories/InventoryRepositoryIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/InventoryRepositoryIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/JpaRepositoriesIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/JpaRepositoriesIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/dao/repositories/JpaRepositoriesIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/JpaRepositoriesIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/UserRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/UserRepositoryIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/dao/repositories/UserRepositoryIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/UserRepositoryIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate2EventsIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate2EventsIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate2EventsIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate2EventsIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate3EventsIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate3EventsIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate3EventsIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/Aggregate3EventsIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/ddd/event/AggregateEventsIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/AggregateEventsIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/ddd/event/AggregateEventsIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/AggregateEventsIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/ddd/event/TestEventHandler.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/TestEventHandler.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/ddd/event/TestEventHandler.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/ddd/event/TestEventHandler.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/services/AbstractServicePersistenceIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/AbstractServicePersistenceIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/services/AbstractServicePersistenceIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/AbstractServicePersistenceIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/services/FooServicePersistenceIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/FooServicePersistenceIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/services/FooServicePersistenceIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/FooServicePersistenceIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/services/JpaMultipleDBIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/JpaMultipleDBIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/services/JpaMultipleDBIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/JpaMultipleDBIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/services/SpringDataJPABarAuditIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/SpringDataJPABarAuditIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/services/SpringDataJPABarAuditIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/services/SpringDataJPABarAuditIntegrationTest.java diff --git a/spring-data-jpa/src/test/java/com/baeldung/util/IDUtil.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/util/IDUtil.java similarity index 100% rename from spring-data-jpa/src/test/java/com/baeldung/util/IDUtil.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/util/IDUtil.java diff --git a/spring-data-jpa/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-data-jpa/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-data-jpa/src/test/resources/import_entities.sql b/persistence-modules/spring-data-jpa/src/test/resources/import_entities.sql similarity index 100% rename from spring-data-jpa/src/test/resources/import_entities.sql rename to persistence-modules/spring-data-jpa/src/test/resources/import_entities.sql diff --git a/spring-data-keyvalue/README.md b/persistence-modules/spring-data-keyvalue/README.md similarity index 100% rename from spring-data-keyvalue/README.md rename to persistence-modules/spring-data-keyvalue/README.md diff --git a/spring-data-keyvalue/pom.xml b/persistence-modules/spring-data-keyvalue/pom.xml similarity index 94% rename from spring-data-keyvalue/pom.xml rename to persistence-modules/spring-data-keyvalue/pom.xml index edd8967b97..6675595f2b 100644 --- a/spring-data-keyvalue/pom.xml +++ b/persistence-modules/spring-data-keyvalue/pom.xml @@ -7,7 +7,7 @@ parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/Configurations.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/Configurations.java similarity index 100% rename from spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/Configurations.java rename to persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/Configurations.java diff --git a/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/SpringDataKeyValueApplication.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/SpringDataKeyValueApplication.java similarity index 100% rename from spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/SpringDataKeyValueApplication.java rename to persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/SpringDataKeyValueApplication.java diff --git a/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/repositories/EmployeeRepository.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/repositories/EmployeeRepository.java similarity index 100% rename from spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/repositories/EmployeeRepository.java rename to persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/repositories/EmployeeRepository.java diff --git a/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/EmployeeService.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/EmployeeService.java similarity index 100% rename from spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/EmployeeService.java rename to persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/EmployeeService.java diff --git a/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java similarity index 100% rename from spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java rename to persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java diff --git a/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithRepository.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithRepository.java similarity index 100% rename from spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithRepository.java rename to persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithRepository.java diff --git a/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/vo/Employee.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/vo/Employee.java similarity index 100% rename from spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/vo/Employee.java rename to persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/vo/Employee.java diff --git a/spring-data-keyvalue/src/main/resources/logback.xml b/persistence-modules/spring-data-keyvalue/src/main/resources/logback.xml similarity index 100% rename from spring-data-keyvalue/src/main/resources/logback.xml rename to persistence-modules/spring-data-keyvalue/src/main/resources/logback.xml diff --git a/spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithKeyValueRepositoryIntegrationTest.java b/persistence-modules/spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithKeyValueRepositoryIntegrationTest.java similarity index 100% rename from spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithKeyValueRepositoryIntegrationTest.java rename to persistence-modules/spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithKeyValueRepositoryIntegrationTest.java diff --git a/spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithRepositoryIntegrationTest.java b/persistence-modules/spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithRepositoryIntegrationTest.java similarity index 100% rename from spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithRepositoryIntegrationTest.java rename to persistence-modules/spring-data-keyvalue/src/test/java/com/baeldung/spring/data/keyvalue/services/test/EmployeeServicesWithRepositoryIntegrationTest.java diff --git a/spring-data-keyvalue/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/persistence-modules/spring-data-keyvalue/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-data-keyvalue/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to persistence-modules/spring-data-keyvalue/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-data-mongodb/README.md b/persistence-modules/spring-data-mongodb/README.md similarity index 100% rename from spring-data-mongodb/README.md rename to persistence-modules/spring-data-mongodb/README.md diff --git a/spring-data-mongodb/pom.xml b/persistence-modules/spring-data-mongodb/pom.xml similarity index 98% rename from spring-data-mongodb/pom.xml rename to persistence-modules/spring-data-mongodb/pom.xml index 072ed7a2ac..466acf5a43 100644 --- a/spring-data-mongodb/pom.xml +++ b/persistence-modules/spring-data-mongodb/pom.xml @@ -10,7 +10,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/spring-data-mongodb/src/main/java/com/baeldung/annotation/CascadeSave.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/annotation/CascadeSave.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/annotation/CascadeSave.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/annotation/CascadeSave.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/config/MongoReactiveConfig.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoReactiveConfig.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/config/MongoReactiveConfig.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoReactiveConfig.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/config/SimpleMongoConfig.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/SimpleMongoConfig.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/config/SimpleMongoConfig.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/SimpleMongoConfig.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/converter/UserWriterConverter.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/converter/UserWriterConverter.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/converter/UserWriterConverter.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/converter/UserWriterConverter.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/event/CascadeCallback.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/CascadeCallback.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/event/CascadeCallback.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/CascadeCallback.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/event/CascadeSaveMongoEventListener.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/CascadeSaveMongoEventListener.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/event/CascadeSaveMongoEventListener.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/CascadeSaveMongoEventListener.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/event/FieldCallback.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/FieldCallback.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/event/FieldCallback.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/FieldCallback.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/event/UserCascadeSaveMongoEventListener.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/UserCascadeSaveMongoEventListener.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/event/UserCascadeSaveMongoEventListener.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/event/UserCascadeSaveMongoEventListener.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/model/EmailAddress.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/EmailAddress.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/model/EmailAddress.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/EmailAddress.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/model/User.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/User.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/model/User.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/User.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/reactive/repository/UserRepository.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/reactive/repository/UserRepository.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/reactive/repository/UserRepository.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/reactive/repository/UserRepository.java diff --git a/spring-data-mongodb/src/main/java/com/baeldung/repository/UserRepository.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/repository/UserRepository.java similarity index 100% rename from spring-data-mongodb/src/main/java/com/baeldung/repository/UserRepository.java rename to persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/repository/UserRepository.java diff --git a/spring-data-mongodb/src/main/resources/logback.xml b/persistence-modules/spring-data-mongodb/src/main/resources/logback.xml similarity index 100% rename from spring-data-mongodb/src/main/resources/logback.xml rename to persistence-modules/spring-data-mongodb/src/main/resources/logback.xml diff --git a/spring-data-mongodb/src/main/resources/mongoConfig.xml b/persistence-modules/spring-data-mongodb/src/main/resources/mongoConfig.xml similarity index 100% rename from spring-data-mongodb/src/main/resources/mongoConfig.xml rename to persistence-modules/spring-data-mongodb/src/main/resources/mongoConfig.xml diff --git a/spring-data-mongodb/src/main/resources/test.png b/persistence-modules/spring-data-mongodb/src/main/resources/test.png similarity index 100% rename from spring-data-mongodb/src/main/resources/test.png rename to persistence-modules/spring-data-mongodb/src/main/resources/test.png diff --git a/spring-data-mongodb/src/test/java/com/baeldung/aggregation/ZipsAggregationLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/aggregation/ZipsAggregationLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/aggregation/ZipsAggregationLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/aggregation/ZipsAggregationLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/aggregation/model/StatePopulation.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/aggregation/model/StatePopulation.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/aggregation/model/StatePopulation.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/aggregation/model/StatePopulation.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/gridfs/GridFSLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/gridfs/GridFSLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/gridfs/GridFSLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/gridfs/GridFSLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/DocumentQueryLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/DocumentQueryLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/DocumentQueryLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/DocumentQueryLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateProjectionLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/mongotemplate/MongoTemplateQueryLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/repository/BaseQueryLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/BaseQueryLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/repository/BaseQueryLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/BaseQueryLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/repository/DSLQueryLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/DSLQueryLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/repository/DSLQueryLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/DSLQueryLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/repository/JSONQueryLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/JSONQueryLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/repository/JSONQueryLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/JSONQueryLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/repository/QueryMethodsLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/QueryMethodsLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/repository/QueryMethodsLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/QueryMethodsLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryProjectionLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryProjectionLiveTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryProjectionLiveTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/UserRepositoryProjectionLiveTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionReactiveIntegrationTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionReactiveIntegrationTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionReactiveIntegrationTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionReactiveIntegrationTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionTemplateIntegrationTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionTemplateIntegrationTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionTemplateIntegrationTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionTemplateIntegrationTest.java diff --git a/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionalIntegrationTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionalIntegrationTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionalIntegrationTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/transaction/MongoTransactionalIntegrationTest.java diff --git a/spring-data-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/persistence-modules/spring-data-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-data-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to persistence-modules/spring-data-mongodb/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-data-mongodb/src/test/resources/zips.json b/persistence-modules/spring-data-mongodb/src/test/resources/zips.json similarity index 100% rename from spring-data-mongodb/src/test/resources/zips.json rename to persistence-modules/spring-data-mongodb/src/test/resources/zips.json diff --git a/spring-hibernate3/README.md b/persistence-modules/spring-hibernate3/README.md similarity index 100% rename from spring-hibernate3/README.md rename to persistence-modules/spring-hibernate3/README.md diff --git a/spring-hibernate3/src/main/java/org/baeldung/spring/PersistenceConfigHibernate3.java b/persistence-modules/spring-hibernate3/src/main/java/org/baeldung/spring/PersistenceConfigHibernate3.java similarity index 97% rename from spring-hibernate3/src/main/java/org/baeldung/spring/PersistenceConfigHibernate3.java rename to persistence-modules/spring-hibernate3/src/main/java/org/baeldung/spring/PersistenceConfigHibernate3.java index a128d8848c..f38da21dc0 100644 --- a/spring-hibernate3/src/main/java/org/baeldung/spring/PersistenceConfigHibernate3.java +++ b/persistence-modules/spring-hibernate3/src/main/java/org/baeldung/spring/PersistenceConfigHibernate3.java @@ -1,81 +1,81 @@ -package org.baeldung.spring; - -import java.util.Properties; - -import javax.sql.DataSource; - -import org.apache.tomcat.dbcp.dbcp2.BasicDataSource; -import org.hibernate.SessionFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.env.Environment; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.Resource; -import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; -import org.springframework.orm.hibernate3.HibernateTransactionManager; -import org.springframework.orm.hibernate3.LocalSessionFactoryBean; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -import com.google.common.base.Preconditions; - -@Configuration -@EnableTransactionManagement -@PropertySource({ "classpath:persistence-h2.properties" }) -@ComponentScan({ "org.baeldung.persistence.dao", "org.baeldung.persistence.service" }) -public class PersistenceConfigHibernate3 { - - @Autowired - private Environment env; - - public PersistenceConfigHibernate3() { - super(); - } - - @Bean - public LocalSessionFactoryBean sessionFactory() { - final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); - Resource config = new ClassPathResource("exceptionDemo.cfg.xml"); - sessionFactory.setDataSource(dataSource()); - sessionFactory.setConfigLocation(config); - sessionFactory.setHibernateProperties(hibernateProperties()); - - return sessionFactory; - } - - @Bean - public DataSource dataSource() { - final BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName"))); - dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url"))); - dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user"))); - dataSource.setPassword(Preconditions.checkNotNull(env.getProperty("jdbc.pass"))); - - return dataSource; - } - - @Bean - @Autowired - public HibernateTransactionManager transactionManager(final SessionFactory sessionFactory) { - final HibernateTransactionManager txManager = new HibernateTransactionManager(); - txManager.setSessionFactory(sessionFactory); - - return txManager; - } - - @Bean - public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { - return new PersistenceExceptionTranslationPostProcessor(); - } - - final Properties hibernateProperties() { - final Properties hibernateProperties = new Properties(); - hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); - hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); - return hibernateProperties; - } - -} +package org.baeldung.spring; + +import java.util.Properties; + +import javax.sql.DataSource; + +import org.apache.tomcat.dbcp.dbcp2.BasicDataSource; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.env.Environment; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; +import org.springframework.orm.hibernate3.HibernateTransactionManager; +import org.springframework.orm.hibernate3.LocalSessionFactoryBean; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import com.google.common.base.Preconditions; + +@Configuration +@EnableTransactionManagement +@PropertySource({ "classpath:persistence-h2.properties" }) +@ComponentScan({ "org.baeldung.persistence.dao", "org.baeldung.persistence.service" }) +public class PersistenceConfigHibernate3 { + + @Autowired + private Environment env; + + public PersistenceConfigHibernate3() { + super(); + } + + @Bean + public LocalSessionFactoryBean sessionFactory() { + final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); + Resource config = new ClassPathResource("exceptionDemo.cfg.xml"); + sessionFactory.setDataSource(dataSource()); + sessionFactory.setConfigLocation(config); + sessionFactory.setHibernateProperties(hibernateProperties()); + + return sessionFactory; + } + + @Bean + public DataSource dataSource() { + final BasicDataSource dataSource = new BasicDataSource(); + dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName"))); + dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url"))); + dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user"))); + dataSource.setPassword(Preconditions.checkNotNull(env.getProperty("jdbc.pass"))); + + return dataSource; + } + + @Bean + @Autowired + public HibernateTransactionManager transactionManager(final SessionFactory sessionFactory) { + final HibernateTransactionManager txManager = new HibernateTransactionManager(); + txManager.setSessionFactory(sessionFactory); + + return txManager; + } + + @Bean + public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { + return new PersistenceExceptionTranslationPostProcessor(); + } + + final Properties hibernateProperties() { + final Properties hibernateProperties = new Properties(); + hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); + hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); + // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + return hibernateProperties; + } + +} diff --git a/spring-hibernate3/src/main/resources/logback.xml b/persistence-modules/spring-hibernate3/src/main/resources/logback.xml similarity index 100% rename from spring-hibernate3/src/main/resources/logback.xml rename to persistence-modules/spring-hibernate3/src/main/resources/logback.xml diff --git a/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen1MainIntegrationTest.java b/persistence-modules/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen1MainIntegrationTest.java similarity index 97% rename from spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen1MainIntegrationTest.java rename to persistence-modules/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen1MainIntegrationTest.java index d53c4445a8..bbbf074c1a 100644 --- a/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen1MainIntegrationTest.java +++ b/persistence-modules/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen1MainIntegrationTest.java @@ -1,43 +1,43 @@ -package org.baeldung.persistence.service; - -import java.util.List; - -import org.baeldung.persistence.model.Event; -import org.baeldung.spring.PersistenceConfigHibernate3; -import org.hamcrest.core.IsInstanceOf; -import org.hibernate.HibernateException; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceConfigHibernate3.class }, loader = AnnotationConfigContextLoader.class) -public class HibernateExceptionScen1MainIntegrationTest { - - @Autowired - EventService service; - - @Rule - public ExpectedException expectedEx = ExpectedException.none(); - - @Test - public final void whenEntityIsCreated_thenNoExceptions() { - service.create(new Event("from LocalSessionFactoryBean")); - } - - @Test - @Ignore - public final void whenNoTransBoundToSession_thenException() { - expectedEx.expectCause(IsInstanceOf.instanceOf(HibernateException.class)); - expectedEx.expectMessage("No Hibernate Session bound to thread, " - + "and configuration does not allow creation " - + "of non-transactional one here"); - service.create(new Event("from LocalSessionFactoryBean")); - } -} +package org.baeldung.persistence.service; + +import java.util.List; + +import org.baeldung.persistence.model.Event; +import org.baeldung.spring.PersistenceConfigHibernate3; +import org.hamcrest.core.IsInstanceOf; +import org.hibernate.HibernateException; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceConfigHibernate3.class }, loader = AnnotationConfigContextLoader.class) +public class HibernateExceptionScen1MainIntegrationTest { + + @Autowired + EventService service; + + @Rule + public ExpectedException expectedEx = ExpectedException.none(); + + @Test + public final void whenEntityIsCreated_thenNoExceptions() { + service.create(new Event("from LocalSessionFactoryBean")); + } + + @Test + @Ignore + public final void whenNoTransBoundToSession_thenException() { + expectedEx.expectCause(IsInstanceOf.instanceOf(HibernateException.class)); + expectedEx.expectMessage("No Hibernate Session bound to thread, " + + "and configuration does not allow creation " + + "of non-transactional one here"); + service.create(new Event("from LocalSessionFactoryBean")); + } +} diff --git a/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen2MainIntegrationTest.java b/persistence-modules/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen2MainIntegrationTest.java similarity index 97% rename from spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen2MainIntegrationTest.java rename to persistence-modules/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen2MainIntegrationTest.java index 84cafe0536..d8810f0e90 100644 --- a/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen2MainIntegrationTest.java +++ b/persistence-modules/spring-hibernate3/src/test/java/org/baeldung/persistence/service/HibernateExceptionScen2MainIntegrationTest.java @@ -1,45 +1,45 @@ -package org.baeldung.persistence.service; - -import java.util.List; - -import org.baeldung.persistence.model.Event; -import org.baeldung.spring.PersistenceConfig; -import org.hamcrest.core.IsInstanceOf; -import org.hibernate.HibernateException; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) -public class HibernateExceptionScen2MainIntegrationTest { - - @Autowired - EventService service; - - @Rule - public ExpectedException expectedEx = ExpectedException.none(); - - @Test - public final void whenEntityIsCreated_thenNoExceptions() { - service.create(new Event("from AnnotationSessionFactoryBean")); - } - - @Test - @Ignore - public final void whenNoTransBoundToSession_thenException() { - expectedEx.expectCause(IsInstanceOf.instanceOf(HibernateException.class)); - expectedEx.expectMessage("No Hibernate Session bound to thread, " - + "and configuration does not allow creation " - + "of non-transactional one here"); - service.create(new Event("from AnnotationSessionFactoryBean")); - } - -} +package org.baeldung.persistence.service; + +import java.util.List; + +import org.baeldung.persistence.model.Event; +import org.baeldung.spring.PersistenceConfig; +import org.hamcrest.core.IsInstanceOf; +import org.hibernate.HibernateException; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) +public class HibernateExceptionScen2MainIntegrationTest { + + @Autowired + EventService service; + + @Rule + public ExpectedException expectedEx = ExpectedException.none(); + + @Test + public final void whenEntityIsCreated_thenNoExceptions() { + service.create(new Event("from AnnotationSessionFactoryBean")); + } + + @Test + @Ignore + public final void whenNoTransBoundToSession_thenException() { + expectedEx.expectCause(IsInstanceOf.instanceOf(HibernateException.class)); + expectedEx.expectMessage("No Hibernate Session bound to thread, " + + "and configuration does not allow creation " + + "of non-transactional one here"); + service.create(new Event("from AnnotationSessionFactoryBean")); + } + +} diff --git a/spring-hibernate4/.gitignore b/persistence-modules/spring-hibernate4/.gitignore similarity index 100% rename from spring-hibernate4/.gitignore rename to persistence-modules/spring-hibernate4/.gitignore diff --git a/spring-hibernate4/README.md b/persistence-modules/spring-hibernate4/README.md similarity index 100% rename from spring-hibernate4/README.md rename to persistence-modules/spring-hibernate4/README.md diff --git a/spring-hibernate4/pom.xml b/persistence-modules/spring-hibernate4/pom.xml similarity index 99% rename from spring-hibernate4/pom.xml rename to persistence-modules/spring-hibernate4/pom.xml index 505a218a94..fad84870df 100644 --- a/spring-hibernate4/pom.xml +++ b/persistence-modules/spring-hibernate4/pom.xml @@ -10,6 +10,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../ diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/criteria/model/Item.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/OrderDetail.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserEager.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/model/UserLazy.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/util/HibernateUtil.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/fetching/view/FetchingAppView.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/config/HibernateAnnotationUtil.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/config/HibernateAnnotationUtil.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/config/HibernateAnnotationUtil.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/config/HibernateAnnotationUtil.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMain.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMain.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMain.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMain.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Cart.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Cart.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Cart.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Cart.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Items.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Items.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Items.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/hibernate/oneToMany/model/Items.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarAuditableDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarCrudRepository.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IBarDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IChildDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooAuditableDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IFooDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/IParentDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateAuditableDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractHibernateDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/AbstractJpaDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/GenericHibernateDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IAuditOperations.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IGenericDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/common/IOperations.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarAuditableDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/BarJpaDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ChildDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooAuditableDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/FooDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/dao/impl/ParentDao.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Bar.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Child.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Foo.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Parent.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/model/Person.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarAuditableService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IBarService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IChildService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooAuditableService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IFooService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/IParentService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateAuditableService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractHibernateService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractJpaService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/common/AbstractSpringDataJpaService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarAuditableService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarJpaService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/BarSpringDataJpaService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ChildService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooAuditableService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/FooService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/persistence/service/impl/ParentService.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceConfig.java diff --git a/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java b/persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java similarity index 100% rename from spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java rename to persistence-modules/spring-hibernate4/src/main/java/com/baeldung/spring/PersistenceXmlConfig.java diff --git a/spring-hibernate4/src/main/resources/fetching.cfg.xml b/persistence-modules/spring-hibernate4/src/main/resources/fetching.cfg.xml similarity index 100% rename from spring-hibernate4/src/main/resources/fetching.cfg.xml rename to persistence-modules/spring-hibernate4/src/main/resources/fetching.cfg.xml diff --git a/spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml similarity index 100% rename from spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml rename to persistence-modules/spring-hibernate4/src/main/resources/fetchingLazy.cfg.xml diff --git a/spring-hibernate4/src/main/resources/fetching_create_queries.sql b/persistence-modules/spring-hibernate4/src/main/resources/fetching_create_queries.sql similarity index 100% rename from spring-hibernate4/src/main/resources/fetching_create_queries.sql rename to persistence-modules/spring-hibernate4/src/main/resources/fetching_create_queries.sql diff --git a/spring-hibernate4/src/main/resources/hibernate-annotation.cfg.xml b/persistence-modules/spring-hibernate4/src/main/resources/hibernate-annotation.cfg.xml similarity index 100% rename from spring-hibernate4/src/main/resources/hibernate-annotation.cfg.xml rename to persistence-modules/spring-hibernate4/src/main/resources/hibernate-annotation.cfg.xml diff --git a/spring-hibernate4/src/main/resources/hibernate4Config.xml b/persistence-modules/spring-hibernate4/src/main/resources/hibernate4Config.xml similarity index 100% rename from spring-hibernate4/src/main/resources/hibernate4Config.xml rename to persistence-modules/spring-hibernate4/src/main/resources/hibernate4Config.xml diff --git a/spring-hibernate4/src/main/resources/immutable.cfg.xml b/persistence-modules/spring-hibernate4/src/main/resources/immutable.cfg.xml similarity index 100% rename from spring-hibernate4/src/main/resources/immutable.cfg.xml rename to persistence-modules/spring-hibernate4/src/main/resources/immutable.cfg.xml diff --git a/spring-hibernate4/src/main/resources/insert_statements.sql b/persistence-modules/spring-hibernate4/src/main/resources/insert_statements.sql similarity index 100% rename from spring-hibernate4/src/main/resources/insert_statements.sql rename to persistence-modules/spring-hibernate4/src/main/resources/insert_statements.sql diff --git a/spring-hibernate4/src/main/resources/logback.xml b/persistence-modules/spring-hibernate4/src/main/resources/logback.xml similarity index 100% rename from spring-hibernate4/src/main/resources/logback.xml rename to persistence-modules/spring-hibernate4/src/main/resources/logback.xml diff --git a/spring-hibernate4/src/main/resources/one_to_many.sql b/persistence-modules/spring-hibernate4/src/main/resources/one_to_many.sql similarity index 100% rename from spring-hibernate4/src/main/resources/one_to_many.sql rename to persistence-modules/spring-hibernate4/src/main/resources/one_to_many.sql diff --git a/spring-hibernate4/src/main/resources/persistence-mysql.properties b/persistence-modules/spring-hibernate4/src/main/resources/persistence-mysql.properties similarity index 100% rename from spring-hibernate4/src/main/resources/persistence-mysql.properties rename to persistence-modules/spring-hibernate4/src/main/resources/persistence-mysql.properties diff --git a/spring-hibernate4/src/main/resources/stored_procedure.sql b/persistence-modules/spring-hibernate4/src/main/resources/stored_procedure.sql similarity index 95% rename from spring-hibernate4/src/main/resources/stored_procedure.sql rename to persistence-modules/spring-hibernate4/src/main/resources/stored_procedure.sql index 8e1bdf57dd..9cedb75c37 100644 --- a/spring-hibernate4/src/main/resources/stored_procedure.sql +++ b/persistence-modules/spring-hibernate4/src/main/resources/stored_procedure.sql @@ -1,20 +1,20 @@ -DELIMITER // - CREATE PROCEDURE GetFoosByName(IN fooName VARCHAR(255)) - LANGUAGE SQL - DETERMINISTIC - SQL SECURITY DEFINER - BEGIN - SELECT * FROM foo WHERE name = fooName; - END // -DELIMITER ; - - -DELIMITER // - CREATE PROCEDURE GetAllFoos() - LANGUAGE SQL - DETERMINISTIC - SQL SECURITY DEFINER - BEGIN - SELECT * FROM foo; - END // +DELIMITER // + CREATE PROCEDURE GetFoosByName(IN fooName VARCHAR(255)) + LANGUAGE SQL + DETERMINISTIC + SQL SECURITY DEFINER + BEGIN + SELECT * FROM foo WHERE name = fooName; + END // +DELIMITER ; + + +DELIMITER // + CREATE PROCEDURE GetAllFoos() + LANGUAGE SQL + DETERMINISTIC + SQL SECURITY DEFINER + BEGIN + SELECT * FROM foo; + END // DELIMITER ; \ No newline at end of file diff --git a/spring-hibernate4/src/main/resources/webSecurityConfig.xml b/persistence-modules/spring-hibernate4/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-hibernate4/src/main/resources/webSecurityConfig.xml rename to persistence-modules/spring-hibernate4/src/main/resources/webSecurityConfig.xml diff --git a/spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMainIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMainIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMainIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/hibernate/oneToMany/main/HibernateOneToManyAnnotationMainIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/IntegrationTestSuite.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/AuditTestSuite.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/EnversFooBarAuditIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/JPABarAuditIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/audit/SpringDataJPABarAuditIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooFixtures.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooPaginationPersistenceIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/hibernate/FooSortingPersistenceIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/save/SaveMethodsIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServiceBasicPersistenceIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooServicePersistenceIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java similarity index 97% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java index 9ec04d297c..d9353f1ad1 100644 --- a/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java +++ b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/FooStoredProceduresLiveTest.java @@ -1,121 +1,121 @@ -package com.baeldung.persistence.service; - -import java.util.List; - -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; -import static org.junit.Assert.assertEquals; - -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.exception.SQLGrammarException; -import org.junit.After; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.support.AnnotationConfigContextLoader; - -import com.baeldung.persistence.model.Foo; -import com.baeldung.spring.PersistenceConfig; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) -public class FooStoredProceduresLiveTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(FooStoredProceduresLiveTest.class); - - @Autowired - private SessionFactory sessionFactory; - - @Autowired - private IFooService fooService; - - private Session session; - - @Before - public final void before() { - session = sessionFactory.openSession(); - Assume.assumeTrue(getAllFoosExists()); - Assume.assumeTrue(getFoosByNameExists()); - } - - private boolean getFoosByNameExists() { - try { - Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); - sqlQuery.list(); - return true; - } catch (SQLGrammarException e) { - LOGGER.error("WARNING : GetFoosByName() Procedure is may be missing ", e); - return false; - } - } - - private boolean getAllFoosExists() { - try { - Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); - sqlQuery.list(); - return true; - } catch (SQLGrammarException e) { - LOGGER.error("WARNING : GetAllFoos() Procedure is may be missing ", e); - return false; - } - } - - @After - public final void after() { - session.close(); - } - - @Test - public final void getAllFoosUsingStoredProcedures() { - - fooService.create(new Foo(randomAlphabetic(6))); - - // Stored procedure getAllFoos using createSQLQuery - Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); - @SuppressWarnings("unchecked") - List allFoos = sqlQuery.list(); - for (Foo foo : allFoos) { - LOGGER.info("getAllFoos() SQL Query result : {}", foo.getName()); - } - assertEquals(allFoos.size(), fooService.findAll().size()); - - // Stored procedure getAllFoos using a Named Query - Query namedQuery = session.getNamedQuery("callGetAllFoos"); - @SuppressWarnings("unchecked") - List allFoos2 = namedQuery.list(); - for (Foo foo : allFoos2) { - LOGGER.info("getAllFoos() NamedQuery result : {}", foo.getName()); - } - assertEquals(allFoos2.size(), fooService.findAll().size()); - } - - @Test - public final void getFoosByNameUsingStoredProcedures() { - - fooService.create(new Foo("NewFooName")); - - // Stored procedure getFoosByName using createSQLQuery() - Query sqlQuery = session.createSQLQuery("CALL GetFoosByName(:fooName)").addEntity(Foo.class).setParameter("fooName", "NewFooName"); - @SuppressWarnings("unchecked") - List allFoosByName = sqlQuery.list(); - for (Foo foo : allFoosByName) { - LOGGER.info("getFoosByName() using SQL Query : found => {}", foo.toString()); - } - - // Stored procedure getFoosByName using getNamedQuery() - Query namedQuery = session.getNamedQuery("callGetFoosByName").setParameter("fooName", "NewFooName"); - @SuppressWarnings("unchecked") - List allFoosByName2 = namedQuery.list(); - for (Foo foo : allFoosByName2) { - LOGGER.info("getFoosByName() using Native Query : found => {}", foo.toString()); - } - - } -} +package com.baeldung.persistence.service; + +import java.util.List; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.junit.Assert.assertEquals; + +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.exception.SQLGrammarException; +import org.junit.After; +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import com.baeldung.persistence.model.Foo; +import com.baeldung.spring.PersistenceConfig; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) +public class FooStoredProceduresLiveTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(FooStoredProceduresLiveTest.class); + + @Autowired + private SessionFactory sessionFactory; + + @Autowired + private IFooService fooService; + + private Session session; + + @Before + public final void before() { + session = sessionFactory.openSession(); + Assume.assumeTrue(getAllFoosExists()); + Assume.assumeTrue(getFoosByNameExists()); + } + + private boolean getFoosByNameExists() { + try { + Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); + sqlQuery.list(); + return true; + } catch (SQLGrammarException e) { + LOGGER.error("WARNING : GetFoosByName() Procedure is may be missing ", e); + return false; + } + } + + private boolean getAllFoosExists() { + try { + Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); + sqlQuery.list(); + return true; + } catch (SQLGrammarException e) { + LOGGER.error("WARNING : GetAllFoos() Procedure is may be missing ", e); + return false; + } + } + + @After + public final void after() { + session.close(); + } + + @Test + public final void getAllFoosUsingStoredProcedures() { + + fooService.create(new Foo(randomAlphabetic(6))); + + // Stored procedure getAllFoos using createSQLQuery + Query sqlQuery = session.createSQLQuery("CALL GetAllFoos()").addEntity(Foo.class); + @SuppressWarnings("unchecked") + List allFoos = sqlQuery.list(); + for (Foo foo : allFoos) { + LOGGER.info("getAllFoos() SQL Query result : {}", foo.getName()); + } + assertEquals(allFoos.size(), fooService.findAll().size()); + + // Stored procedure getAllFoos using a Named Query + Query namedQuery = session.getNamedQuery("callGetAllFoos"); + @SuppressWarnings("unchecked") + List allFoos2 = namedQuery.list(); + for (Foo foo : allFoos2) { + LOGGER.info("getAllFoos() NamedQuery result : {}", foo.getName()); + } + assertEquals(allFoos2.size(), fooService.findAll().size()); + } + + @Test + public final void getFoosByNameUsingStoredProcedures() { + + fooService.create(new Foo("NewFooName")); + + // Stored procedure getFoosByName using createSQLQuery() + Query sqlQuery = session.createSQLQuery("CALL GetFoosByName(:fooName)").addEntity(Foo.class).setParameter("fooName", "NewFooName"); + @SuppressWarnings("unchecked") + List allFoosByName = sqlQuery.list(); + for (Foo foo : allFoosByName) { + LOGGER.info("getFoosByName() using SQL Query : found => {}", foo.toString()); + } + + // Stored procedure getFoosByName using getNamedQuery() + Query namedQuery = session.getNamedQuery("callGetFoosByName").setParameter("fooName", "NewFooName"); + @SuppressWarnings("unchecked") + List allFoosByName2 = namedQuery.list(); + for (Foo foo : allFoosByName2) { + LOGGER.info("getFoosByName() using Native Query : found => {}", foo.toString()); + } + + } +} diff --git a/spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/persistence/service/ParentServicePersistenceIntegrationTest.java diff --git a/spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java b/persistence-modules/spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java similarity index 100% rename from spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java rename to persistence-modules/spring-hibernate4/src/test/java/com/baeldung/spring/config/PersistenceTestConfig.java diff --git a/spring-hibernate4/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/persistence-modules/spring-hibernate4/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-hibernate4/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to persistence-modules/spring-hibernate4/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-hibernate4/src/test/resources/.gitignore b/persistence-modules/spring-hibernate4/src/test/resources/.gitignore similarity index 100% rename from spring-hibernate4/src/test/resources/.gitignore rename to persistence-modules/spring-hibernate4/src/test/resources/.gitignore diff --git a/spring-hibernate4/src/test/resources/fetching.cfg.xml b/persistence-modules/spring-hibernate4/src/test/resources/fetching.cfg.xml similarity index 100% rename from spring-hibernate4/src/test/resources/fetching.cfg.xml rename to persistence-modules/spring-hibernate4/src/test/resources/fetching.cfg.xml diff --git a/spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml similarity index 100% rename from spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml rename to persistence-modules/spring-hibernate4/src/test/resources/fetchingLazy.cfg.xml diff --git a/spring-hibernate4/src/test/resources/persistence-h2.properties b/persistence-modules/spring-hibernate4/src/test/resources/persistence-h2.properties similarity index 100% rename from spring-hibernate4/src/test/resources/persistence-h2.properties rename to persistence-modules/spring-hibernate4/src/test/resources/persistence-h2.properties diff --git a/pom.xml b/pom.xml index ed7ca7d6d3..5ba509798d 100644 --- a/pom.xml +++ b/pom.xml @@ -357,14 +357,14 @@ core-java-io core-java-8 java-streams - core-java-persistence + persistence-modules/core-java-persistence core-kotlin kotlin-libraries core-groovy core-java-concurrency core-java-concurrency-collections couchbase - deltaspike + persistence-modules/deltaspike dozer ethereum ejb @@ -392,7 +392,7 @@ hystrix image-processing immutables - influxdb + persistence-modules/influxdb jackson persistence-modules/java-cassandra vavr @@ -436,7 +436,7 @@ mustache mvn-wrapper noexception - orientdb + persistence-modules/orientdb osgi orika patterns @@ -477,7 +477,7 @@ spring-boot-admin spring-boot-camel spring-boot-ops - spring-boot-persistence + persistence-modules/spring-boot-persistence spring-boot-security spring-boot-mvc spring-boot-vue @@ -494,10 +494,10 @@ persistence-modules/spring-data-cassandra spring-data-couchbase-2 persistence-modules/spring-data-dynamodb - spring-data-elasticsearch - spring-data-jpa - spring-data-keyvalue - spring-data-mongodb + persistence-modules/spring-data-elasticsearch + persistence-modules/spring-data-jpa + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-mongodb persistence-modules/spring-data-neo4j persistence-modules/spring-data-redis spring-data-rest @@ -506,7 +506,7 @@ spring-exceptions spring-freemarker persistence-modules/spring-hibernate-3 - spring-hibernate4 + persistence-modules/spring-hibernate4 persistence-modules/spring-hibernate-5 persistence-modules/spring-data-eclipselink spring-integration @@ -806,13 +806,13 @@ spring-cloud/spring-cloud-data-flow/time-processor spring-cloud/spring-cloud-data-flow/time-source spring-cucumber - spring-data-keyvalue + persistence-modules/spring-data-keyvalue spring-data-rest spring-dispatcher-servlet spring-drools spring-freemarker - spring-hibernate-3 - spring-hibernate4 + persistence-modules/spring-hibernate-3 + persistence-modules/spring-hibernate4 spring-integration spring-jenkins-pipeline spring-jersey @@ -941,7 +941,7 @@ azure bootique cdi core-java core-java-collections core-java-io core-java-8 core-kotlin core-groovy core-java-concurrency - couchbase deltaspike dozer + couchbase persistence-modules/deltaspike dozer ethereum ejb feign flips geotools testing-modules/groovy-spock testing-modules/gatling google-cloud google-web-toolkit gson @@ -949,7 +949,7 @@ guava-modules/guava-21 guice disruptor spring-static-resources hazelcast hbase hibernate5 httpclient hystrix - image-processing immutables influxdb + image-processing immutables persistence-modules/influxdb jackson persistence-modules/java-cassandra vavr java-lite java-numbers java-rmi java-vavr-stream javax-servlets @@ -974,7 +974,7 @@ mustache mvn-wrapper noexception - orientdb + persistence-modules/orientdb osgi orika patterns @@ -1021,7 +1021,7 @@ spring-boot-admin spring-boot-camel spring-boot-ops - spring-boot-persistence + persistence-modules/spring-boot-persistence spring-boot-security spring-boot-mvc spring-boot-logging-log4j2 @@ -1037,10 +1037,10 @@ persistence-modules/spring-data-cassandra spring-data-couchbase-2 persistence-modules/spring-data-dynamodb - spring-data-elasticsearch - spring-data-keyvalue - spring-data-mongodb - spring-data-jpa + persistence-modules/spring-data-elasticsearch + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-mongodb + persistence-modules/spring-data-jpa persistence-modules/spring-data-neo4j persistence-modules/spring-data-redis spring-data-rest @@ -1055,7 +1055,7 @@ spring-exceptions spring-freemarker persistence-modules/spring-hibernate-3 - spring-hibernate4 + persistence-modules/spring-hibernate4 persistence-modules/spring-hibernate-5 persistence-modules/spring-data-eclipselink spring-integration @@ -1278,7 +1278,7 @@ core-groovy couchbase - deltaspike + persistence-modules/deltaspike dozer ethereum feign @@ -1300,7 +1300,7 @@ hystrix image-processing immutables - influxdb + persistence-modules/influxdb jackson vavr java-lite @@ -1341,7 +1341,7 @@ mustache mvn-wrapper noexception - orientdb + persistence-modules/orientdb osgi orika patterns @@ -1378,7 +1378,7 @@ spring-boot-bootstrap spring-boot-admin spring-boot-camel - spring-boot-persistence + persistence-modules/spring-boot-persistence spring-boot-security spring-boot-mvc spring-boot-logging-log4j2 @@ -1393,8 +1393,8 @@ spring-aop persistence-modules/spring-data-dynamodb - spring-data-keyvalue - spring-data-mongodb + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-mongodb persistence-modules/spring-data-neo4j spring-data-rest @@ -1509,7 +1509,7 @@ maven-archetype apache-meecrowave - spring-hibernate4 + persistence-modules/spring-hibernate4 xml vertx metrics @@ -1603,7 +1603,7 @@ google-web-toolkit spring-security-mvc-custom hibernate5 - spring-data-elasticsearch + persistence-modules/spring-data-elasticsearch core-java-concurrency core-java-concurrency-collections From b79874af3b590128e65006980b01bfef7413ef3f Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 10:18:28 +0300 Subject: [PATCH 163/546] Update pom.xml --- parent-boot-1/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index 0f1086fa31..a5c38f277f 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -52,5 +52,4 @@ 3.1.0 1.5.16.RELEASE - - \ No newline at end of file + From dc9b1354171f75cd60474040ae76029e1a14106c Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 20 Oct 2018 15:22:59 +0530 Subject: [PATCH 164/546] [BAEL-9517] - Upgraded parent-spring-4 to the latest version of Spring 4.3.20 --- parent-spring-4/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent-spring-4/pom.xml b/parent-spring-4/pom.xml index d1b1298013..9b3c42599b 100644 --- a/parent-spring-4/pom.xml +++ b/parent-spring-4/pom.xml @@ -29,7 +29,7 @@ - 4.3.17.RELEASE + 4.3.20.RELEASE 5.0.2 From d639ab24957ec7f796c43d7578f5b1b866760712 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 15:10:00 +0300 Subject: [PATCH 165/546] Update README.md --- java-collections-maps/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java-collections-maps/README.md b/java-collections-maps/README.md index 4883e0e1b6..ca7fee1d21 100644 --- a/java-collections-maps/README.md +++ b/java-collections-maps/README.md @@ -14,4 +14,5 @@ - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) - [Get the Key for a Value from a Java Map](https://www.baeldung.com/java-map-key-from-value) - [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) -- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) \ No newline at end of file +- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) +- [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps) From 6be1833b3d54b296bc053109f9c78f6de926ab44 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 20 Oct 2018 23:11:32 +0530 Subject: [PATCH 166/546] [BAEL-9550] - Moved GuavaBiMapUnitTest from core-java to java-collections-map module --- .../src/test/java/com/baeldung/guava/GuavaBiMapUnitTest.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {core-java => java-collections-maps}/src/test/java/com/baeldung/guava/GuavaBiMapUnitTest.java (100%) diff --git a/core-java/src/test/java/com/baeldung/guava/GuavaBiMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/guava/GuavaBiMapUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/guava/GuavaBiMapUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/guava/GuavaBiMapUnitTest.java From 294d52e7e45773dbfa7d9bd061bae0bbdb4c072a Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 20:41:36 +0300 Subject: [PATCH 167/546] change setup of spring-ejb-client --- spring-ejb/pom.xml | 1 + spring-ejb/spring-ejb-client/pom.xml | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/spring-ejb/pom.xml b/spring-ejb/pom.xml index 31cde720f9..055df9ea04 100755 --- a/spring-ejb/pom.xml +++ b/spring-ejb/pom.xml @@ -73,6 +73,7 @@ ejb-remote-for-spring ejb-beans + spring-ejb-client diff --git a/spring-ejb/spring-ejb-client/pom.xml b/spring-ejb/spring-ejb-client/pom.xml index c935e1f14a..50337e8b21 100644 --- a/spring-ejb/spring-ejb-client/pom.xml +++ b/spring-ejb/spring-ejb-client/pom.xml @@ -10,11 +10,22 @@ Spring EJB Client - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 + com.baeldung.spring.ejb + spring-ejb + 1.0.1 + + + + + org.springframework.boot + spring-boot-dependencies + 2.0.4.RELEASE + pom + import + + + @@ -54,6 +65,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.0.4.RELEASE From f8a7e1a29185adfdf61f1a46c3c50fb6ab225795 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 20:48:22 +0300 Subject: [PATCH 168/546] remove from main pom --- pom.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pom.xml b/pom.xml index ed7ca7d6d3..0952a9f8e2 100644 --- a/pom.xml +++ b/pom.xml @@ -489,7 +489,6 @@ spring-core spring-cucumber spring-ejb - spring-ejb/spring-ejb-client spring-aop persistence-modules/spring-data-cassandra spring-data-couchbase-2 @@ -1032,7 +1031,6 @@ spring-core spring-cucumber spring-ejb - spring-ejb/spring-ejb-client spring-aop persistence-modules/spring-data-cassandra spring-data-couchbase-2 @@ -1389,7 +1387,6 @@ spring-core spring-cucumber spring-ejb - spring-ejb/spring-ejb-client spring-aop persistence-modules/spring-data-dynamodb From 6c1722a5a21a8912922697e4ee677dc71f4f6011 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 20 Oct 2018 23:41:12 +0530 Subject: [PATCH 169/546] [BAEL-9696] - Moved persistence-related modules into the persistence folder --- .../activejdbc}/README.md | 0 .../activejdbc}/pom.xml | 1 + .../main/java/com/baeldung/ActiveJDBCApp.java | 0 .../java/com/baeldung/model/Employee.java | 0 .../main/java/com/baeldung/model/Role.java | 0 .../src/main/migration/_create_tables.sql | 0 .../src/main/resources/database.properties | 0 .../src/main/resources/logback.xml | 0 .../com/baeldung/ActiveJDBCAppManualTest.java | 0 .../apache-cayenne}/README.md | 0 .../apache-cayenne}/pom.xml | 1 + .../apachecayenne/persistent/Article.java | 0 .../apachecayenne/persistent/Author.java | 0 .../persistent/auto/_Article.java | 0 .../persistent/auto/_Author.java | 0 .../src/main/resources/cayenne-project.xml | 0 .../src/main/resources/datamap.map.xml | 0 .../src/main/resources/logback.xml | 0 .../CayenneAdvancedOperationLiveTest.java | 0 .../CayenneOperationLiveTest.java | 0 .../flyway}/.gitignore | 0 .../flyway}/README.MD | 0 .../V1_0__create_employee_schema.sql | 0 .../V2_0__create_department_schema.sql | 0 .../flyway}/myFlywayConfig.properties | 0 .../flyway}/pom.xml | 2 +- .../ExampleFlywayCallback.java | 0 .../flywaycallbacks/FlywayApplication.java | 0 .../src/main/resources/application.properties | 0 .../db/callbacks/beforeEachMigrate.sql | 0 .../resources/db/callbacks/beforeMigrate.sql | 0 .../db/migration/V1_0__add_table_one.sql | 0 .../db/migration/V1_1__add_table_two.sql | 0 .../flyway}/src/main/resources/logback.xml | 0 .../FlywayApplicationUnitTest.java | 0 .../FlywayCallbackTestConfig.java | 0 .../hbase}/README.md | 0 {hbase => persistence-modules/hbase}/pom.xml | 1 + .../baeldung/hbase/HBaseClientOperations.java | 0 .../baeldung/hbase/HbaseClientExample.java | 0 .../hbase}/src/main/resources/hbase-site.xml | 0 .../hbase}/src/main/resources/logback.xml | 0 .../hibernate5}/README.md | 0 .../hibernate5}/pom.xml | 1 + .../com/baeldung/hibernate/HibernateUtil.java | 0 .../UnsupportedTenancyException.java | 0 .../converters/PersonNameConverter.java | 0 .../hibernate/entities/Department.java | 0 .../hibernate/entities/DeptEmployee.java | 0 .../interceptors/CustomInterceptor.java | 0 .../interceptors/CustomInterceptorImpl.java | 0 .../hibernate/interceptors/HibernateUtil.java | 0 .../hibernate/interceptors/entity/User.java | 0 .../hibernate/joincolumn/Address.java | 0 .../baeldung/hibernate/joincolumn/Email.java | 0 .../hibernate/joincolumn/Employee.java | 0 .../baeldung/hibernate/joincolumn/Office.java | 0 .../jpabootstrap/application/Application.java | 0 .../config/HibernatePersistenceUnitInfo.java | 0 .../config/JpaEntityManagerFactory.java | 0 .../hibernate/jpabootstrap/entities/User.java | 0 .../lifecycle/DirtyDataInspector.java | 0 .../hibernate/lifecycle/FootballPlayer.java | 0 .../lifecycle/HibernateLifecycleUtil.java | 0 .../hibernate/lob/HibernateSessionUtil.java | 0 .../baeldung/hibernate/lob/model/User.java | 0 .../CustomPhysicalNamingStrategy.java | 0 .../hibernate/namingstrategy/Customer.java | 0 .../OptimisticLockingCourse.java | 0 .../OptimisticLockingStudent.java | 0 .../hibernate/pessimisticlocking/Address.java | 0 .../pessimisticlocking/Customer.java | 0 .../pessimisticlocking/Individual.java | 0 .../PessimisticLockingCourse.java | 0 .../PessimisticLockingEmployee.java | 0 .../PessimisticLockingStudent.java | 0 .../com/baeldung/hibernate/pojo/Course.java | 0 .../baeldung/hibernate/pojo/Department.java | 0 .../com/baeldung/hibernate/pojo/Employee.java | 0 .../hibernate/pojo/EntityDescription.java | 0 .../baeldung/hibernate/pojo/OrderEntry.java | 0 .../hibernate/pojo/OrderEntryIdClass.java | 0 .../baeldung/hibernate/pojo/OrderEntryPK.java | 0 .../com/baeldung/hibernate/pojo/Person.java | 0 .../baeldung/hibernate/pojo/PersonName.java | 0 .../com/baeldung/hibernate/pojo/Phone.java | 0 .../baeldung/hibernate/pojo/PointEntity.java | 0 .../hibernate/pojo/PolygonEntity.java | 0 .../com/baeldung/hibernate/pojo/Product.java | 0 .../com/baeldung/hibernate/pojo/Result.java | 0 .../com/baeldung/hibernate/pojo/Student.java | 0 .../hibernate/pojo/TemporalValues.java | 0 .../com/baeldung/hibernate/pojo/User.java | 0 .../baeldung/hibernate/pojo/UserProfile.java | 0 .../hibernate/pojo/generator/MyGenerator.java | 0 .../hibernate/pojo/inheritance/Animal.java | 0 .../hibernate/pojo/inheritance/Bag.java | 0 .../hibernate/pojo/inheritance/Book.java | 0 .../hibernate/pojo/inheritance/Car.java | 0 .../hibernate/pojo/inheritance/Item.java | 0 .../pojo/inheritance/MyEmployee.java | 0 .../hibernate/pojo/inheritance/MyProduct.java | 0 .../hibernate/pojo/inheritance/Pen.java | 0 .../hibernate/pojo/inheritance/Person.java | 0 .../hibernate/pojo/inheritance/Pet.java | 0 .../hibernate/pojo/inheritance/Vehicle.java | 0 .../baeldung/hibernate/pojo/package-info.java | 0 .../com/baeldung/hibernate/proxy/Company.java | 0 .../baeldung/hibernate/proxy/Employee.java | 0 .../hibernate/proxy/HibernateUtil.java | 0 .../src/main/resources/logback.xml | 0 .../hibernate/CustomClassIntegrationTest.java | 0 .../DynamicMappingIntegrationTest.java | 0 .../HibernateSpatialIntegrationTest.java | 0 .../hibernate/IdentifiersIntegrationTest.java | 0 .../InheritanceMappingIntegrationTest.java | 0 .../hibernate/TemporalValuesUnitTest.java | 0 .../PersonNameConverterUnitTest.java | 0 .../HibernateInterceptorUnitTest.java | 0 .../joincolumn/JoinColumnIntegrationTest.java | 0 .../lifecycle/HibernateLifecycleUnitTest.java | 0 .../baeldung/hibernate/lob/LobUnitTest.java | 0 .../baeldung/hibernate/multitenancy/Car.java | 0 .../MultitenancyIntegrationTest.java | 0 ...seApproachMultitenancyIntegrationTest.java | 0 .../MapMultiTenantConnectionProvider.java | 0 .../multitenancy/database/TenantIdNames.java | 0 ...maApproachMultitenancyIntegrationTest.java | 0 .../SchemaMultiTenantConnectionProvider.java | 0 .../multitenancy/schema/TenantIdNames.java | 0 .../NamingStrategyLiveTest.java | 0 .../OptimisticLockingIntegrationTest.java | 0 ...asicPessimisticLockingIntegrationTest.java | 0 .../PessimisticLockScopesIntegrationTest.java | 0 .../proxy/HibernateProxyUnitTest.java | 0 ...hibernate-database-multitenancy.properties | 0 .../hibernate-database-mydb1.properties | 0 .../hibernate-database-mydb2.properties | 0 .../hibernate-interceptors.properties | 0 .../resources/hibernate-lifecycle.properties | 0 .../hibernate-namingstrategy.properties | 0 .../hibernate-pessimistic-locking.properties | 0 .../hibernate-schema-multitenancy.properties | 0 .../resources/hibernate-spatial.properties | 0 .../src/test/resources/hibernate.properties | 0 .../src/test/resources/lifecycle-init.sql | 0 .../src/test/resources/profile.png | Bin .../jnosql}/README.md | 0 .../jnosql}/jnosql-artemis/pom.xml | 0 .../baeldung/jnosql/artemis/AppConfig.java | 0 .../jnosql/artemis/EmbeddedMongoDBSetup.java | 0 .../jnosql/artemis/EntityManagerProducer.java | 0 .../jnosql/artemis/RepositoryTodoManager.java | 0 .../jnosql/artemis/TemplateTodoManager.java | 0 .../com/baeldung/jnosql/artemis/Todo.java | 0 .../baeldung/jnosql/artemis/TodoManager.java | 0 .../jnosql/artemis/TodoRepository.java | 0 .../baeldung/jnosql/artemis/TodoResource.java | 0 .../jnosql/artemis/qualifier/Repo.java | 0 .../jnosql/artemis/qualifier/Template.java | 0 .../src/main/liberty/config/server.xml | 0 .../src/main/resources/META-INF/beans.xml | 0 .../src/main/resources/META-INF/jnosql.json | 0 .../src/main/resources/logback.xml | 0 .../src/main/webapp/WEB-INF/jnosql.json | 0 .../jnosql}/jnosql-diana/pom.xml | 0 .../jnosql/diana/column/ColumnFamilyApp.java | 0 .../jnosql/diana/document/DocumentApp.java | 0 .../jnosql/diana/document/MongoDbInit.java | 0 .../com/baeldung/jnosql/diana/key/Book.java | 0 .../jnosql/diana/key/KeyValueApp.java | 0 .../main/resources/diana-cassandra.properties | 0 .../main/resources/diana-hazelcast.properties | 0 .../main/resources/diana-mongodb.properties | 0 .../src/main/resources/logback.xml | 0 .../jnosql}/pom.xml | 0 .../spring-boot-h2}/README.md | 0 .../spring-boot-h2-database/.gitignore | 0 .../spring-boot-h2-database/pom.xml | 0 .../configuration/AutoConfigurationDemo.java | 28 +++++------ .../h2db/demo/client/ClientSpringBootApp.java | 0 .../h2db/demo/server/SpringBootApp.java | 0 .../src/main/resources/application.properties | 0 .../SpringContextIntegrationTest.java | 0 .../spring-data-couchbase-2}/README.md | 0 .../spring-data-couchbase-2}/pom.xml | 1 + .../spring/data/couchbase/model/Campus.java | 0 .../spring/data/couchbase/model/Person.java | 0 .../spring/data/couchbase/model/Student.java | 0 .../repos/CustomStudentRepository.java | 0 .../repos/CustomStudentRepositoryImpl.java | 0 .../couchbase/repos/PersonRepository.java | 0 .../couchbase/repos/StudentRepository.java | 0 .../service/PersonRepositoryService.java | 0 .../data/couchbase/service/PersonService.java | 0 .../service/PersonTemplateService.java | 0 .../service/StudentRepositoryService.java | 0 .../couchbase/service/StudentService.java | 0 .../service/StudentTemplateService.java | 0 .../couchbase2b/repos/CampusRepository.java | 0 .../couchbase2b/repos/PersonRepository.java | 0 .../couchbase2b/repos/StudentRepository.java | 0 .../couchbase2b/service/CampusService.java | 0 .../service/CampusServiceImpl.java | 0 .../couchbase2b/service/PersonService.java | 0 .../service/PersonServiceImpl.java | 0 .../couchbase2b/service/StudentService.java | 0 .../service/StudentServiceImpl.java | 0 .../src/main/resources/logback.xml | 0 .../src/site/site.xml | 0 .../SpringContextIntegrationTest.java | 0 .../CustomTypeKeyCouchbaseConfig.java | 0 .../data/couchbase/IntegrationTest.java | 0 .../data/couchbase/IntegrationTestConfig.java | 0 .../data/couchbase/MyCouchbaseConfig.java | 0 .../ReadYourOwnWritesCouchbaseConfig.java | 0 ...ersonRepositoryServiceIntegrationTest.java | 0 .../service/PersonServiceIntegrationTest.java | 0 .../PersonTemplateServiceIntegrationTest.java | 0 ...udentRepositoryServiceIntegrationTest.java | 0 .../StudentServiceIntegrationTest.java | 0 ...StudentTemplateServiceIntegrationTest.java | 0 .../MultiBucketCouchbaseConfig.java | 0 .../MultiBucketIntegrationTest.java | 0 .../MultiBucketIntegrationTestConfig.java | 0 .../CampusServiceImplIntegrationTest.java | 0 .../PersonServiceImplIntegrationTest.java | 0 .../StudentServiceImplIntegrationTest.java | 0 .../src/test/resources/logback.xml | 0 pom.xml | 44 +++++++++--------- 230 files changed, 42 insertions(+), 37 deletions(-) rename {activejdbc => persistence-modules/activejdbc}/README.md (100%) rename {activejdbc => persistence-modules/activejdbc}/pom.xml (98%) rename {activejdbc => persistence-modules/activejdbc}/src/main/java/com/baeldung/ActiveJDBCApp.java (100%) rename {activejdbc => persistence-modules/activejdbc}/src/main/java/com/baeldung/model/Employee.java (100%) rename {activejdbc => persistence-modules/activejdbc}/src/main/java/com/baeldung/model/Role.java (100%) rename {activejdbc => persistence-modules/activejdbc}/src/main/migration/_create_tables.sql (100%) rename {activejdbc => persistence-modules/activejdbc}/src/main/resources/database.properties (100%) rename {activejdbc => persistence-modules/activejdbc}/src/main/resources/logback.xml (100%) rename {activejdbc => persistence-modules/activejdbc}/src/test/java/com/baeldung/ActiveJDBCAppManualTest.java (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/README.md (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/pom.xml (97%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/main/java/com/baeldung/apachecayenne/persistent/Article.java (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/main/java/com/baeldung/apachecayenne/persistent/Author.java (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Article.java (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Author.java (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/main/resources/cayenne-project.xml (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/main/resources/datamap.map.xml (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/main/resources/logback.xml (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/test/java/com/baeldung/apachecayenne/CayenneAdvancedOperationLiveTest.java (100%) rename {apache-cayenne => persistence-modules/apache-cayenne}/src/test/java/com/baeldung/apachecayenne/CayenneOperationLiveTest.java (100%) rename {flyway => persistence-modules/flyway}/.gitignore (100%) rename {flyway => persistence-modules/flyway}/README.MD (100%) rename {flyway => persistence-modules/flyway}/db/migration/V1_0__create_employee_schema.sql (100%) rename {flyway => persistence-modules/flyway}/db/migration/V2_0__create_department_schema.sql (100%) rename {flyway => persistence-modules/flyway}/myFlywayConfig.properties (100%) rename {flyway => persistence-modules/flyway}/pom.xml (97%) rename {flyway => persistence-modules/flyway}/src/main/java/com/baeldung/flywaycallbacks/ExampleFlywayCallback.java (100%) rename {flyway => persistence-modules/flyway}/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java (100%) rename {flyway => persistence-modules/flyway}/src/main/resources/application.properties (100%) rename {flyway => persistence-modules/flyway}/src/main/resources/db/callbacks/beforeEachMigrate.sql (100%) rename {flyway => persistence-modules/flyway}/src/main/resources/db/callbacks/beforeMigrate.sql (100%) rename {flyway => persistence-modules/flyway}/src/main/resources/db/migration/V1_0__add_table_one.sql (100%) rename {flyway => persistence-modules/flyway}/src/main/resources/db/migration/V1_1__add_table_two.sql (100%) rename {flyway => persistence-modules/flyway}/src/main/resources/logback.xml (100%) rename {flyway => persistence-modules/flyway}/src/test/java/com/baeldung/flywaycallbacks/FlywayApplicationUnitTest.java (100%) rename {flyway => persistence-modules/flyway}/src/test/java/com/baeldung/flywaycallbacks/FlywayCallbackTestConfig.java (100%) rename {hbase => persistence-modules/hbase}/README.md (100%) rename {hbase => persistence-modules/hbase}/pom.xml (96%) rename {hbase => persistence-modules/hbase}/src/main/java/org/baeldung/hbase/HBaseClientOperations.java (100%) rename {hbase => persistence-modules/hbase}/src/main/java/org/baeldung/hbase/HbaseClientExample.java (100%) rename {hbase => persistence-modules/hbase}/src/main/resources/hbase-site.xml (100%) rename {hbase => persistence-modules/hbase}/src/main/resources/logback.xml (100%) rename {hibernate5 => persistence-modules/hibernate5}/README.md (100%) rename {hibernate5 => persistence-modules/hibernate5}/pom.xml (98%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/HibernateUtil.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/UnsupportedTenancyException.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/converters/PersonNameConverter.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/entities/Department.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptor.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptorImpl.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/interceptors/HibernateUtil.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/interceptors/entity/User.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/joincolumn/Address.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/joincolumn/Email.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/joincolumn/Employee.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/joincolumn/Office.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/jpabootstrap/config/HibernatePersistenceUnitInfo.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/jpabootstrap/config/JpaEntityManagerFactory.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/jpabootstrap/entities/User.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/lifecycle/DirtyDataInspector.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/lifecycle/FootballPlayer.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUtil.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/lob/HibernateSessionUtil.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/lob/model/User.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/namingstrategy/CustomPhysicalNamingStrategy.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/namingstrategy/Customer.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingCourse.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingStudent.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pessimisticlocking/Address.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pessimisticlocking/Customer.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pessimisticlocking/Individual.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingCourse.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingEmployee.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingStudent.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Course.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Department.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Employee.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/EntityDescription.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/OrderEntry.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/OrderEntryIdClass.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/OrderEntryPK.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Person.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/PersonName.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Phone.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/PointEntity.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/PolygonEntity.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Product.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Result.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/Student.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/TemporalValues.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/User.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/UserProfile.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/generator/MyGenerator.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Animal.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Bag.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Book.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Car.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Item.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyEmployee.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyProduct.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pen.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Person.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pet.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/inheritance/Vehicle.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/pojo/package-info.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/proxy/Company.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/proxy/Employee.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/proxy/HibernateUtil.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/resources/logback.xml (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/CustomClassIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/DynamicMappingIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/HibernateSpatialIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/IdentifiersIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/InheritanceMappingIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/TemporalValuesUnitTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/converter/PersonNameConverterUnitTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/interceptors/HibernateInterceptorUnitTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/joincolumn/JoinColumnIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUnitTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/lob/LobUnitTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/Car.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/MultitenancyIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/database/DatabaseApproachMultitenancyIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/database/MapMultiTenantConnectionProvider.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/database/TenantIdNames.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaApproachMultitenancyIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaMultiTenantConnectionProvider.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/multitenancy/schema/TenantIdNames.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/namingstrategy/NamingStrategyLiveTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/pessimisticlocking/BasicPessimisticLockingIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockScopesIntegrationTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/proxy/HibernateProxyUnitTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-database-multitenancy.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-database-mydb1.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-database-mydb2.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-interceptors.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-lifecycle.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-namingstrategy.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-pessimistic-locking.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-schema-multitenancy.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-spatial.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate.properties (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/lifecycle-init.sql (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/profile.png (100%) rename {jnosql => persistence-modules/jnosql}/README.md (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/pom.xml (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/AppConfig.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EmbeddedMongoDBSetup.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EntityManagerProducer.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/RepositoryTodoManager.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TemplateTodoManager.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/Todo.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoManager.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoRepository.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoResource.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Repo.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Template.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/liberty/config/server.xml (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/resources/META-INF/beans.xml (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/resources/META-INF/jnosql.json (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/resources/logback.xml (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-artemis/src/main/webapp/WEB-INF/jnosql.json (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/pom.xml (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/column/ColumnFamilyApp.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/DocumentApp.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/MongoDbInit.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/Book.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/KeyValueApp.java (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/resources/diana-cassandra.properties (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/resources/diana-hazelcast.properties (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/resources/diana-mongodb.properties (100%) rename {jnosql => persistence-modules/jnosql}/jnosql-diana/src/main/resources/logback.xml (100%) rename {jnosql => persistence-modules/jnosql}/pom.xml (100%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/README.md (100%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/spring-boot-h2-database/.gitignore (100%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/spring-boot-h2-database/pom.xml (100%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java (96%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/client/ClientSpringBootApp.java (100%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/server/SpringBootApp.java (100%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/spring-boot-h2-database/src/main/resources/application.properties (100%) rename {spring-boot-h2 => persistence-modules/spring-boot-h2}/spring-boot-h2-remote-app/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/README.md (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/pom.xml (98%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/model/Campus.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/model/Person.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/model/Student.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepository.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepositoryImpl.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/repos/PersonRepository.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/repos/StudentRepository.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/service/PersonService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/service/PersonTemplateService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/service/StudentService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase/service/StudentTemplateService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/repos/CampusRepository.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/repos/PersonRepository.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/repos/StudentRepository.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImpl.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImpl.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentService.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImpl.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/main/resources/logback.xml (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/site/site.xml (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/SpringContextIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/CustomTypeKeyCouchbaseConfig.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTestConfig.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/MyCouchbaseConfig.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/ReadYourOwnWritesCouchbaseConfig.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryServiceIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/service/PersonServiceIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/service/PersonTemplateServiceIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryServiceIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/service/StudentServiceIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase/service/StudentTemplateServiceIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketCouchbaseConfig.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTestConfig.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImplIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImplIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImplIntegrationTest.java (100%) rename {spring-data-couchbase-2 => persistence-modules/spring-data-couchbase-2}/src/test/resources/logback.xml (100%) diff --git a/activejdbc/README.md b/persistence-modules/activejdbc/README.md similarity index 100% rename from activejdbc/README.md rename to persistence-modules/activejdbc/README.md diff --git a/activejdbc/pom.xml b/persistence-modules/activejdbc/pom.xml similarity index 98% rename from activejdbc/pom.xml rename to persistence-modules/activejdbc/pom.xml index 542e674ff3..6a29f14ced 100644 --- a/activejdbc/pom.xml +++ b/persistence-modules/activejdbc/pom.xml @@ -11,6 +11,7 @@ parent-modules com.baeldung 1.0.0-SNAPSHOT + ../../ diff --git a/activejdbc/src/main/java/com/baeldung/ActiveJDBCApp.java b/persistence-modules/activejdbc/src/main/java/com/baeldung/ActiveJDBCApp.java similarity index 100% rename from activejdbc/src/main/java/com/baeldung/ActiveJDBCApp.java rename to persistence-modules/activejdbc/src/main/java/com/baeldung/ActiveJDBCApp.java diff --git a/activejdbc/src/main/java/com/baeldung/model/Employee.java b/persistence-modules/activejdbc/src/main/java/com/baeldung/model/Employee.java similarity index 100% rename from activejdbc/src/main/java/com/baeldung/model/Employee.java rename to persistence-modules/activejdbc/src/main/java/com/baeldung/model/Employee.java diff --git a/activejdbc/src/main/java/com/baeldung/model/Role.java b/persistence-modules/activejdbc/src/main/java/com/baeldung/model/Role.java similarity index 100% rename from activejdbc/src/main/java/com/baeldung/model/Role.java rename to persistence-modules/activejdbc/src/main/java/com/baeldung/model/Role.java diff --git a/activejdbc/src/main/migration/_create_tables.sql b/persistence-modules/activejdbc/src/main/migration/_create_tables.sql similarity index 100% rename from activejdbc/src/main/migration/_create_tables.sql rename to persistence-modules/activejdbc/src/main/migration/_create_tables.sql diff --git a/activejdbc/src/main/resources/database.properties b/persistence-modules/activejdbc/src/main/resources/database.properties similarity index 100% rename from activejdbc/src/main/resources/database.properties rename to persistence-modules/activejdbc/src/main/resources/database.properties diff --git a/activejdbc/src/main/resources/logback.xml b/persistence-modules/activejdbc/src/main/resources/logback.xml similarity index 100% rename from activejdbc/src/main/resources/logback.xml rename to persistence-modules/activejdbc/src/main/resources/logback.xml diff --git a/activejdbc/src/test/java/com/baeldung/ActiveJDBCAppManualTest.java b/persistence-modules/activejdbc/src/test/java/com/baeldung/ActiveJDBCAppManualTest.java similarity index 100% rename from activejdbc/src/test/java/com/baeldung/ActiveJDBCAppManualTest.java rename to persistence-modules/activejdbc/src/test/java/com/baeldung/ActiveJDBCAppManualTest.java diff --git a/apache-cayenne/README.md b/persistence-modules/apache-cayenne/README.md similarity index 100% rename from apache-cayenne/README.md rename to persistence-modules/apache-cayenne/README.md diff --git a/apache-cayenne/pom.xml b/persistence-modules/apache-cayenne/pom.xml similarity index 97% rename from apache-cayenne/pom.xml rename to persistence-modules/apache-cayenne/pom.xml index 591809d47f..d0c6d1f2b2 100644 --- a/apache-cayenne/pom.xml +++ b/persistence-modules/apache-cayenne/pom.xml @@ -13,6 +13,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../ diff --git a/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Article.java b/persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Article.java similarity index 100% rename from apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Article.java rename to persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Article.java diff --git a/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Author.java b/persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Author.java similarity index 100% rename from apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Author.java rename to persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/Author.java diff --git a/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Article.java b/persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Article.java similarity index 100% rename from apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Article.java rename to persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Article.java diff --git a/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Author.java b/persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Author.java similarity index 100% rename from apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Author.java rename to persistence-modules/apache-cayenne/src/main/java/com/baeldung/apachecayenne/persistent/auto/_Author.java diff --git a/apache-cayenne/src/main/resources/cayenne-project.xml b/persistence-modules/apache-cayenne/src/main/resources/cayenne-project.xml similarity index 100% rename from apache-cayenne/src/main/resources/cayenne-project.xml rename to persistence-modules/apache-cayenne/src/main/resources/cayenne-project.xml diff --git a/apache-cayenne/src/main/resources/datamap.map.xml b/persistence-modules/apache-cayenne/src/main/resources/datamap.map.xml similarity index 100% rename from apache-cayenne/src/main/resources/datamap.map.xml rename to persistence-modules/apache-cayenne/src/main/resources/datamap.map.xml diff --git a/apache-cayenne/src/main/resources/logback.xml b/persistence-modules/apache-cayenne/src/main/resources/logback.xml similarity index 100% rename from apache-cayenne/src/main/resources/logback.xml rename to persistence-modules/apache-cayenne/src/main/resources/logback.xml diff --git a/apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneAdvancedOperationLiveTest.java b/persistence-modules/apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneAdvancedOperationLiveTest.java similarity index 100% rename from apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneAdvancedOperationLiveTest.java rename to persistence-modules/apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneAdvancedOperationLiveTest.java diff --git a/apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneOperationLiveTest.java b/persistence-modules/apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneOperationLiveTest.java similarity index 100% rename from apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneOperationLiveTest.java rename to persistence-modules/apache-cayenne/src/test/java/com/baeldung/apachecayenne/CayenneOperationLiveTest.java diff --git a/flyway/.gitignore b/persistence-modules/flyway/.gitignore similarity index 100% rename from flyway/.gitignore rename to persistence-modules/flyway/.gitignore diff --git a/flyway/README.MD b/persistence-modules/flyway/README.MD similarity index 100% rename from flyway/README.MD rename to persistence-modules/flyway/README.MD diff --git a/flyway/db/migration/V1_0__create_employee_schema.sql b/persistence-modules/flyway/db/migration/V1_0__create_employee_schema.sql similarity index 100% rename from flyway/db/migration/V1_0__create_employee_schema.sql rename to persistence-modules/flyway/db/migration/V1_0__create_employee_schema.sql diff --git a/flyway/db/migration/V2_0__create_department_schema.sql b/persistence-modules/flyway/db/migration/V2_0__create_department_schema.sql similarity index 100% rename from flyway/db/migration/V2_0__create_department_schema.sql rename to persistence-modules/flyway/db/migration/V2_0__create_department_schema.sql diff --git a/flyway/myFlywayConfig.properties b/persistence-modules/flyway/myFlywayConfig.properties similarity index 100% rename from flyway/myFlywayConfig.properties rename to persistence-modules/flyway/myFlywayConfig.properties diff --git a/flyway/pom.xml b/persistence-modules/flyway/pom.xml similarity index 97% rename from flyway/pom.xml rename to persistence-modules/flyway/pom.xml index 353bbfb1ec..237b426521 100644 --- a/flyway/pom.xml +++ b/persistence-modules/flyway/pom.xml @@ -11,7 +11,7 @@ parent-boot-1 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/flyway/src/main/java/com/baeldung/flywaycallbacks/ExampleFlywayCallback.java b/persistence-modules/flyway/src/main/java/com/baeldung/flywaycallbacks/ExampleFlywayCallback.java similarity index 100% rename from flyway/src/main/java/com/baeldung/flywaycallbacks/ExampleFlywayCallback.java rename to persistence-modules/flyway/src/main/java/com/baeldung/flywaycallbacks/ExampleFlywayCallback.java diff --git a/flyway/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java b/persistence-modules/flyway/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java similarity index 100% rename from flyway/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java rename to persistence-modules/flyway/src/main/java/com/baeldung/flywaycallbacks/FlywayApplication.java diff --git a/flyway/src/main/resources/application.properties b/persistence-modules/flyway/src/main/resources/application.properties similarity index 100% rename from flyway/src/main/resources/application.properties rename to persistence-modules/flyway/src/main/resources/application.properties diff --git a/flyway/src/main/resources/db/callbacks/beforeEachMigrate.sql b/persistence-modules/flyway/src/main/resources/db/callbacks/beforeEachMigrate.sql similarity index 100% rename from flyway/src/main/resources/db/callbacks/beforeEachMigrate.sql rename to persistence-modules/flyway/src/main/resources/db/callbacks/beforeEachMigrate.sql diff --git a/flyway/src/main/resources/db/callbacks/beforeMigrate.sql b/persistence-modules/flyway/src/main/resources/db/callbacks/beforeMigrate.sql similarity index 100% rename from flyway/src/main/resources/db/callbacks/beforeMigrate.sql rename to persistence-modules/flyway/src/main/resources/db/callbacks/beforeMigrate.sql diff --git a/flyway/src/main/resources/db/migration/V1_0__add_table_one.sql b/persistence-modules/flyway/src/main/resources/db/migration/V1_0__add_table_one.sql similarity index 100% rename from flyway/src/main/resources/db/migration/V1_0__add_table_one.sql rename to persistence-modules/flyway/src/main/resources/db/migration/V1_0__add_table_one.sql diff --git a/flyway/src/main/resources/db/migration/V1_1__add_table_two.sql b/persistence-modules/flyway/src/main/resources/db/migration/V1_1__add_table_two.sql similarity index 100% rename from flyway/src/main/resources/db/migration/V1_1__add_table_two.sql rename to persistence-modules/flyway/src/main/resources/db/migration/V1_1__add_table_two.sql diff --git a/flyway/src/main/resources/logback.xml b/persistence-modules/flyway/src/main/resources/logback.xml similarity index 100% rename from flyway/src/main/resources/logback.xml rename to persistence-modules/flyway/src/main/resources/logback.xml diff --git a/flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayApplicationUnitTest.java b/persistence-modules/flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayApplicationUnitTest.java similarity index 100% rename from flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayApplicationUnitTest.java rename to persistence-modules/flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayApplicationUnitTest.java diff --git a/flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayCallbackTestConfig.java b/persistence-modules/flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayCallbackTestConfig.java similarity index 100% rename from flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayCallbackTestConfig.java rename to persistence-modules/flyway/src/test/java/com/baeldung/flywaycallbacks/FlywayCallbackTestConfig.java diff --git a/hbase/README.md b/persistence-modules/hbase/README.md similarity index 100% rename from hbase/README.md rename to persistence-modules/hbase/README.md diff --git a/hbase/pom.xml b/persistence-modules/hbase/pom.xml similarity index 96% rename from hbase/pom.xml rename to persistence-modules/hbase/pom.xml index 117cf72e30..ffd1464482 100644 --- a/hbase/pom.xml +++ b/persistence-modules/hbase/pom.xml @@ -8,6 +8,7 @@ parent-modules com.baeldung 1.0.0-SNAPSHOT + ../../ diff --git a/hbase/src/main/java/org/baeldung/hbase/HBaseClientOperations.java b/persistence-modules/hbase/src/main/java/org/baeldung/hbase/HBaseClientOperations.java similarity index 100% rename from hbase/src/main/java/org/baeldung/hbase/HBaseClientOperations.java rename to persistence-modules/hbase/src/main/java/org/baeldung/hbase/HBaseClientOperations.java diff --git a/hbase/src/main/java/org/baeldung/hbase/HbaseClientExample.java b/persistence-modules/hbase/src/main/java/org/baeldung/hbase/HbaseClientExample.java similarity index 100% rename from hbase/src/main/java/org/baeldung/hbase/HbaseClientExample.java rename to persistence-modules/hbase/src/main/java/org/baeldung/hbase/HbaseClientExample.java diff --git a/hbase/src/main/resources/hbase-site.xml b/persistence-modules/hbase/src/main/resources/hbase-site.xml similarity index 100% rename from hbase/src/main/resources/hbase-site.xml rename to persistence-modules/hbase/src/main/resources/hbase-site.xml diff --git a/hbase/src/main/resources/logback.xml b/persistence-modules/hbase/src/main/resources/logback.xml similarity index 100% rename from hbase/src/main/resources/logback.xml rename to persistence-modules/hbase/src/main/resources/logback.xml diff --git a/hibernate5/README.md b/persistence-modules/hibernate5/README.md similarity index 100% rename from hibernate5/README.md rename to persistence-modules/hibernate5/README.md diff --git a/hibernate5/pom.xml b/persistence-modules/hibernate5/pom.xml similarity index 98% rename from hibernate5/pom.xml rename to persistence-modules/hibernate5/pom.xml index 610c893bdc..ede939d899 100644 --- a/hibernate5/pom.xml +++ b/persistence-modules/hibernate5/pom.xml @@ -10,6 +10,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../ diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/HibernateUtil.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/UnsupportedTenancyException.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/UnsupportedTenancyException.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/UnsupportedTenancyException.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/UnsupportedTenancyException.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/converters/PersonNameConverter.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/converters/PersonNameConverter.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/converters/PersonNameConverter.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/converters/PersonNameConverter.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/entities/Department.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/Department.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/entities/Department.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/Department.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptor.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptor.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptor.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptor.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptorImpl.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptorImpl.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptorImpl.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/CustomInterceptorImpl.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/HibernateUtil.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/HibernateUtil.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/interceptors/HibernateUtil.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/HibernateUtil.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/entity/User.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/entity/User.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/interceptors/entity/User.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/interceptors/entity/User.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Address.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Address.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Address.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Address.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Email.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Email.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Email.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Email.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Employee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Employee.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Employee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Employee.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Office.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Office.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Office.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/joincolumn/Office.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/application/Application.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/HibernatePersistenceUnitInfo.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/HibernatePersistenceUnitInfo.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/HibernatePersistenceUnitInfo.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/HibernatePersistenceUnitInfo.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/JpaEntityManagerFactory.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/JpaEntityManagerFactory.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/JpaEntityManagerFactory.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/config/JpaEntityManagerFactory.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/entities/User.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/entities/User.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/entities/User.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpabootstrap/entities/User.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/DirtyDataInspector.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/DirtyDataInspector.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/DirtyDataInspector.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/DirtyDataInspector.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/FootballPlayer.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/FootballPlayer.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/FootballPlayer.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/FootballPlayer.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUtil.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUtil.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUtil.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUtil.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/lob/HibernateSessionUtil.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lob/HibernateSessionUtil.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/lob/HibernateSessionUtil.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lob/HibernateSessionUtil.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/lob/model/User.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lob/model/User.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/lob/model/User.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/lob/model/User.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/CustomPhysicalNamingStrategy.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/CustomPhysicalNamingStrategy.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/CustomPhysicalNamingStrategy.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/CustomPhysicalNamingStrategy.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/Customer.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/Customer.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/Customer.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/namingstrategy/Customer.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingCourse.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingCourse.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingCourse.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingCourse.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingStudent.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingStudent.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingStudent.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingStudent.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Address.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Address.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Address.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Address.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Customer.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Customer.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Customer.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Customer.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Individual.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Individual.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Individual.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/Individual.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingCourse.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingCourse.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingCourse.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingCourse.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingEmployee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingEmployee.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingEmployee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingEmployee.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingStudent.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingStudent.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingStudent.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockingStudent.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Course.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Course.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Course.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Course.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Department.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Department.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Department.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Department.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Employee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Employee.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Employee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Employee.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/EntityDescription.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/EntityDescription.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/EntityDescription.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/EntityDescription.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntry.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntry.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntry.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntry.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryIdClass.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryIdClass.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryIdClass.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryIdClass.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryPK.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryPK.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryPK.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/OrderEntryPK.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Person.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Person.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Person.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Person.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PersonName.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PersonName.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/PersonName.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PersonName.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Phone.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Phone.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Phone.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Phone.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PointEntity.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PointEntity.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/PointEntity.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PointEntity.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PolygonEntity.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PolygonEntity.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/PolygonEntity.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/PolygonEntity.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Product.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Product.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Product.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Product.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Result.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Result.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Result.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Result.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Student.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Student.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/Student.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/Student.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/TemporalValues.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/TemporalValues.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/TemporalValues.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/TemporalValues.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/User.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/User.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/User.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/User.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/UserProfile.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/UserProfile.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/UserProfile.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/UserProfile.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/generator/MyGenerator.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/generator/MyGenerator.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/generator/MyGenerator.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/generator/MyGenerator.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Animal.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Animal.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Animal.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Animal.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Bag.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Bag.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Bag.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Bag.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Book.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Book.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Book.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Book.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Car.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Car.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Car.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Car.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Item.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Item.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Item.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Item.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyEmployee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyEmployee.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyEmployee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyEmployee.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyProduct.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyProduct.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyProduct.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/MyProduct.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pen.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pen.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pen.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pen.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Person.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Person.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Person.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Person.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pet.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pet.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pet.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Pet.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Vehicle.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Vehicle.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Vehicle.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/inheritance/Vehicle.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/pojo/package-info.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/package-info.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/pojo/package-info.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/pojo/package-info.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/proxy/Company.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/proxy/Company.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/proxy/Company.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/proxy/Company.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/proxy/Employee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/proxy/Employee.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/proxy/Employee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/proxy/Employee.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/proxy/HibernateUtil.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/proxy/HibernateUtil.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/proxy/HibernateUtil.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/proxy/HibernateUtil.java diff --git a/hibernate5/src/main/resources/logback.xml b/persistence-modules/hibernate5/src/main/resources/logback.xml similarity index 100% rename from hibernate5/src/main/resources/logback.xml rename to persistence-modules/hibernate5/src/main/resources/logback.xml diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/CustomClassIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/CustomClassIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/CustomClassIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/CustomClassIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/DynamicMappingIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/DynamicMappingIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/DynamicMappingIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/DynamicMappingIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/HibernateSpatialIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/HibernateSpatialIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/HibernateSpatialIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/HibernateSpatialIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/IdentifiersIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/IdentifiersIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/IdentifiersIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/IdentifiersIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/InheritanceMappingIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/InheritanceMappingIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/InheritanceMappingIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/InheritanceMappingIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/TemporalValuesUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/TemporalValuesUnitTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/TemporalValuesUnitTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/TemporalValuesUnitTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/converter/PersonNameConverterUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/converter/PersonNameConverterUnitTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/converter/PersonNameConverterUnitTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/converter/PersonNameConverterUnitTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/interceptors/HibernateInterceptorUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/interceptors/HibernateInterceptorUnitTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/interceptors/HibernateInterceptorUnitTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/interceptors/HibernateInterceptorUnitTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/joincolumn/JoinColumnIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/joincolumn/JoinColumnIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/joincolumn/JoinColumnIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/joincolumn/JoinColumnIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUnitTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUnitTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/lifecycle/HibernateLifecycleUnitTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/lob/LobUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/lob/LobUnitTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/lob/LobUnitTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/lob/LobUnitTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/Car.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/Car.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/Car.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/Car.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/MultitenancyIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/MultitenancyIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/MultitenancyIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/MultitenancyIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/DatabaseApproachMultitenancyIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/DatabaseApproachMultitenancyIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/DatabaseApproachMultitenancyIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/DatabaseApproachMultitenancyIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/MapMultiTenantConnectionProvider.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/MapMultiTenantConnectionProvider.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/MapMultiTenantConnectionProvider.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/MapMultiTenantConnectionProvider.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/TenantIdNames.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/TenantIdNames.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/TenantIdNames.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/database/TenantIdNames.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaApproachMultitenancyIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaApproachMultitenancyIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaApproachMultitenancyIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaApproachMultitenancyIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaMultiTenantConnectionProvider.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaMultiTenantConnectionProvider.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaMultiTenantConnectionProvider.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/SchemaMultiTenantConnectionProvider.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/TenantIdNames.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/TenantIdNames.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/TenantIdNames.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/multitenancy/schema/TenantIdNames.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/namingstrategy/NamingStrategyLiveTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/namingstrategy/NamingStrategyLiveTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/namingstrategy/NamingStrategyLiveTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/namingstrategy/NamingStrategyLiveTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/optimisticlocking/OptimisticLockingIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/BasicPessimisticLockingIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/BasicPessimisticLockingIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/BasicPessimisticLockingIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/BasicPessimisticLockingIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockScopesIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockScopesIntegrationTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockScopesIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/pessimisticlocking/PessimisticLockScopesIntegrationTest.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/proxy/HibernateProxyUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/proxy/HibernateProxyUnitTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/proxy/HibernateProxyUnitTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/proxy/HibernateProxyUnitTest.java diff --git a/hibernate5/src/test/resources/hibernate-database-multitenancy.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-database-multitenancy.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-database-multitenancy.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-database-multitenancy.properties diff --git a/hibernate5/src/test/resources/hibernate-database-mydb1.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-database-mydb1.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-database-mydb1.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-database-mydb1.properties diff --git a/hibernate5/src/test/resources/hibernate-database-mydb2.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-database-mydb2.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-database-mydb2.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-database-mydb2.properties diff --git a/hibernate5/src/test/resources/hibernate-interceptors.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-interceptors.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-interceptors.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-interceptors.properties diff --git a/hibernate5/src/test/resources/hibernate-lifecycle.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-lifecycle.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-lifecycle.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-lifecycle.properties diff --git a/hibernate5/src/test/resources/hibernate-namingstrategy.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-namingstrategy.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-namingstrategy.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-namingstrategy.properties diff --git a/hibernate5/src/test/resources/hibernate-pessimistic-locking.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-pessimistic-locking.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-pessimistic-locking.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-pessimistic-locking.properties diff --git a/hibernate5/src/test/resources/hibernate-schema-multitenancy.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-schema-multitenancy.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-schema-multitenancy.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-schema-multitenancy.properties diff --git a/hibernate5/src/test/resources/hibernate-spatial.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-spatial.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-spatial.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-spatial.properties diff --git a/hibernate5/src/test/resources/hibernate.properties b/persistence-modules/hibernate5/src/test/resources/hibernate.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate.properties diff --git a/hibernate5/src/test/resources/lifecycle-init.sql b/persistence-modules/hibernate5/src/test/resources/lifecycle-init.sql similarity index 100% rename from hibernate5/src/test/resources/lifecycle-init.sql rename to persistence-modules/hibernate5/src/test/resources/lifecycle-init.sql diff --git a/hibernate5/src/test/resources/profile.png b/persistence-modules/hibernate5/src/test/resources/profile.png similarity index 100% rename from hibernate5/src/test/resources/profile.png rename to persistence-modules/hibernate5/src/test/resources/profile.png diff --git a/jnosql/README.md b/persistence-modules/jnosql/README.md similarity index 100% rename from jnosql/README.md rename to persistence-modules/jnosql/README.md diff --git a/jnosql/jnosql-artemis/pom.xml b/persistence-modules/jnosql/jnosql-artemis/pom.xml similarity index 100% rename from jnosql/jnosql-artemis/pom.xml rename to persistence-modules/jnosql/jnosql-artemis/pom.xml diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/AppConfig.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/AppConfig.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/AppConfig.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/AppConfig.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EmbeddedMongoDBSetup.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EmbeddedMongoDBSetup.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EmbeddedMongoDBSetup.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EmbeddedMongoDBSetup.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EntityManagerProducer.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EntityManagerProducer.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EntityManagerProducer.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/EntityManagerProducer.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/RepositoryTodoManager.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/RepositoryTodoManager.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/RepositoryTodoManager.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/RepositoryTodoManager.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TemplateTodoManager.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TemplateTodoManager.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TemplateTodoManager.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TemplateTodoManager.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/Todo.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/Todo.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/Todo.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/Todo.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoManager.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoManager.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoManager.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoManager.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoRepository.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoRepository.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoRepository.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoRepository.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoResource.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoResource.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoResource.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/TodoResource.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Repo.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Repo.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Repo.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Repo.java diff --git a/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Template.java b/persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Template.java similarity index 100% rename from jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Template.java rename to persistence-modules/jnosql/jnosql-artemis/src/main/java/com/baeldung/jnosql/artemis/qualifier/Template.java diff --git a/jnosql/jnosql-artemis/src/main/liberty/config/server.xml b/persistence-modules/jnosql/jnosql-artemis/src/main/liberty/config/server.xml similarity index 100% rename from jnosql/jnosql-artemis/src/main/liberty/config/server.xml rename to persistence-modules/jnosql/jnosql-artemis/src/main/liberty/config/server.xml diff --git a/jnosql/jnosql-artemis/src/main/resources/META-INF/beans.xml b/persistence-modules/jnosql/jnosql-artemis/src/main/resources/META-INF/beans.xml similarity index 100% rename from jnosql/jnosql-artemis/src/main/resources/META-INF/beans.xml rename to persistence-modules/jnosql/jnosql-artemis/src/main/resources/META-INF/beans.xml diff --git a/jnosql/jnosql-artemis/src/main/resources/META-INF/jnosql.json b/persistence-modules/jnosql/jnosql-artemis/src/main/resources/META-INF/jnosql.json similarity index 100% rename from jnosql/jnosql-artemis/src/main/resources/META-INF/jnosql.json rename to persistence-modules/jnosql/jnosql-artemis/src/main/resources/META-INF/jnosql.json diff --git a/jnosql/jnosql-artemis/src/main/resources/logback.xml b/persistence-modules/jnosql/jnosql-artemis/src/main/resources/logback.xml similarity index 100% rename from jnosql/jnosql-artemis/src/main/resources/logback.xml rename to persistence-modules/jnosql/jnosql-artemis/src/main/resources/logback.xml diff --git a/jnosql/jnosql-artemis/src/main/webapp/WEB-INF/jnosql.json b/persistence-modules/jnosql/jnosql-artemis/src/main/webapp/WEB-INF/jnosql.json similarity index 100% rename from jnosql/jnosql-artemis/src/main/webapp/WEB-INF/jnosql.json rename to persistence-modules/jnosql/jnosql-artemis/src/main/webapp/WEB-INF/jnosql.json diff --git a/jnosql/jnosql-diana/pom.xml b/persistence-modules/jnosql/jnosql-diana/pom.xml similarity index 100% rename from jnosql/jnosql-diana/pom.xml rename to persistence-modules/jnosql/jnosql-diana/pom.xml diff --git a/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/column/ColumnFamilyApp.java b/persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/column/ColumnFamilyApp.java similarity index 100% rename from jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/column/ColumnFamilyApp.java rename to persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/column/ColumnFamilyApp.java diff --git a/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/DocumentApp.java b/persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/DocumentApp.java similarity index 100% rename from jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/DocumentApp.java rename to persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/DocumentApp.java diff --git a/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/MongoDbInit.java b/persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/MongoDbInit.java similarity index 100% rename from jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/MongoDbInit.java rename to persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/document/MongoDbInit.java diff --git a/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/Book.java b/persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/Book.java similarity index 100% rename from jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/Book.java rename to persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/Book.java diff --git a/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/KeyValueApp.java b/persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/KeyValueApp.java similarity index 100% rename from jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/KeyValueApp.java rename to persistence-modules/jnosql/jnosql-diana/src/main/java/com/baeldung/jnosql/diana/key/KeyValueApp.java diff --git a/jnosql/jnosql-diana/src/main/resources/diana-cassandra.properties b/persistence-modules/jnosql/jnosql-diana/src/main/resources/diana-cassandra.properties similarity index 100% rename from jnosql/jnosql-diana/src/main/resources/diana-cassandra.properties rename to persistence-modules/jnosql/jnosql-diana/src/main/resources/diana-cassandra.properties diff --git a/jnosql/jnosql-diana/src/main/resources/diana-hazelcast.properties b/persistence-modules/jnosql/jnosql-diana/src/main/resources/diana-hazelcast.properties similarity index 100% rename from jnosql/jnosql-diana/src/main/resources/diana-hazelcast.properties rename to persistence-modules/jnosql/jnosql-diana/src/main/resources/diana-hazelcast.properties diff --git a/jnosql/jnosql-diana/src/main/resources/diana-mongodb.properties b/persistence-modules/jnosql/jnosql-diana/src/main/resources/diana-mongodb.properties similarity index 100% rename from jnosql/jnosql-diana/src/main/resources/diana-mongodb.properties rename to persistence-modules/jnosql/jnosql-diana/src/main/resources/diana-mongodb.properties diff --git a/jnosql/jnosql-diana/src/main/resources/logback.xml b/persistence-modules/jnosql/jnosql-diana/src/main/resources/logback.xml similarity index 100% rename from jnosql/jnosql-diana/src/main/resources/logback.xml rename to persistence-modules/jnosql/jnosql-diana/src/main/resources/logback.xml diff --git a/jnosql/pom.xml b/persistence-modules/jnosql/pom.xml similarity index 100% rename from jnosql/pom.xml rename to persistence-modules/jnosql/pom.xml diff --git a/spring-boot-h2/README.md b/persistence-modules/spring-boot-h2/README.md similarity index 100% rename from spring-boot-h2/README.md rename to persistence-modules/spring-boot-h2/README.md diff --git a/spring-boot-h2/spring-boot-h2-database/.gitignore b/persistence-modules/spring-boot-h2/spring-boot-h2-database/.gitignore similarity index 100% rename from spring-boot-h2/spring-boot-h2-database/.gitignore rename to persistence-modules/spring-boot-h2/spring-boot-h2-database/.gitignore diff --git a/spring-boot-h2/spring-boot-h2-database/pom.xml b/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml similarity index 100% rename from spring-boot-h2/spring-boot-h2-database/pom.xml rename to persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml diff --git a/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java b/persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java similarity index 96% rename from spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java rename to persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java index 8d92e18754..18236be234 100644 --- a/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java +++ b/persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/auto/configuration/AutoConfigurationDemo.java @@ -1,14 +1,14 @@ -package com.baeldung.h2db.auto.configuration; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -public class AutoConfigurationDemo { - - public static void main(String[] args) { - SpringApplication.run(AutoConfigurationDemo.class, args); - } - -} +package com.baeldung.h2db.auto.configuration; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +public class AutoConfigurationDemo { + + public static void main(String[] args) { + SpringApplication.run(AutoConfigurationDemo.class, args); + } + +} diff --git a/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/client/ClientSpringBootApp.java b/persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/client/ClientSpringBootApp.java similarity index 100% rename from spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/client/ClientSpringBootApp.java rename to persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/client/ClientSpringBootApp.java diff --git a/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/server/SpringBootApp.java b/persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/server/SpringBootApp.java similarity index 100% rename from spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/server/SpringBootApp.java rename to persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/server/SpringBootApp.java diff --git a/spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties b/persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties similarity index 100% rename from spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties rename to persistence-modules/spring-boot-h2/spring-boot-h2-database/src/main/resources/application.properties diff --git a/spring-boot-h2/spring-boot-h2-remote-app/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/persistence-modules/spring-boot-h2/spring-boot-h2-remote-app/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-boot-h2/spring-boot-h2-remote-app/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to persistence-modules/spring-boot-h2/spring-boot-h2-remote-app/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-data-couchbase-2/README.md b/persistence-modules/spring-data-couchbase-2/README.md similarity index 100% rename from spring-data-couchbase-2/README.md rename to persistence-modules/spring-data-couchbase-2/README.md diff --git a/spring-data-couchbase-2/pom.xml b/persistence-modules/spring-data-couchbase-2/pom.xml similarity index 98% rename from spring-data-couchbase-2/pom.xml rename to persistence-modules/spring-data-couchbase-2/pom.xml index 6c7d7a9d11..a857ee538f 100644 --- a/spring-data-couchbase-2/pom.xml +++ b/persistence-modules/spring-data-couchbase-2/pom.xml @@ -11,6 +11,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../ diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Campus.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Campus.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Campus.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Campus.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Person.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Person.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Person.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Person.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Student.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Student.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Student.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/model/Student.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepository.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepository.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepository.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepository.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepositoryImpl.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepositoryImpl.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepositoryImpl.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/CustomStudentRepositoryImpl.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/PersonRepository.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/PersonRepository.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/PersonRepository.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/PersonRepository.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/StudentRepository.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/StudentRepository.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/StudentRepository.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/repos/StudentRepository.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonTemplateService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonTemplateService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonTemplateService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/PersonTemplateService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentTemplateService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentTemplateService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentTemplateService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase/service/StudentTemplateService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/CampusRepository.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/CampusRepository.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/CampusRepository.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/CampusRepository.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/PersonRepository.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/PersonRepository.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/PersonRepository.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/PersonRepository.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/StudentRepository.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/StudentRepository.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/StudentRepository.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/repos/StudentRepository.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImpl.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImpl.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImpl.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImpl.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImpl.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImpl.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImpl.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImpl.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentService.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentService.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentService.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentService.java diff --git a/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImpl.java b/persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImpl.java similarity index 100% rename from spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImpl.java rename to persistence-modules/spring-data-couchbase-2/src/main/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImpl.java diff --git a/spring-data-couchbase-2/src/main/resources/logback.xml b/persistence-modules/spring-data-couchbase-2/src/main/resources/logback.xml similarity index 100% rename from spring-data-couchbase-2/src/main/resources/logback.xml rename to persistence-modules/spring-data-couchbase-2/src/main/resources/logback.xml diff --git a/spring-data-couchbase-2/src/site/site.xml b/persistence-modules/spring-data-couchbase-2/src/site/site.xml similarity index 100% rename from spring-data-couchbase-2/src/site/site.xml rename to persistence-modules/spring-data-couchbase-2/src/site/site.xml diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/SpringContextIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/SpringContextIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/CustomTypeKeyCouchbaseConfig.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/CustomTypeKeyCouchbaseConfig.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/CustomTypeKeyCouchbaseConfig.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/CustomTypeKeyCouchbaseConfig.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTestConfig.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTestConfig.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTestConfig.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/IntegrationTestConfig.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/MyCouchbaseConfig.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/MyCouchbaseConfig.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/MyCouchbaseConfig.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/MyCouchbaseConfig.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/ReadYourOwnWritesCouchbaseConfig.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/ReadYourOwnWritesCouchbaseConfig.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/ReadYourOwnWritesCouchbaseConfig.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/ReadYourOwnWritesCouchbaseConfig.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryServiceIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryServiceIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryServiceIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonRepositoryServiceIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonServiceIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonServiceIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonServiceIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonServiceIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonTemplateServiceIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonTemplateServiceIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonTemplateServiceIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/PersonTemplateServiceIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryServiceIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryServiceIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryServiceIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentRepositoryServiceIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentServiceIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentServiceIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentServiceIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentServiceIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentTemplateServiceIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentTemplateServiceIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentTemplateServiceIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase/service/StudentTemplateServiceIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketCouchbaseConfig.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketCouchbaseConfig.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketCouchbaseConfig.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketCouchbaseConfig.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTestConfig.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTestConfig.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTestConfig.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/MultiBucketIntegrationTestConfig.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImplIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImplIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImplIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/CampusServiceImplIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImplIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImplIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImplIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/PersonServiceImplIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImplIntegrationTest.java b/persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImplIntegrationTest.java similarity index 100% rename from spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImplIntegrationTest.java rename to persistence-modules/spring-data-couchbase-2/src/test/java/org/baeldung/spring/data/couchbase2b/service/StudentServiceImplIntegrationTest.java diff --git a/spring-data-couchbase-2/src/test/resources/logback.xml b/persistence-modules/spring-data-couchbase-2/src/test/resources/logback.xml similarity index 100% rename from spring-data-couchbase-2/src/test/resources/logback.xml rename to persistence-modules/spring-data-couchbase-2/src/test/resources/logback.xml diff --git a/pom.xml b/pom.xml index 67c58c9a50..1adaa5a9a9 100644 --- a/pom.xml +++ b/pom.xml @@ -330,7 +330,7 @@ parent-kotlin asm atomix - apache-cayenne + persistence-modules/apache-cayenne aws aws-lambda akka-streams @@ -388,8 +388,8 @@ disruptor spring-static-resources hazelcast - hbase - hibernate5 + persistence-modules/hbase + persistence-modules/hibernate5 httpclient hystrix image-processing @@ -494,7 +494,7 @@ spring-ejb/spring-ejb-client spring-aop persistence-modules/spring-data-cassandra - spring-data-couchbase-2 + persistence-modules/spring-data-couchbase-2 persistence-modules/spring-data-dynamodb persistence-modules/spring-data-elasticsearch persistence-modules/spring-data-jpa @@ -628,13 +628,13 @@ optaplanner apache-meecrowave spring-reactive-kotlin - jnosql + persistence-modules/jnosql spring-boot-angular-ecommerce cdi-portable-extension jta java-websocket - activejdbc + persistence-modules/activejdbc animal-sniffer-mvn-plugin apache-avro apache-bval @@ -649,7 +649,7 @@ dagger data-structures dubbo - flyway + persistence-modules/flyway jni @@ -700,8 +700,8 @@ spring-boot-custom-starter/greeter - spring-boot-h2/spring-boot-h2-database - + persistence-modules/spring-boot-h2/spring-boot-h2-database + @@ -780,7 +780,7 @@ spring-boot-custom-starter greeter-spring-boot-autoconfigure greeter-spring-boot-sample-app - spring-boot-h2/spring-boot-h2-database + persistence-modules/spring-boot-h2/spring-boot-h2-database spring-boot-jasypt spring-boot-keycloak spring-boot-mvc @@ -934,7 +934,7 @@ parent-kotlin - java-websocket - activejdbc + persistence-modules/activejdbc animal-sniffer-mvn-plugin apache-avro apache-bval @@ -1148,7 +1148,7 @@ dagger data-structures dubbo - flyway + persistence-modules/flyway jni @@ -1199,8 +1199,8 @@ spring-boot-custom-starter/greeter - spring-boot-h2/spring-boot-h2-database - + persistence-modules/spring-boot-h2/spring-boot-h2-database + @@ -1252,7 +1252,7 @@ parent-kotlin asm atomix - apache-cayenne + persistence-modules/apache-cayenne aws aws-lambda akka-streams @@ -1299,7 +1299,7 @@ disruptor spring-static-resources hazelcast - hbase + persistence-modules/hbase hystrix image-processing @@ -1525,7 +1525,7 @@ persistence-modules/java-cassandra persistence-modules/spring-data-cassandra logging-modules/log4j2 - spring-data-couchbase-2 + persistence-modules/spring-data-couchbase-2 persistence-modules/spring-data-redis jmeter @@ -1606,7 +1606,7 @@ core-java google-web-toolkit spring-security-mvc-custom - hibernate5 + persistence-modules/hibernate5 persistence-modules/spring-data-elasticsearch core-java-concurrency core-java-concurrency-collections From bb380406b286eb578f7ddbbaa14ef90983847cb2 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 21:53:54 +0300 Subject: [PATCH 170/546] Update pom.xml --- parent-boot-2/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index ba98898987..bcfcfdec44 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -75,5 +75,4 @@ 1.0.11.RELEASE 2.0.5.RELEASE - - \ No newline at end of file + From b2f3115cfda2dd24d38b29f9553cb462f7c727bb Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Sun, 21 Oct 2018 00:26:30 +0530 Subject: [PATCH 171/546] BAEL-9040 Two quick improvements to the foreach article -Added more tests for forEach tutorial --- .../baeldung/java8/Java8ForEachUnitTest.java | 63 ++++++++++++++++--- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java b/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java index 6a485e939f..7840c84b7d 100644 --- a/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java +++ b/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java @@ -4,8 +4,15 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayDeque; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Set; import java.util.function.Consumer; public class Java8ForEachUnitTest { @@ -29,8 +36,18 @@ public class Java8ForEachUnitTest { } // Java 8 - forEach - LOG.debug("--- forEach method ---"); - names.forEach(name -> LOG.debug(name)); + names.forEach(name -> { + System.out.println(name); + }); + + LOG.debug("--- Print Consumer ---"); + Consumer printConsumer = new Consumer() { + public void accept(String name) { + System.out.println(name); + }; + }; + + names.forEach(printConsumer); // Anonymous inner class that implements Consumer interface LOG.debug("--- Anonymous inner class ---"); @@ -40,17 +57,45 @@ public class Java8ForEachUnitTest { } }); - // Create a Consumer implementation to then use in a forEach method - Consumer consumerNames = name -> { - LOG.debug(name); - }; - LOG.debug("--- Implementation of Consumer interface ---"); - names.forEach(consumerNames); + // Java 8 - forEach - Lambda Syntax + LOG.debug("--- forEach method ---"); + names.forEach(name -> LOG.debug(name)); - // Print elements using a Method Reference + // Java 8 - forEach - Print elements using a Method Reference LOG.debug("--- Method Reference ---"); names.forEach(LOG::debug); + } + @Test + public void givenList_thenIterateAndPrintResults() { + List names = Arrays.asList("Larry", "Steve", "James"); + + names.forEach(System.out::println); + } + + @Test + public void givenSet_thenIterateAndPrintResults() { + Set uniqueNames = new HashSet<>(Arrays.asList("Larry", "Steve", "James")); + + uniqueNames.forEach(System.out::println); + } + + @Test + public void givenQueue_thenIterateAndPrintResults() { + Queue namesQueue = new ArrayDeque<>(Arrays.asList("Larry", "Steve", "James")); + + namesQueue.forEach(System.out::println); + } + + @Test + public void givenMap_thenIterateAndPrintResults() { + Map namesMap = new HashMap<>(); + namesMap.put(1, "Larry"); + namesMap.put(2, "Steve"); + namesMap.put(3, "James"); + + namesMap.entrySet() + .forEach(entry -> System.out.println(entry.getKey() + " " + entry.getValue())); } } From cf56156f338c69af789b5eb5be76d1a821546c05 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 22:02:24 +0300 Subject: [PATCH 172/546] fix custom starter setup --- .../greeter-spring-boot-sample-app/pom.xml | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml index 4eac7eba19..88c5d1caf5 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml @@ -7,11 +7,23 @@ 0.0.1-SNAPSHOT - parent-boot-1 + spring-boot-custom-starter com.baeldung 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../spring-boot-custom-starter + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + @@ -19,9 +31,27 @@ greeter-spring-boot-starter ${greeter-starter.version} + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + + 1.5.15.RELEASE 0.0.1-SNAPSHOT From d10f6b56ed57e159f1c503028c1d34e73fb625a4 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 22:08:41 +0300 Subject: [PATCH 173/546] trigger parent build --- spring-boot-custom-starter/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-custom-starter/pom.xml b/spring-boot-custom-starter/pom.xml index b8ad8fa12c..97b33ce2b8 100644 --- a/spring-boot-custom-starter/pom.xml +++ b/spring-boot-custom-starter/pom.xml @@ -18,5 +18,6 @@ greeter-spring-boot-starter greeter-spring-boot-sample-app + \ No newline at end of file From d166c0bb2e8c3b71dc4fb504de31ae94692257ab Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 20 Oct 2018 22:26:50 +0300 Subject: [PATCH 174/546] Update pom.xml --- parent-boot-1/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index a5c38f277f..c61b791ef3 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -52,4 +52,5 @@ 3.1.0 1.5.16.RELEASE + From 682f93885b1e92411aad23ba6659e935bfcf4002 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 21 Oct 2018 11:48:52 +0530 Subject: [PATCH 175/546] [BAEL-9696] - Fixed conflicts and moved new code changes --- .../src/main/java/com/baeldung/hibernate/customtypes/Address.java | 0 .../main/java/com/baeldung/hibernate/customtypes/AddressType.java | 0 .../hibernate/customtypes/LocalDateStringJavaDescriptor.java | 0 .../com/baeldung/hibernate/customtypes/LocalDateStringType.java | 0 .../java/com/baeldung/hibernate/customtypes/OfficeEmployee.java | 0 .../main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java | 0 .../java/com/baeldung/hibernate/customtypes/PhoneNumberType.java | 0 .../src/main/java/com/baeldung/hibernate/customtypes/Salary.java | 0 .../baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java | 0 .../main/java/com/baeldung/hibernate/customtypes/SalaryType.java | 0 .../hibernate/customtypes/HibernateCustomTypesUnitTest.java | 0 .../src/test/resources/hibernate-customtypes.properties | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/Address.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/Salary.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java (100%) rename {hibernate5 => persistence-modules/hibernate5}/src/test/resources/hibernate-customtypes.properties (100%) diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Address.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/AddressType.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringJavaDescriptor.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/LocalDateStringType.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/OfficeEmployee.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumber.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/PhoneNumberType.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/Salary.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryCurrencyConvertor.java diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java similarity index 100% rename from hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/customtypes/SalaryType.java diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java diff --git a/hibernate5/src/test/resources/hibernate-customtypes.properties b/persistence-modules/hibernate5/src/test/resources/hibernate-customtypes.properties similarity index 100% rename from hibernate5/src/test/resources/hibernate-customtypes.properties rename to persistence-modules/hibernate5/src/test/resources/hibernate-customtypes.properties From a658ab4834f80817d16b8a915c4f1ad2b2863c83 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 21 Oct 2018 10:20:13 +0300 Subject: [PATCH 176/546] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d896ac0715..f3fe5e3bf0 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,4 @@ To run a Spring Boot module run the command: `mvn spring-boot:run -Dgib.enabled= + From 5bfec51157b2b478eb5f961f84034e9c651bb8a1 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 21 Oct 2018 10:53:15 +0300 Subject: [PATCH 177/546] fix main class of activiti boot --- spring-activiti/pom.xml | 14 +++++++++++++- .../activitiwithspring/ActivitiController.java | 2 +- .../ActivitiWithSpringApplication.java | 2 +- .../activitiwithspring/TaskRepresentation.java | 2 +- .../servicetasks/SendEmailServiceTask.java | 2 +- .../baeldung/SpringContextIntegrationTest.java | 4 ++-- .../ActivitiControllerIntegrationTest.java | 3 ++- .../ActivitiSpringSecurityIntegrationTest.java | 2 +- ...tivitiWithSpringApplicationIntegrationTest.java | 2 +- .../ProcessEngineCreationIntegrationTest.java | 2 +- .../ProcessExecutionIntegrationTest.java | 2 +- 11 files changed, 25 insertions(+), 12 deletions(-) rename spring-activiti/src/main/java/com/{example => baeldung}/activitiwithspring/ActivitiController.java (97%) rename spring-activiti/src/main/java/com/{example => baeldung}/activitiwithspring/ActivitiWithSpringApplication.java (91%) rename spring-activiti/src/main/java/com/{example => baeldung}/activitiwithspring/TaskRepresentation.java (90%) rename spring-activiti/src/main/java/com/{example => baeldung}/activitiwithspring/servicetasks/SendEmailServiceTask.java (83%) rename spring-activiti/src/test/java/{org => com}/baeldung/SpringContextIntegrationTest.java (81%) rename spring-activiti/src/test/java/com/{example => baeldung}/activitiwithspring/ActivitiControllerIntegrationTest.java (97%) rename spring-activiti/src/test/java/com/{example => baeldung}/activitiwithspring/ActivitiSpringSecurityIntegrationTest.java (96%) rename spring-activiti/src/test/java/com/{example => baeldung}/activitiwithspring/ActivitiWithSpringApplicationIntegrationTest.java (89%) rename spring-activiti/src/test/java/com/{example => baeldung}/activitiwithspring/ProcessEngineCreationIntegrationTest.java (98%) rename spring-activiti/src/test/java/com/{example => baeldung}/activitiwithspring/ProcessExecutionIntegrationTest.java (99%) diff --git a/spring-activiti/pom.xml b/spring-activiti/pom.xml index 0a19f483c1..4e21c5b032 100644 --- a/spring-activiti/pom.xml +++ b/spring-activiti/pom.xml @@ -41,9 +41,21 @@ test + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.baeldung.activitiwithspring.ActivitiWithSpringApplication + + + + - com.example.activitiwithspring.ActivitiWithSpringApplication UTF-8 UTF-8 6.0.0 diff --git a/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiController.java b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/ActivitiController.java similarity index 97% rename from spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiController.java rename to spring-activiti/src/main/java/com/baeldung/activitiwithspring/ActivitiController.java index 96b551c03c..54dd4670f0 100644 --- a/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiController.java +++ b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/ActivitiController.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; diff --git a/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiWithSpringApplication.java b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/ActivitiWithSpringApplication.java similarity index 91% rename from spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiWithSpringApplication.java rename to spring-activiti/src/main/java/com/baeldung/activitiwithspring/ActivitiWithSpringApplication.java index a9cd1301eb..d43ae3cc35 100644 --- a/spring-activiti/src/main/java/com/example/activitiwithspring/ActivitiWithSpringApplication.java +++ b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/ActivitiWithSpringApplication.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-activiti/src/main/java/com/example/activitiwithspring/TaskRepresentation.java b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/TaskRepresentation.java similarity index 90% rename from spring-activiti/src/main/java/com/example/activitiwithspring/TaskRepresentation.java rename to spring-activiti/src/main/java/com/baeldung/activitiwithspring/TaskRepresentation.java index bb1412b057..de1ad88ba9 100644 --- a/spring-activiti/src/main/java/com/example/activitiwithspring/TaskRepresentation.java +++ b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/TaskRepresentation.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; class TaskRepresentation { diff --git a/spring-activiti/src/main/java/com/example/activitiwithspring/servicetasks/SendEmailServiceTask.java b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/servicetasks/SendEmailServiceTask.java similarity index 83% rename from spring-activiti/src/main/java/com/example/activitiwithspring/servicetasks/SendEmailServiceTask.java rename to spring-activiti/src/main/java/com/baeldung/activitiwithspring/servicetasks/SendEmailServiceTask.java index c11b48f37a..c174b6ae4a 100644 --- a/spring-activiti/src/main/java/com/example/activitiwithspring/servicetasks/SendEmailServiceTask.java +++ b/spring-activiti/src/main/java/com/baeldung/activitiwithspring/servicetasks/SendEmailServiceTask.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring.servicetasks; +package com.baeldung.activitiwithspring.servicetasks; import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.JavaDelegate; diff --git a/spring-activiti/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-activiti/src/test/java/com/baeldung/SpringContextIntegrationTest.java similarity index 81% rename from spring-activiti/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to spring-activiti/src/test/java/com/baeldung/SpringContextIntegrationTest.java index ae37e77f86..ce48080753 100644 --- a/spring-activiti/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ b/spring-activiti/src/test/java/com/baeldung/SpringContextIntegrationTest.java @@ -1,11 +1,11 @@ -package org.baeldung; +package com.baeldung; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import com.example.activitiwithspring.ActivitiWithSpringApplication; +import com.baeldung.activitiwithspring.ActivitiWithSpringApplication; @RunWith(SpringRunner.class) @SpringBootTest(classes = ActivitiWithSpringApplication.class) diff --git a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiControllerIntegrationTest.java b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiControllerIntegrationTest.java similarity index 97% rename from spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiControllerIntegrationTest.java rename to spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiControllerIntegrationTest.java index 65fd33bfc6..12c855e5ff 100644 --- a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiControllerIntegrationTest.java +++ b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiControllerIntegrationTest.java @@ -1,5 +1,6 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; +import com.baeldung.activitiwithspring.TaskRepresentation; import com.fasterxml.jackson.databind.ObjectMapper; import org.activiti.engine.RuntimeService; import org.activiti.engine.runtime.ProcessInstance; diff --git a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiSpringSecurityIntegrationTest.java b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiSpringSecurityIntegrationTest.java similarity index 96% rename from spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiSpringSecurityIntegrationTest.java rename to spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiSpringSecurityIntegrationTest.java index c2eeb96555..53bdcee888 100644 --- a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiSpringSecurityIntegrationTest.java +++ b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiSpringSecurityIntegrationTest.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; import org.activiti.engine.IdentityService; import org.junit.Test; diff --git a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiWithSpringApplicationIntegrationTest.java b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiWithSpringApplicationIntegrationTest.java similarity index 89% rename from spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiWithSpringApplicationIntegrationTest.java rename to spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiWithSpringApplicationIntegrationTest.java index 7460c302d8..8c1e400215 100644 --- a/spring-activiti/src/test/java/com/example/activitiwithspring/ActivitiWithSpringApplicationIntegrationTest.java +++ b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ActivitiWithSpringApplicationIntegrationTest.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-activiti/src/test/java/com/example/activitiwithspring/ProcessEngineCreationIntegrationTest.java b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ProcessEngineCreationIntegrationTest.java similarity index 98% rename from spring-activiti/src/test/java/com/example/activitiwithspring/ProcessEngineCreationIntegrationTest.java rename to spring-activiti/src/test/java/com/baeldung/activitiwithspring/ProcessEngineCreationIntegrationTest.java index 00afd14590..00538f8e6e 100644 --- a/spring-activiti/src/test/java/com/example/activitiwithspring/ProcessEngineCreationIntegrationTest.java +++ b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ProcessEngineCreationIntegrationTest.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; import org.activiti.engine.ProcessEngine; import org.activiti.engine.ProcessEngineConfiguration; diff --git a/spring-activiti/src/test/java/com/example/activitiwithspring/ProcessExecutionIntegrationTest.java b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ProcessExecutionIntegrationTest.java similarity index 99% rename from spring-activiti/src/test/java/com/example/activitiwithspring/ProcessExecutionIntegrationTest.java rename to spring-activiti/src/test/java/com/baeldung/activitiwithspring/ProcessExecutionIntegrationTest.java index 9c35ea413b..4342590ea9 100644 --- a/spring-activiti/src/test/java/com/example/activitiwithspring/ProcessExecutionIntegrationTest.java +++ b/spring-activiti/src/test/java/com/baeldung/activitiwithspring/ProcessExecutionIntegrationTest.java @@ -1,4 +1,4 @@ -package com.example.activitiwithspring; +package com.baeldung.activitiwithspring; import org.activiti.engine.ActivitiException; From bc8e2179e601a1836681562e785b4c1c16f9faef Mon Sep 17 00:00:00 2001 From: Ganesh Pagade Date: Sun, 21 Oct 2018 18:22:58 +0530 Subject: [PATCH 178/546] basic service with rate limit --- .../spring-cloud-zuul-throttling/pom.xml | 80 +++++++++++++++++++ .../ZuulRatelimitDemoApplication.java | 12 +++ .../controller/GreetingController.java | 23 ++++++ .../src/main/resources/application.yml | 23 ++++++ .../ZuulRatelimitDemoApplicationTests.java | 16 ++++ 5 files changed, 154 insertions(+) create mode 100644 spring-cloud/spring-cloud-zuul-throttling/pom.xml create mode 100644 spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java create mode 100644 spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java create mode 100644 spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml create mode 100644 spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java diff --git a/spring-cloud/spring-cloud-zuul-throttling/pom.xml b/spring-cloud/spring-cloud-zuul-throttling/pom.xml new file mode 100644 index 0000000000..180cc96f00 --- /dev/null +++ b/spring-cloud/spring-cloud-zuul-throttling/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + + com.baeldung.spring.cloud + zuul-ratelimit-demo + 0.0.1-SNAPSHOT + jar + + zuul-ratelimit-demo + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.0.6.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + Finchley.SR1 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-netflix-zuul + + + com.marcosbarbero.cloud + spring-cloud-zuul-ratelimit + LATEST + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java new file mode 100644 index 0000000000..18a779f976 --- /dev/null +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.spring.cloud.zuulratelimitdemo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ZuulRatelimitDemoApplication { + + public static void main(String[] args) { + SpringApplication.run(ZuulRatelimitDemoApplication.class, args); + } +} diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java new file mode 100644 index 0000000000..ed380d17ea --- /dev/null +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java @@ -0,0 +1,23 @@ +package com.baeldung.spring.cloud.zuulratelimitdemo.controller; + +import org.springframework.cloud.client.SpringCloudApplication; +import org.springframework.cloud.netflix.zuul.EnableZuulProxy; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@EnableZuulProxy +@SpringCloudApplication +@RequestMapping("/greeting") +public class GreetingController { + + @GetMapping("/simple") + public ResponseEntity serviceA() { + return ResponseEntity.ok("Hi!"); + } + + @GetMapping("/advanced") + public ResponseEntity serviceB() { + return ResponseEntity.ok("Hello, how you doing?"); + } +} diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml b/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml new file mode 100644 index 0000000000..d3afd34b2c --- /dev/null +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml @@ -0,0 +1,23 @@ +zuul: + routes: + serviceSimple: + path: /greeting/simple + url: forward:/ + serviceAdvanced: + path: /greeting/advanced + url: forward:/ + ratelimit: + enabled: true + repository: JPA + policy-list: + serviceSimple: + - limit: 1 + refresh-interval: 60 + type: + - origin + serviceAdvanced: + - limit: 1 + refresh-interval: 2 + type: + - origin + strip-prefix: true diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java new file mode 100644 index 0000000000..134d400b21 --- /dev/null +++ b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java @@ -0,0 +1,16 @@ +package com.baeldung.spring.cloud.zuulratelimitdemo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ZuulRatelimitDemoApplicationTests { + + @Test + public void contextLoads() { + } + +} From e9bc235b1c4917968531c2a9cb50043fe560108d Mon Sep 17 00:00:00 2001 From: Ganesh Pagade Date: Sun, 21 Oct 2018 19:10:30 +0530 Subject: [PATCH 179/546] added test --- .../controller/GreetingController.java | 7 +- .../ZuulRatelimitDemoApplicationTests.java | 16 --- .../controller/GreetingControllerTest.java | 98 +++++++++++++++++++ 3 files changed, 103 insertions(+), 18 deletions(-) delete mode 100644 spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java create mode 100644 spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java index ed380d17ea..4a27324b4d 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java @@ -11,13 +11,16 @@ import org.springframework.web.bind.annotation.RequestMapping; @RequestMapping("/greeting") public class GreetingController { + public static final String SIMPLE_RESPONSE = "Hi!"; + public static final String ADVANCED_RESPONSE = "Hello, how you doing?"; + @GetMapping("/simple") public ResponseEntity serviceA() { - return ResponseEntity.ok("Hi!"); + return ResponseEntity.ok(SIMPLE_RESPONSE); } @GetMapping("/advanced") public ResponseEntity serviceB() { - return ResponseEntity.ok("Hello, how you doing?"); + return ResponseEntity.ok(ADVANCED_RESPONSE); } } diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java deleted file mode 100644 index 134d400b21..0000000000 --- a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplicationTests.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.spring.cloud.zuulratelimitdemo; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class ZuulRatelimitDemoApplicationTests { - - @Test - public void contextLoads() { - } - -} diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java new file mode 100644 index 0000000000..6b6dba1704 --- /dev/null +++ b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java @@ -0,0 +1,98 @@ +package com.baeldung.spring.cloud.zuulratelimitdemo.controller; + +import static com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.RateLimitConstants.HEADER_LIMIT; +import static com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.RateLimitConstants.HEADER_QUOTA; +import static com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.RateLimitConstants.HEADER_REMAINING; +import static com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.RateLimitConstants.HEADER_REMAINING_QUOTA; +import static com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.RateLimitConstants.HEADER_RESET; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.springframework.http.HttpStatus.OK; +import static org.springframework.http.HttpStatus.TOO_MANY_REQUESTS; + +import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.junit4.SpringRunner; + +@AutoConfigureTestDatabase +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class GreetingControllerTest { + + private static final String SIMPLE_GREETING = "/greeting/simple"; + private static final String ADVANCED_GREETING = "/greeting/advanced"; + + @Autowired + private TestRestTemplate restTemplate; + + @Test + public void testNotExceedingCapacityRequest() { + ResponseEntity response = this.restTemplate.getForEntity(SIMPLE_GREETING, String.class); + HttpHeaders headers = response.getHeaders(); + String key = "rate-limit-application_serviceSimple_127.0.0.1"; + assertHeaders(headers, key, false, false); + assertEquals(OK, response.getStatusCode()); + } + + @Test + public void testExceedingCapacity() throws InterruptedException { + ResponseEntity response = this.restTemplate + .getForEntity(ADVANCED_GREETING, String.class); + HttpHeaders headers = response.getHeaders(); + String key = "rate-limit-application_serviceAdvanced_127.0.0.1"; + assertHeaders(headers, key, false, false); + assertEquals(OK, response.getStatusCode()); + + for (int i = 0; i < 2; i++) { + response = this.restTemplate.getForEntity(ADVANCED_GREETING, String.class); + } + + assertEquals(TOO_MANY_REQUESTS, response.getStatusCode()); + assertNotEquals(GreetingController.ADVANCED_RESPONSE, response.getBody()); + + TimeUnit.SECONDS.sleep(2); + + response = this.restTemplate.getForEntity(ADVANCED_GREETING, String.class); + headers = response.getHeaders(); + assertHeaders(headers, key, false, false); + assertEquals(OK, response.getStatusCode()); + } + + private void assertHeaders(HttpHeaders headers, String key, boolean nullable, + boolean quotaHeaders) { + String quota = headers.getFirst(HEADER_QUOTA + key); + String remainingQuota = headers.getFirst(HEADER_REMAINING_QUOTA + key); + String limit = headers.getFirst(HEADER_LIMIT + key); + String remaining = headers.getFirst(HEADER_REMAINING + key); + String reset = headers.getFirst(HEADER_RESET + key); + + if (nullable) { + if (quotaHeaders) { + assertNull(quota); + assertNull(remainingQuota); + } else { + assertNull(limit); + assertNull(remaining); + } + assertNull(reset); + } else { + if (quotaHeaders) { + assertNotNull(quota); + assertNotNull(remainingQuota); + } else { + assertNotNull(limit); + assertNotNull(remaining); + } + assertNotNull(reset); + } + } +} From a7276eb191eabaa52138388366c5e28c1e1f1584 Mon Sep 17 00:00:00 2001 From: Sjmillington Date: Sun, 21 Oct 2018 17:42:54 +0100 Subject: [PATCH 180/546] [BAEL-2256] Guide to simple date format unit tests --- .../SimpleDateFormatUnitTest.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java new file mode 100644 index 0000000000..ee994247a4 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java @@ -0,0 +1,59 @@ +package com.baeldung; + +import org.junit.Test; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; +import java.util.TimeZone; +import java.util.logging.Logger; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + + +public class SimpleDateFormatUnitTest { + + private static final Logger logger = Logger.getLogger(SimpleDateFormatUnitTest.class.getName()); + + @Test + public void givenSpecificDate_whenFormatted_checkFormatCorrect() throws Exception { + SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); + assertEquals("24-05-1977", formatter.format(new Date(233345223232L))); + } + + @Test + public void givenSpecificDate_whenFormattedUsingDateFormat_checkFormatCorrect() throws Exception { + DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT); + assertEquals("5/24/77", formatter.format(new Date(233345223232L))); + } + + @Test + public void givenStringDate_whenParsed_checkDateCorrect() throws Exception{ + SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); + Date myDate = new Date(233276400000L); + Date parsedDate = formatter.parse("24-05-1977"); + assertEquals(myDate.getTime(), parsedDate.getTime()); + } + + @Test + public void givenFranceLocale_whenFormatted_checkFormatCorrect() throws Exception{ + SimpleDateFormat franceDateFormatter = new SimpleDateFormat("EEEEE dd-MMMMMMM-yyyy", Locale.FRANCE); + Date myWednesday = new Date(1539341312904L); + assertTrue(franceDateFormatter.format(myWednesday).startsWith("vendredi")); + } + + @Test + public void given2TimeZones_whenFormatted_checkTimeDifference() throws Exception { + Date now = new Date(); + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE dd-MMM-yy HH:mm:ssZ"); + + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("Europe/London")); + logger.info(simpleDateFormat.format(now)); + //change the date format + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York")); + logger.info(simpleDateFormat.format(now)); + } +} From 06be85c4a183549f2bc6a6e99f35276014e0dafb Mon Sep 17 00:00:00 2001 From: Sam Millington Date: Sun, 21 Oct 2018 18:06:39 +0100 Subject: [PATCH 181/546] Added 'thens' to conform with given_when_then format --- .../simpledateformat/SimpleDateFormatUnitTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java index ee994247a4..ba4ea32e21 100644 --- a/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java +++ b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java @@ -18,19 +18,19 @@ public class SimpleDateFormatUnitTest { private static final Logger logger = Logger.getLogger(SimpleDateFormatUnitTest.class.getName()); @Test - public void givenSpecificDate_whenFormatted_checkFormatCorrect() throws Exception { + public void givenSpecificDate_whenFormatted_thenCheckFormatCorrect() throws Exception { SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); assertEquals("24-05-1977", formatter.format(new Date(233345223232L))); } @Test - public void givenSpecificDate_whenFormattedUsingDateFormat_checkFormatCorrect() throws Exception { + public void givenSpecificDate_whenFormattedUsingDateFormat_thenCheckFormatCorrect() throws Exception { DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT); assertEquals("5/24/77", formatter.format(new Date(233345223232L))); } @Test - public void givenStringDate_whenParsed_checkDateCorrect() throws Exception{ + public void givenStringDate_whenParsed_thenCheckDateCorrect() throws Exception{ SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); Date myDate = new Date(233276400000L); Date parsedDate = formatter.parse("24-05-1977"); @@ -38,14 +38,14 @@ public class SimpleDateFormatUnitTest { } @Test - public void givenFranceLocale_whenFormatted_checkFormatCorrect() throws Exception{ + public void givenFranceLocale_whenFormatted_thenCheckFormatCorrect() throws Exception{ SimpleDateFormat franceDateFormatter = new SimpleDateFormat("EEEEE dd-MMMMMMM-yyyy", Locale.FRANCE); Date myWednesday = new Date(1539341312904L); assertTrue(franceDateFormatter.format(myWednesday).startsWith("vendredi")); } @Test - public void given2TimeZones_whenFormatted_checkTimeDifference() throws Exception { + public void given2TimeZones_whenFormatted_thenCheckTimeDifference() throws Exception { Date now = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE dd-MMM-yy HH:mm:ssZ"); From 2c6635bef2f5ead9c938af231a31b78674a2f924 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Sun, 21 Oct 2018 23:58:43 +0530 Subject: [PATCH 182/546] BAEL-2262 Added code for demonstration of HTTPS enabled Spring Boot Application --- spring-security-mvc-boot/pom.xml | 6 +- .../baeldung/ssl/HttpsEnabledApplication.java | 14 ++++ .../java/org/baeldung/ssl/SecurityConfig.java | 36 ++++++++++ .../org/baeldung/ssl/WelcomeController.java | 15 ++++ .../main/resources/application-ssl.properties | 20 ++++++ .../src/main/resources/keystore/baeldung.p12 | Bin 0 -> 2603 bytes .../main/resources/templates/ssl/welcome.html | 1 + .../web/HttpsApplicationIntegrationTest.java | 67 ++++++++++++++++++ 8 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java create mode 100644 spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java create mode 100644 spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java create mode 100644 spring-security-mvc-boot/src/main/resources/application-ssl.properties create mode 100644 spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 create mode 100644 spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html create mode 100644 spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-mvc-boot/pom.xml index 4090beab99..d2316ddca5 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-mvc-boot/pom.xml @@ -229,12 +229,16 @@ - + + + 1.1.2 1.2 1.6.1 2.6.11 + 1.8 diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java new file mode 100644 index 0000000000..70fe30abdc --- /dev/null +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java @@ -0,0 +1,14 @@ +package org.baeldung.ssl; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class HttpsEnabledApplication { + + public static void main(String... args) { + SpringApplication application = new SpringApplication(HttpsEnabledApplication.class); + application.setAdditionalProfiles("ssl"); + application.run(args); + } +} diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java new file mode 100644 index 0000000000..98a59b11bb --- /dev/null +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java @@ -0,0 +1,36 @@ +package org.baeldung.ssl; + +import org.springframework.context.annotation.Bean; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; + +@EnableWebSecurity +public class SecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + public void configure(AuthenticationManagerBuilder auth) throws Exception { + + auth.inMemoryAuthentication() + .withUser("memuser") + .password(passwordEncoder().encode("pass")) + .roles("USER"); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.httpBasic() + .and() + .authorizeRequests() + .antMatchers("/**") + .authenticated(); + } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java new file mode 100644 index 0000000000..72ad8abb85 --- /dev/null +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java @@ -0,0 +1,15 @@ +package org.baeldung.ssl; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +public class WelcomeController { + + @GetMapping("/welcome") + public String welcome() { + return "ssl/welcome"; + } + +} diff --git a/spring-security-mvc-boot/src/main/resources/application-ssl.properties b/spring-security-mvc-boot/src/main/resources/application-ssl.properties new file mode 100644 index 0000000000..090b775d03 --- /dev/null +++ b/spring-security-mvc-boot/src/main/resources/application-ssl.properties @@ -0,0 +1,20 @@ + +http.port=8080 + +server.port=8443 + +security.require-ssl=true + +# The format used for the keystore +server.ssl.key-store-type=PKCS12 +# The path to the keystore containing the certificate +server.ssl.key-store=classpath:keystore/baeldung.p12 +# The password used to generate the certificate +server.ssl.key-store-password=password +# The alias mapped to the certificate +server.ssl.key-alias=baeldung + +#trust store location +trust.store=classpath:keystore/baeldung.p12 +#trust store password +trust.store.password=password diff --git a/spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 b/spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 new file mode 100644 index 0000000000000000000000000000000000000000..cd8eb284297009e987aa1a1d6b53c48af587776e GIT binary patch literal 2603 zcmY+EXEYlM8^;r3M9o+w1hFbbqGHbuyEIm+snTk!hO1FpR7GP|aZ6j;auK8UtQAG7 zV$YhT2qmc9Vcsg&`=0l`_uLQ9dCvL$|IhRBhaz(+vH)38WbiCI7!hqAy~_jS08+@{ zK@b_-cZ|DGWH#S_MQko0G8^s~V~@v<{lx#SxVeBV6f)>1iVWICDY0|?A0I!5f`s^3 zu&dJJ6F~Z?bJm7OhKe^z>^=)CfQ|u?L7h6GkAgI65DwJB{KM&_MXKTI9lIqxhN`1} z`A*KRClYJWaEY_s^N|voc6A00ThR7qHjQvZX+gn$-BvCy^h*XXd@(9FFl&uIA(ye3~t$x%OvdtZ6kea z?f2mYKd}#kcfP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q3PJ)r!`Io^PGnnr+kk7{UX+IJgRt#f%T8fU$?%w|Vop*RwEGqa{ z(WG3c0FW|}N4&}s$|j#RGGV2oSE>W{OZ@E-b47trP;YC$ z=vPW$1m1o3sc292)J35Y(%$!P4;0VKD5xumEa}b>FU(NpzSChk7S=$(X973=-bj9{y};Q81=IyKM8_P=YATS4wxXidLc;YHIX!VEoy)KSNh5GdGhbD-AIfz3o9_1@)sB) B#c}`u literal 0 HcmV?d00001 diff --git a/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html b/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html new file mode 100644 index 0000000000..93b3577f5c --- /dev/null +++ b/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html @@ -0,0 +1 @@ +

Welcome to Secured Site

\ No newline at end of file diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java new file mode 100644 index 0000000000..63b421604a --- /dev/null +++ b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java @@ -0,0 +1,67 @@ +package org.baeldung.web; + +import org.apache.http.client.HttpClient; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; +import org.baeldung.ssl.HttpsEnabledApplication; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.core.io.Resource; +import org.springframework.http.*; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.client.RestTemplate; + +import javax.net.ssl.SSLContext; +import java.util.Base64; + +import static org.junit.Assert.assertEquals; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = HttpsEnabledApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@ActiveProfiles("ssl") +public class HttpsApplicationIntegrationTest { + + private static final String WELCOME_URL = "https://localhost:8443/welcome"; + + @Value("${trust.store}") + private Resource trustStore; + + @Value("${trust.store.password}") + private String trustStorePassword; + + @Test + public void whenGETanHTTPSResource_thenCorrectResponse() throws Exception { + ResponseEntity response = restTemplate().exchange(WELCOME_URL, HttpMethod.GET, new HttpEntity(withAuthorization("memuser", "pass")), String.class); + + assertEquals("

Welcome to Secured Site

", response.getBody()); + assertEquals(HttpStatus.OK, response.getStatusCode()); + } + + RestTemplate restTemplate() throws Exception { + SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(trustStore.getURL(), trustStorePassword.toCharArray()) + .build(); + SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext); + HttpClient httpClient = HttpClients.custom() + .setSSLSocketFactory(socketFactory) + .build(); + HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient); + return new RestTemplate(factory); + } + + HttpHeaders withAuthorization(String userName, String password) { + return new HttpHeaders() { + { + String auth = userName + ":" + password; + String authHeader = "Basic " + new String(Base64.getEncoder() + .encode(auth.getBytes())); + set("Authorization", authHeader); + } + }; + } + +} From 277898ac24a3088b2adaaf6c6b71a1b59c5e64eb Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 21 Oct 2018 21:37:25 +0300 Subject: [PATCH 183/546] update zonedatetime test --- .../zoneddatetime/ZonedDateTimeUnitTest.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java b/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java index 355fef35c6..c95d1a1203 100644 --- a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java +++ b/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java @@ -1,19 +1,22 @@ package com.baeldung.zoneddatetime; +import static org.junit.jupiter.api.Assertions.assertThrows; + import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.logging.Logger; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ZonedDateTimeUnitTest { private static final Logger log = Logger.getLogger(ZonedDateTimeUnitTest.class.getName()); @Test - public void testZonedDateTimeToString() { + public void givenZonedDateTime_whenConvertToString_thenOk() { ZonedDateTime zonedDateTimeNow = ZonedDateTime.now(ZoneId.of("UTC")); ZonedDateTime zonedDateTimeOf = ZonedDateTime.of(2018, 01, 01, 0, 0, 0, 0, ZoneId.of("UTC")); @@ -33,9 +36,21 @@ public class ZonedDateTimeUnitTest { } @Test - public void testZonedDateTimeFromString() { + public void givenString_whenParseZonedDateTime_thenOk() { + ZonedDateTime zonedDateTime = ZonedDateTime.parse("2011-12-03T10:15:30+01:00"); - ZonedDateTime zonedDateTime = ZonedDateTime.parse("2011-12-03T10:15:30+01:00", DateTimeFormatter.ISO_ZONED_DATE_TIME); + log.info(zonedDateTime.format(DateTimeFormatter.ISO_ZONED_DATE_TIME)); + } + + @Test + public void givenString_whenParseZonedDateTimeWithoutZone_thenException() { + assertThrows(DateTimeParseException.class, () -> ZonedDateTime.parse("2011-12-03T10:15:30", DateTimeFormatter.ISO_DATE_TIME)); + } + + @Test + public void givenString_whenParseLocalDateTimeAtZone_thenOk() { + ZoneId timeZone = ZoneId.systemDefault(); + ZonedDateTime zonedDateTime = LocalDateTime.parse("2011-12-03T10:15:30", DateTimeFormatter.ISO_DATE_TIME).atZone(timeZone); log.info(zonedDateTime.format(DateTimeFormatter.ISO_ZONED_DATE_TIME)); } From d67ad2151bcadca931f0cc88eb94c886d36c328c Mon Sep 17 00:00:00 2001 From: sandy03934 Date: Mon, 22 Oct 2018 01:11:25 +0530 Subject: [PATCH 184/546] BAEL-2262 Demo Spring Boot App for HTTPS enabled. (#5513) * BAEL-1979 Added examples for SnakeYAML Library * BAEL-1979 Moved the snakeyaml related code to libraries module * BAEL-1979 Removed the System.out.println() statements and converted the assertTrue to assertEquals wherever possible. * BAEL-1979 Removed println statements, small formatting fix in pom.xml * BAEL-1466 Added a new module for apache-geode * BAEL-1466 Updated the Integration Tests. * BAEL-1466 Updated the Integration Tests. * BAEL-1466 Updated the Integration Tests. * BAEL-1466 Removed the Unnecessary code. * BAEL-2262 Added code for demonstration of HTTPS enabled Spring Boot Application --- spring-security-mvc-boot/pom.xml | 6 +- .../baeldung/ssl/HttpsEnabledApplication.java | 14 ++++ .../java/org/baeldung/ssl/SecurityConfig.java | 36 ++++++++++ .../org/baeldung/ssl/WelcomeController.java | 15 ++++ .../main/resources/application-ssl.properties | 20 ++++++ .../src/main/resources/keystore/baeldung.p12 | Bin 0 -> 2603 bytes .../main/resources/templates/ssl/welcome.html | 1 + .../web/HttpsApplicationIntegrationTest.java | 67 ++++++++++++++++++ 8 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java create mode 100644 spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java create mode 100644 spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java create mode 100644 spring-security-mvc-boot/src/main/resources/application-ssl.properties create mode 100644 spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 create mode 100644 spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html create mode 100644 spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-mvc-boot/pom.xml index 4090beab99..d2316ddca5 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-mvc-boot/pom.xml @@ -229,12 +229,16 @@ - + + + 1.1.2 1.2 1.6.1 2.6.11 + 1.8 diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java new file mode 100644 index 0000000000..70fe30abdc --- /dev/null +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java @@ -0,0 +1,14 @@ +package org.baeldung.ssl; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class HttpsEnabledApplication { + + public static void main(String... args) { + SpringApplication application = new SpringApplication(HttpsEnabledApplication.class); + application.setAdditionalProfiles("ssl"); + application.run(args); + } +} diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java new file mode 100644 index 0000000000..98a59b11bb --- /dev/null +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java @@ -0,0 +1,36 @@ +package org.baeldung.ssl; + +import org.springframework.context.annotation.Bean; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; + +@EnableWebSecurity +public class SecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + public void configure(AuthenticationManagerBuilder auth) throws Exception { + + auth.inMemoryAuthentication() + .withUser("memuser") + .password(passwordEncoder().encode("pass")) + .roles("USER"); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.httpBasic() + .and() + .authorizeRequests() + .antMatchers("/**") + .authenticated(); + } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java new file mode 100644 index 0000000000..72ad8abb85 --- /dev/null +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java @@ -0,0 +1,15 @@ +package org.baeldung.ssl; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +public class WelcomeController { + + @GetMapping("/welcome") + public String welcome() { + return "ssl/welcome"; + } + +} diff --git a/spring-security-mvc-boot/src/main/resources/application-ssl.properties b/spring-security-mvc-boot/src/main/resources/application-ssl.properties new file mode 100644 index 0000000000..090b775d03 --- /dev/null +++ b/spring-security-mvc-boot/src/main/resources/application-ssl.properties @@ -0,0 +1,20 @@ + +http.port=8080 + +server.port=8443 + +security.require-ssl=true + +# The format used for the keystore +server.ssl.key-store-type=PKCS12 +# The path to the keystore containing the certificate +server.ssl.key-store=classpath:keystore/baeldung.p12 +# The password used to generate the certificate +server.ssl.key-store-password=password +# The alias mapped to the certificate +server.ssl.key-alias=baeldung + +#trust store location +trust.store=classpath:keystore/baeldung.p12 +#trust store password +trust.store.password=password diff --git a/spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 b/spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 new file mode 100644 index 0000000000000000000000000000000000000000..cd8eb284297009e987aa1a1d6b53c48af587776e GIT binary patch literal 2603 zcmY+EXEYlM8^;r3M9o+w1hFbbqGHbuyEIm+snTk!hO1FpR7GP|aZ6j;auK8UtQAG7 zV$YhT2qmc9Vcsg&`=0l`_uLQ9dCvL$|IhRBhaz(+vH)38WbiCI7!hqAy~_jS08+@{ zK@b_-cZ|DGWH#S_MQko0G8^s~V~@v<{lx#SxVeBV6f)>1iVWICDY0|?A0I!5f`s^3 zu&dJJ6F~Z?bJm7OhKe^z>^=)CfQ|u?L7h6GkAgI65DwJB{KM&_MXKTI9lIqxhN`1} z`A*KRClYJWaEY_s^N|voc6A00ThR7qHjQvZX+gn$-BvCy^h*XXd@(9FFl&uIA(ye3~t$x%Ovdt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{296 zn)bo1Ypxj{s&Zq3PJ)r!`Io^PGnnr+kk7{UX+IJgRt#f%T8fU$?%w|Vop*RwEGqa{ z(WG3c0FW|}N4&}s$|j#RGGV2oSE>W{OZ@E-b47trP;YC$ z=vPW$1m1o3sc292)J35Y(%$!P4;0VKD5xumEa}b>FU(NpzSChk7S=$(X973=-bj9{y};Q81=IyKM8_P=YATS4wxXidLc;YHIX!VEoy)KSNh5GdGhbD-AIfz3o9_1@)sB) B#c}`u literal 0 HcmV?d00001 diff --git a/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html b/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html new file mode 100644 index 0000000000..93b3577f5c --- /dev/null +++ b/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html @@ -0,0 +1 @@ +

Welcome to Secured Site

\ No newline at end of file diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java new file mode 100644 index 0000000000..63b421604a --- /dev/null +++ b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java @@ -0,0 +1,67 @@ +package org.baeldung.web; + +import org.apache.http.client.HttpClient; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; +import org.baeldung.ssl.HttpsEnabledApplication; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.core.io.Resource; +import org.springframework.http.*; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.client.RestTemplate; + +import javax.net.ssl.SSLContext; +import java.util.Base64; + +import static org.junit.Assert.assertEquals; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = HttpsEnabledApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@ActiveProfiles("ssl") +public class HttpsApplicationIntegrationTest { + + private static final String WELCOME_URL = "https://localhost:8443/welcome"; + + @Value("${trust.store}") + private Resource trustStore; + + @Value("${trust.store.password}") + private String trustStorePassword; + + @Test + public void whenGETanHTTPSResource_thenCorrectResponse() throws Exception { + ResponseEntity response = restTemplate().exchange(WELCOME_URL, HttpMethod.GET, new HttpEntity(withAuthorization("memuser", "pass")), String.class); + + assertEquals("

Welcome to Secured Site

", response.getBody()); + assertEquals(HttpStatus.OK, response.getStatusCode()); + } + + RestTemplate restTemplate() throws Exception { + SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(trustStore.getURL(), trustStorePassword.toCharArray()) + .build(); + SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext); + HttpClient httpClient = HttpClients.custom() + .setSSLSocketFactory(socketFactory) + .build(); + HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient); + return new RestTemplate(factory); + } + + HttpHeaders withAuthorization(String userName, String password) { + return new HttpHeaders() { + { + String auth = userName + ":" + password; + String authHeader = "Basic " + new String(Base64.getEncoder() + .encode(auth.getBytes())); + set("Authorization", authHeader); + } + }; + } + +} From 0ee48a7d92d100a6164ee425abdb0dfdde1b4745 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Mon, 22 Oct 2018 09:05:47 +0530 Subject: [PATCH 185/546] BAEL-2262 Removed the Basic Authentication from the HttpsEnabledApplication. --- .../java/org/baeldung/ssl/SecurityConfig.java | 26 +++---------------- .../web/HttpsApplicationIntegrationTest.java | 19 +++----------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java index 98a59b11bb..92f92d8fc7 100644 --- a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java @@ -1,36 +1,16 @@ package org.baeldung.ssl; -import org.springframework.context.annotation.Bean; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { - @Override - public void configure(AuthenticationManagerBuilder auth) throws Exception { - - auth.inMemoryAuthentication() - .withUser("memuser") - .password(passwordEncoder().encode("pass")) - .roles("USER"); - } - @Override protected void configure(HttpSecurity http) throws Exception { - http.httpBasic() - .and() - .authorizeRequests() - .antMatchers("/**") - .authenticated(); - } - - @Bean - public PasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); + http.authorizeRequests() + .antMatchers("/**") + .permitAll(); } } diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java index 63b421604a..fe7883ec94 100644 --- a/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java +++ b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java @@ -10,14 +10,15 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.core.io.Resource; -import org.springframework.http.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.client.RestTemplate; import javax.net.ssl.SSLContext; -import java.util.Base64; +import java.util.Collections; import static org.junit.Assert.assertEquals; @@ -36,7 +37,7 @@ public class HttpsApplicationIntegrationTest { @Test public void whenGETanHTTPSResource_thenCorrectResponse() throws Exception { - ResponseEntity response = restTemplate().exchange(WELCOME_URL, HttpMethod.GET, new HttpEntity(withAuthorization("memuser", "pass")), String.class); + ResponseEntity response = restTemplate().getForEntity(WELCOME_URL, String.class, Collections.emptyMap()); assertEquals("

Welcome to Secured Site

", response.getBody()); assertEquals(HttpStatus.OK, response.getStatusCode()); @@ -52,16 +53,4 @@ public class HttpsApplicationIntegrationTest { HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient); return new RestTemplate(factory); } - - HttpHeaders withAuthorization(String userName, String password) { - return new HttpHeaders() { - { - String auth = userName + ":" + password; - String authHeader = "Basic " + new String(Base64.getEncoder() - .encode(auth.getBytes())); - set("Authorization", authHeader); - } - }; - } - } From daa1de25a2d346d6a5cb7043c5023e4c2cf11282 Mon Sep 17 00:00:00 2001 From: Pranay jain Date: Thu, 18 Oct 2018 12:59:24 +0530 Subject: [PATCH 186/546] BAEL-2236: Reading a CSV file into a array --- core-java-io/pom.xml | 8 +- .../baeldung/csv/ReadCSVInArrayUnitTest.java | 106 ++++++++++++++++++ core-java-io/src/test/resources/book.csv | 2 + 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 core-java-io/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java create mode 100644 core-java-io/src/test/resources/book.csv diff --git a/core-java-io/pom.xml b/core-java-io/pom.xml index cf3e950cb8..efa32b8e3e 100644 --- a/core-java-io/pom.xml +++ b/core-java-io/pom.xml @@ -154,6 +154,12 @@ async-http-client ${async-http-client.version} + + com.opencsv + opencsv + ${opencsv.version} + test + @@ -247,7 +253,7 @@ 1.13 0.6.5 0.9.0 - + 4.1 3.6.1 1.7.0 diff --git a/core-java-io/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java b/core-java-io/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java new file mode 100644 index 0000000000..2593eee82b --- /dev/null +++ b/core-java-io/src/test/java/com/baeldung/csv/ReadCSVInArrayUnitTest.java @@ -0,0 +1,106 @@ +package com.baeldung.csv; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Scanner; + +import org.junit.Assert; +import org.junit.Test; + +import com.opencsv.CSVReader; + +public class ReadCSVInArrayUnitTest { + public static final String COMMA_DELIMITER = ","; + public static final String CSV_FILE = "src/test/resources/book.csv"; + public static final List> EXPECTED_ARRAY = Collections.unmodifiableList(new ArrayList>() { + { + add(new ArrayList() { + { + add("Mary Kom"); + add("Unbreakable"); + } + }); + add(new ArrayList() { + { + add("Kapil Isapuari"); + add("Farishta"); + } + }); + } + }); + + @Test + public void givenCSVFile_whenBufferedReader_thenContentsAsExpected() throws IOException { + List> records = new ArrayList>(); + try (BufferedReader br = new BufferedReader(new FileReader(CSV_FILE))) { + String line = ""; + while ((line = br.readLine()) != null) { + String[] values = line.split(COMMA_DELIMITER); + records.add(Arrays.asList(values)); + } + } catch (Exception e) { + e.printStackTrace(); + } + for (int i = 0; i < EXPECTED_ARRAY.size(); i++) { + Assert.assertArrayEquals(EXPECTED_ARRAY.get(i) + .toArray(), + records.get(i) + .toArray()); + } + } + + @Test + public void givenCSVFile_whenScanner_thenContentsAsExpected() throws IOException { + List> records = new ArrayList>(); + try (Scanner scanner = new Scanner(new File(CSV_FILE));) { + while (scanner.hasNextLine()) { + records.add(getRecordFromLine(scanner.nextLine())); + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + for (int i = 0; i < EXPECTED_ARRAY.size(); i++) { + Assert.assertArrayEquals(EXPECTED_ARRAY.get(i) + .toArray(), + records.get(i) + .toArray()); + } + } + + private List getRecordFromLine(String line) { + List values = new ArrayList(); + try (Scanner rowScanner = new Scanner(line)) { + rowScanner.useDelimiter(COMMA_DELIMITER); + while (rowScanner.hasNext()) { + values.add(rowScanner.next()); + } + } + return values; + } + + @Test + public void givenCSVFile_whenOpencsv_thenContentsAsExpected() throws IOException { + List> records = new ArrayList>(); + try (CSVReader csvReader = new CSVReader(new FileReader(CSV_FILE));) { + String[] values = null; + while ((values = csvReader.readNext()) != null) { + records.add(Arrays.asList(values)); + } + } catch (Exception e) { + e.printStackTrace(); + } + for (int i = 0; i < EXPECTED_ARRAY.size(); i++) { + Assert.assertArrayEquals(EXPECTED_ARRAY.get(i) + .toArray(), + records.get(i) + .toArray()); + } + } +} diff --git a/core-java-io/src/test/resources/book.csv b/core-java-io/src/test/resources/book.csv new file mode 100644 index 0000000000..b7c4b80499 --- /dev/null +++ b/core-java-io/src/test/resources/book.csv @@ -0,0 +1,2 @@ +Mary Kom,Unbreakable +Kapil Isapuari,Farishta \ No newline at end of file From 6fa2361283915ab562115dc7bc0b28b563206e41 Mon Sep 17 00:00:00 2001 From: DomWos Date: Mon, 22 Oct 2018 11:51:37 +0200 Subject: [PATCH 187/546] Fixes according to comments. --- .../java/com/baeldung/storm/bolt/FileWritingBolt.java | 10 ++++++++++ .../com/baeldung/storm/spout/RandomNumberSpout.java | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java index 40ed72164d..339e0dc055 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/FileWritingBolt.java @@ -22,6 +22,7 @@ public class FileWritingBolt extends BaseRichBolt { private BufferedWriter writer; private String filePath; private ObjectMapper objectMapper; + @Override public void prepare(Map map, TopologyContext topologyContext, OutputCollector outputCollector) { objectMapper = new ObjectMapper(); @@ -55,6 +56,15 @@ public class FileWritingBolt extends BaseRichBolt { this.filePath = filePath; } + @Override + public void cleanup() { + try { + writer.close(); + } catch (IOException e) { + logger.error("Failed to close the writer!"); + } + } + @Override public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { diff --git a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java index 371a61720a..26fb1d82c0 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java +++ b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java @@ -26,7 +26,7 @@ public class RandomNumberSpout extends BaseRichSpout { public void nextTuple() { Utils.sleep(1000); //This will select random int from the range (-1000, 1000) - int operation = random.nextInt(1000 + 1 + 1000) - 1000; + int operation = random.nextInt(101); long timestamp = System.currentTimeMillis(); Values values = new Values(operation, timestamp); From aed1514c0b73bd0e00e11e7de6b4fa65842935e2 Mon Sep 17 00:00:00 2001 From: DomWos Date: Mon, 22 Oct 2018 11:54:39 +0200 Subject: [PATCH 188/546] Filtering fix. --- .../src/main/java/com/baeldung/storm/bolt/FilteringBolt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java b/libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java index a2e80deb33..564076a1df 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java +++ b/libraries-data/src/main/java/com/baeldung/storm/bolt/FilteringBolt.java @@ -10,7 +10,7 @@ public class FilteringBolt extends BaseBasicBolt { @Override public void execute(Tuple tuple, BasicOutputCollector basicOutputCollector) { int operation = tuple.getIntegerByField("operation"); - if(operation >= 0 ) { + if(operation > 0 ) { basicOutputCollector.emit(tuple.getValues()); } } From 87153bd9ff329f5505bb36f8b75acb28d54ff18f Mon Sep 17 00:00:00 2001 From: Ganesh Pagade Date: Mon, 22 Oct 2018 19:11:40 +0530 Subject: [PATCH 189/546] minor changes --- .../src/main/resources/application.yml | 2 +- .../controller/GreetingControllerTest.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml b/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml index d3afd34b2c..884ee9446e 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml @@ -11,7 +11,7 @@ zuul: repository: JPA policy-list: serviceSimple: - - limit: 1 + - limit: 5 refresh-interval: 60 type: - origin diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java index 6b6dba1704..360d005c43 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java +++ b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java @@ -35,7 +35,7 @@ public class GreetingControllerTest { private TestRestTemplate restTemplate; @Test - public void testNotExceedingCapacityRequest() { + public void whenRequestNotExceedingCapacity_thenReturnOkResponse() { ResponseEntity response = this.restTemplate.getForEntity(SIMPLE_GREETING, String.class); HttpHeaders headers = response.getHeaders(); String key = "rate-limit-application_serviceSimple_127.0.0.1"; @@ -44,7 +44,7 @@ public class GreetingControllerTest { } @Test - public void testExceedingCapacity() throws InterruptedException { + public void whenRequestExceedingCapacity_thenReturnTooManyRequestsResponse() throws InterruptedException { ResponseEntity response = this.restTemplate .getForEntity(ADVANCED_GREETING, String.class); HttpHeaders headers = response.getHeaders(); @@ -95,4 +95,6 @@ public class GreetingControllerTest { assertNotNull(reset); } } + + } From eaadcf96e2b0d2ff4a518d85a7ae78848cf77a4a Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Mon, 22 Oct 2018 16:36:27 +0200 Subject: [PATCH 190/546] BAEL-2292 --- .../com/baeldung/datetime/DateTimeConfig.java | 29 +++++++++++++++++++ .../baeldung/datetime/DateTimeController.java | 29 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java create mode 100644 spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java diff --git a/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java new file mode 100644 index 0000000000..8a5d1c71af --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java @@ -0,0 +1,29 @@ +package com.baeldung.datetime; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.format.number.NumberFormatAnnotationFormatterFactory; +import org.springframework.format.support.DefaultFormattingConversionService; +import org.springframework.format.support.FormattingConversionService; + +import java.time.format.DateTimeFormatter; + +@Configuration +class DateTimeConfig { + + @Bean + public FormattingConversionService conversionService() { + DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(false); + + conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory()); + + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setDateFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy")); + registrar.setDateTimeFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss")); + registrar.registerFormatters(conversionService); + + return conversionService; + } + +} \ No newline at end of file diff --git a/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java new file mode 100644 index 0000000000..5741b35530 --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java @@ -0,0 +1,29 @@ +package com.baeldung.datetime; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; + +@RestController +public class DateTimeController { + + @PostMapping("/date") + public void date(@RequestParam("date") @DateTimeFormat(pattern = "dd.MM.yyyy") Date date) { + // ... + } + + @PostMapping("/localdate") + public void localDate(@RequestParam("localDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate localDate) { + // ... + } + + @PostMapping("/localdatetime") + public void dateTime(@RequestParam("localDateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime localDateTime) { + // ... + } +} \ No newline at end of file From c533462382afb1c0ffe95c72ab888583062c4a5f Mon Sep 17 00:00:00 2001 From: sandy03934 Date: Mon, 22 Oct 2018 21:08:39 +0530 Subject: [PATCH 191/546] Bael 2262 : Removed the basic authentication from HTTPS Enabled Application (#5516) * BAEL-1979 Added examples for SnakeYAML Library * BAEL-1979 Moved the snakeyaml related code to libraries module * BAEL-1979 Removed the System.out.println() statements and converted the assertTrue to assertEquals wherever possible. * BAEL-1979 Removed println statements, small formatting fix in pom.xml * BAEL-1466 Added a new module for apache-geode * BAEL-1466 Updated the Integration Tests. * BAEL-1466 Updated the Integration Tests. * BAEL-1466 Updated the Integration Tests. * BAEL-1466 Removed the Unnecessary code. * BAEL-2262 Added code for demonstration of HTTPS enabled Spring Boot Application * BAEL-2262 Removed the Basic Authentication from the HttpsEnabledApplication. --- .../java/org/baeldung/ssl/SecurityConfig.java | 26 +++---------------- .../web/HttpsApplicationIntegrationTest.java | 19 +++----------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java index 98a59b11bb..92f92d8fc7 100644 --- a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java +++ b/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java @@ -1,36 +1,16 @@ package org.baeldung.ssl; -import org.springframework.context.annotation.Bean; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { - @Override - public void configure(AuthenticationManagerBuilder auth) throws Exception { - - auth.inMemoryAuthentication() - .withUser("memuser") - .password(passwordEncoder().encode("pass")) - .roles("USER"); - } - @Override protected void configure(HttpSecurity http) throws Exception { - http.httpBasic() - .and() - .authorizeRequests() - .antMatchers("/**") - .authenticated(); - } - - @Bean - public PasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); + http.authorizeRequests() + .antMatchers("/**") + .permitAll(); } } diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java index 63b421604a..fe7883ec94 100644 --- a/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java +++ b/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java @@ -10,14 +10,15 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.core.io.Resource; -import org.springframework.http.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.client.RestTemplate; import javax.net.ssl.SSLContext; -import java.util.Base64; +import java.util.Collections; import static org.junit.Assert.assertEquals; @@ -36,7 +37,7 @@ public class HttpsApplicationIntegrationTest { @Test public void whenGETanHTTPSResource_thenCorrectResponse() throws Exception { - ResponseEntity response = restTemplate().exchange(WELCOME_URL, HttpMethod.GET, new HttpEntity(withAuthorization("memuser", "pass")), String.class); + ResponseEntity response = restTemplate().getForEntity(WELCOME_URL, String.class, Collections.emptyMap()); assertEquals("

Welcome to Secured Site

", response.getBody()); assertEquals(HttpStatus.OK, response.getStatusCode()); @@ -52,16 +53,4 @@ public class HttpsApplicationIntegrationTest { HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient); return new RestTemplate(factory); } - - HttpHeaders withAuthorization(String userName, String password) { - return new HttpHeaders() { - { - String auth = userName + ":" + password; - String authHeader = "Basic " + new String(Base64.getEncoder() - .encode(auth.getBytes())); - set("Authorization", authHeader); - } - }; - } - } From 906082b26f19143c1277ce43d8de68e0befdb0f4 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Mon, 22 Oct 2018 20:05:17 +0300 Subject: [PATCH 192/546] fix formating --- .../com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java b/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java index c95d1a1203..65f63bc787 100644 --- a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java +++ b/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java @@ -24,10 +24,10 @@ public class ZonedDateTimeUnitTest { LocalDateTime localDateTime = LocalDateTime.now(); ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, ZoneId.of("UTC")); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy - hh:mm:ss Z"); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy - HH:mm:ss Z"); String formattedString = zonedDateTime.format(formatter); - DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("MM/dd/yyyy - hh:mm:ss z"); + DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("MM/dd/yyyy - HH:mm:ss z"); String formattedString2 = zonedDateTime.format(formatter2); log.info(formattedString); From 38e9149af6841dea55ce9b3fb9f93da85b4a6a05 Mon Sep 17 00:00:00 2001 From: DOHA Date: Mon, 22 Oct 2018 22:39:07 +0300 Subject: [PATCH 193/546] httpOnly session --- .../org/baeldung/security/SessionFilter.java | 45 +++++++++++++++++++ .../src/main/webapp/WEB-INF/web.xml | 13 ++++++ 2 files changed, 58 insertions(+) create mode 100644 spring-security-mvc-session/src/main/java/org/baeldung/security/SessionFilter.java diff --git a/spring-security-mvc-session/src/main/java/org/baeldung/security/SessionFilter.java b/spring-security-mvc-session/src/main/java/org/baeldung/security/SessionFilter.java new file mode 100644 index 0000000000..d37d46e478 --- /dev/null +++ b/spring-security-mvc-session/src/main/java/org/baeldung/security/SessionFilter.java @@ -0,0 +1,45 @@ +package org.baeldung.security; + +import java.io.IOException; +import java.util.Arrays; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class SessionFilter implements Filter{ + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + System.out.println("init filter"); + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + HttpServletRequest req = (HttpServletRequest) request; + HttpServletResponse res = (HttpServletResponse) response; + Cookie[] allCookies = req.getCookies(); + if (allCookies != null) { + Cookie session = Arrays.stream(allCookies).filter(x -> x.getName().equals("JSESSIONID")).findFirst().orElse(null); + + if (session != null) { + session.setHttpOnly(true); + session.setSecure(true); + res.addCookie(session); + } + } + chain.doFilter(req, res); + } + + @Override + public void destroy() { + System.out.println("destroy filter"); + } + +} diff --git a/spring-security-mvc-session/src/main/webapp/WEB-INF/web.xml b/spring-security-mvc-session/src/main/webapp/WEB-INF/web.xml index 57826fadac..2ef734441b 100644 --- a/spring-security-mvc-session/src/main/webapp/WEB-INF/web.xml +++ b/spring-security-mvc-session/src/main/webapp/WEB-INF/web.xml @@ -8,6 +8,10 @@ 1 + org.baeldung.web.SessionListenerWithMetrics @@ -52,6 +56,15 @@ springSecurityFilterChain /* + + From 917c64307ac18bd638ff65e500e7398efb2fdf36 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Mon, 22 Oct 2018 21:57:52 -0500 Subject: [PATCH 194/546] UnzipFile is vulnerable to Zip Slip #5497 --- .../java/com/baeldung/unzip/UnzipFile.java | 22 +++++++++++++++--- .../main/resources/unzipTest/compressed.zip | Bin 0 -> 256 bytes 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 core-java-io/src/main/resources/unzipTest/compressed.zip diff --git a/core-java-io/src/main/java/com/baeldung/unzip/UnzipFile.java b/core-java-io/src/main/java/com/baeldung/unzip/UnzipFile.java index 6648d5f926..140d809d44 100644 --- a/core-java-io/src/main/java/com/baeldung/unzip/UnzipFile.java +++ b/core-java-io/src/main/java/com/baeldung/unzip/UnzipFile.java @@ -9,13 +9,13 @@ import java.util.zip.ZipInputStream; public class UnzipFile { public static void main(final String[] args) throws IOException { - final String fileZip = "src/main/resources/compressed.zip"; + final String fileZip = "src/main/resources/unzipTest/compressed.zip"; + final File destDir = new File("src/main/resources/unzipTest"); final byte[] buffer = new byte[1024]; final ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip)); ZipEntry zipEntry = zis.getNextEntry(); while (zipEntry != null) { - final String fileName = zipEntry.getName(); - final File newFile = new File("src/main/resources/unzipTest/" + fileName); + final File newFile = newFile(destDir, zipEntry); final FileOutputStream fos = new FileOutputStream(newFile); int len; while ((len = zis.read(buffer)) > 0) { @@ -27,4 +27,20 @@ public class UnzipFile { zis.closeEntry(); zis.close(); } + + /** + * @see https://snyk.io/research/zip-slip-vulnerability + */ + public static File newFile(File destinationDir, ZipEntry zipEntry) throws IOException { + File destFile = new File(destinationDir, zipEntry.getName()); + + String destDirPath = destinationDir.getCanonicalPath(); + String destFilePath = destFile.getCanonicalPath(); + + if (!destFilePath.startsWith(destDirPath + File.separator)) { + throw new IOException("Entry is outside of the target dir: " + zipEntry.getName()); + } + + return destFile; + } } \ No newline at end of file diff --git a/core-java-io/src/main/resources/unzipTest/compressed.zip b/core-java-io/src/main/resources/unzipTest/compressed.zip new file mode 100644 index 0000000000000000000000000000000000000000..89a9fd831cd096c745a718559ca433666da44bec GIT binary patch literal 256 zcmWIWW@Zs#;Nak3P+S$}%YXzpf$Wmh;u1r>l8O>;PhCAj7KQ+Cc8+JCi@n)_a;!ic zKv1_4TsIR~cg&)yO9j+mTHM*^Ua}ZVB*4)rM>&sx~{I2_S7?M+A7YvVlxw N0>V5XT?67U006uTCJ_Jt literal 0 HcmV?d00001 From fc139249625b505766d7c674def1e8eb377cb331 Mon Sep 17 00:00:00 2001 From: charlesgonzales <39999268+charlesgonzales@users.noreply.github.com> Date: Tue, 23 Oct 2018 16:57:41 +0800 Subject: [PATCH 195/546] Bi-monthly fix (BAEL-9663) (#5523) * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.MD * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Create README.md * Update README.md * Update README.md * Update README.md --- algorithms/README.md | 3 +++ apache-geode/README.md | 3 +++ core-java-collections/README.md | 1 + core-java-io/README.md | 3 ++- core-java/README.md | 1 + core-kotlin/README.md | 1 + hibernate5/README.md | 1 + java-collections-maps/README.md | 1 + java-dates/README.md | 3 ++- java-numbers/README.md | 1 + libraries-security/README.md | 1 + maven-polyglot/README.md | 3 ++- maven/README.md | 3 +++ spring-5-reactive-security/README.md | 2 +- spring-boot-mvc/README.md | 3 ++- spring-boot/README.MD | 1 + testing-modules/testng/README.md | 1 + xml/README.md | 1 + 18 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 apache-geode/README.md diff --git a/algorithms/README.md b/algorithms/README.md index 9d347869bd..b9a37a7bf2 100644 --- a/algorithms/README.md +++ b/algorithms/README.md @@ -31,3 +31,6 @@ - [Round Up to the Nearest Hundred](https://www.baeldung.com/java-round-up-nearest-hundred) - [Merge Sort in Java](https://www.baeldung.com/java-merge-sort) - [Calculate Percentage in Java](https://www.baeldung.com/java-calculate-percentage) +- [Quicksort Algorithm Implementation in Java](https://www.baeldung.com/java-quicksort) +- [Insertion Sort in Java](https://www.baeldung.com/java-insertion-sort) +- [Converting Between Byte Arrays and Hexadecimal Strings in Java](https://www.baeldung.com/java-byte-arrays-hex-strings) diff --git a/apache-geode/README.md b/apache-geode/README.md new file mode 100644 index 0000000000..2f04418825 --- /dev/null +++ b/apache-geode/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [A Quick Guide to Apache Geode](https://www.baeldung.com/apache-geode) diff --git a/core-java-collections/README.md b/core-java-collections/README.md index 684beda281..d0aaaa7182 100644 --- a/core-java-collections/README.md +++ b/core-java-collections/README.md @@ -38,3 +38,4 @@ - [Time Complexity of Java Collections](https://www.baeldung.com/java-collections-complexity) - [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) - [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections) +- [Guide to EnumSet](https://www.baeldung.com/java-enumset) diff --git a/core-java-io/README.md b/core-java-io/README.md index 58e331b6fc..ae4c267b8a 100644 --- a/core-java-io/README.md +++ b/core-java-io/README.md @@ -31,4 +31,5 @@ - [Create a Symbolic Link with Java](http://www.baeldung.com/java-symlink) - [Quick Use of FilenameFilter](http://www.baeldung.com/java-filename-filter) - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) -- [ Read a File into an ArrayList](https://www.baeldung.com/java-file-to-arraylist) +- [Read a File into an ArrayList](https://www.baeldung.com/java-file-to-arraylist) +- [Guide to Java OutputStream](https://www.baeldung.com/java-outputstream) diff --git a/core-java/README.md b/core-java/README.md index 1cbbfe2b39..59aab91aa9 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -157,3 +157,4 @@ - [Hashing a Password in Java](https://www.baeldung.com/java-password-hashing) - [Java Switch Statement](https://www.baeldung.com/java-switch) - [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) +- [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) diff --git a/core-kotlin/README.md b/core-kotlin/README.md index 523f5b6e78..9906b59a93 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -39,3 +39,4 @@ - [Introduction to Kovenant Library for Kotlin](https://www.baeldung.com/kotlin-kovenant) - [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) - [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings) +- [Kotlin return, break, continue Keywords](https://www.baeldung.com/kotlin-return-break-continue) diff --git a/hibernate5/README.md b/hibernate5/README.md index fbf46eed50..7f52531076 100644 --- a/hibernate5/README.md +++ b/hibernate5/README.md @@ -17,3 +17,4 @@ - [Mapping A Hibernate Query to a Custom Class](https://www.baeldung.com/hibernate-query-to-custom-class) - [@JoinColumn Annotation Explained](https://www.baeldung.com/jpa-join-column) - [Hibernate 5 Naming Strategy Configuration](https://www.baeldung.com/hibernate-naming-strategy) +- [Proxy in Hibernate load() Method](https://www.baeldung.com/hibernate-proxy-load-method) diff --git a/java-collections-maps/README.md b/java-collections-maps/README.md index ca7fee1d21..a6037a3c57 100644 --- a/java-collections-maps/README.md +++ b/java-collections-maps/README.md @@ -16,3 +16,4 @@ - [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) - [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) - [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps) +- [How to Check If a Key Exists in a Map](https://www.baeldung.com/java-map-key-exists) diff --git a/java-dates/README.md b/java-dates/README.md index 54843f90ee..f99bfeb861 100644 --- a/java-dates/README.md +++ b/java-dates/README.md @@ -21,4 +21,5 @@ - [How to Get the Start and the End of a Day using Java](http://www.baeldung.com/java-day-start-end) - [Calculate Age in Java](http://www.baeldung.com/java-get-age) - [Increment Date in Java](http://www.baeldung.com/java-increment-date) -- [Add Hours To a Date In Java](http://www.baeldung.com/java-add-hours-date) \ No newline at end of file +- [Add Hours To a Date In Java](http://www.baeldung.com/java-add-hours-date) +- [Guide to DateTimeFormatter](https://www.baeldung.com/java-datetimeformatter) diff --git a/java-numbers/README.md b/java-numbers/README.md index 6d6a279cc9..1138d9a74c 100644 --- a/java-numbers/README.md +++ b/java-numbers/README.md @@ -12,3 +12,4 @@ - [BigDecimal and BigInteger in Java](http://www.baeldung.com/java-bigdecimal-biginteger) - [Find All Pairs of Numbers in an Array That Add Up to a Given Sum](http://www.baeldung.com/java-algorithm-number-pairs-sum) - [Java – Random Long, Float, Integer and Double](http://www.baeldung.com/java-generate-random-long-float-integer-double) +- [Using Math.sin with Degrees](https://www.baeldung.com/java-math-sin-degrees) diff --git a/libraries-security/README.md b/libraries-security/README.md index c42e91a888..6923e0474e 100644 --- a/libraries-security/README.md +++ b/libraries-security/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Guide to ScribeJava](https://www.baeldung.com/scribejava) +- [Guide to Passay](https://www.baeldung.com/java-passay) diff --git a/maven-polyglot/README.md b/maven-polyglot/README.md index 589315efd1..8635c8eddf 100644 --- a/maven-polyglot/README.md +++ b/maven-polyglot/README.md @@ -1,3 +1,4 @@ To run the maven-polyglot-json-app successfully, you first have to build the maven-polyglot-json-extension module using: mvn clean install. -Related Articles: +### Relevant Articles: +- [Maven Polyglot](https://www.baeldung.com/maven-polyglot) diff --git a/maven/README.md b/maven/README.md index 2d838bcb76..970250d142 100644 --- a/maven/README.md +++ b/maven/README.md @@ -10,3 +10,6 @@ - [Build a Jar with Maven and Ignore the Test Results](http://www.baeldung.com/maven-ignore-test-results) - [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories) - [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test) +- [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure) +- [Apache Maven Tutorial](https://www.baeldung.com/maven) +- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version) diff --git a/spring-5-reactive-security/README.md b/spring-5-reactive-security/README.md index 3395cf5562..845d07cd7f 100644 --- a/spring-5-reactive-security/README.md +++ b/spring-5-reactive-security/README.md @@ -8,4 +8,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring Boot Actuator](http://www.baeldung.com/spring-boot-actuators) - [Spring Security 5 for Reactive Applications](http://www.baeldung.com/spring-security-5-reactive) - [Guide to Spring 5 WebFlux](http://www.baeldung.com/spring-webflux) - +- [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web) diff --git a/spring-boot-mvc/README.md b/spring-boot-mvc/README.md index b46dbe3bae..e7b42f8f50 100644 --- a/spring-boot-mvc/README.md +++ b/spring-boot-mvc/README.md @@ -7,4 +7,5 @@ - [Spring Web Annotations](http://www.baeldung.com/spring-mvc-annotations) - [Spring Core Annotations](http://www.baeldung.com/spring-core-annotations) - [Display RSS Feed with Spring MVC](http://www.baeldung.com/spring-mvc-rss-feed) - +- [A Controller, Service and DAO Example with Spring Boot and JSF](https://www.baeldung.com/jsf-spring-boot-controller-service-dao) +- [Cache Eviction in Spring Boot](https://www.baeldung.com/spring-boot-evict-cache) diff --git a/spring-boot/README.MD b/spring-boot/README.MD index aed2d2c5f8..9a9f44e1cf 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -35,3 +35,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring Component Scanning](https://www.baeldung.com/spring-component-scanning) - [Load Spring Boot Properties From a JSON File](https://www.baeldung.com/spring-boot-json-properties) - [Display Auto-Configuration Report in Spring Boot](https://www.baeldung.com/spring-boot-auto-configuration-report) +- [Logging to Graylog with Spring Boot](https://www.baeldung.com/graylog-with-spring-boot) diff --git a/testing-modules/testng/README.md b/testing-modules/testng/README.md index e54ee1dbf2..a7e0e29d62 100644 --- a/testing-modules/testng/README.md +++ b/testing-modules/testng/README.md @@ -2,3 +2,4 @@ - [Introduction to TestNG](http://www.baeldung.com/testng) - [Custom Reporting with TestNG](http://www.baeldung.com/testng-custom-reporting) +- [A Quick JUnit vs TestNG Comparison](https://www.baeldung.com/junit-vs-testng) diff --git a/xml/README.md b/xml/README.md index 80c6a069f0..fb070100db 100644 --- a/xml/README.md +++ b/xml/README.md @@ -3,3 +3,4 @@ - [Introduction to JiBX](http://www.baeldung.com/jibx) - [XML Libraries Support in Java](http://www.baeldung.com/java-xml-libraries) - [DOM parsing with Xerces](http://www.baeldung.com/java-xerces-dom-parsing) +- [Write an org.w3.dom.Document to a File](https://www.baeldung.com/java-write-xml-document-file) From 6f34ca1de2e1edb79c7751514446eda991500a0b Mon Sep 17 00:00:00 2001 From: DomWos Date: Tue, 23 Oct 2018 12:09:46 +0200 Subject: [PATCH 196/546] Changed the comment about random range to proper values. --- .../main/java/com/baeldung/storm/spout/RandomNumberSpout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java index 26fb1d82c0..c9291cdc9d 100644 --- a/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java +++ b/libraries-data/src/main/java/com/baeldung/storm/spout/RandomNumberSpout.java @@ -25,7 +25,7 @@ public class RandomNumberSpout extends BaseRichSpout { @Override public void nextTuple() { Utils.sleep(1000); - //This will select random int from the range (-1000, 1000) + //This will select random int from the range (0, 100) int operation = random.nextInt(101); long timestamp = System.currentTimeMillis(); From 1bca2a8c54a4827d22b5da196cd0174ca16c0fbf Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Tue, 23 Oct 2018 04:50:09 -0700 Subject: [PATCH 197/546] Update README.md (#5525) --- persistence-modules/spring-data-mongodb/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-data-mongodb/README.md b/persistence-modules/spring-data-mongodb/README.md index 4e12a2218a..c7bc7584be 100644 --- a/persistence-modules/spring-data-mongodb/README.md +++ b/persistence-modules/spring-data-mongodb/README.md @@ -11,3 +11,4 @@ - [Introduction to Spring Data MongoDB](http://www.baeldung.com/spring-data-mongodb-tutorial) - [Spring Data MongoDB: Projections and Aggregations](http://www.baeldung.com/spring-data-mongodb-projections-aggregations) - [Spring Data Annotations](http://www.baeldung.com/spring-data-annotations) +- [Spring Data MongoDB Transactions](https://www.baeldung.com/spring-data-mongodb-transactions ) From 2809811d9fe32d2417f5a7e04aee19d558c5c42c Mon Sep 17 00:00:00 2001 From: Nikhil Khatwani Date: Tue, 23 Oct 2018 17:56:26 +0530 Subject: [PATCH 198/546] Changes for BAEL-2215 --- .../collection/CollectionInjectionDemo.java | 1 + .../com/baeldung/collection/CollectionsBean.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/spring-core/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java b/spring-core/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java index 2e0d9eb8d8..2ee265f134 100644 --- a/spring-core/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java +++ b/spring-core/src/main/java/com/baeldung/collection/CollectionInjectionDemo.java @@ -16,5 +16,6 @@ public class CollectionInjectionDemo { collectionsBean.printNameSet(); collectionsBean.printNameMap(); collectionsBean.printBeanList(); + collectionsBean.printNameListWithDefaults(); } } diff --git a/spring-core/src/main/java/com/baeldung/collection/CollectionsBean.java b/spring-core/src/main/java/com/baeldung/collection/CollectionsBean.java index a0e985267f..fc90f2c6ff 100644 --- a/spring-core/src/main/java/com/baeldung/collection/CollectionsBean.java +++ b/spring-core/src/main/java/com/baeldung/collection/CollectionsBean.java @@ -1,13 +1,14 @@ package com.baeldung.collection; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; - import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; + /** * Created by Gebruiker on 5/18/2018. */ @@ -24,6 +25,9 @@ public class CollectionsBean { @Qualifier("CollectionsBean") private List beanList = new ArrayList<>(); + @Value("${names.list:}#{T(java.util.Collections).emptyList()}") + private List nameListWithDefaultValue; + public CollectionsBean() { } @@ -51,4 +55,8 @@ public class CollectionsBean { public void printBeanList() { System.out.println(beanList); } + + public void printNameListWithDefaults() { + System.out.println(nameListWithDefaultValue); + } } From 6ef143f57060e7dd32302a108b3439e0368c59f0 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 23 Oct 2018 22:00:06 +0530 Subject: [PATCH 199/546] BAEL-9040 Two quick improvements to the foreach article -Added Map's forEach BiConsumer example --- .../baeldung/java8/Java8ForEachUnitTest.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java b/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java index 7840c84b7d..f5201f54cf 100644 --- a/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java +++ b/core-java-8/src/test/java/com/baeldung/java8/Java8ForEachUnitTest.java @@ -1,9 +1,5 @@ package com.baeldung.java8; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; @@ -15,6 +11,10 @@ import java.util.Queue; import java.util.Set; import java.util.function.Consumer; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class Java8ForEachUnitTest { private static final Logger LOG = LoggerFactory.getLogger(Java8ForEachUnitTest.class); @@ -98,4 +98,14 @@ public class Java8ForEachUnitTest { .forEach(entry -> System.out.println(entry.getKey() + " " + entry.getValue())); } + @Test + public void givenMap_whenUsingBiConsumer_thenIterateAndPrintResults2() { + Map namesMap = new HashMap<>(); + namesMap.put(1, "Larry"); + namesMap.put(2, "Steve"); + namesMap.put(3, "James"); + + namesMap.forEach((key, value) -> System.out.println(key + " " + value)); + } + } From e24426923eb5a254bd4620200c62305a7c0975a3 Mon Sep 17 00:00:00 2001 From: daoire Date: Tue, 23 Oct 2018 21:09:29 +0100 Subject: [PATCH 200/546] Refactor Code and add Tests (#5251) --- .../com/baeldung/string/DoubleToString.java | 41 +++++++++++++++++ .../string/DoubleToStringUnitTest.java | 45 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/string/DoubleToString.java create mode 100644 core-java/src/test/java/com/baeldung/string/DoubleToStringUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/string/DoubleToString.java b/core-java/src/main/java/com/baeldung/string/DoubleToString.java new file mode 100644 index 0000000000..d26d26f3df --- /dev/null +++ b/core-java/src/main/java/com/baeldung/string/DoubleToString.java @@ -0,0 +1,41 @@ +package com.baeldung.string; + +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.NumberFormat; + +public class DoubleToString { + + public static String truncateByCast(double d) { + return String.valueOf((int) d); + } + + public static String roundWithStringFormat(double d) { + return String.format("%.0f", d); + } + + public static String truncateWithNumberFormat(double d) { + NumberFormat nf = NumberFormat.getInstance(); + nf.setMaximumFractionDigits(0); + nf.setRoundingMode(RoundingMode.FLOOR); + return nf.format(d); + } + + public static String roundWithNumberFormat(double d) { + NumberFormat nf = NumberFormat.getInstance(); + nf.setMaximumFractionDigits(0); + return nf.format(d); + } + + public static String truncateWithDecimalFormat(double d) { + DecimalFormat df = new DecimalFormat("#,###"); + df.setRoundingMode(RoundingMode.FLOOR); + return df.format(d); + } + + public static String roundWithDecimalFormat(double d) { + DecimalFormat df = new DecimalFormat("#,###"); + return df.format(d); + } + +} diff --git a/core-java/src/test/java/com/baeldung/string/DoubleToStringUnitTest.java b/core-java/src/test/java/com/baeldung/string/DoubleToStringUnitTest.java new file mode 100644 index 0000000000..5212d7aa1a --- /dev/null +++ b/core-java/src/test/java/com/baeldung/string/DoubleToStringUnitTest.java @@ -0,0 +1,45 @@ +package com.baeldung.string; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.Test; + +public class DoubleToStringUnitTest { + + private static final double DOUBLE_VALUE = 3.56; + private static final String TRUNCATED_DOUBLE = "3"; + private static final String ROUNDED_UP_DOUBLE = "4"; + + + @Test + public void truncateByCastTest() { + assertThat(DoubleToString.truncateByCast(DOUBLE_VALUE)).isEqualTo(TRUNCATED_DOUBLE); + } + + @Test + public void roundingWithStringFormatTest() { + assertThat(DoubleToString.roundWithStringFormat(DOUBLE_VALUE)).isEqualTo(ROUNDED_UP_DOUBLE); + } + + @Test + public void truncateWithNumberFormatTest() { + assertThat(DoubleToString.truncateWithNumberFormat(DOUBLE_VALUE)).isEqualTo(TRUNCATED_DOUBLE); + } + + @Test + public void roundWithNumberFormatTest() { + assertThat(DoubleToString.roundWithNumberFormat(DOUBLE_VALUE)).isEqualTo(ROUNDED_UP_DOUBLE); + } + + @Test + public void truncateWithDecimalFormatTest() { + assertThat(DoubleToString.truncateWithDecimalFormat(DOUBLE_VALUE)).isEqualTo(TRUNCATED_DOUBLE); + } + + @Test + public void roundWithDecimalFormatTest() { + assertThat(DoubleToString.roundWithDecimalFormat(DOUBLE_VALUE)).isEqualTo(ROUNDED_UP_DOUBLE); + } + + +} From a828ae21377d86727c598c56a7f4a4af11f788bd Mon Sep 17 00:00:00 2001 From: Alfonso Lentini Date: Tue, 23 Oct 2018 23:40:46 +0200 Subject: [PATCH 201/546] Added comments --- .../src/test/kotlin/com/baeldung/filter/SliceTest.kt | 1 + .../src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt index db2bfed947..793fe68427 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/filter/SliceTest.kt @@ -24,6 +24,7 @@ internal class SliceTest { assertIterableEquals(expected, actual) } +// From the 1.3 version of Kotlin APIs, slice doesn't return array of nulls but throw IndexOutOfBoundsException // @Test // fun whenSlicingBeyondTheRangeOfTheArray_thenContainManyNulls() { // val original = arrayOf(12, 3, 34, 4) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt index 74b2dd9fa1..b7993c5f43 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt @@ -222,6 +222,8 @@ internal class FuelHttpUnitTest { } + +// The new 1.3 coroutine APIs, aren't implemented yet in Fuel Library // @Test // fun whenMakeGETRequestUsingCoroutines_thenResponseStatusCode200() = runBlocking { // val (request, response, result) = Fuel.get("http://httpbin.org/get").awaitStringResponse() @@ -231,8 +233,8 @@ internal class FuelHttpUnitTest { // // }, { error -> }) // } -// -// + +// The new 1.3 coroutine APIs, aren't implemented yet in Fuel Library // @Test // fun whenMakeGETRequestUsingCoroutines_thenDeserializeResponse() = runBlocking { // Fuel.get("https://jsonplaceholder.typicode.com/posts?id=1").awaitObjectResult(Post.Deserializer()) From e2aad41b7815ba30718025b43c04a60dc84559b2 Mon Sep 17 00:00:00 2001 From: Tino M Thomas Date: Wed, 24 Oct 2018 09:36:56 +0300 Subject: [PATCH 202/546] BAEL - 2251 Moved the code from spring-boot-mvc to spring-all --- .../caching/eviction/CacheEvictionMain.java | 17 ++++++ .../cotrollers/CachingController.java | 18 ++++++ .../eviction/service/CachingService.java | 53 ++++++++++++++++++ .../CacheEvictAnnotationIntegrationTest.java | 44 +++++++++++++++ .../CacheManagerEvictIntegrationTest.java | 55 +++++++++++++++++++ .../SpringBootMvcApplication.java | 4 -- .../caching/CachingController.java | 17 ------ .../springbootmvc/caching/CachingService.java | 53 ------------------ .../CacheEvictAnnotationIntegrationTest.java | 44 --------------- .../CacheManagerEvictIntegrationTest.java | 55 ------------------- 10 files changed, 187 insertions(+), 173 deletions(-) create mode 100644 spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java create mode 100644 spring-all/src/main/java/org/baeldung/caching/eviction/cotrollers/CachingController.java create mode 100644 spring-all/src/main/java/org/baeldung/caching/eviction/service/CachingService.java create mode 100644 spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java create mode 100644 spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java delete mode 100644 spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java delete mode 100644 spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java delete mode 100644 spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java delete mode 100644 spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java diff --git a/spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java b/spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java new file mode 100644 index 0000000000..18fac83ad4 --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java @@ -0,0 +1,17 @@ +package org.baeldung.caching.eviction; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.scheduling.annotation.EnableScheduling; + + +@SpringBootApplication +@EnableCaching +@EnableScheduling +public class CacheEvictionMain { + + public static void main(String[] args) { + SpringApplication.run(CacheEvictionMain.class, args); + } +} diff --git a/spring-all/src/main/java/org/baeldung/caching/eviction/cotrollers/CachingController.java b/spring-all/src/main/java/org/baeldung/caching/eviction/cotrollers/CachingController.java new file mode 100644 index 0000000000..92265f4f18 --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/caching/eviction/cotrollers/CachingController.java @@ -0,0 +1,18 @@ +package org.baeldung.caching.eviction.cotrollers; + +import org.baeldung.caching.eviction.service.CachingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class CachingController { + + @Autowired + CachingService cachingService; + + @GetMapping("clearAllCaches") + public void clearAllCaches() { + cachingService.evictAllCaches(); + } +} diff --git a/spring-all/src/main/java/org/baeldung/caching/eviction/service/CachingService.java b/spring-all/src/main/java/org/baeldung/caching/eviction/service/CachingService.java new file mode 100644 index 0000000000..7e37215954 --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/caching/eviction/service/CachingService.java @@ -0,0 +1,53 @@ +package org.baeldung.caching.eviction.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class CachingService { + + @Autowired + CacheManager cacheManager; + + public void putToCache(String cacheName, String key, String value) { + cacheManager.getCache(cacheName).put(key, value); + } + + public String getFromCache(String cacheName, String key) { + String value = null; + if (cacheManager.getCache(cacheName).get(key) != null) { + value = cacheManager.getCache(cacheName).get(key).get().toString(); + } + return value; + } + + @CacheEvict(value = "first", key = "#cacheKey") + public void evictSingleCacheValue(String cacheKey) { + } + + @CacheEvict(value = "first", allEntries = true) + public void evictAllCacheValues() { + } + + public void evictSingleCacheValue(String cacheName, String cacheKey) { + cacheManager.getCache(cacheName).evict(cacheKey); + } + + public void evictAllCacheValues(String cacheName) { + cacheManager.getCache(cacheName).clear(); + } + + public void evictAllCaches() { + cacheManager.getCacheNames() + .parallelStream() + .forEach(cacheName -> cacheManager.getCache(cacheName).clear()); + } + + @Scheduled(fixedRate = 6000) + public void evictAllcachesAtIntervals() { + evictAllCaches(); + } +} diff --git a/spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java b/spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java new file mode 100644 index 0000000000..3ad4ded745 --- /dev/null +++ b/spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java @@ -0,0 +1,44 @@ +package org.baeldung.caching.test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; + +import org.baeldung.caching.eviction.CacheEvictionMain; +import org.baeldung.caching.eviction.service.CachingService; +import org.junit.Before; +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.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = { CacheEvictionMain.class, CachingService.class }) +public class CacheEvictAnnotationIntegrationTest { + + @Autowired + CachingService cachingService; + + @Before + public void before() { + cachingService.putToCache("first", "key1", "Baeldung"); + cachingService.putToCache("first", "key2", "Article"); + } + + @Test + public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { + cachingService.evictSingleCacheValue("key1"); + String key1 = cachingService.getFromCache("first", "key1"); + assertThat(key1, is(nullValue())); + } + + @Test + public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { + cachingService.evictAllCacheValues(); + String key1 = cachingService.getFromCache("first", "key1"); + String key2 = cachingService.getFromCache("first", "key2"); + assertThat(key1, is(nullValue())); + assertThat(key2, is(nullValue())); + } +} diff --git a/spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java b/spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java new file mode 100644 index 0000000000..e65e8800a2 --- /dev/null +++ b/spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java @@ -0,0 +1,55 @@ +package org.baeldung.caching.test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; + +import org.baeldung.caching.eviction.CacheEvictionMain; +import org.baeldung.caching.eviction.service.CachingService; +import org.junit.Before; +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.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = { CacheEvictionMain.class, CachingService.class }) +public class CacheManagerEvictIntegrationTest { + + @Autowired + CachingService cachingService; + + @Before + public void before() { + cachingService.putToCache("first", "key1", "Baeldung"); + cachingService.putToCache("first", "key2", "Article"); + cachingService.putToCache("second", "key", "Article"); + } + + @Test + public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { + cachingService.evictSingleCacheValue("first", "key1"); + String key1 = cachingService.getFromCache("first", "key1"); + assertThat(key1, is(nullValue())); + } + + @Test + public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { + cachingService.evictAllCacheValues("first"); + String key1 = cachingService.getFromCache("first", "key1"); + String key2 = cachingService.getFromCache("first", "key2"); + assertThat(key1, is(nullValue())); + assertThat(key2, is(nullValue())); + } + + @Test + public void givenAllCaches_whenAllCacheEvictRequested_thenEmptyAllCaches() { + cachingService.evictAllCaches(); + String key1 = cachingService.getFromCache("first", "key1"); + assertThat(key1, is(nullValue())); + + String key = cachingService.getFromCache("second", "key"); + assertThat(key, is(nullValue())); + } +} diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java index 99f081c602..df8f72f500 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java +++ b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java @@ -2,12 +2,8 @@ package com.baeldung.springbootmvc; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication -@EnableCaching -@EnableScheduling public class SpringBootMvcApplication { public static void main(String[] args) { diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java deleted file mode 100644 index 390759de9b..0000000000 --- a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingController.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.springbootmvc.caching; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class CachingController { - - @Autowired - CachingService cachingService; - - @GetMapping("clearAllCaches") - public void clearAllCaches() { - cachingService.evictAllCaches(); - } -} diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java deleted file mode 100644 index e291640bd8..0000000000 --- a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/caching/CachingService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.baeldung.springbootmvc.caching; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.CacheManager; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -@Component -public class CachingService { - - @Autowired - CacheManager cacheManager; - - public void putToCache(String cacheName, String key, String value) { - cacheManager.getCache(cacheName).put(key, value); - } - - public String getFromCache(String cacheName, String key) { - String value = null; - if (cacheManager.getCache(cacheName).get(key) != null) { - value = cacheManager.getCache(cacheName).get(key).get().toString(); - } - return value; - } - - @CacheEvict(value = "first", key = "#cacheKey") - public void evictSingleCacheValue(String cacheKey) { - } - - @CacheEvict(value = "first", allEntries = true) - public void evictAllCacheValues() { - } - - public void evictSingleCacheValue(String cacheName, String cacheKey) { - cacheManager.getCache(cacheName).evict(cacheKey); - } - - public void evictAllCacheValues(String cacheName) { - cacheManager.getCache(cacheName).clear(); - } - - public void evictAllCaches() { - cacheManager.getCacheNames() - .parallelStream() - .forEach(cacheName -> cacheManager.getCache(cacheName).clear()); - } - - @Scheduled(fixedRate = 6000) - public void evictAllcachesAtIntervals() { - evictAllCaches(); - } -} diff --git a/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java b/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java deleted file mode 100644 index dc50d48215..0000000000 --- a/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheEvictAnnotationIntegrationTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.baeldung.caching; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; - -import org.junit.Before; -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.test.context.junit4.SpringRunner; - -import com.baeldung.springbootmvc.SpringBootMvcApplication; -import com.baeldung.springbootmvc.caching.CachingService; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = {SpringBootMvcApplication.class, CachingService.class}) -public class CacheEvictAnnotationIntegrationTest { - - @Autowired CachingService cachingService; - - @Before - public void before() { - cachingService.putToCache("first", "key1", "Baeldung"); - cachingService.putToCache("first", "key2", "Article"); - } - - @Test - public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { - cachingService.evictSingleCacheValue("key1"); - String key1 = cachingService.getFromCache("first", "key1"); - assertThat(key1, is(nullValue())); - } - - @Test - public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { - cachingService.evictAllCacheValues(); - String key1 = cachingService.getFromCache("first", "key1"); - String key2 = cachingService.getFromCache("first", "key2"); - assertThat(key1, is(nullValue())); - assertThat(key2, is(nullValue())); - } -} diff --git a/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java b/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java deleted file mode 100644 index 7f7921fbe5..0000000000 --- a/spring-boot-mvc/src/test/java/com/baeldung/caching/CacheManagerEvictIntegrationTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.baeldung.caching; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; - -import org.junit.Before; -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.test.context.junit4.SpringRunner; - -import com.baeldung.springbootmvc.SpringBootMvcApplication; -import com.baeldung.springbootmvc.caching.CachingService; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = {SpringBootMvcApplication.class, CachingService.class}) -public class CacheManagerEvictIntegrationTest { - - @Autowired CachingService cachingService; - - @Before - public void before() { - cachingService.putToCache("first", "key1", "Baeldung"); - cachingService.putToCache("first", "key2", "Article"); - cachingService.putToCache("second", "key", "Article"); - } - - @Test - public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { - cachingService.evictSingleCacheValue("first","key1"); - String key1 = cachingService.getFromCache("first", "key1"); - assertThat(key1, is(nullValue())); - } - - @Test - public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { - cachingService.evictAllCacheValues("first"); - String key1 = cachingService.getFromCache("first", "key1"); - String key2 = cachingService.getFromCache("first", "key2"); - assertThat(key1, is(nullValue())); - assertThat(key2, is(nullValue())); - } - - @Test - public void givenAllCaches_whenAllCacheEvictRequested_thenEmptyAllCaches() { - cachingService.evictAllCaches(); - String key1 = cachingService.getFromCache("first", "key1"); - assertThat(key1, is(nullValue())); - - String key = cachingService.getFromCache("second", "key"); - assertThat(key, is(nullValue())); - } -} From a559137c8c31028fc0b757f86f2656d49122b438 Mon Sep 17 00:00:00 2001 From: RanjeetKaur17 Date: Wed, 24 Oct 2018 23:05:27 +0400 Subject: [PATCH 203/546] Changes as per review comments --- .../countdownlatch/CountdownLatchResetExample.java | 7 ++++--- .../cyclicbarrier/CyclicBarrierCountExample.java | 2 +- .../cyclicbarrier/CyclicBarrierResetExample.java | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java index 7effc9e374..55e509e374 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java @@ -23,10 +23,11 @@ public class CountdownLatchResetExample { ExecutorService es = Executors.newFixedThreadPool(threadCount); for (int i = 0; i < threadCount; i++) { es.execute(() -> { - if (countDownLatch.getCount() > 0) { - outputScraper.add("Count Left : " + countDownLatch.getCount()); - } + long prevValue = countDownLatch.getCount(); countDownLatch.countDown(); + if (countDownLatch.getCount() != prevValue) { + outputScraper.add("Count Updated"); + } }); } diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java index c7a9b20698..9d637b428b 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java @@ -26,7 +26,7 @@ public class CyclicBarrierCountExample { } public static void main(String[] args) { - CyclicBarrierCountExample ex = new CyclicBarrierCountExample(1); + CyclicBarrierCountExample ex = new CyclicBarrierCountExample(7); System.out.println("Count : " + ex.callTwiceInSameThread()); } } diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java index c355b7eead..febeb0978e 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java @@ -28,8 +28,8 @@ public class CyclicBarrierResetExample { es.execute(() -> { try { if (cyclicBarrier.getNumberWaiting() > 0) { - outputScraper.add("Waiting Count : " + cyclicBarrier.getNumberWaiting()); - } + outputScraper.add("Count Updated"); + } cyclicBarrier.await(); } catch (InterruptedException | BrokenBarrierException e) { e.printStackTrace(); @@ -41,7 +41,7 @@ public class CyclicBarrierResetExample { } public static void main(String[] args) { - CyclicBarrierResetExample ex = new CyclicBarrierResetExample(new ArrayList(), 5, 20); + CyclicBarrierResetExample ex = new CyclicBarrierResetExample(new ArrayList(), 7, 20); System.out.println("Count : " + ex.countWaits()); } } From 7bd608207c8482d2511d8c0814e42e31feffe3cc Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 24 Oct 2018 22:29:28 +0300 Subject: [PATCH 204/546] fix bubble sort --- .../java/com/baeldung/algorithms/bubblesort/BubbleSort.java | 2 +- .../baeldung/algorithms/bubblesort/BubbleSortUnitTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/algorithms/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java b/algorithms/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java index a561072b2e..275cb7f3a2 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java @@ -7,7 +7,7 @@ public class BubbleSort { void bubbleSort(Integer[] arr) { int n = arr.length; IntStream.range(0, n - 1) - .flatMap(i -> IntStream.range(i + 1, n - i)) + .flatMap(i -> IntStream.range(1, n - i)) .forEach(j -> { if (arr[j - 1] > arr[j]) { int temp = arr[j]; diff --git a/algorithms/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java index c7f3f7dc38..c3260a18dd 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java +++ b/algorithms/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java @@ -1,8 +1,8 @@ package com.baeldung.algorithms.bubblesort; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class BubbleSortUnitTest { From 464189ff4ee5d8b3ce701003b135eb6fbe335020 Mon Sep 17 00:00:00 2001 From: chandra Date: Wed, 24 Oct 2018 16:43:09 -0400 Subject: [PATCH 205/546] Introduction to Scala Updated examples --- .gitignore | 4 +- core-scala/pom.xml | 2 +- .../scala/ControlStructuresDemo.scala | 44 ++++++++++ .../scala/com/baeldung/scala/Employee.scala | 29 +++++-- .../scala/com/baeldung/scala/HelloWorld.scala | 4 +- .../baeldung/scala/HigherOrderFunctions.scala | 29 +++++-- .../scala/com/baeldung/scala/IntSet.scala | 34 ++++++++ .../main/scala/com/baeldung/scala/Utils.scala | 85 ++++++------------- .../scala/ControlStructuresDemoUnitTest.scala | 33 +++++++ .../com/baeldung/scala/EmployeeUnitTest.scala | 32 ++++--- .../scala/HigherOrderFunctionsUnitTest.scala | 63 +++++++------- .../com/baeldung/scala/IntSetUnitTest.scala | 23 +++++ .../com/baeldung/scala/UtilsUnitTest.scala | 67 ++++++--------- 13 files changed, 291 insertions(+), 158 deletions(-) create mode 100644 core-scala/src/main/scala/com/baeldung/scala/ControlStructuresDemo.scala create mode 100644 core-scala/src/main/scala/com/baeldung/scala/IntSet.scala create mode 100644 core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala create mode 100644 core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala diff --git a/.gitignore b/.gitignore index 7fe2778755..0e71421ee7 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,6 @@ jmeter/src/main/resources/*-JMeter.csv **/tmp **/out-tsc **/nbproject/ -**/nb-configuration.xml \ No newline at end of file +**/nb-configuration.xml +core-scala/.cache-main +core-scala/.cache-tests diff --git a/core-scala/pom.xml b/core-scala/pom.xml index a5d6ac6e07..eb7c1c3330 100644 --- a/core-scala/pom.xml +++ b/core-scala/pom.xml @@ -47,7 +47,7 @@
- 2.11.8 + 2.12.7 diff --git a/core-scala/src/main/scala/com/baeldung/scala/ControlStructuresDemo.scala b/core-scala/src/main/scala/com/baeldung/scala/ControlStructuresDemo.scala new file mode 100644 index 0000000000..7c1281e573 --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/scala/ControlStructuresDemo.scala @@ -0,0 +1,44 @@ +package com.baeldung.scala + +/** + * Sample code demonstrating the various control structured. + * + * @author Chandra Prakash + * + */ +object ControlStructuresDemo { + def gcd(x : Int, y : Int) : Int = { + if (y == 0) x else gcd(y, x % y) + } + + def gcdIter(x : Int, y : Int) : Int = { + var a = x + var b = y + while (b > 0) { + a = a % b + val t = a + a = b + b = t + } + a + } + + def rangeSum(a : Int, b : Int) = { + var sum = 0; + for (i <- a to b) { + sum += i + } + sum + } + + def factorial(a : Int) : Int = { + var result = 1; + var i = 1; + do { + result *= i + i = i + 1 + } while (i <= a) + result + } + +} \ No newline at end of file diff --git a/core-scala/src/main/scala/com/baeldung/scala/Employee.scala b/core-scala/src/main/scala/com/baeldung/scala/Employee.scala index 3266b9a557..397f166aa7 100644 --- a/core-scala/src/main/scala/com/baeldung/scala/Employee.scala +++ b/core-scala/src/main/scala/com/baeldung/scala/Employee.scala @@ -1,10 +1,27 @@ package com.baeldung.scala -class Employee(val name: String, var salary: Int, annualIncrement: Int = 20) extends AnyRef { +/** + * Sample Code demonstrating a class. + * + * @author Chandra Prakash + * + */ +class Employee(val name : String, + var salary : Int, + annualIncrement : Int = 20) { - def incrementSalary(): Unit = { - salary += annualIncrement - } + def incrementSalary() : Unit = { + salary += annualIncrement + } + + override def toString = + s"Employee(name=$name, salary=$salary)" +} + +/** + * A Trait which will make the toString return upper case value. + */ +trait UpperCasePrinter { + override def toString = super.toString toUpperCase +} - override def toString = s"Employee(name=$name, salary=$salary)" -} \ No newline at end of file diff --git a/core-scala/src/main/scala/com/baeldung/scala/HelloWorld.scala b/core-scala/src/main/scala/com/baeldung/scala/HelloWorld.scala index fde03f2cb4..b3f0ce09a5 100644 --- a/core-scala/src/main/scala/com/baeldung/scala/HelloWorld.scala +++ b/core-scala/src/main/scala/com/baeldung/scala/HelloWorld.scala @@ -1,6 +1,6 @@ package com.baeldung.scala object HelloWorld extends App { - println("Hello World!") - args foreach println + println("Hello World!") + args foreach println } diff --git a/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala b/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala index bab28d4f86..df97013206 100644 --- a/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala +++ b/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala @@ -1,14 +1,27 @@ - - package com.baeldung.scala +/** + * Sample higher order functions. + * + * @author Chandra Prakash + * + */ object HigherOrderFunctions { - def mapReduce(r: (Int, Int) => Int, i: Int, m: Int => Int, a: Int, b: Int) = { - def iter(a: Int, result: Int): Int = { - if (a > b) result - else iter(a + 1, r(m(a), result)) - } - iter(a, i) + def mapReduce(r : (Int, Int) => Int, + i : Int, + m : Int => Int, + a : Int, b : Int) = { + def iter(a : Int, result : Int) : Int = { + if (a > b) result + else iter(a + 1, r(m(a), result)) + } + iter(a, i) + } + + def whileLoop(condition : => Boolean)(body : => Unit) : Unit = + if (condition) { + body + whileLoop(condition)(body) } } \ No newline at end of file diff --git a/core-scala/src/main/scala/com/baeldung/scala/IntSet.scala b/core-scala/src/main/scala/com/baeldung/scala/IntSet.scala new file mode 100644 index 0000000000..f1a5722a4e --- /dev/null +++ b/core-scala/src/main/scala/com/baeldung/scala/IntSet.scala @@ -0,0 +1,34 @@ +package com.baeldung.scala + +/** + * An abstract class for set of integers and its implementation. + * + * @author Chandra Prakash + * + */ +abstract class IntSet { + // add an element to the set + def incl(x : Int) : IntSet + + // whether an element belongs to the set + def contains(x : Int) : Boolean +} + +class EmptyIntSet extends IntSet { + + def contains(x : Int) : Boolean = false + + def incl(x : Int) = + new NonEmptyIntSet(x, this) +} + +class NonEmptyIntSet(val head : Int, val tail : IntSet) + extends IntSet { + + def contains(x : Int) : Boolean = + head == x || (tail contains x) + + def incl(x : Int) : IntSet = + if (this contains x) this + else new NonEmptyIntSet(x, this) +} \ No newline at end of file diff --git a/core-scala/src/main/scala/com/baeldung/scala/Utils.scala b/core-scala/src/main/scala/com/baeldung/scala/Utils.scala index af41685be9..93cd3e697e 100644 --- a/core-scala/src/main/scala/com/baeldung/scala/Utils.scala +++ b/core-scala/src/main/scala/com/baeldung/scala/Utils.scala @@ -1,66 +1,33 @@ package com.baeldung.scala +/** + * Some utility methods. + * + * @author Chandra Prakash + * + */ object Utils { - def average(x: Double, y: Double) = (x + y) / 2 + def average(x : Double, y : Double) = (x + y) / 2 - def gcd(x: Int, y: Int): Int = { - if (y == 0) x else gcd(y, x % y) + def randomLessThan(d : Double) = { + var random = 0d + do { + random = Math.random() + } while (random >= d) + random + } + + def power(x : Int, y : Int) : Int = { + def powNested(i : Int, accumulator : Int) : Int = { + if (i <= 0) accumulator + else powNested(i - 1, x * accumulator) } + powNested(y, 1) + } - def gcdIter(x: Int, y: Int): Int = { - var a = x - var b = y - while (b > 0) { - a = a % b - val t = a - a = b - b = t - } - return a - } - - def rangeSum(a: Int, b: Int) = { - var sum = 0; - for (i <- a to b) { - sum += i - } - sum - } - - def factorial(a: Int): Int = { - var result = 1; - var i = a; - do { - result *= i - i = i - 1 - } while (i > 0) - result - } - - def randomLessThan(d: Double) = { - var random = 0d - do { - random = Math.random() - } while (random >= d) - random - } - - def whileLoop(condition: => Boolean)(body: => Unit): Unit = - if (condition) { - body - whileLoop(condition)(body) - } - - def power(x: Int, y: Int): Int = { - def powNested(i: Int, accumulator: Int): Int = { - if (i <= 0) accumulator - else powNested(i - 1, x * accumulator) - } - powNested(y, 1) - } - - def fibonacci(n: Int): Int = n match { - case 0 | 1 => 1 - case x if x > 1 => fibonacci(x - 1) + fibonacci(x - 2) - } + def fibonacci(n : Int) : Int = n match { + case 0 | 1 => 1 + case x if x > 1 => + fibonacci(x - 1) + fibonacci(x - 2) + } } \ No newline at end of file diff --git a/core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala new file mode 100644 index 0000000000..71422a8b4f --- /dev/null +++ b/core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala @@ -0,0 +1,33 @@ +package com.baeldung.scala + +import com.baeldung.scala.ControlStructuresDemo._ +import org.junit.Test +import org.junit.Assert.assertEquals + +class ControlStructuresDemoUnitTest { + @Test + def givenTwoIntegers_whenGcdCalled_thenCorrectValueReturned = { + assertEquals(3, gcd(15, 27)) + } + + @Test + def givenTwoIntegers_whenGcdIterCalled_thenCorrectValueReturned = { + assertEquals(3, gcdIter(15, 27)) + } + + @Test + def givenTwoIntegers_whenRangeSumcalled_thenCorrectValueReturned = { + assertEquals(55, rangeSum(1, 10)) + } + + @Test + def givenPositiveInteger_whenFactorialInvoked_thenCorrectValueReturned = { + assertEquals(720, factorial(6)) + } + + @Test + def whenFactorialOf0Invoked_then1Returned = { + assertEquals(1, factorial(0)) + } + +} \ No newline at end of file diff --git a/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala index 997a11a518..c51631dd2c 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala @@ -1,22 +1,30 @@ package com.baeldung.scala +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert._ class EmployeeUnitTest { - @Test - def whenEmployeeSalaryIncremented_thenCorrectSalary() = { - val employee = new Employee("John Doe", 1000); - employee.incrementSalary(); - assertEquals(1020, employee.salary); - } + @Test + def whenEmployeeSalaryIncremented_thenCorrectSalary = { + val employee = new Employee("John Doe", 1000) + employee.incrementSalary() + assertEquals(1020, employee.salary) + } + + @Test + def givenEmployee_whenToStringCalled_thenCorrectStringReturned = { + val employee = new Employee("John Doe", 1000) + assertEquals("Employee(name=John Doe, salary=1000)", employee.toString) + } + + @Test + def givenEmployeeWithTrait_whenToStringCalled_thenCorrectStringReturned = { + val employee = + new Employee("John Doe", 1000) with UpperCasePrinter + assertEquals("EMPLOYEE(NAME=JOHN DOE, SALARY=1000)", employee.toString) + } - @Test - def givenEmployee_whenToStringCalled_thenCorrectStringReturned() = { - val employee = new Employee("John Doe", 1000); - assertEquals("Employee(name=John Doe, salary=1000)", employee.toString); - } } diff --git a/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala index a939e38c25..63530ecaf4 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala @@ -1,44 +1,49 @@ package com.baeldung.scala +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert._ -import HigherOrderFunctions._ + +import HigherOrderFunctions.mapReduce class HigherOrderFunctionsUnitTest { - @Test - def whenCalledWithSumAndSquareFunctions_thenCorrectValueReturned = { - def square(x: Int) = x * x + @Test + def whenCalledWithSumAndSquareFunctions_thenCorrectValueReturned = { + def square(x : Int) = x * x - def sum(x: Int, y: Int) = x + y + def sum(x : Int, y : Int) = x + y - def sumSquares(a: Int, b: Int) = - mapReduce(sum, 0, square, a, b) + def sumSquares(a : Int, b : Int) = + mapReduce(sum, 0, square, a, b) - val n = 10 - val expected = n * (n + 1) * (2 * n + 1) / 6 - assertEquals(expected, sumSquares(1, n)); - } + assertEquals(385, sumSquares(1, 10)) + } - @Test - def whenComputingSumOfSquaresWithAnonymousFunctions_thenCorrectValueReturned = { - def sumSquares(a: Int, b: Int) = - mapReduce((x, y) => x + y, 0, x => x * x, a, b) + @Test + def whenComputingSumOfSquaresWithAnonymousFunctions_thenCorrectValueReturned = { + def sumSquares(a : Int, b : Int) = + mapReduce((x, y) => x + y, 0, x => x * x, a, b) - val n = 10 - val expected = n * (n + 1) * (2 * n + 1) / 6 - assertEquals(expected, sumSquares(1, n)); - } + assertEquals(385, sumSquares(1, 10)) + } - @Test - def givenCurriedFunctions_whenInvoked_thenCorrectValueReturned = { - def sum(f: Int => Int)(a: Int, b: Int): Int = - if (a > b) 0 else f(a) + sum(f)(a + 1, b) + @Test + def givenCurriedFunctions_whenInvoked_thenCorrectValueReturned = { + // a curried function + def sum(f : Int => Int)(a : Int, + b : Int) : Int = + if (a > b) 0 else f(a) + sum(f)(a + 1, b) - def mod(n: Int)(x: Int) = x % n + // another curried function + def mod(n : Int)(x : Int) = x % n - def sumMod5 = sum(mod(5)) _ - - assertEquals(10, sumMod5(6,10)); - } + // application of a curried function + assertEquals(1, mod(5)(6)) + + // partial application of curried function + // trailing underscore is required to make function type explicit + val sumMod5 = sum(mod(5)) _ + + assertEquals(10, sumMod5(6, 10)) + } } \ No newline at end of file diff --git a/core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala new file mode 100644 index 0000000000..5cc19e9215 --- /dev/null +++ b/core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala @@ -0,0 +1,23 @@ +package com.baeldung.scala + +import scala.Range + +import org.junit.Assert.assertFalse +import org.junit.Test + +class IntSetUnitTest { + + @Test + def givenSetof1To10_whenContains11Called_thenFalse = { + + // Set up a set containing integers 1 to 10. + val set1To10 = + Range(1, 10) + .foldLeft(new EmptyIntSet() : IntSet) { + (x, y) => x incl y + } + + assertFalse(set1To10 contains 11) + } + +} \ No newline at end of file diff --git a/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala index f4799ed552..47f9873aad 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala @@ -1,50 +1,37 @@ package com.baeldung.scala +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Test -import Utils._ -import org.junit.Assert._ + +import Utils.average +import Utils.fibonacci +import Utils.power +import Utils.randomLessThan class UtilsUnitTest { - @Test - def whenAverageCalled_thenCorrectValueReturned() = { - val average = Utils.average(10, 20) - assertEquals(15.0, average, 1e-5) - } + @Test + def whenAverageCalled_thenCorrectValueReturned() = { + assertEquals(15.0, average(10, 20), 1e-5) + } - @Test - def givenTwoIntegers_whenGcdCalled_thenCorrectValueReturned = { - assertEquals(3, Utils.gcd(15, 27)) - } + @Test + def whenRandomLessThanInvokedWithANumber_thenARandomLessThanItReturned = { + val d = 0.1 + assertTrue(randomLessThan(d) < d) + } - @Test - def givenTwoIntegers_whenGcdIterCalled_thenCorrectValueReturned = { - assertEquals(3, Utils.gcdIter(15, 27)) - } + @Test + def whenPowerInvokedWith2And3_then8Returned = { + assertEquals(8, power(2, 3)) + } - @Test - def givenTwoIntegers_whenRangeSumcalled_thenCorrectValueReturned = { - assertEquals(55, Utils.rangeSum(1, 10)) - } - - @Test - def givenPositiveInteger_whenFactorialInvoked_thenCorrectValueReturned = { - assertEquals(720, Utils.factorial(6)) - } - - @Test - def whenRandomLessThanInvokedWithANumber_thenARandomLessThanItReturned = { - val d = 0.1 - assertTrue(Utils.randomLessThan(d) < d) - } - - @Test - def whenPowerInvokedWith2And3_then8Returned = { - assertEquals(8, power(2, 3)) - } - - @Test - def whenFibonacciCalled_thenCorrectValueReturned = { - assertEquals(34, fibonacci(8)) - } + @Test + def whenFibonacciCalled_thenCorrectValueReturned = { + assertEquals(1, fibonacci(0)) + assertEquals(1, fibonacci(1)) + assertEquals(fibonacci(6), + fibonacci(4) + fibonacci(5)) + } } \ No newline at end of file From cadc14f0c9b8ca2b2be434d1269472b5b309e17d Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Thu, 25 Oct 2018 21:09:35 -0300 Subject: [PATCH 206/546] BAEL-2299 - A CRUD web application with SpringBoot and Thymeleaf (#5530) * Initial Commit * Update Application.java * Update pom.xml * Update pom.xml * Update pom.xml * Update Application.java --- .../spring-boot-persistence/pom.xml | 33 +++++--- .../application/Application.java | 22 +++++ .../controllers/UserController.java | 66 +++++++++++++++ .../application/entities/User.java | 56 +++++++++++++ .../repositories/UserRepository.java | 13 +++ .../src/main/resources/css/shards.min.css | 2 + .../main/resources/templates/add-user.html | 40 +++++++++ .../src/main/resources/templates/index.html | 43 ++++++++++ .../main/resources/templates/update-user.html | 40 +++++++++ .../tests/UserControllerUnitTest.java | 81 +++++++++++++++++++ .../application/tests/UserUnitTest.java | 46 +++++++++++ 11 files changed, 429 insertions(+), 13 deletions(-) create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/Application.java create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/controllers/UserController.java create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/entities/User.java create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/repositories/UserRepository.java create mode 100644 persistence-modules/spring-boot-persistence/src/main/resources/css/shards.min.css create mode 100644 persistence-modules/spring-boot-persistence/src/main/resources/templates/add-user.html create mode 100644 persistence-modules/spring-boot-persistence/src/main/resources/templates/index.html create mode 100644 persistence-modules/spring-boot-persistence/src/main/resources/templates/update-user.html create mode 100644 persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserControllerUnitTest.java create mode 100644 persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserUnitTest.java diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index b34e33e38a..80472fdd57 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -16,22 +16,35 @@ + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + org.springframework.boot spring-boot-starter-data-jpa - - - com.zaxxer - HikariCP - - org.springframework.boot spring-boot-starter-test + + + org.mockito + mockito-core + ${mockito.version} test + com.h2database + h2 + ${h2database.version} + runtime + + org.apache.tomcat tomcat-jdbc ${tomcat-jdbc.version} @@ -41,20 +54,14 @@ mysql-connector-java ${mysql-connector-java.version} - - com.h2database - h2 - ${h2database.version} - runtime - - UTF-8 1.8 8.0.12 9.0.10 1.4.197 + 2.23.0 diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/Application.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/Application.java new file mode 100644 index 0000000000..ad99f4b3f2 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/Application.java @@ -0,0 +1,22 @@ +package com.baeldung.springbootcrudapp.application; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +@EnableAutoConfiguration +@ComponentScan(basePackages={"com.baeldung.springbootcrudapp.application"}) +@EnableJpaRepositories(basePackages="com.baeldung.springbootcrudapp.application.repositories") +@EnableTransactionManagement +@EntityScan(basePackages="com.baeldung.springbootcrudapp.application.entities") +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/controllers/UserController.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/controllers/UserController.java new file mode 100644 index 0000000000..c55f1083ba --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/controllers/UserController.java @@ -0,0 +1,66 @@ +package com.baeldung.springbootcrudapp.application.controllers; + +import com.baeldung.springbootcrudapp.application.repositories.UserRepository; +import com.baeldung.springbootcrudapp.application.entities.User; +import javax.validation.Valid; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +@Controller +public class UserController { + + private final UserRepository userRepository; + + @Autowired + public UserController(UserRepository userRepository) { + this.userRepository = userRepository; + } + + @GetMapping("/signup") + public String showSignUpForm(User user) { + return "add-user"; + } + + @PostMapping("/adduser") + public String addUser(@Valid User user, BindingResult result, Model model) { + if (result.hasErrors()) { + return "add-user"; + } + + userRepository.save(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } + + @GetMapping("/edit/{id}") + public String showUpdateForm(@PathVariable("id") long id, Model model) { + User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + model.addAttribute("user", user); + return "update-user"; + } + + @PostMapping("/update/{id}") + public String updateUser(@PathVariable("id") long id, @Valid User user, BindingResult result, Model model) { + if (result.hasErrors()) { + user.setId(id); + return "update-user"; + } + + userRepository.save(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } + + @GetMapping("/delete/{id}") + public String deleteUser(@PathVariable("id") long id, Model model) { + User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + userRepository.delete(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } +} diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/entities/User.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/entities/User.java new file mode 100644 index 0000000000..145f251158 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/entities/User.java @@ -0,0 +1,56 @@ +package com.baeldung.springbootcrudapp.application.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotBlank; + +@Entity +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + @NotBlank(message = "Name is mandatory") + private String name; + + @NotBlank(message = "Email is mandatory") + private String email; + + public User() {} + + public User(String name, String email) { + this.name = name; + this.email = email; + } + + public void setId(long id) { + this.id = id; + } + + public long getId() { + return id; + } + + public void setName(String name) { + this.name = name; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public String getEmail() { + return email; + } + + @Override + public String toString() { + return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; + } +} diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/repositories/UserRepository.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/repositories/UserRepository.java new file mode 100644 index 0000000000..c69372aab4 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/springbootcrudapp/application/repositories/UserRepository.java @@ -0,0 +1,13 @@ +package com.baeldung.springbootcrudapp.application.repositories; + +import com.baeldung.springbootcrudapp.application.entities.User; +import java.util.List; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserRepository extends CrudRepository { + + List findByName(String name); + +} diff --git a/persistence-modules/spring-boot-persistence/src/main/resources/css/shards.min.css b/persistence-modules/spring-boot-persistence/src/main/resources/css/shards.min.css new file mode 100644 index 0000000000..02260d25fa --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/resources/css/shards.min.css @@ -0,0 +1,2 @@ +@import url(https://fonts.googleapis.com/css?family=Poppins:300,400,500,600|Roboto+Mono);:root{--blue:#007bff;--indigo:#674eec;--purple:#8445f7;--pink:#ff4169;--red:#c4183c;--orange:#fb7906;--yellow:#ffb400;--green:#17c671;--teal:#1adba2;--cyan:#00b8d8;--white:#fff;--gray:#868e96;--gray-dark:#343a40;--primary:#007bff;--secondary:#5A6169;--success:#17c671;--info:#00b8d8;--warning:#ffb400;--danger:#c4183c;--light:#e9ecef;--dark:#212529;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;--font-family-monospace:"Roboto Mono",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}@media (max-width:575.98px){html{font-size:15px}}body{font-size:1rem;font-weight:300;color:#5a6169;background-color:#fff}a{color:#007bff;text-decoration:none}a:hover{color:#0056b3;text-decoration:underline}b,strong{font-weight:500}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}.h1,.h2,.h3,.h4,.h5,.h6{display:block}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.75rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:400;color:#212529}.h1,h1{font-size:3.052rem;letter-spacing:-.0625rem;line-height:3rem}.h2,h2{font-size:2.441rem;letter-spacing:-.0625rem;line-height:2.25rem}.h3,h3{font-size:1.953rem;line-height:2.25rem}.h4,h4{font-size:1.563rem;line-height:2rem}.h5,h5{font-size:1.25rem;line-height:1.5rem}.h6,h6{font-size:1rem;line-height:1.5rem}.lead{line-height:1.875rem}.display-1,.display-2,.display-3,.display-4{margin-bottom:.75rem}.display-1{font-size:7.451rem;line-height:1}.display-2{font-size:5.96rem;line-height:1}.display-3{font-size:4.768rem;line-height:1}.display-4{font-size:3.815rem;line-height:1}p{margin-bottom:1.75rem}hr{margin-top:1.125rem;margin-bottom:1.125rem;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:300}.mark,mark{padding:.2em;background-color:#fff09e}.blockquote{margin-bottom:.75rem;font-size:1.5rem}.blockquote-footer{font-size:1.125rem}.img-thumbnail{padding:0;border:none;background-color:#fff;border-radius:.375rem;box-shadow:none}.figure-img{margin-bottom:.75rem}.figure-caption{font-size:1rem;color:#868e96}code,kbd,pre,samp{font-family:"Roboto Mono",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}code{font-size:.75rem;padding:.1875rem .8125rem}kbd{padding:.1875rem .8125rem;font-size:.75rem;color:#fff;background-color:#212529;border-radius:.625rem;box-shadow:none}kbd kbd{font-weight:500}pre{margin-bottom:.75rem;font-size:.75rem;color:#212529;line-height:1.375rem}.pre-scrollable{max-height:340px}.table{background-color:transparent}.table td,.table th{padding:.75rem}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d1d3d5}.table-hover .table-secondary:hover{background-color:#c4c6c9}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c4c6c9}.table-success,.table-success>td,.table-success>th{background-color:#beefd7}.table-hover .table-success:hover{background-color:#aaeaca}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#aaeaca}.table-info,.table-info>td,.table-info>th{background-color:#b8ebf4}.table-hover .table-info:hover{background-color:#a2e5f1}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#a2e5f1}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeab8}.table-hover .table-warning:hover{background-color:#ffe29f}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe29f}.table-danger,.table-danger>td,.table-danger>th{background-color:#eebec8}.table-hover .table-danger:hover{background-color:#e9aab7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#e9aab7}.table-light,.table-light>td,.table-light>th{background-color:#f9fafb}.table-hover .table-light:hover{background-color:#eaedf1}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#eaedf1}.table-dark,.table-dark>td,.table-dark>th{background-color:#c1c2c3}.table-hover .table-dark:hover{background-color:#b4b5b6}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b4b5b6}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{background-color:rgba(255,255,255,.075)}.form-control{height:auto;padding:.5rem 1rem;font-size:.95rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #becad6;font-weight:300;will-change:border-color,box-shadow;border-radius:.375rem;box-shadow:none;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06)}.form-control:hover{border-color:#8fa4b8}.form-control:focus{color:#495057;background-color:#fff;border-color:#007bff;box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.form-control:focus:hover{border-color:#007bff}.form-control::-webkit-input-placeholder{color:#868e96}.form-control:-ms-input-placeholder{color:#868e96}.form-control::-ms-input-placeholder{color:#868e96}.form-control::placeholder{color:#868e96}.form-control:disabled,.form-control[readonly]{background-color:#f5f6f7}.form-control:disabled:hover,.form-control[readonly]:hover{border-color:#becad6;cursor:not-allowed}.form-control[readonly]:not(:disabled):focus{box-shadow:none;border-color:#becad6}select.form-control:not([size]):not([multiple]){height:calc(2.425rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}select.form-control:hover{cursor:pointer}form label:hover{cursor:pointer}.col-form-label{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);line-height:1.5}.col-form-label-lg{padding-top:calc(.75rem + 1px);padding-bottom:calc(.75rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.35rem + 1px);padding-bottom:calc(.35rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{padding-top:.5rem;padding-bottom:.5rem;line-height:1.5;font-weight:300}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-middle>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.35rem .75rem;font-size:.875rem;line-height:1.5;border-radius:.35rem}.input-group-sm>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-middle>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(2.0125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-middle>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.75rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.5rem}.input-group-lg>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-middle>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(3.375rem + 2px)}.form-group{margin-bottom:1rem}.form-text{margin-top:.25rem}.form-check{padding-left:1.25rem}.form-check-input{margin-top:.313rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#868e96}.form-check-inline{margin-right:.75rem}.form-check-inline .form-check-input{margin-right:.3125rem}.valid-feedback{margin-top:.25rem;font-size:80%;color:#17c671}.valid-tooltip{background-color:rgba(23,198,113,.8)}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#17c671;box-shadow:0 5px 11.5px rgba(23,198,113,.1)}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{box-shadow:0 5px 11.5px rgba(23,198,113,.1),0 1px 1px .1rem rgba(23,198,113,.2)}.custom-select.is-valid:hover,.form-control.is-valid:hover,.was-validated .custom-select:valid:hover,.was-validated .form-control:valid:hover{border-color:#17c671}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#17c671}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#17c671}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{background-color:#57eca4;border-color:#2ae68b}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{background-color:#2ae68b}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(23,198,113,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{color:#17c671;border-color:#17c671}.custom-file-input.is-valid~.custom-file-label::after,.was-validated .custom-file-input:valid~.custom-file-label::after{background-color:#b3f6d5;border-color:#2ae68b;color:#17c671}.custom-file-input:focus.is-valid~.custom-file-label,.was-validated .custom-file-input:focus:valid~.custom-file-label{border-color:#17c671;box-shadow:0 5px 11.5px rgba(23,198,113,.1),0 1px 1px .1rem rgba(23,198,113,.2)}.custom-file-input:hover.is-valid~.custom-file-label,.was-validated .custom-file-input:hover:valid~.custom-file-label{border-color:#17c671}.custom-toggle .custom-control-input:not(:checked).is-valid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:not(:checked):valid~.custom-control-label::before{background-color:#fff}.custom-toggle .custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:valid~.custom-control-label::before{background-color:#17c671}.custom-toggle .custom-control-input.is-invalid~.custom-control-label::after,.was-validated .custom-toggle .custom-control-input:invalid~.custom-control-label::after{background-color:#eb8c95}.custom-toggle .custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(23,198,113,.1),0 .156rem .125rem rgba(0,0,0,.06)}.invalid-feedback{margin-top:.25rem;font-size:80%;color:#c4183c}.invalid-tooltip{background-color:rgba(196,24,60,.8)}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#c4183c;box-shadow:0 5px 11.5px rgba(196,24,60,.1)}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{box-shadow:0 5px 11.5px rgba(196,24,60,.1),0 1px 1px .1rem rgba(196,24,60,.2)}.custom-select.is-invalid:hover,.form-control.is-invalid:hover,.was-validated .custom-select:invalid:hover,.was-validated .form-control:invalid:hover{border-color:#c4183c}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#c4183c}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#c4183c}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{background-color:#ea5876;border-color:#e52a51}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{background-color:#e52a51}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(196,24,60,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{color:#c4183c;border-color:#c4183c}.custom-file-input.is-invalid~.custom-file-label::after,.was-validated .custom-file-input:invalid~.custom-file-label::after{background-color:#f6b2c0;border-color:#e52a51;color:#c4183c}.custom-file-input:focus.is-invalid~.custom-file-label,.was-validated .custom-file-input:focus:invalid~.custom-file-label{border-color:#c4183c;box-shadow:0 5px 11.5px rgba(196,24,60,.1),0 1px 1px .1rem rgba(196,24,60,.2)}.custom-file-input:hover.is-invalid~.custom-file-label,.was-validated .custom-file-input:hover:invalid~.custom-file-label{border-color:#c4183c}.custom-toggle .custom-control-input:not(:checked).is-invalid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:not(:checked):invalid~.custom-control-label::before{background-color:#fff}.custom-toggle .custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:valid~.custom-control-label::before{background-color:#17c671}.custom-toggle .custom-control-input.is-invalid~.custom-control-label::after,.was-validated .custom-toggle .custom-control-input:invalid~.custom-control-label::after{background-color:#eb8c95}.custom-toggle .custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(196,24,60,.1),0 .156rem .125rem rgba(0,0,0,.06)}@media (min-width:576px){.form-inline .form-check-input{margin-right:.313rem}}.btn{font-weight:300;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;border:1px solid transparent;padding:.75rem 1.25rem;font-size:.875rem;line-height:1.125;border-radius:.375rem;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.btn.hover,.btn:hover{cursor:pointer}.btn.focus,.btn:focus{box-shadow:none}.btn:not([disabled]):not(.disabled).active,.btn:not([disabled]):not(.disabled):active{background-image:none;box-shadow:none}.btn.btn-squared{border-radius:0}.btn.btn-pill{border-radius:50px}.btn-primary{color:#fff;border-color:#007bff;background-color:#007bff;box-shadow:none}.btn-primary:hover{color:#fff;background-color:#006fe6;border-color:#006fe6;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,123,255,.25)}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 3px rgba(0,123,255,.15),0 3px 15px rgba(0,123,255,.2),0 2px 5px rgba(0,0,0,.1)}.btn-primary.disabled,.btn-primary:disabled{background-color:#007bff;border-color:#007bff;box-shadow:none;cursor:not-allowed}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#006fe6;border-color:#0062cc;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-secondary{color:#fff;border-color:#5a6169;background-color:#5a6169;box-shadow:none}.btn-secondary:hover{color:#fff;background-color:#4e545b;border-color:#4e545b;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(90,97,105,.25)}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 3px rgba(90,97,105,.15),0 3px 15px rgba(90,97,105,.2),0 2px 5px rgba(0,0,0,.1)}.btn-secondary.disabled,.btn-secondary:disabled{background-color:#5a6169;border-color:#5a6169;box-shadow:none;cursor:not-allowed}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#4e545b;border-color:#42484e;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-success{color:#fff;border-color:#17c671;background-color:#17c671;box-shadow:none}.btn-success:hover{color:#fff;background-color:#14af64;border-color:#14af64;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(23,198,113,.25)}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 3px rgba(23,198,113,.15),0 3px 15px rgba(23,198,113,.2),0 2px 5px rgba(0,0,0,.1)}.btn-success.disabled,.btn-success:disabled{background-color:#17c671;border-color:#17c671;box-shadow:none;cursor:not-allowed}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#14af64;border-color:#129857;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-info{color:#fff;border-color:#00b8d8;background-color:#00b8d8;box-shadow:none}.btn-info:hover{color:#fff;background-color:#00a2bf;border-color:#00a2bf;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,184,216,.25)}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 3px rgba(0,184,216,.15),0 3px 15px rgba(0,184,216,.2),0 2px 5px rgba(0,0,0,.1)}.btn-info.disabled,.btn-info:disabled{background-color:#00b8d8;border-color:#00b8d8;box-shadow:none;cursor:not-allowed}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#00a2bf;border-color:#008da5;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-warning{color:#212529;border-color:#ffb400;background-color:#ffb400;box-shadow:none}.btn-warning:hover{color:#212529;background-color:#e6a200;border-color:#e6a200;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,180,0,.25)}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 3px rgba(255,180,0,.15),0 3px 15px rgba(255,180,0,.2),0 2px 5px rgba(0,0,0,.1)}.btn-warning.disabled,.btn-warning:disabled{background-color:#ffb400;border-color:#ffb400;box-shadow:none;cursor:not-allowed}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#e6a200;border-color:#cc9000;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-danger{color:#fff;border-color:#c4183c;background-color:#c4183c;box-shadow:none}.btn-danger:hover{color:#fff;background-color:#ad1535;border-color:#ad1535;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(196,24,60,.25)}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 3px rgba(196,24,60,.15),0 3px 15px rgba(196,24,60,.2),0 2px 5px rgba(0,0,0,.1)}.btn-danger.disabled,.btn-danger:disabled{background-color:#c4183c;border-color:#c4183c;box-shadow:none;cursor:not-allowed}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#ad1535;border-color:#97122e;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-light{color:#212529;border-color:#e9ecef;background-color:#e9ecef;box-shadow:none}.btn-light:hover{color:#212529;background-color:#dadfe4;border-color:#dadfe4;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(233,236,239,.25)}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 3px rgba(233,236,239,.15),0 3px 15px rgba(233,236,239,.2),0 2px 5px rgba(0,0,0,.1)}.btn-light.disabled,.btn-light:disabled{background-color:#e9ecef;border-color:#e9ecef;box-shadow:none;cursor:not-allowed}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dadfe4;border-color:#cbd3da;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-dark{color:#fff;border-color:#212529;background-color:#212529;box-shadow:none}.btn-dark:hover{color:#fff;background-color:#16181b;border-color:#16181b;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(33,37,41,.25)}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 3px rgba(33,37,41,.15),0 3px 15px rgba(33,37,41,.2),0 2px 5px rgba(0,0,0,.1)}.btn-dark.disabled,.btn-dark:disabled{background-color:#212529;border-color:#212529;box-shadow:none;cursor:not-allowed}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#16181b;border-color:#0a0c0d;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-white{color:#212529;border-color:#fff;background-color:#fff;box-shadow:none}.btn-white:hover{color:#212529;background-color:#f2f2f2;border-color:#f2f2f2;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,255,255,.25)}.btn-white.focus,.btn-white:focus{box-shadow:0 0 0 3px rgba(255,255,255,.15),0 3px 15px rgba(255,255,255,.2),0 2px 5px rgba(0,0,0,.1)}.btn-white.disabled,.btn-white:disabled{background-color:#fff;border-color:#fff;box-shadow:none;cursor:not-allowed}.btn-white:not(:disabled):not(.disabled).active,.btn-white:not(:disabled):not(.disabled):active,.show>.btn-white.dropdown-toggle{color:#212529;background-color:#f2f2f2;border-color:#e6e6e6;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-black{color:#fff;border-color:#000;background-color:#000;box-shadow:none}.btn-black:hover{color:#fff;background-color:#000;border-color:#000;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,0,0,.25)}.btn-black.focus,.btn-black:focus{box-shadow:0 0 0 3px rgba(0,0,0,.15),0 3px 15px rgba(0,0,0,.2),0 2px 5px rgba(0,0,0,.1)}.btn-black.disabled,.btn-black:disabled{background-color:#000;border-color:#000;box-shadow:none;cursor:not-allowed}.btn-black:not(:disabled):not(.disabled).active,.btn-black:not(:disabled):not(.disabled):active,.show>.btn-black.dropdown-toggle{color:#fff;background-color:#000;border-color:#000;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-primary{background-color:transparent;background-image:none;border-color:#007bff;color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,123,255,.25)}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 3px rgba(0,123,255,.15),0 3px 15px rgba(0,123,255,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent;box-shadow:none}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-secondary{background-color:transparent;background-image:none;border-color:#5a6169;color:#5a6169}.btn-outline-secondary:hover{color:#fff;background-color:#5a6169;border-color:#5a6169;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(90,97,105,.25)}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 3px rgba(90,97,105,.15),0 3px 15px rgba(90,97,105,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#5a6169;background-color:transparent;box-shadow:none}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#5a6169;border-color:#5a6169}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-success{background-color:transparent;background-image:none;border-color:#17c671;color:#17c671}.btn-outline-success:hover{color:#fff;background-color:#17c671;border-color:#17c671;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(23,198,113,.25)}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 3px rgba(23,198,113,.15),0 3px 15px rgba(23,198,113,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#17c671;background-color:transparent;box-shadow:none}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#17c671;border-color:#17c671}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-info{background-color:transparent;background-image:none;border-color:#00b8d8;color:#00b8d8}.btn-outline-info:hover{color:#fff;background-color:#00b8d8;border-color:#00b8d8;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,184,216,.25)}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 3px rgba(0,184,216,.15),0 3px 15px rgba(0,184,216,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#00b8d8;background-color:transparent;box-shadow:none}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#00b8d8;border-color:#00b8d8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-warning{background-color:transparent;background-image:none;border-color:#ffb400;color:#ffb400}.btn-outline-warning:hover{color:#212529;background-color:#ffb400;border-color:#ffb400;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,180,0,.25)}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 3px rgba(255,180,0,.15),0 3px 15px rgba(255,180,0,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffb400;background-color:transparent;box-shadow:none}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffb400;border-color:#ffb400}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-danger{background-color:transparent;background-image:none;border-color:#c4183c;color:#c4183c}.btn-outline-danger:hover{color:#fff;background-color:#c4183c;border-color:#c4183c;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(196,24,60,.25)}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 3px rgba(196,24,60,.15),0 3px 15px rgba(196,24,60,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#c4183c;background-color:transparent;box-shadow:none}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#c4183c;border-color:#c4183c}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-light{background-color:transparent;background-image:none;border-color:#e9ecef;color:#212529}.btn-outline-light:hover{color:#212529;background-color:#e9ecef;border-color:#e9ecef;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(233,236,239,.25)}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 3px rgba(233,236,239,.15),0 3px 15px rgba(233,236,239,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#e9ecef;background-color:transparent;box-shadow:none}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#e9ecef;border-color:#e9ecef}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-dark{background-color:transparent;background-image:none;border-color:#212529;color:#212529}.btn-outline-dark:hover{color:#fff;background-color:#212529;border-color:#212529;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(33,37,41,.25)}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 3px rgba(33,37,41,.15),0 3px 15px rgba(33,37,41,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#212529;background-color:transparent;box-shadow:none}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#212529;border-color:#212529}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-white{background-color:transparent;background-image:none;border-color:#fff;color:#212529;color:#fff}.btn-outline-white:hover{color:#212529;background-color:#fff;border-color:#fff;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,255,255,.25)}.btn-outline-white.focus,.btn-outline-white:focus{box-shadow:0 0 0 3px rgba(255,255,255,.15),0 3px 15px rgba(255,255,255,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-white.disabled,.btn-outline-white:disabled{color:#fff;background-color:transparent;box-shadow:none}.btn-outline-white:not(:disabled):not(.disabled).active,.btn-outline-white:not(:disabled):not(.disabled):active,.show>.btn-outline-white.dropdown-toggle{color:#212529;background-color:#fff;border-color:#fff}.btn-outline-white:not(:disabled):not(.disabled).active:focus,.btn-outline-white:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-white.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-white:not(:disabled):not(.disabled).active,.btn-outline-white:not(:disabled):not(.disabled):active{color:#000}.btn-outline-black{background-color:transparent;background-image:none;border-color:#000;color:#000;color:#000}.btn-outline-black:hover{color:#fff;background-color:#000;border-color:#000;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,0,0,.25)}.btn-outline-black.focus,.btn-outline-black:focus{box-shadow:0 0 0 3px rgba(0,0,0,.15),0 3px 15px rgba(0,0,0,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-black.disabled,.btn-outline-black:disabled{color:#000;background-color:transparent;box-shadow:none}.btn-outline-black:not(:disabled):not(.disabled).active,.btn-outline-black:not(:disabled):not(.disabled):active,.show>.btn-outline-black.dropdown-toggle{color:#fff;background-color:#000;border-color:#000}.btn-outline-black:not(:disabled):not(.disabled).active:focus,.btn-outline-black:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-black.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-black:not(:disabled):not(.disabled).active,.btn-outline-black:not(:disabled):not(.disabled):active{color:#fff}.btn-link{font-weight:300;color:#007bff}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link:disabled{color:#868e96}.btn-group-lg>.btn,.btn-lg{padding:.75rem 1.75rem;font-size:1.125rem;line-height:1.5;border-radius:.5rem}.btn-group-sm>.btn,.btn-sm{padding:.35rem 1rem;font-size:.75rem;line-height:1.5;border-radius:.35rem}.btn-block+.btn-block{margin-top:.5rem}.fade{transition:opacity .2s ease-in-out}.collapsing{transition:height 350ms ease-in-out}i.material-icons{font-size:inherit;position:relative;top:2px}.dropdown-menu{z-index:1000;min-width:10rem;padding:.5rem 0;margin:0 0 0;font-size:1rem;color:#5a6169;background-color:#fff;border:1px solid rgba(0,0,0,.05);border-radius:.375rem;box-shadow:0 .5rem 4rem rgba(0,0,0,.11),0 10px 20px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.06)}.dropdown-menu-small{box-shadow:0 .5rem 2rem rgba(0,0,0,.11),0 3px 10px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.06);padding:.25rem 0;font-size:.813rem}.dropdown-menu-small .dropdown-item{padding:.375rem .875rem;font-size:.813rem}.dropdown-menu-small .dropdown-divider{margin:.25rem 0}.dropup .dropdown-menu{margin-bottom:0}.dropright .dropdown-menu{margin-left:0}.dropleft .dropdown-menu{margin-right:0}.dropdown-divider{height:0;margin:.75rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{padding:.5rem 1.25rem;font-weight:300;color:#212529;font-size:.9375rem;transition:background-color 250ms cubic-bezier(.27,.01,.38,1.06),color 250ms cubic-bezier(.27,.01,.38,1.06)}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;background-color:#eceeef}.dropdown-item.active,.dropdown-item:active{color:#fff;background-color:#c3c7cc}.dropdown-item.disabled,.dropdown-item:disabled{color:#868e96}.dropdown-item.disabled:hover,.dropdown-item:disabled:hover{background:0 0;cursor:not-allowed}.dropdown-header{padding:.5rem 1.25rem;font-size:.875rem;color:#868e96}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.9375rem;padding-left:.9375rem}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:1.3125rem;padding-left:1.3125rem}.btn-group.show .dropdown-toggle{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.show .dropdown-toggle.btn-link{box-shadow:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control{margin-left:-1px}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-file:not(:first-child) .custom-file-label::after{border-top-left-radius:0;border-bottom-left-radius:0}.input-group.input-group-seamless>.form-control{border-radius:.375rem}.input-group.input-group-seamless>.input-group-append,.input-group.input-group-seamless>.input-group-prepend{position:absolute;top:0;bottom:0;z-index:4}.input-group.input-group-seamless>.input-group-append .input-group-text,.input-group.input-group-seamless>.input-group-prepend .input-group-text{padding:12px 14px;background:0 0;border:none}.input-group.input-group-seamless>.input-group-append{right:0}.input-group.input-group-seamless>.input-group-middle{right:0;left:0}.input-group.input-group-seamless>.input-group-prepend{left:0}.input-group.input-group-seamless>.custom-select:not(:last-child),.input-group.input-group-seamless>.form-control:not(:last-child){padding-right:40px}.input-group.input-group-seamless>.custom-select:not(:first-child),.input-group.input-group-seamless>.form-control:not(:first-child){padding-left:40px}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{font-size:1rem;font-weight:300;line-height:1.5;color:#abb6bf;background-color:#f9fafb;border:1px solid #becad6;border-radius:.375rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.input-group-middle>.btn,.input-group>.input-group-middle>.input-group-text{border-left:0;border-right:0;border-radius:0}.input-group-middle{display:-ms-flexbox;display:flex}.custom-control{min-height:1.5rem;padding-left:1.688rem}.custom-control:hover{cursor:pointer}.custom-control .custom-control-label:before{pointer-events:all}.custom-control-inline{margin-right:1rem}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:transparent;background-color:#007bff;box-shadow:none}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-control-input:active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;box-shadow:none}.custom-control-input:disabled~.custom-control-label{color:#868e96}.custom-control-input:disabled~.custom-control-label:hover{cursor:not-allowed}.custom-control-input:disabled~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:static}.custom-control-label:hover{cursor:pointer}.custom-control-label::before{top:.1875rem;left:0;width:1.125rem;height:1.125rem;background-color:#fff;border:1px solid #becad6;transition:all 250ms cubic-bezier(.27,.01,.38,1.06);box-shadow:none}.custom-control-label::after{top:.1875rem;width:1.125rem;height:1.125rem;background-size:50% 50%}.custom-checkbox .custom-control-label::before{border-radius:2px}.custom-checkbox .custom-control-label::after{content:'';position:absolute;top:5px;left:7px;width:5px;height:11px;opacity:0;-webkit-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);border-right:2px solid #fff;border-bottom:2px solid #fff;transition:border 250ms cubic-bezier(.27,.01,.38,1.06),-webkit-transform 250ms cubic-bezier(.27,.01,.38,1.06);transition:transform 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06);transition:transform 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06),-webkit-transform 250ms cubic-bezier(.27,.01,.38,1.06);transition-delay:.1s}.custom-checkbox .custom-control-input:checked~.custom-control-label::before{background-image:none}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{opacity:1;-webkit-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1);background-image:none}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border:none;background-color:#007bff;box-shadow:none}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{content:'';position:absolute;-webkit-transform:scale(1);transform:scale(1);background-image:none;background-color:#fff;border:none;width:10px;height:2px;top:11px;left:4px;opacity:1;transition:none}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background:#e9ecef;border-color:#becad6}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::after{border-color:#becad6}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-label::after{content:'';border-radius:50%;-webkit-transform:scale(0);transform:scale(0);background-image:none!important;position:absolute;background:#fff;width:8px;height:8px;top:8px;left:5px;transition:all 250ms cubic-bezier(.27,.01,.38,1.06);transition-delay:.1s;opacity:0;transform:scale(0)}.custom-radio .custom-control-input:checked~.custom-control-label::before{background-color:#007bff}.custom-radio .custom-control-input:checked~.custom-control-label::after{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:#a8aeb4}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background:#e9ecef;border-color:#becad6}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::after{background:#becad6}.custom-select{height:calc(2.425rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.2;color:#495057;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid #becad6;font-weight:300;font-size:.95rem;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06);border-radius:.375rem}.custom-select:focus{border-color:#007bff;box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select:hover:not(:focus):not(:disabled){cursor:pointer;border-color:#8fa4b8}.custom-select[multiple],.custom-select[size]:not([size="1"]){padding-right:.75rem}.custom-select:disabled{color:#868e96;background-color:#e9ecef}.custom-select-sm{height:calc(2.0125rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:.75rem}.custom-select-lg{height:calc(3.375rem + 2px);font-size:1.25rem;padding-top:.375rem;padding-bottom:.375rem}.custom-file{height:calc(2.428rem + 2px);font-size:.95rem;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06)}.custom-file-input{min-width:14rem;height:calc(2.428rem + 2px)}.custom-file-input:focus~.custom-file-label{border-color:#007bff;color:#495057;box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-file-input:focus~.custom-file-label::after{border-color:#007bff;color:#007bff;background:#e6f2ff}.custom-file-input:focus~.custom-file-label:hover{border-color:#007bff}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input:not(:disabled):hover{cursor:pointer}.custom-file-input:not(:disabled):hover~.custom-file-label,.custom-file-input:not(:disabled):hover~.custom-file-label:before{border-color:#8fa4b8}.custom-file-input:disabled+.custom-file-label{color:#868e96;background-color:#f8f9fa}.custom-file-label{height:calc(2.428rem + 2px);padding:.5rem 1rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #becad6;font-weight:300;box-shadow:none;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border-color 250ms cubic-bezier(.27,.01,.38,1.06);border-radius:.375rem}.custom-file-label::after{padding:.5rem 1rem;height:calc(calc(2.428rem + 2px) - 1px * 2);line-height:1.5;color:#495057;border-left:1px solid #becad6;background-color:#e9ecef;border-radius:0 .375rem .375rem 0}.custom-toggle{position:relative;padding-left:3.75rem}.custom-toggle .custom-control-label::before{position:absolute;top:0;left:0;display:block;width:3.125rem;height:1.75rem;background:#fff;border-radius:100px;border:.0625rem solid #becad6}.custom-toggle .custom-control-label::after{content:'';position:absolute;top:.25rem;left:.25rem;width:1.25rem;height:1.25rem;background:#becad6;border-radius:6.25rem;transition:350ms}.custom-toggle .custom-control-input:checked~.custom-control-label::before{background:#17c671;border-color:#17c671}.custom-toggle .custom-control-input:checked~.custom-control-label::after{left:2.875rem;-webkit-transform:translateX(-100%);transform:translateX(-100%);background:#fff}.custom-toggle .custom-control-input:checked:disabled~.custom-control-label::before{background:#e9ecef;border-color:#becad6}.custom-toggle .custom-control-input:checked:disabled~.custom-control-label::after{background:#becad6}.custom-toggle .custom-control-input:active:not(:disabled)~.custom-control-label::after{width:1.625rem}.custom-toggle .custom-control-input:active:not(:checked)~.custom-control-label::before{background-color:#fff}.custom-toggle .custom-control-input:disabled:active~.custom-control-label::before{background-color:#e9ecef}.custom-toggle .custom-control-input:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(23,198,113,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-toggle .custom-control-input:focus:not(:checked)~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-toggle.custom-toggle-sm{padding-left:2.625rem}.custom-toggle.custom-toggle-sm .custom-control-label::before{top:.1875rem;position:absolute;display:block;width:2.1875rem;height:1.125rem;background:#fff;border-radius:100px;border:.0625rem solid #becad6}.custom-toggle.custom-toggle-sm .custom-control-label::after{content:'';position:absolute;top:.375rem;left:.1875rem;width:.75rem;height:.75rem}.custom-toggle.custom-toggle-sm .custom-control-input:checked~.custom-control-label::after{left:1.9375rem}.custom-toggle.custom-toggle-sm .custom-control-input:active:not(:disabled)~.custom-control-label::after{width:1rem}.nav{font-size:.875rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}.nav-link{padding:.625rem 1.125rem;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.nav-link.disabled{color:#868e96}.nav-tabs{border-bottom:1px solid #d1d4d8}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.375rem;border-top-right-radius:.375rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef}.nav-tabs .nav-link.disabled{color:#868e96}.nav-tabs .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-tabs .nav-link:hover{border-color:#e7e9ea}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#ddd}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.375rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-pills:hover{background-color:#fdfdfd}.nav-outlined-pills .nav-link{border-radius:.375rem;border:1px solid transparent}.nav-outlined-pills .nav-link.active,.show>.nav-outlined-pills .nav-link{background:0 0;color:#007bff;border-color:#007bff}.nav-outlined-pills .nav-link:hover{border-color:#e7e9ea}.nav-blue .nav-link.active{background-color:#007bff;border-color:#0074f0;color:#fff}.nav-blue .nav-link.disabled{color:#868e96}.nav-blue .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-blue .nav-link{color:#007bff}.nav-blue.nav-outlined-pills .nav-link.active{background:0 0;border-color:#3395ff;color:#007bff}.nav-blue.nav-outlined-pills .nav-link.active:hover{border-color:#3395ff}.nav-blue.nav-outlined-pills .nav-link{color:#007bff}.nav-indigo .nav-link.active{background-color:#674eec;border-color:#5b40eb;color:#fff}.nav-indigo .nav-link.disabled{color:#868e96}.nav-indigo .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-indigo .nav-link{color:#674eec}.nav-indigo.nav-outlined-pills .nav-link.active{background:0 0;border-color:#8f7cf1;color:#674eec}.nav-indigo.nav-outlined-pills .nav-link.active:hover{border-color:#8f7cf1}.nav-indigo.nav-outlined-pills .nav-link{color:#674eec}.nav-purple .nav-link.active{background-color:#8445f7;border-color:#7a36f6;color:#fff}.nav-purple .nav-link.disabled{color:#868e96}.nav-purple .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-purple .nav-link{color:#8445f7}.nav-purple.nav-outlined-pills .nav-link.active{background:0 0;border-color:#a476f9;color:#8445f7}.nav-purple.nav-outlined-pills .nav-link.active:hover{border-color:#a476f9}.nav-purple.nav-outlined-pills .nav-link{color:#8445f7}.nav-pink .nav-link.active{background-color:#ff4169;border-color:#ff325d;color:#fff}.nav-pink .nav-link.disabled{color:#868e96}.nav-pink .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-pink .nav-link{color:#ff4169}.nav-pink.nav-outlined-pills .nav-link.active{background:0 0;border-color:#ff7491;color:#ff4169}.nav-pink.nav-outlined-pills .nav-link.active:hover{border-color:#ff7491}.nav-pink.nav-outlined-pills .nav-link{color:#ff4169}.nav-red .nav-link.active{background-color:#c4183c;border-color:#b61638;color:#fff}.nav-red .nav-link.disabled{color:#868e96}.nav-red .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-red .nav-link{color:#c4183c}.nav-red.nav-outlined-pills .nav-link.active{background:0 0;border-color:#e52a51;color:#c4183c}.nav-red.nav-outlined-pills .nav-link.active:hover{border-color:#e52a51}.nav-red.nav-outlined-pills .nav-link{color:#c4183c}.nav-orange .nav-link.active{background-color:#fb7906;border-color:#ee7204;color:#fff}.nav-orange .nav-link.disabled{color:#868e96}.nav-orange .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-orange .nav-link{color:#fb7906}.nav-orange.nav-outlined-pills .nav-link.active{background:0 0;border-color:#fc9438;color:#fb7906}.nav-orange.nav-outlined-pills .nav-link.active:hover{border-color:#fc9438}.nav-orange.nav-outlined-pills .nav-link{color:#fb7906}.nav-yellow .nav-link.active{background-color:#ffb400;border-color:#f0a900;color:#212529}.nav-yellow .nav-link.disabled{color:#868e96}.nav-yellow .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-yellow .nav-link{color:#ffb400}.nav-yellow.nav-outlined-pills .nav-link.active{background:0 0;border-color:#ffc333;color:#ffb400}.nav-yellow.nav-outlined-pills .nav-link.active:hover{border-color:#ffc333}.nav-yellow.nav-outlined-pills .nav-link{color:#ffb400}.nav-green .nav-link.active{background-color:#17c671;border-color:#15b869;color:#fff}.nav-green .nav-link.disabled{color:#868e96}.nav-green .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-green .nav-link{color:#17c671}.nav-green.nav-outlined-pills .nav-link.active{background:0 0;border-color:#2ae68b;color:#17c671}.nav-green.nav-outlined-pills .nav-link.active:hover{border-color:#2ae68b}.nav-green.nav-outlined-pills .nav-link{color:#17c671}.nav-teal .nav-link.active{background-color:#1adba2;border-color:#18cd98;color:#212529}.nav-teal .nav-link.disabled{color:#868e96}.nav-teal .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-teal .nav-link{color:#1adba2}.nav-teal.nav-outlined-pills .nav-link.active{background:0 0;border-color:#40e8b7;color:#1adba2}.nav-teal.nav-outlined-pills .nav-link.active:hover{border-color:#40e8b7}.nav-teal.nav-outlined-pills .nav-link{color:#1adba2}.nav-cyan .nav-link.active{background-color:#00b8d8;border-color:#00abc9;color:#fff}.nav-cyan .nav-link.disabled{color:#868e96}.nav-cyan .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-cyan .nav-link{color:#00b8d8}.nav-cyan.nav-outlined-pills .nav-link.active{background:0 0;border-color:#0cdbff;color:#00b8d8}.nav-cyan.nav-outlined-pills .nav-link.active:hover{border-color:#0cdbff}.nav-cyan.nav-outlined-pills .nav-link{color:#00b8d8}.nav-white .nav-link.active{background-color:#fff;border-color:#f7f7f7;color:#212529}.nav-white .nav-link.disabled{color:#868e96}.nav-white .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-white .nav-link{color:#fff}.nav-white.nav-outlined-pills .nav-link.active{background:0 0;border-color:#fff;color:#fff}.nav-white.nav-outlined-pills .nav-link.active:hover{border-color:#fff}.nav-white.nav-outlined-pills .nav-link{color:#fff}.nav-gray .nav-link.active{background-color:#868e96;border-color:#7e868f;color:#fff}.nav-gray .nav-link.disabled{color:#868e96}.nav-gray .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-gray .nav-link{color:#868e96}.nav-gray.nav-outlined-pills .nav-link.active{background:0 0;border-color:#a1a8ae;color:#868e96}.nav-gray.nav-outlined-pills .nav-link.active:hover{border-color:#a1a8ae}.nav-gray.nav-outlined-pills .nav-link{color:#868e96}.nav-gray-dark .nav-link.active{background-color:#343a40;border-color:#2d3238;color:#fff}.nav-gray-dark .nav-link.disabled{color:#868e96}.nav-gray-dark .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-gray-dark .nav-link{color:#343a40}.nav-gray-dark.nav-outlined-pills .nav-link.active{background:0 0;border-color:#4b545c;color:#343a40}.nav-gray-dark.nav-outlined-pills .nav-link.active:hover{border-color:#4b545c}.nav-gray-dark.nav-outlined-pills .nav-link{color:#343a40}.navbar{padding:.75rem 1.5rem}.navbar-brand{padding-top:.625rem;padding-bottom:.625rem;margin-right:1.5rem;font-size:1rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:400}.navbar-text{padding-top:.625rem;padding-bottom:.625rem}.navbar-toggler{padding:.5rem .5rem;font-size:1rem;background:#fff;border:1px solid transparent;border-radius:.375rem}@media (min-width:576px){.navbar-expand-sm .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}@media (min-width:768px){.navbar-expand-md .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}@media (min-width:992px){.navbar-expand-lg .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}@media (min-width:1200px){.navbar-expand-xl .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}.navbar-expand .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1);background:0 0}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1);background:0 0}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{background-color:#fff;border:none;border-radius:.625rem;box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.625rem;border-top-right-radius:.625rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.625rem;border-bottom-left-radius:.625rem}.card .list-group-item{padding:.8125rem 1.875rem}.card .card-text{margin-bottom:1.5625rem}.card a:hover{text-decoration:none}.card-small{box-shadow:0 2px 0 rgba(90,97,105,.11),0 4px 8px rgba(90,97,105,.12),0 10px 10px rgba(90,97,105,.06),0 7px 70px rgba(90,97,105,.1)}.card-small .card-body,.card-small .card-footer,.card-small .card-header{padding:1rem 1rem}.card-body{padding:1.875rem}.card-body>p:last-child{margin-bottom:0}.card-title{font-weight:500;margin-bottom:.75rem}.card-subtitle{margin-top:-1.09375rem}.card-link{font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}.card-link+.card-link{margin-left:1.875rem}.card-header{padding:1.09375rem 1.875rem;background-color:rgba(90,97,105,.06);border-bottom:none}.card-header:first-child{border-radius:.625rem .625rem 0 0}.card-footer{padding:1.09375rem 1.875rem;background-color:rgba(90,97,105,.06);border-top:none}.card-footer:last-child{border-radius:0 0 .625rem .625rem}.card-header-tabs{margin-bottom:-1rem;border-bottom:0}.card-header-tabs .nav-link,.card-header-tabs .nav-link:hover{border-bottom:transparent}.card-header-pills{margin-right:-.9375rem;margin-left:-.9375rem}.card-header-pills:hover{background:0 0}.card-img-overlay{padding:1.875rem 2.1875rem;background:rgba(90,97,105,.5);border-radius:.625rem}.card-img-overlay .card-title{color:#fff}.card-img{border-radius:.625rem}.card-img-top{border-top-left-radius:.625rem;border-top-right-radius:.625rem}.card-img-bottom{border-bottom-right-radius:.625rem;border-bottom-left-radius:.625rem}.card-deck .card{margin-bottom:.9375rem}@media (min-width:576px){.card-deck{margin-right:-.9375rem;margin-left:-.9375rem}.card-deck .card{margin-right:.9375rem;margin-left:.9375rem}}.card-group>.card{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.card-group>.card:last-child .card-body,.card-group>.card:last-child .card-footer{border-right:none}.card-group .card-body,.card-group .card-footer{border-right:1px solid #e7e9ea}@media (min-width:576px){.card-group{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1);border-radius:.625rem}.card-group>.card{box-shadow:none}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:.625rem}.card-group>.card:only-child .card-header,.card-group>.card:only-child .card-img-top{border-top-left-radius:.625rem;border-top-right-radius:.625rem}.card-group>.card:only-child .card-footer,.card-group>.card:only-child .card-img-bottom{border-bottom-right-radius:.625rem;border-bottom-left-radius:.625rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child){border-radius:0}.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:2.1875rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem}}.pagination{padding-left:0;list-style:none;border-radius:.375rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:.875rem}.page-link{padding:.5rem .75rem;line-height:1.25;color:#007bff;background-color:#fff;border:none;margin:0;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.page-link:focus,.page-link:hover{color:#0056b3;background-color:#f5f5f6;border-color:#dfe1e3}.page-item{box-shadow:0 .125rem .9375rem rgba(90,97,105,.1),0 .125rem .1875rem rgba(90,97,105,.15)}.page-item:first-child{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;overflow:hidden}.page-item:last-child{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem;overflow:hidden}.page-item:last-child .page-link{border-right:none}.page-item.active .page-link{color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#a8aeb4;background-color:#fff;border-color:#dfe1e3}.pagination-lg .page-link{padding:.9375rem 1.5625rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.pagination-sm .page-link{padding:.25rem .6875rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.35rem;border-bottom-left-radius:.35rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.35rem;border-bottom-right-radius:.35rem}.badge{padding:.375rem .5rem;font-size:75%;font-weight:500;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:#fff;border-radius:.375rem}a.badge{transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.badge-pill{padding-right:.5rem;padding-left:.5rem;border-radius:10rem}.badge-squared{border-radius:0}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-outline-primary{background:0 0;border:1px solid #007bff;color:#007bff}.badge-secondary{color:#fff;background-color:#5a6169}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#42484e}.badge-outline-secondary{background:0 0;border:1px solid #5a6169;color:#5a6169}.badge-success{color:#fff;background-color:#17c671}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#129857}.badge-outline-success{background:0 0;border:1px solid #17c671;color:#17c671}.badge-info{color:#fff;background-color:#00b8d8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#008da5}.badge-outline-info{background:0 0;border:1px solid #00b8d8;color:#00b8d8}.badge-warning{color:#212529;background-color:#ffb400}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#212529;text-decoration:none;background-color:#cc9000}.badge-outline-warning{background:0 0;border:1px solid #ffb400;color:#ffb400}.badge-danger{color:#fff;background-color:#c4183c}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#97122e}.badge-outline-danger{background:0 0;border:1px solid #c4183c;color:#c4183c}.badge-light{color:#212529;background-color:#e9ecef}.badge-light[href]:focus,.badge-light[href]:hover{color:#212529;text-decoration:none;background-color:#cbd3da}.badge-outline-light{background:0 0;border:1px solid #e9ecef;color:#e9ecef;color:#212529}.badge-dark{color:#fff;background-color:#212529}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#0a0c0d}.badge-outline-dark{background:0 0;border:1px solid #212529;color:#212529}.jumbotron{padding:38px 42px;margin-bottom:2rem;background-color:#eceeef;border-radius:.5rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.alert{padding:.75rem 1.25rem;margin-bottom:1rem;border:none;border-radius:0}.alert-link{font-weight:500}.alert-dismissible .close{top:0;right:0;padding:.75rem 1.25rem;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.alert-dismissible .close:hover{cursor:pointer}.alert-primary{color:#f5faff;background-color:#007bff}.alert-primary .alert-link{color:#f5faff}.alert-secondary{color:#d9dcdf;background-color:#5a6169}.alert-secondary .alert-link{color:#d9dcdf}.alert-success{color:#d7fae9;background-color:#17c671}.alert-success .alert-link{color:#d7fae9}.alert-info{color:#cef8ff;background-color:#00b8d8}.alert-info .alert-link{color:#cef8ff}.alert-warning{color:#fffcf5;background-color:#ffb400}.alert-warning .alert-link{color:#fffcf5}.alert-danger{color:#fad7de;background-color:#c4183c}.alert-danger .alert-link{color:#fad7de}.alert-light{color:#fff;background-color:#e9ecef;color:#212529}.alert-light .alert-link{color:#fff}.alert-light .alert-link{color:#212529}.alert-dark{color:#959faa;background-color:#212529}.alert-dark .alert-link{color:#959faa}.progress-wrapper{position:relative;color:#5a6169}.progress-wrapper .progress-label{font-size:.8125rem}.progress-wrapper .progress-value{position:absolute;top:6px;right:0;color:#5a6169}.progress{height:.625rem;font-size:.625rem;line-height:.625rem;background-color:#f5f5f6;margin-top:6px;border-radius:1.25rem;box-shadow:inset 0 .1rem .1rem rgba(90,97,105,.15)}.progress-sm{height:.3125rem}.progress-lg{height:.9375rem}.progress-lg .progress-bar{height:.9375rem}.progress-bar{height:.625rem;line-height:.625rem;color:#fff;background-color:#007bff;transition:width .6s ease}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:.625rem .625rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.list-group-small .list-group-item{padding:.625rem 1rem;font-size:.8125rem}.list-group-item-action{color:#5a6169;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.list-group-item-action:focus,.list-group-item-action:hover{color:#5a6169;background-color:#f7f8f8}.list-group-item-action:active{color:#5a6169;background-color:#eceeef}.list-group-item{padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125);font-weight:300}.list-group-item:first-child{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.list-group-item:last-child{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.list-group-item.disabled,.list-group-item:disabled{color:#868e96;background-color:#fff}.list-group-item.active{color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item-primary{color:#004085;background-color:#b8daff}a.list-group-item-primary,button.list-group-item-primary{color:#004085}a.list-group-item-primary:focus,a.list-group-item-primary:hover,button.list-group-item-primary:focus,button.list-group-item-primary:hover{color:#004085;background-color:#9fcdff}a.list-group-item-primary.active,button.list-group-item-primary.active{background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#2f3237;background-color:#d1d3d5}a.list-group-item-secondary,button.list-group-item-secondary{color:#2f3237}a.list-group-item-secondary:focus,a.list-group-item-secondary:hover,button.list-group-item-secondary:focus,button.list-group-item-secondary:hover{color:#2f3237;background-color:#c4c6c9}a.list-group-item-secondary.active,button.list-group-item-secondary.active{background-color:#2f3237;border-color:#2f3237}.list-group-item-success{color:#0c673b;background-color:#beefd7}a.list-group-item-success,button.list-group-item-success{color:#0c673b}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#0c673b;background-color:#aaeaca}a.list-group-item-success.active,button.list-group-item-success.active{background-color:#0c673b;border-color:#0c673b}.list-group-item-info{color:#006070;background-color:#b8ebf4}a.list-group-item-info,button.list-group-item-info{color:#006070}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#006070;background-color:#a2e5f1}a.list-group-item-info.active,button.list-group-item-info.active{background-color:#006070;border-color:#006070}.list-group-item-warning{color:#855e00;background-color:#ffeab8}a.list-group-item-warning,button.list-group-item-warning{color:#855e00}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#855e00;background-color:#ffe29f}a.list-group-item-warning.active,button.list-group-item-warning.active{background-color:#855e00;border-color:#855e00}.list-group-item-danger{color:#660c1f;background-color:#eebec8}a.list-group-item-danger,button.list-group-item-danger{color:#660c1f}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#660c1f;background-color:#e9aab7}a.list-group-item-danger.active,button.list-group-item-danger.active{background-color:#660c1f;border-color:#660c1f}.list-group-item-light{color:#797b7c;background-color:#f9fafb}a.list-group-item-light,button.list-group-item-light{color:#797b7c}a.list-group-item-light:focus,a.list-group-item-light:hover,button.list-group-item-light:focus,button.list-group-item-light:hover{color:#797b7c;background-color:#eaedf1}a.list-group-item-light.active,button.list-group-item-light.active{background-color:#797b7c;border-color:#797b7c}.list-group-item-dark{color:#111315;background-color:#c1c2c3}a.list-group-item-dark,button.list-group-item-dark{color:#111315}a.list-group-item-dark:focus,a.list-group-item-dark:hover,button.list-group-item-dark:focus,button.list-group-item-dark:hover{color:#111315;background-color:#b4b5b6}a.list-group-item-dark.active,button.list-group-item-dark.active{background-color:#111315;border-color:#111315}.close{font-size:1.5rem;font-weight:500;color:#8c949d;text-shadow:none;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.close:focus,.close:hover{color:#8c949d}.modal{z-index:1050}.modal-dialog{margin:.625rem}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out}.modal-dialog-centered{min-height:calc(100% - (.625rem * 2))}.modal-content{background-color:#fff;border:none;border-radius:.5rem;box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.modal-backdrop{z-index:1040;background-color:#5a6169}.modal-backdrop.show{opacity:.12}.modal-header{padding:.9375rem 2.1875rem;border-bottom:1px solid #dfe1e3}.modal-title{line-height:1.5}.modal-body{padding:1.875rem 2.1875rem}.modal-footer{padding:.9375rem 2.1875rem;border-top:1px solid #dfe1e3}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.875rem auto}.modal-dialog-centered{min-height:calc(100% - (1.875rem * 2))}.modal-content{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{z-index:1070;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:300;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem}.tooltip.show{opacity:1}.tooltip .arrow{width:5px;height:5px}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:5px 0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{border-width:5px 2.5px 0;border-top-color:#fff}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 5px}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{width:5px;height:5px}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{border-width:2.5px 5px 2.5px 0;border-right-color:#fff}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:5px 0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{border-width:0 2.5px 5px;border-bottom-color:#fff}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 5px}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{width:5px;height:5px}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{border-width:2.5px 0 2.5px 5px;border-left-color:#fff}.tooltip-inner{max-width:200px;padding:7px 13px;color:#5a6169;background-color:#fff;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2);border-radius:.375rem}.popover{z-index:1060;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:300;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;background-color:#fff;border:none;padding:0;border-radius:.5rem;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.popover .arrow{width:10px;height:5px;margin:0 .5rem}.popover .arrow::before{border-width:11px}.popover .arrow::after{border-width:11px}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:5px}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((5px + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::after,.bs-popover-top .arrow::before{border-width:5px 5px 0}.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::before{border-top-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-top .arrow::after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:5px}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((5px + 1px) * -1);width:5px;height:10px;margin:.5rem 0}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::after,.bs-popover-right .arrow::before{border-width:5px 5px 5px 0}.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::before{border-right-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-right .arrow::after{left:1px;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:5px}.bs-popover-auto[x-placement^=bottom] .arrow,.bs-popover-bottom .arrow{top:calc((5px + 1px) * -1)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::after,.bs-popover-bottom .arrow::before{border-width:0 5px 5px 5px}.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::before{border-bottom-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-bottom .arrow::after{top:1px;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{width:10px;margin-left:-5px;border-bottom:1px solid #f5f5f6}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:5px}.bs-popover-auto[x-placement^=left] .arrow,.bs-popover-left .arrow{right:calc((5px + 1px) * -1);width:5px;height:10px;margin:.5rem 0}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::after,.bs-popover-left .arrow::before{border-width:5px 0 5px 5px}.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::before{border-left-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-left .arrow::after{right:1px;border-left-color:#fff}.popover-header{padding:14px 20px;font-size:1rem;color:#212529;line-height:14px;background-color:#f5f5f6;border-bottom:1px solid #e7e9ea;border-top-left-radius:calc(.5rem - 1px);border-top-right-radius:calc(.5rem - 1px)}.popover-body{padding:15px 20px;color:#5a6169}.carousel{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.carousel-item{transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease}.carousel-control-next,.carousel-control-prev{width:15%;color:#fff;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff}.carousel-control-next-icon,.carousel-control-prev-icon{width:20px;height:20px}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{margin-right:15%;margin-left:15%}.carousel-indicators li{width:30px;height:3px;margin-right:3px;margin-left:3px;background-color:rgba(255,255,255,.5);border-radius:3px}.carousel-indicators .active{background-color:#fff}.carousel-caption{right:15%;left:15%;color:#fff}.noUi-target,.noUi-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-ms-touch-action:none;touch-action:none;-ms-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box}.noUi-target{position:relative;direction:ltr;background:#eceeef;border-radius:5px;box-shadow:inset 0 1px 2px rgba(90,97,105,.1);margin:35px 0}.noUi-target:focus{outline:0;box-shadow:0 0 8px rgba(0,123,255,.65),0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.noUi-base,.noUi-connects{width:100%;height:100%;position:relative;z-index:1}.noUi-connects{overflow:hidden;z-index:0}.noUi-connect,.noUi-origin{position:absolute;will-change:transform;z-index:1;top:0;left:0;height:100%;width:100%;-webkit-transform-origin:0 0;transform-origin:0 0}.noUi-connect:focus,.noUi-origin:focus{outline:0}.noUi-connect{background:#007bff;border-radius:5px}html:not([dir=rtl]) .noUi-horizontal .noUi-origin{left:auto;right:0}html:not([dir=rtl]) .noUi-horizontal .noUi-handle{right:-17px;left:auto}.noUi-rtl .noUi-value-horizontal{-webkit-transform:translate(50%,50%);transform:translate(50%,50%)}.noUi-rtl .noUi-value-vertical{-webkit-transform:translate(0,50%);transform:translate(0,50%)}.noUi-vertical{width:5px}.noUi-vertical .noUi-origin{width:0}.noUi-vertical .noUi-handle{left:-10px;top:-11.5px}.noUi-vertical .noUi-handle:after,.noUi-vertical .noUi-handle:before{width:14px;height:1px;left:6px;top:14px}.noUi-vertical .noUi-handle:after{top:17px}.noUi-vertical .noUi-tooltip{-webkit-transform:translate(0,-50%);transform:translate(0,-50%);top:50%;right:30px}.noUi-vertical .noUi-draggable{cursor:ns-resize}.noUi-horizontal{height:5px}.noUi-horizontal .noUi-origin{height:0}.noUi-horizontal .noUi-handle{left:-11.5px;top:-10px}.noUi-horizontal .noUi-tooltip{-webkit-transform:translate(-50%,0);transform:translate(-50%,0);left:50%;bottom:30px}.noUi-handle{position:absolute;border:1px solid #e7e9ea;border-radius:50%;width:23px;height:23px;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2);background:#fff;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.noUi-handle:hover{cursor:grab;cursor:-webkit-grab;cursor:-moz-grab}.noUi-handle:active{cursor:grabbing;cursor:-webkit-grabbing;cursor:-moz-grabbing}.noUi-handle:focus{outline:0;box-shadow:0 0 8px rgba(0,123,255,.65),0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.noUi-handle:after{left:17px}.noUi-state-tap .noUi-connect,.noUi-state-tap .noUi-origin{transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.noUi-state-drag *{cursor:inherit!important}.noUi-connects{border-radius:5px}.noUi-draggable{cursor:ew-resize}.noUi-active{-webkit-transform:scale(1.1);transform:scale(1.1)}[disabled] .noUi-connect{background:#b8b8b8}[disabled] .noUi-handle,[disabled].noUi-handle,[disabled].noUi-target{cursor:not-allowed}[disabled] .noUi-handle{background:#f2f3f4}[disabled] .noUi-handle:focus{box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.noUi-pips,.noUi-pips *{box-sizing:border-box}.noUi-pips{position:absolute;color:#a8aeb4;font-size:12px}.noUi-value{position:absolute;white-space:nowrap;text-align:center}.noUi-value-sub{color:#a8aeb4;font-size:10px}.noUi-marker{position:absolute;background:#a8aeb4}.noUi-marker-sub{background:#a8aeb4}.noUi-marker-large{background:#a8aeb4}.noUi-pips-horizontal{padding:10px 0;height:auto;top:100%;left:0;width:100%}.noUi-value-horizontal{-webkit-transform:translate3d(-50%,50%,0);transform:translate3d(-50%,50%,0)}.noUi-marker-horizontal.noUi-marker{margin-left:-1px;width:1px;height:4px}.noUi-marker-horizontal.noUi-marker-sub{height:5px}.noUi-marker-horizontal.noUi-marker-large{height:7px}.noUi-pips-vertical{padding:0 10px;height:100%;top:0;left:100%}.noUi-value-vertical{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0);padding-left:15px}.noUi-marker-vertical.noUi-marker{width:4px;height:1px;margin-top:-1px}.noUi-marker-vertical.noUi-marker-sub{width:10px}.noUi-marker-vertical.noUi-marker-large{width:7px}.noUi-tooltip{display:block;position:absolute;text-align:center;white-space:nowrap;border-radius:.375rem;border-radius:.375rem;background:#fff;color:#5a6169;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2);font-size:.75rem;padding:5px 10px}.slider-primary .noUi-connect{background:#007bff}.slider-secondary .noUi-connect{background:#5a6169}.slider-success .noUi-connect{background:#17c671}.slider-info .noUi-connect{background:#00b8d8}.slider-warning .noUi-connect{background:#ffb400}.slider-danger .noUi-connect{background:#c4183c}.slider-light .noUi-connect{background:#e9ecef}.slider-dark .noUi-connect{background:#212529}.datepicker{border-radius:.625rem;direction:ltr}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl.dropdown-menu{left:auto}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0;padding:20px 22px}.datepicker-dropdown:after,.datepicker-dropdown:before{content:'';display:inline-block;border-top:0;position:absolute}.datepicker-dropdown:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #c3c7cc;border-bottom-color:rgba(0,0,0,.2)}.datepicker-dropdown:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff}.datepicker-dropdown.datepicker-orient-left:before{left:6px}.datepicker-dropdown.datepicker-orient-left:after{left:7px}.datepicker-dropdown.datepicker-orient-right:before{right:6px}.datepicker-dropdown.datepicker-orient-right:after{right:7px}.datepicker-dropdown.datepicker-orient-bottom:before{top:-7px}.datepicker-dropdown.datepicker-orient-bottom:after{top:-6px}.datepicker-dropdown.datepicker-orient-top:before{bottom:-7px;border-bottom:0;border-top:7px solid #c3c7cc}.datepicker-dropdown.datepicker-orient-top:after{bottom:-6px;border-bottom:0;border-top:6px solid #fff}.datepicker table{margin:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker table tr td{border-radius:50%}.datepicker table tr th{border-radius:.375rem;font-weight:500}.datepicker table tr td,.datepicker table tr th{transition:all 250ms cubic-bezier(.27,.01,.38,1.06);width:36px;height:36px;border:none;text-align:center}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.datepicker table tr td.new,.datepicker table tr td.old{color:#c3c7cc}.datepicker table tr td.day:hover,.datepicker table tr td.focused{background:#eceeef;cursor:pointer}.datepicker table tr td.disabled,.datepicker table tr td.disabled:hover{background:0 0;color:#e7e9ea;cursor:default}.datepicker table tr td.highlighted{border-radius:0}.datepicker table tr td.highlighted.focused{background:#007bff}.datepicker table tr td.highlighted.disabled,.datepicker table tr td.highlighted.disabled:active{background:#007bff;color:#5a6169}.datepicker table tr td.today{background:#e6f2ff}.datepicker table tr td.today.focused{background:#f5f5f6}.datepicker table tr td.today.disabled,.datepicker table tr td.today.disabled:active{background:#f5f5f6;color:#868e96}.datepicker table tr td.range{background:#007bff;color:#fff;border-radius:0}.datepicker table tr td.range.focused{background:#0067d6}.datepicker table tr td.range.day.disabled:hover,.datepicker table tr td.range.disabled,.datepicker table tr td.range.disabled:active{background:#0062cc;color:#3395ff}.datepicker table tr td.range.highlighted.focused{background:#cbd3da}.datepicker table tr td.range.highlighted.disabled,.datepicker table tr td.range.highlighted.disabled:active{background:#e9ecef;color:#e7e9ea}.datepicker table tr td.range.today.disabled,.datepicker table tr td.range.today.disabled:active{background:#007bff;color:#fff}.datepicker table tr td.day.range-start{border-top-right-radius:0;border-bottom-right-radius:0}.datepicker table tr td.day.range-end{border-top-left-radius:0;border-bottom-left-radius:0}.datepicker table tr td.day.range-start.range-end{border-radius:50%}.datepicker table tr td.day.range:hover,.datepicker table tr td.selected,.datepicker table tr td.selected.highlighted,.datepicker table tr td.selected.highlighted:hover,.datepicker table tr td.selected:hover{background:#007bff;color:#fff}.datepicker table tr td.active,.datepicker table tr td.active.highlighted,.datepicker table tr td.active.highlighted:hover,.datepicker table tr td.active:hover{background:#007bff;color:#fff}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;border-radius:4px}.datepicker table tr td span.focused,.datepicker table tr td span:hover{background:#e9ecef}.datepicker table tr td span.disabled,.datepicker table tr td span.disabled:hover{background:0 0;color:#e7e9ea;cursor:default}.datepicker table tr td span.active,.datepicker table tr td span.active.disabled,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active:hover{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td span.new,.datepicker table tr td span.old{color:#868e96}.datepicker .datepicker-switch{width:145px}.datepicker .datepicker-switch,.datepicker .next,.datepicker .prev,.datepicker tfoot tr th{cursor:pointer}.datepicker .datepicker-switch:hover,.datepicker .next:hover,.datepicker .prev:hover,.datepicker tfoot tr th:hover{background:#e9ecef}.datepicker .next.disabled,.datepicker .prev.disabled{visibility:hidden}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.input-daterange input{text-align:center}.bg-primary{background-color:#007bff!important}.bg-primary.card .card-body,.bg-primary.card .card-footer,.bg-primary.card .card-header,.bg-primary.card .card-title{background-color:#0062cc!important}.bg-primary.card .card-footer,.bg-primary.card .card-header{background:#0074f0}a.bg-primary:focus,a.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#5a6169!important}.bg-secondary.card .card-body,.bg-secondary.card .card-footer,.bg-secondary.card .card-header,.bg-secondary.card .card-title{background-color:#42484e!important}.bg-secondary.card .card-footer,.bg-secondary.card .card-header{background:#535961}a.bg-secondary:focus,a.bg-secondary:hover{background-color:#42484e!important}.bg-success{background-color:#17c671!important}.bg-success.card .card-body,.bg-success.card .card-footer,.bg-success.card .card-header,.bg-success.card .card-title{background-color:#129857!important}.bg-success.card .card-footer,.bg-success.card .card-header{background:#15b869}a.bg-success:focus,a.bg-success:hover{background-color:#129857!important}.bg-info{background-color:#00b8d8!important}.bg-info.card .card-body,.bg-info.card .card-footer,.bg-info.card .card-header,.bg-info.card .card-title{background-color:#008da5!important}.bg-info.card .card-footer,.bg-info.card .card-header{background:#00abc9}a.bg-info:focus,a.bg-info:hover{background-color:#008da5!important}.bg-warning{background-color:#ffb400!important}.bg-warning.card .card-body,.bg-warning.card .card-footer,.bg-warning.card .card-header,.bg-warning.card .card-title{background-color:#cc9000!important}.bg-warning.card .card-footer,.bg-warning.card .card-header{background:#f0a900}a.bg-warning:focus,a.bg-warning:hover{background-color:#cc9000!important}.bg-danger{background-color:#c4183c!important}.bg-danger.card .card-body,.bg-danger.card .card-footer,.bg-danger.card .card-header,.bg-danger.card .card-title{background-color:#97122e!important}.bg-danger.card .card-footer,.bg-danger.card .card-header{background:#b61638}a.bg-danger:focus,a.bg-danger:hover{background-color:#97122e!important}.bg-light{background-color:#e9ecef!important}.bg-light.card .card-body,.bg-light.card .card-footer,.bg-light.card .card-header,.bg-light.card .card-title{background-color:#cbd3da!important}.bg-light.card .card-footer,.bg-light.card .card-header{background:#e0e4e9}a.bg-light:focus,a.bg-light:hover{background-color:#cbd3da!important}.bg-dark{background-color:#212529!important}.bg-dark.card .card-body,.bg-dark.card .card-footer,.bg-dark.card .card-header,.bg-dark.card .card-title{background-color:#0a0c0d!important}.bg-dark.card .card-footer,.bg-dark.card .card-header{background:#1a1d21}a.bg-dark:focus,a.bg-dark:hover{background-color:#0a0c0d!important}.border{border:1px solid #becad6!important}.border-top{border-top:1px solid #becad6!important}.border-right{border-right:1px solid #becad6!important}.border-bottom{border-bottom:1px solid #becad6!important}.border-left{border-left:1px solid #becad6!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#5a6169!important}.border-success{border-color:#17c671!important}.border-info{border-color:#00b8d8!important}.border-warning{border-color:#ffb400!important}.border-danger{border-color:#c4183c!important}.border-light{border-color:#e9ecef!important}.border-dark{border-color:#212529!important}.rounded{border-radius:.375rem!important}.rounded-top{border-top-left-radius:.375rem!important;border-top-right-radius:.375rem!important}.rounded-right{border-top-right-radius:.375rem!important;border-bottom-right-radius:.375rem!important}.rounded-bottom{border-bottom-right-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.rounded-left{border-top-left-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.text-monospace{font-family:"Roboto Mono",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}.font-weight-normal{font-weight:300}.font-weight-bold{font-weight:500}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#5a6169!important}a.text-secondary:focus,a.text-secondary:hover{color:#42484e!important}.text-success{color:#17c671!important}a.text-success:focus,a.text-success:hover{color:#129857!important}.text-info{color:#00b8d8!important}a.text-info:focus,a.text-info:hover{color:#008da5!important}.text-warning{color:#ffb400!important}a.text-warning:focus,a.text-warning:hover{color:#cc9000!important}.text-danger{color:#c4183c!important}a.text-danger:focus,a.text-danger:hover{color:#97122e!important}.text-light{color:#e9ecef!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#212529!important}a.text-dark:focus,a.text-dark:hover{color:#0a0c0d!important}.text-body{color:#5a6169!important}a.text-white:focus,a.text-white:hover{color:#e6e6e6!important}.text-black{color:#000}a.text-black:focus,a.text-black:hover{color:#000!important}.text-muted{color:#868e96!important}.with-shadows{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)} +/*# sourceMappingURL=shards.min.css.map */ \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/src/main/resources/templates/add-user.html b/persistence-modules/spring-boot-persistence/src/main/resources/templates/add-user.html new file mode 100644 index 0000000000..31d38f2cb5 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/resources/templates/add-user.html @@ -0,0 +1,40 @@ + + + + + + Add User + + + + + + +
+

New User

+
+
+
+
+
+ + + +
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/src/main/resources/templates/index.html b/persistence-modules/spring-boot-persistence/src/main/resources/templates/index.html new file mode 100644 index 0000000000..2634e10380 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/resources/templates/index.html @@ -0,0 +1,43 @@ + + + + + + Users + + + + + + +
+ + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/src/main/resources/templates/update-user.html b/persistence-modules/spring-boot-persistence/src/main/resources/templates/update-user.html new file mode 100644 index 0000000000..f94e8eb987 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/resources/templates/update-user.html @@ -0,0 +1,40 @@ + + + + + + Update User + + + + + + +
+

Update User

+
+
+
+
+
+ + + +
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserControllerUnitTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserControllerUnitTest.java new file mode 100644 index 0000000000..658af84516 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserControllerUnitTest.java @@ -0,0 +1,81 @@ +package com.baeldung.springbootcrudapp.application.tests; + +import com.baeldung.springbootcrudapp.application.controllers.UserController; +import com.baeldung.springbootcrudapp.application.entities.User; +import com.baeldung.springbootcrudapp.application.repositories.UserRepository; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; + +public class UserControllerUnitTest { + + private static UserController userController; + private static UserRepository mockedUserRepository; + private static BindingResult mockedBindingResult; + private static Model mockedModel; + + @BeforeClass + public static void setUpUserControllerInstance() { + mockedUserRepository = mock(UserRepository.class); + mockedBindingResult = mock(BindingResult.class); + mockedModel = mock(Model.class); + userController = new UserController(mockedUserRepository); + } + + @Test + public void whenCalledshowSignUpForm_thenCorrect() { + User user = new User("John", "john@domain.com"); + + assertThat(userController.showSignUpForm(user)).isEqualTo("add-user"); + } + + @Test + public void whenCalledaddUserAndValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(false); + + assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("index"); + } + + @Test + public void whenCalledaddUserAndInValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(true); + + assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("add-user"); + } + + @Test(expected = IllegalArgumentException.class) + public void whenCalledshowUpdateForm_thenIllegalArgumentException() { + assertThat(userController.showUpdateForm(0, mockedModel)).isEqualTo("update-user"); + } + + @Test + public void whenCalledupdateUserAndValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(false); + + assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("index"); + } + + @Test + public void whenCalledupdateUserAndInValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(true); + + assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("update-user"); + } + + @Test(expected = IllegalArgumentException.class) + public void whenCalleddeleteUser_thenIllegalArgumentException() { + assertThat(userController.deleteUser(1l, mockedModel)).isEqualTo("index"); + } +} diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserUnitTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserUnitTest.java new file mode 100644 index 0000000000..2bc4a72542 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootcrudapp/application/tests/UserUnitTest.java @@ -0,0 +1,46 @@ +package com.baeldung.springbootcrudapp.application.tests; + +import com.baeldung.springbootcrudapp.application.entities.User; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +public class UserUnitTest { + + @Test + public void whenCalledGetName_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + assertThat(user.getName()).isEqualTo("Julie"); + } + + @Test + public void whenCalledGetEmail_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + assertThat(user.getEmail()).isEqualTo("julie@domain.com"); + } + + @Test + public void whenCalledSetName_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + user.setName("John"); + + assertThat(user.getName()).isEqualTo("John"); + } + + @Test + public void whenCalledSetEmail_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + user.setEmail("john@domain.com"); + + assertThat(user.getEmail()).isEqualTo("john@domain.com"); + } + + @Test + public void whenCalledtoString_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + assertThat(user.toString()).isEqualTo("User{id=0, name=Julie, email=julie@domain.com}"); + } +} From 8837a12608d2b2296d73f24bde4f200ac211820e Mon Sep 17 00:00:00 2001 From: eric-martin Date: Thu, 25 Oct 2018 23:47:46 -0500 Subject: [PATCH 207/546] Fixed SimpleDateFormatUnitTest --- .../baeldung/simpledateformat/SimpleDateFormatUnitTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java index ba4ea32e21..4ae7b77089 100644 --- a/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java +++ b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.simpledateformat; import org.junit.Test; @@ -32,6 +32,7 @@ public class SimpleDateFormatUnitTest { @Test public void givenStringDate_whenParsed_thenCheckDateCorrect() throws Exception{ SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); + formatter.setTimeZone(TimeZone.getTimeZone("Europe/London")); Date myDate = new Date(233276400000L); Date parsedDate = formatter.parse("24-05-1977"); assertEquals(myDate.getTime(), parsedDate.getTime()); From f34d44faaa742da46467a00562380669f4b4c881 Mon Sep 17 00:00:00 2001 From: Ganesh Pagade Date: Fri, 26 Oct 2018 10:21:35 +0530 Subject: [PATCH 208/546] fixes --- .../spring-cloud-zuul-throttling/pom.xml | 2 +- .../ZuulRatelimitDemoApplication.java | 47 ++++++- .../controller/GreetingController.java | 20 +-- .../src/main/resources/application.yml | 18 +-- .../controller/GreetingControllerTest.java | 125 ++++++++++-------- 5 files changed, 133 insertions(+), 79 deletions(-) diff --git a/spring-cloud/spring-cloud-zuul-throttling/pom.xml b/spring-cloud/spring-cloud-zuul-throttling/pom.xml index 180cc96f00..b34ade662a 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/pom.xml +++ b/spring-cloud/spring-cloud-zuul-throttling/pom.xml @@ -37,7 +37,7 @@ com.marcosbarbero.cloud spring-cloud-zuul-ratelimit - LATEST + 2.2.0.RELEASE org.springframework.boot diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java index 18a779f976..cc13b7a046 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java @@ -1,12 +1,53 @@ package com.baeldung.spring.cloud.zuulratelimitdemo; +import javax.servlet.http.HttpServletRequest; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.zuul.filters.Route; +import org.springframework.context.annotation.Bean; + +import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.RateLimitKeyGenerator; +import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.RateLimitUtils; +import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.properties.RateLimitProperties; +import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.repository.RateLimiterErrorHandler; +import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.repository.DefaultRateLimiterErrorHandler; +import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.DefaultRateLimitKeyGenerator; @SpringBootApplication public class ZuulRatelimitDemoApplication { - public static void main(String[] args) { - SpringApplication.run(ZuulRatelimitDemoApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(ZuulRatelimitDemoApplication.class, args); + } + + @Bean + public RateLimitKeyGenerator ratelimitKeyGenerator(RateLimitProperties properties, RateLimitUtils rateLimitUtils) { + return new DefaultRateLimitKeyGenerator(properties, rateLimitUtils) { + @Override + public String key(HttpServletRequest request, Route route, RateLimitProperties.Policy policy) { + return super.key(request, route, policy) + ":" + request.getMethod(); + } + }; + } + + @Bean + public RateLimiterErrorHandler rateLimitErrorHandler() { + return new DefaultRateLimiterErrorHandler() { + @Override + public void handleSaveError(String key, Exception e) { + // custom code + } + + @Override + public void handleFetchError(String key, Exception e) { + // custom code + } + + @Override + public void handleError(String msg, Exception e) { + // custom code + } + }; + } } diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java index 4a27324b4d..f0facc621a 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java @@ -11,16 +11,16 @@ import org.springframework.web.bind.annotation.RequestMapping; @RequestMapping("/greeting") public class GreetingController { - public static final String SIMPLE_RESPONSE = "Hi!"; - public static final String ADVANCED_RESPONSE = "Hello, how you doing?"; + public static final String SIMPLE_RESPONSE = "Hi!"; + public static final String ADVANCED_RESPONSE = "Hello, how you doing?"; - @GetMapping("/simple") - public ResponseEntity serviceA() { - return ResponseEntity.ok(SIMPLE_RESPONSE); - } + @GetMapping("/simple") + public ResponseEntity getSimple() { + return ResponseEntity.ok(SIMPLE_RESPONSE); + } - @GetMapping("/advanced") - public ResponseEntity serviceB() { - return ResponseEntity.ok(ADVANCED_RESPONSE); - } + @GetMapping("/advanced") + public ResponseEntity getAdvanced() { + return ResponseEntity.ok(ADVANCED_RESPONSE); + } } diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml b/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml index 884ee9446e..86a29ca06d 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml +++ b/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml @@ -11,13 +11,13 @@ zuul: repository: JPA policy-list: serviceSimple: - - limit: 5 - refresh-interval: 60 - type: - - origin + - limit: 5 + refresh-interval: 60 + type: + - origin serviceAdvanced: - - limit: 1 - refresh-interval: 2 - type: - - origin - strip-prefix: true + - limit: 1 + refresh-interval: 2 + type: + - origin + strip-prefix: true \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java index 360d005c43..fe81838d5d 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java +++ b/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java @@ -28,73 +28,86 @@ import org.springframework.test.context.junit4.SpringRunner; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class GreetingControllerTest { - private static final String SIMPLE_GREETING = "/greeting/simple"; - private static final String ADVANCED_GREETING = "/greeting/advanced"; + private static final String SIMPLE_GREETING = "/greeting/simple"; + private static final String ADVANCED_GREETING = "/greeting/advanced"; - @Autowired - private TestRestTemplate restTemplate; + @Autowired + private TestRestTemplate restTemplate; - @Test - public void whenRequestNotExceedingCapacity_thenReturnOkResponse() { - ResponseEntity response = this.restTemplate.getForEntity(SIMPLE_GREETING, String.class); - HttpHeaders headers = response.getHeaders(); - String key = "rate-limit-application_serviceSimple_127.0.0.1"; - assertHeaders(headers, key, false, false); - assertEquals(OK, response.getStatusCode()); - } + @Test + public void whenRequestNotExceedingCapacity_thenReturnOkResponse() { + ResponseEntity response = this.restTemplate.getForEntity(SIMPLE_GREETING, String.class); + HttpHeaders headers = response.getHeaders(); + String key = "rate-limit-application_serviceSimple_127.0.0.1"; - @Test - public void whenRequestExceedingCapacity_thenReturnTooManyRequestsResponse() throws InterruptedException { - ResponseEntity response = this.restTemplate - .getForEntity(ADVANCED_GREETING, String.class); - HttpHeaders headers = response.getHeaders(); - String key = "rate-limit-application_serviceAdvanced_127.0.0.1"; - assertHeaders(headers, key, false, false); - assertEquals(OK, response.getStatusCode()); + String limit = headers.getFirst(HEADER_LIMIT + key); + String remaining = headers.getFirst(HEADER_REMAINING + key); + String reset = headers.getFirst(HEADER_RESET + key); - for (int i = 0; i < 2; i++) { - response = this.restTemplate.getForEntity(ADVANCED_GREETING, String.class); + assertEquals(limit, "5"); + assertEquals(remaining, "4"); + assertEquals(reset, "60000"); + + assertEquals(OK, response.getStatusCode()); } - assertEquals(TOO_MANY_REQUESTS, response.getStatusCode()); - assertNotEquals(GreetingController.ADVANCED_RESPONSE, response.getBody()); + @Test + public void whenRequestExceedingCapacity_thenReturnTooManyRequestsResponse() throws InterruptedException { + ResponseEntity response = this.restTemplate.getForEntity(ADVANCED_GREETING, String.class); + HttpHeaders headers = response.getHeaders(); + String key = "rate-limit-application_serviceAdvanced_127.0.0.1"; + assertHeaders(headers, key, false, false); + assertEquals(OK, response.getStatusCode()); - TimeUnit.SECONDS.sleep(2); + for (int i = 0; i < 2; i++) { + response = this.restTemplate.getForEntity(ADVANCED_GREETING, String.class); + } - response = this.restTemplate.getForEntity(ADVANCED_GREETING, String.class); - headers = response.getHeaders(); - assertHeaders(headers, key, false, false); - assertEquals(OK, response.getStatusCode()); - } + headers = response.getHeaders(); + String limit = headers.getFirst(HEADER_LIMIT + key); + String remaining = headers.getFirst(HEADER_REMAINING + key); + String reset = headers.getFirst(HEADER_RESET + key); - private void assertHeaders(HttpHeaders headers, String key, boolean nullable, - boolean quotaHeaders) { - String quota = headers.getFirst(HEADER_QUOTA + key); - String remainingQuota = headers.getFirst(HEADER_REMAINING_QUOTA + key); - String limit = headers.getFirst(HEADER_LIMIT + key); - String remaining = headers.getFirst(HEADER_REMAINING + key); - String reset = headers.getFirst(HEADER_RESET + key); + assertEquals(limit, "1"); + assertEquals(remaining, "0"); + assertNotEquals(reset, "2000"); - if (nullable) { - if (quotaHeaders) { - assertNull(quota); - assertNull(remainingQuota); - } else { - assertNull(limit); - assertNull(remaining); - } - assertNull(reset); - } else { - if (quotaHeaders) { - assertNotNull(quota); - assertNotNull(remainingQuota); - } else { - assertNotNull(limit); - assertNotNull(remaining); - } - assertNotNull(reset); + assertEquals(TOO_MANY_REQUESTS, response.getStatusCode()); + assertNotEquals(GreetingController.ADVANCED_RESPONSE, response.getBody()); + + TimeUnit.SECONDS.sleep(2); + + response = this.restTemplate.getForEntity(ADVANCED_GREETING, String.class); + headers = response.getHeaders(); + assertHeaders(headers, key, false, false); + assertEquals(OK, response.getStatusCode()); } - } + private void assertHeaders(HttpHeaders headers, String key, boolean nullable, boolean quotaHeaders) { + String quota = headers.getFirst(HEADER_QUOTA + key); + String remainingQuota = headers.getFirst(HEADER_REMAINING_QUOTA + key); + String limit = headers.getFirst(HEADER_LIMIT + key); + String remaining = headers.getFirst(HEADER_REMAINING + key); + String reset = headers.getFirst(HEADER_RESET + key); + if (nullable) { + if (quotaHeaders) { + assertNull(quota); + assertNull(remainingQuota); + } else { + assertNull(limit); + assertNull(remaining); + } + assertNull(reset); + } else { + if (quotaHeaders) { + assertNotNull(quota); + assertNotNull(remainingQuota); + } else { + assertNotNull(limit); + assertNotNull(remaining); + } + assertNotNull(reset); + } + } } From e69b7283f327f1b2e018ed9c6b4ac57289ac1013 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Fri, 26 Oct 2018 00:18:26 -0500 Subject: [PATCH 209/546] Renamed HibernateCustomTypesUnitTest --- ...stomTypesUnitTest.java => HibernateCustomTypesManualTest.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hibernate5/src/test/java/com/baeldung/hibernate/customtypes/{HibernateCustomTypesUnitTest.java => HibernateCustomTypesManualTest.java} (100%) diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java b/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesManualTest.java similarity index 100% rename from hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesUnitTest.java rename to hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesManualTest.java From ccef2f572e2cf0e7726ed60fdcd3ea3e6851602d Mon Sep 17 00:00:00 2001 From: eric-martin Date: Fri, 26 Oct 2018 00:27:46 -0500 Subject: [PATCH 210/546] HibernateCustomTypesManualTest --- .../hibernate/customtypes/HibernateCustomTypesManualTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesManualTest.java b/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesManualTest.java index f0179701df..63dc6330be 100644 --- a/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesManualTest.java +++ b/hibernate5/src/test/java/com/baeldung/hibernate/customtypes/HibernateCustomTypesManualTest.java @@ -11,7 +11,7 @@ import java.time.LocalDate; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; -public class HibernateCustomTypesUnitTest { +public class HibernateCustomTypesManualTest { @Test public void givenEmployee_whenSavedWithCustomTypes_thenEntityIsSaved() throws IOException { From 0187c74f792cf39feda799508e74ce1478c9b964 Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Fri, 26 Oct 2018 11:22:09 +0300 Subject: [PATCH 211/546] Mercator: Article example implementation of mercator projections. --- .../baeldung/mercator/EllipticalMercator.java | 29 +++++++++++++++++++ .../java/com/baeldung/mercator/Mercator.java | 10 +++++++ .../baeldung/mercator/SphericalMercator.java | 14 +++++++++ .../mercator/EllipticalMercatorUnitTest.java | 25 ++++++++++++++++ .../mercator/SphericalMercatorUnitTest.java | 25 ++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/mercator/EllipticalMercator.java create mode 100644 core-java/src/main/java/com/baeldung/mercator/Mercator.java create mode 100644 core-java/src/main/java/com/baeldung/mercator/SphericalMercator.java create mode 100644 core-java/src/test/java/com/baeldung/mercator/EllipticalMercatorUnitTest.java create mode 100644 core-java/src/test/java/com/baeldung/mercator/SphericalMercatorUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/mercator/EllipticalMercator.java b/core-java/src/main/java/com/baeldung/mercator/EllipticalMercator.java new file mode 100644 index 0000000000..bb9ebb0e58 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/mercator/EllipticalMercator.java @@ -0,0 +1,29 @@ +package com.baeldung.mercator; + +class EllipticalMercator extends Mercator { + @Override + double yAxisProjection(double input) { + if (input > 89.5) { + input = 89.5; + } + if (input < -89.5) { + input = -89.5; + } + double temp = RADIUS_MINOR / RADIUS_MAJOR; + double es = 1.0 - (temp * temp); + double eccent = Math.sqrt(es); + double phi = Math.toRadians(input); + double sinphi = Math.sin(phi); + double con = eccent * sinphi; + double com = 0.5 * eccent; + con = Math.pow(((1.0 - con)/(1.0+con)), com); + double ts = Math.tan(0.5 * ((Math.PI*0.5) - phi))/con; + double y = 0 - RADIUS_MAJOR * Math.log(ts); + return y; + } + + @Override + double xAxisProjection(double input) { + return RADIUS_MAJOR * Math.toRadians(input); + } +} diff --git a/core-java/src/main/java/com/baeldung/mercator/Mercator.java b/core-java/src/main/java/com/baeldung/mercator/Mercator.java new file mode 100644 index 0000000000..3f50884f6b --- /dev/null +++ b/core-java/src/main/java/com/baeldung/mercator/Mercator.java @@ -0,0 +1,10 @@ +package com.baeldung.mercator; + +abstract class Mercator { + final static double RADIUS_MAJOR = 6378137.0; + final static double RADIUS_MINOR = 6356752.3142; + + abstract double yAxisProjection(double input); + + abstract double xAxisProjection(double input); +} diff --git a/core-java/src/main/java/com/baeldung/mercator/SphericalMercator.java b/core-java/src/main/java/com/baeldung/mercator/SphericalMercator.java new file mode 100644 index 0000000000..6cc405b3b0 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/mercator/SphericalMercator.java @@ -0,0 +1,14 @@ +package com.baeldung.mercator; + +public class SphericalMercator extends Mercator { + + @Override + double yAxisProjection(double input) { + return Math.toRadians(input) * RADIUS_MAJOR; + } + + @Override + double xAxisProjection(double input) { + return Math.log(Math.tan(Math.PI / 4 + Math.toRadians(input) / 2)) * RADIUS_MAJOR; + } +} diff --git a/core-java/src/test/java/com/baeldung/mercator/EllipticalMercatorUnitTest.java b/core-java/src/test/java/com/baeldung/mercator/EllipticalMercatorUnitTest.java new file mode 100644 index 0000000000..0088cc451c --- /dev/null +++ b/core-java/src/test/java/com/baeldung/mercator/EllipticalMercatorUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.mercator; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; + +import static junit.framework.TestCase.assertEquals; + +@RunWith(MockitoJUnitRunner.class) +public class EllipticalMercatorUnitTest { + + @Test + public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + Mercator mercator = new EllipticalMercator(); + double result = mercator.xAxisProjection(22); + assertEquals(result, 2449028.7974520186); + } + + @Test + public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + Mercator mercator = new EllipticalMercator(); + double result = mercator.yAxisProjection(44); + assertEquals(result, 5435749.887511954); + } +} diff --git a/core-java/src/test/java/com/baeldung/mercator/SphericalMercatorUnitTest.java b/core-java/src/test/java/com/baeldung/mercator/SphericalMercatorUnitTest.java new file mode 100644 index 0000000000..2e5ebe53cb --- /dev/null +++ b/core-java/src/test/java/com/baeldung/mercator/SphericalMercatorUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.mercator; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; + +import static junit.framework.TestCase.assertEquals; + +@RunWith(MockitoJUnitRunner.class) +public class SphericalMercatorUnitTest { + + @Test + public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + Mercator mercator = new SphericalMercator(); + double result = mercator.xAxisProjection(22); + assertEquals(result, 2511525.234845713); + } + + @Test + public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + Mercator mercator = new SphericalMercator(); + double result = mercator.yAxisProjection(44); + assertEquals(result, 4898057.594904037); + } +} From 541fa8d5be14ed66591c1201ae4e010c870693d1 Mon Sep 17 00:00:00 2001 From: RanjeetKaur17 Date: Fri, 26 Oct 2018 20:50:07 +0400 Subject: [PATCH 212/546] Using AtomicInteger to avoid Race conditions --- .../CountdownLatchResetExample.java | 19 +++++++++---------- .../CyclicBarrierCompletionMethodExample.java | 15 +++++++-------- .../CyclicBarrierResetExample.java | 15 +++++++-------- .../CountdownLatchResetExampleUnitTest.java | 2 +- ...arrierCompletionMethodExampleUnitTest.java | 4 +--- .../CyclicBarrierResetExampleUnitTest.java | 4 +--- 6 files changed, 26 insertions(+), 33 deletions(-) diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java index 55e509e374..1828b7f91e 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java @@ -1,23 +1,22 @@ package com.baeldung.concurrent.countdownlatch; -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicInteger; public class CountdownLatchResetExample { private int count; private int threadCount; - private final List outputScraper; - - CountdownLatchResetExample(final List outputScraper, int count, int threadCount) { - this.outputScraper = outputScraper; + private final AtomicInteger updateCount; + + CountdownLatchResetExample(int count, int threadCount) { + updateCount = new AtomicInteger(0); this.count = count; this.threadCount = threadCount; } - + public int countWaits() { CountDownLatch countDownLatch = new CountDownLatch(count); ExecutorService es = Executors.newFixedThreadPool(threadCount); @@ -26,17 +25,17 @@ public class CountdownLatchResetExample { long prevValue = countDownLatch.getCount(); countDownLatch.countDown(); if (countDownLatch.getCount() != prevValue) { - outputScraper.add("Count Updated"); + updateCount.incrementAndGet(); } }); } es.shutdown(); - return outputScraper.size(); + return updateCount.get(); } public static void main(String[] args) { - CountdownLatchResetExample ex = new CountdownLatchResetExample(new ArrayList<>(),5,20); + CountdownLatchResetExample ex = new CountdownLatchResetExample(5, 20); System.out.println("Count : " + ex.countWaits()); } } diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java index b7a32e2c8d..7c1299da62 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java @@ -1,20 +1,19 @@ package com.baeldung.concurrent.cyclicbarrier; -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicInteger; public class CyclicBarrierCompletionMethodExample { private int count; private int threadCount; - private final List outputScraper; + private final AtomicInteger updateCount; - CyclicBarrierCompletionMethodExample(final List outputScraper, int count, int threadCount) { - this.outputScraper = outputScraper; + CyclicBarrierCompletionMethodExample(int count, int threadCount) { + updateCount = new AtomicInteger(0); this.count = count; this.threadCount = threadCount; } @@ -22,7 +21,7 @@ public class CyclicBarrierCompletionMethodExample { public int countTrips() { CyclicBarrier cyclicBarrier = new CyclicBarrier(count, () -> { - outputScraper.add("Barrier is Tripped"); + updateCount.incrementAndGet(); }); ExecutorService es = Executors.newFixedThreadPool(threadCount); @@ -36,11 +35,11 @@ public class CyclicBarrierCompletionMethodExample { }); } es.shutdown(); - return outputScraper.size(); + return updateCount.get(); } public static void main(String[] args) { - CyclicBarrierCompletionMethodExample ex = new CyclicBarrierCompletionMethodExample(new ArrayList(), 5, 20); + CyclicBarrierCompletionMethodExample ex = new CyclicBarrierCompletionMethodExample(5, 20); System.out.println("Count : " + ex.countTrips()); } } diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java index febeb0978e..76b6198bc4 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java @@ -1,20 +1,19 @@ package com.baeldung.concurrent.cyclicbarrier; -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicInteger; public class CyclicBarrierResetExample { private int count; private int threadCount; - private final List outputScraper; + private final AtomicInteger updateCount; - CyclicBarrierResetExample(final List outputScraper, int count, int threadCount) { - this.outputScraper = outputScraper; + CyclicBarrierResetExample(int count, int threadCount) { + updateCount = new AtomicInteger(0); this.count = count; this.threadCount = threadCount; } @@ -28,7 +27,7 @@ public class CyclicBarrierResetExample { es.execute(() -> { try { if (cyclicBarrier.getNumberWaiting() > 0) { - outputScraper.add("Count Updated"); + updateCount.incrementAndGet(); } cyclicBarrier.await(); } catch (InterruptedException | BrokenBarrierException e) { @@ -37,11 +36,11 @@ public class CyclicBarrierResetExample { }); } es.shutdown(); - return outputScraper.size(); + return updateCount.get(); } public static void main(String[] args) { - CyclicBarrierResetExample ex = new CyclicBarrierResetExample(new ArrayList(), 7, 20); + CyclicBarrierResetExample ex = new CyclicBarrierResetExample(7, 20); System.out.println("Count : " + ex.countWaits()); } } diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java index 2018c9168d..658ab5301a 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java @@ -10,7 +10,7 @@ public class CountdownLatchResetExampleUnitTest { @Test public void whenCountDownLatch_noReset() { - CountdownLatchResetExample ex = new CountdownLatchResetExample(new ArrayList<>(),5,20); + CountdownLatchResetExample ex = new CountdownLatchResetExample(5,20); int lineCount = ex.countWaits(); assertEquals(5, lineCount); } diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java index e8db84935a..f76b51c100 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java @@ -2,15 +2,13 @@ package com.baeldung.concurrent.cyclicbarrier; import static org.junit.Assert.assertEquals; -import java.util.ArrayList; - import org.junit.Test; public class CyclicBarrierCompletionMethodExampleUnitTest { @Test public void whenCyclicBarrier_countTrips() { - CyclicBarrierCompletionMethodExample ex = new CyclicBarrierCompletionMethodExample(new ArrayList<>(),5,20); + CyclicBarrierCompletionMethodExample ex = new CyclicBarrierCompletionMethodExample(5,20); int lineCount = ex.countTrips(); assertEquals(4, lineCount); } diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java index 2871d16348..413a17e9ff 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java @@ -2,15 +2,13 @@ package com.baeldung.concurrent.cyclicbarrier; import static org.junit.Assert.assertEquals; -import java.util.ArrayList; - import org.junit.Test; public class CyclicBarrierResetExampleUnitTest { @Test public void whenCyclicBarrier_reset() { - CyclicBarrierResetExample ex = new CyclicBarrierResetExample(new ArrayList<>(),5,20); + CyclicBarrierResetExample ex = new CyclicBarrierResetExample(5,20); int lineCount = ex.countWaits(); assertEquals(16, lineCount); } From 6ea369f248a8f0dad11a6efd9b9d30a566f6f4c6 Mon Sep 17 00:00:00 2001 From: RanjeetKaur17 Date: Fri, 26 Oct 2018 20:59:34 +0400 Subject: [PATCH 213/546] Fixing Test Cases --- .../CyclicBarrierCompletionMethodExampleUnitTest.java | 4 ++-- .../cyclicbarrier/CyclicBarrierResetExampleUnitTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java index f76b51c100..310063c86c 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExampleUnitTest.java @@ -8,8 +8,8 @@ public class CyclicBarrierCompletionMethodExampleUnitTest { @Test public void whenCyclicBarrier_countTrips() { - CyclicBarrierCompletionMethodExample ex = new CyclicBarrierCompletionMethodExample(5,20); + CyclicBarrierCompletionMethodExample ex = new CyclicBarrierCompletionMethodExample(7,20); int lineCount = ex.countTrips(); - assertEquals(4, lineCount); + assertEquals(2, lineCount); } } diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java index 413a17e9ff..7b6306df76 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java @@ -8,8 +8,8 @@ public class CyclicBarrierResetExampleUnitTest { @Test public void whenCyclicBarrier_reset() { - CyclicBarrierResetExample ex = new CyclicBarrierResetExample(5,20); + CyclicBarrierResetExample ex = new CyclicBarrierResetExample(7,20); int lineCount = ex.countWaits(); - assertEquals(16, lineCount); + assertEquals(17, lineCount); } } From 512a6e05a1dd24ec7caa6c0da53e3e278d40e674 Mon Sep 17 00:00:00 2001 From: RanjeetKaur17 Date: Fri, 26 Oct 2018 21:09:58 +0400 Subject: [PATCH 214/546] Fixing Test Cases --- .../cyclicbarrier/CyclicBarrierResetExampleUnitTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java index 7b6306df76..913325f8e2 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java @@ -8,8 +8,8 @@ public class CyclicBarrierResetExampleUnitTest { @Test public void whenCyclicBarrier_reset() { - CyclicBarrierResetExample ex = new CyclicBarrierResetExample(7,20); + CyclicBarrierResetExample ex = new CyclicBarrierResetExample(7,10); int lineCount = ex.countWaits(); - assertEquals(17, lineCount); + assertEquals(8, lineCount); } } From 8c361330f105494d1d22b95ba9864f919856e523 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 26 Oct 2018 23:56:07 +0530 Subject: [PATCH 215/546] BAEL-9709 Fix start of Boot projects with parent-boot-2 parent -Added placeholder {start-class} tag in parent-boot-2's spring-boot-maven-plugin so that any child that has a {start-class} automatically is benefited from this plugin and wil help that child class to run -Fix startup issues of few spring boot 2 projects --- parent-boot-2/pom.xml | 3 ++ spring-all/pom.xml | 1 - .../spring-boot-h2-database/pom.xml | 2 +- spring-boot-mvc/pom.xml | 43 +++++++++++-------- spring-boot/pom.xml | 8 ++-- spring-security-mvc-boot/pom.xml | 2 +- 6 files changed, 36 insertions(+), 23 deletions(-) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index bcfcfdec44..eded6d1e3c 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -42,6 +42,9 @@ org.springframework.boot spring-boot-maven-plugin ${spring-boot.version} + + ${start-class} + diff --git a/spring-all/pom.xml b/spring-all/pom.xml index bab2e431ec..2dc4915bab 100644 --- a/spring-all/pom.xml +++ b/spring-all/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung spring-all 0.1-SNAPSHOT spring-all diff --git a/spring-boot-h2/spring-boot-h2-database/pom.xml b/spring-boot-h2/spring-boot-h2-database/pom.xml index 94f2293c34..4d677ab0d4 100644 --- a/spring-boot-h2/spring-boot-h2-database/pom.xml +++ b/spring-boot-h2/spring-boot-h2-database/pom.xml @@ -23,7 +23,7 @@ UTF-8 1.8 - com.mycorp.starter.HelloWorldApplication + com.baeldung.h2db.demo.server.SpringBootApp diff --git a/spring-boot-mvc/pom.xml b/spring-boot-mvc/pom.xml index 65d23ebfc6..5f6cdff85b 100644 --- a/spring-boot-mvc/pom.xml +++ b/spring-boot-mvc/pom.xml @@ -8,11 +8,11 @@ Module For Spring Boot MVC - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + @@ -23,7 +23,7 @@ org.apache.tomcat.embed tomcat-embed-jasper - + org.glassfish javax.faces @@ -35,18 +35,27 @@ spring-boot-starter-test test - + org.springframework.boot spring-boot-starter-validation - - + + com.rometools rome ${rome.version} + + + org.hibernate.validator + hibernate-validator + + + javax.validation + validation-api + @@ -55,17 +64,17 @@ org.springframework.boot spring-boot-maven-plugin - com.baeldung.springbootmvc.SpringBootMvcApplication - JAR - + com.baeldung.springbootmvc.SpringBootMvcApplication + JAR + - - - 1.10.0 - com.baeldung.springbootmvc.SpringBootMvcApplication - + + + 1.10.0 + com.baeldung.springbootmvc.SpringBootMvcApplication + diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index 0ea6b6156f..976db40648 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -1,9 +1,7 @@ 4.0.0 - com.baeldung spring-boot - 0.0.1-SNAPSHOT war spring-boot This is simple boot application for Spring boot actuator test @@ -159,6 +157,11 @@ 1.1.16 compile + + + javax.validation + validation-api + @@ -234,7 +237,6 @@ 3.6.0 3.2.0 18.0 - 1.2.0 2.2.4 diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-mvc-boot/pom.xml index d2316ddca5..2427d0de1a 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-mvc-boot/pom.xml @@ -220,7 +220,7 @@ - org.baeldung.Application + org.baeldung.custom.Application From a9d5e2d5f060ed1d49199d3c32b18e62dd9c3fd6 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 26 Oct 2018 22:30:56 +0300 Subject: [PATCH 216/546] Update pom.xml --- parent-boot-2/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index eded6d1e3c..47d382f58d 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -44,6 +44,7 @@ ${spring-boot.version} ${start-class} + From 1c0bd0a01efaeb0b45db0f19a7368452b9eeb111 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Fri, 26 Oct 2018 21:38:56 +0200 Subject: [PATCH 217/546] added link --- lombok/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lombok/README.md b/lombok/README.md index d12c14416d..314a7e7893 100644 --- a/lombok/README.md +++ b/lombok/README.md @@ -3,3 +3,4 @@ - [Using Lombok’s @Builder Annotation](http://www.baeldung.com/lombok-builder) - [Using Lombok’s @Getter for Boolean Fields](https://www.baeldung.com/lombok-getter-boolean) - [Lombok @Builder with Inheritance](https://www.baeldung.com/lombok-builder-inheritance) +- [https://www.baeldung.com/lombok-builder-default-value](https://www.baeldung.com/lombok-builder-default-value) From c4e781ca825553f045bdaec4ea7efe85147b7986 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Fri, 26 Oct 2018 21:43:19 +0200 Subject: [PATCH 218/546] added link --- spring-mvc-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-mvc-java/README.md b/spring-mvc-java/README.md index 3a580202cf..c7fcbd400b 100644 --- a/spring-mvc-java/README.md +++ b/spring-mvc-java/README.md @@ -32,3 +32,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Using Spring @ResponseStatus to Set HTTP Status Code](http://www.baeldung.com/spring-response-status) - [Bootstrap a Web Application with Spring 5](https://www.baeldung.com/bootstraping-a-web-application-with-spring-and-java-based-configuration) - [Spring MVC Tutorial](https://www.baeldung.com/spring-mvc-tutorial) +- [Working with Date Parameters in Spring](https://www.baeldung.com/spring-date-parameters) From 4c3a0d7f1f92e33b552484ada00ff268a8be16bb Mon Sep 17 00:00:00 2001 From: Loredana Date: Fri, 26 Oct 2018 23:25:49 +0300 Subject: [PATCH 219/546] move graylog ex --- spring-boot-logging-log4j2/README.md | 2 ++ spring-boot-logging-log4j2/pom.xml | 16 +++++++++++++++- .../baeldung/graylog/GraylogDemoApplication.java | 0 .../src/main/resources/log4j.xml | 0 spring-boot/README.MD | 3 +-- spring-boot/pom.xml | 16 +--------------- 6 files changed, 19 insertions(+), 18 deletions(-) rename {spring-boot => spring-boot-logging-log4j2}/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java (100%) rename {spring-boot => spring-boot-logging-log4j2}/src/main/resources/log4j.xml (100%) diff --git a/spring-boot-logging-log4j2/README.md b/spring-boot-logging-log4j2/README.md index 7676bd1919..ea968d7fae 100644 --- a/spring-boot-logging-log4j2/README.md +++ b/spring-boot-logging-log4j2/README.md @@ -1,2 +1,4 @@ ### Relevant Articles: - [Logging in Spring Boot](http://www.baeldung.com/spring-boot-logging) +- [Logging to Graylog with Spring Boot](https://www.baeldung.com/graylog-with-spring-boot) + diff --git a/spring-boot-logging-log4j2/pom.xml b/spring-boot-logging-log4j2/pom.xml index 7220672eaf..38dc5fb341 100644 --- a/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-logging-log4j2/pom.xml @@ -34,6 +34,20 @@ org.springframework.boot spring-boot-starter-log4j2 + + + + + org.springframework.boot + spring-boot-starter-log4j + 1.3.8.RELEASE + + + org.graylog2 + gelfj + 1.1.16 + compile + @@ -56,6 +70,6 @@ - + com.baeldung.springbootlogging.SpringBootLoggingApplication diff --git a/spring-boot/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java b/spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java rename to spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java diff --git a/spring-boot/src/main/resources/log4j.xml b/spring-boot-logging-log4j2/src/main/resources/log4j.xml similarity index 100% rename from spring-boot/src/main/resources/log4j.xml rename to spring-boot-logging-log4j2/src/main/resources/log4j.xml diff --git a/spring-boot/README.MD b/spring-boot/README.MD index 9a9f44e1cf..f09ab27fb5 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -34,5 +34,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Introduction to Chaos Monkey](https://www.baeldung.com/spring-boot-chaos-monkey) - [Spring Component Scanning](https://www.baeldung.com/spring-component-scanning) - [Load Spring Boot Properties From a JSON File](https://www.baeldung.com/spring-boot-json-properties) -- [Display Auto-Configuration Report in Spring Boot](https://www.baeldung.com/spring-boot-auto-configuration-report) -- [Logging to Graylog with Spring Boot](https://www.baeldung.com/graylog-with-spring-boot) +- [Display Auto-Configuration Report in Spring Boot](https://www.baeldung.com/spring-boot-auto-configuration-report) \ No newline at end of file diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index 976db40648..f16460b7c3 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -143,20 +143,6 @@ chaos-monkey-spring-boot ${chaos.monkey.version} - - - - - org.springframework.boot - spring-boot-starter-log4j - 1.3.8.RELEASE - - - org.graylog2 - gelfj - 1.1.16 - compile - javax.validation @@ -229,7 +215,7 @@ - org.baeldung.demo.DemoApplication + com.baeldung.intro.App 8.5.11 2.4.1.Final 1.9.0 From 84ef2cd246e1d4776175ab5820ddeba7f88f7996 Mon Sep 17 00:00:00 2001 From: Larry Chung Date: Fri, 26 Oct 2018 22:06:48 -0400 Subject: [PATCH 220/546] BAEL-2142 Code revision to WordIndexer and JUnit (#5484) * Refactoring and Unit testing added based on Kevin Gilmore's advice of Sep 16, 2018 * Refactoring and Unit testing added based on Kevin Gilmore's advice of Sep 16, 2018 * Refactoring and Unit testing added based on Kevin Gilmore's advice of Sep 16, 2018 * Resolve merge conflict Added dependency for org.passay and for org.apache.commons * Create searching/WordIndexer.java * Create WordIndexerUnitTest.java * Updated in response to Kevin Gilmore's questions "What happens if the string ends with the word you're searching for? Would the next iteration of the loop cause an error if index + wordLength is greater than the last position of the string? Be sure to test this scenario." * Updated WordIndexer in response to Kevin Gilmore Generally speaking, it's good practice to declare return types, parameters, variables using an interface rather than an implementation, if the interface is sufficient to satisfy the need. In this case, there's no reason you can't simply return a List of Integer. (Excellent point, fixed) The two methods are identical. Isn't the first one supposed to be the naive approach? (It was a copy and paste error, fixed) * saving changes... * Update java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java Co-Authored-By: codewarrior2000 * Update java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java Co-Authored-By: codewarrior2000 * Update java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java Co-Authored-By: codewarrior2000 * Respond to Kevin Gilmore's code changes * Debugging code change to JUnit --- java-strings/pom.xml | 18 +++++- .../string/searching/WordIndexer.java | 42 +++++++++++++ .../string/searching/WordIndexerUnitTest.java | 62 +++++++++++++++++++ 3 files changed, 121 insertions(+), 1 deletion(-) mode change 100644 => 100755 java-strings/pom.xml create mode 100644 java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java create mode 100644 java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java diff --git a/java-strings/pom.xml b/java-strings/pom.xml old mode 100644 new mode 100755 index a43490ce5c..ab94c28d4d --- a/java-strings/pom.xml +++ b/java-strings/pom.xml @@ -68,6 +68,21 @@ emoji-java 4.0.0 + + + org.junit.jupiter + junit-jupiter-api + 5.3.1 + test + + + + org.hamcrest + hamcrest-library + 1.3 + test + + org.passay @@ -79,6 +94,7 @@ commons-text 1.4 + @@ -115,4 +131,4 @@ 26.0-jre - \ No newline at end of file + diff --git a/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java b/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java new file mode 100644 index 0000000000..5314efb0b4 --- /dev/null +++ b/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java @@ -0,0 +1,42 @@ +package com.baeldung.string.searching; + +import java.util.ArrayList; +import java.util.List; + +public class WordIndexer { + + public List findWord(String textString, String word) { + int index = 0; + List indexes = new ArrayList(); + String lowerCaseTextString = textString.toLowerCase(); + String lowerCaseWord = word.toLowerCase(); + + while(index != -1){ + index = lowerCaseTextString.indexOf(lowerCaseWord, index + 1); + if (index != -1) { + indexes.add(index); + } + } + return indexes; + } + + + + public List findWordUpgrade(String textString, String word) { + int index = 0; + List indexes = new ArrayList(); + StringBuilder output = new StringBuilder(); + String lowerCaseTextString = textString.toLowerCase(); + String lowerCaseWord = word.toLowerCase(); + int wordLength = 0; + + while(index != -1){ + index = lowerCaseTextString.indexOf(lowerCaseWord, index + wordLength); // Slight improvement + if (index != -1) { + indexes.add(index); + } + wordLength = word.length(); + } + return indexes; + } +} diff --git a/java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java b/java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java new file mode 100644 index 0000000000..f3f76db01f --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java @@ -0,0 +1,62 @@ +package com.baeldung.string.searching; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + + +public class WordIndexerUnitTest { + + String theString; + WordIndexer wordIndexer; + + @BeforeEach + public void setUp() throws Exception { + wordIndexer = new WordIndexer(); + + theString = "To be, or not to be: that is the question: " + + "Whether 'tis nobler in the mind to suffer " + + "The slings and arrows of outrageous fortune, " + + "Or to take arms against a sea of troubles, " + + "And by opposing end them? To die: to sleep; " + + "No more; and by a sleep to say we end " + + "The heart-ache and the thousand natural shocks " + + "That flesh is heir to, 'tis a consummation " + + "Devoutly to be wish'd. To die, to sleep; " + + "To sleep: perchance to dream: ay, there's the rub: " + + "For in that sleep of death what dreams may come,"; + } + + @Test + + public void givenWord_whenSearching_thenFindAllIndexedLocations() { + List expectedResult = Arrays.asList(7, 122, 130, 221, 438); + + List actualResult = wordIndexer.findWord(theString, "or"); + + assertEquals(expectedResult, actualResult); + } + + @Test + public void givenWordWithNoRepeatCharacters_whenImprovedSearching_thenFindAllIndexedLocations() { + List expectedResult = Arrays.asList(7, 122, 130, 221, 438); + + List actualResult = wordIndexer.findWordUpgrade(theString, "or"); + + assertEquals(expectedResult, actualResult); + } + + + @Test + public void givenWord_whenSearching_thenFindAtEndOfString() { + List expectedResult = Arrays.asList(480); + + List actualResult = wordIndexer.findWordUpgrade(theString, "come,"); + + assertEquals(expectedResult, actualResult); + } +} From 0987f52a886ea34c7c2f32dd79fe7f8662fb56b1 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Sat, 27 Oct 2018 11:08:14 +0330 Subject: [PATCH 221/546] BAEL-2306: Update Spring JNDI article (#5540) --- .../org/baeldung/config/PersistenceJNDIConfig.java | 14 ++++---------- .../java/org/baeldung/persistence/model/Foo.java | 6 +++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/persistence-modules/spring-jpa/src/main/java/org/baeldung/config/PersistenceJNDIConfig.java b/persistence-modules/spring-jpa/src/main/java/org/baeldung/config/PersistenceJNDIConfig.java index 7f28c958f1..56ba68dcbb 100644 --- a/persistence-modules/spring-jpa/src/main/java/org/baeldung/config/PersistenceJNDIConfig.java +++ b/persistence-modules/spring-jpa/src/main/java/org/baeldung/config/PersistenceJNDIConfig.java @@ -23,23 +23,19 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @Configuration @EnableTransactionManagement -@PropertySource({ "classpath:persistence-jndi.properties" }) -@ComponentScan({ "org.baeldung.persistence" }) +@PropertySource("classpath:persistence-jndi.properties") +@ComponentScan("org.baeldung.persistence") @EnableJpaRepositories(basePackages = "org.baeldung.persistence.dao") public class PersistenceJNDIConfig { @Autowired private Environment env; - public PersistenceJNDIConfig() { - super(); - } - @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() throws NamingException { final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); - em.setPackagesToScan(new String[] { "org.baeldung.persistence.model" }); + em.setPackagesToScan("org.baeldung.persistence.model"); em.setJpaVendorAdapter(new HibernateJpaVendorAdapter()); em.setJpaProperties(additionalProperties()); return em; @@ -52,9 +48,7 @@ public class PersistenceJNDIConfig { @Bean public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) { - final JpaTransactionManager transactionManager = new JpaTransactionManager(); - transactionManager.setEntityManagerFactory(emf); - return transactionManager; + return new JpaTransactionManager(emf); } @Bean diff --git a/persistence-modules/spring-jpa/src/main/java/org/baeldung/persistence/model/Foo.java b/persistence-modules/spring-jpa/src/main/java/org/baeldung/persistence/model/Foo.java index 209ab081de..5294860311 100644 --- a/persistence-modules/spring-jpa/src/main/java/org/baeldung/persistence/model/Foo.java +++ b/persistence-modules/spring-jpa/src/main/java/org/baeldung/persistence/model/Foo.java @@ -25,7 +25,7 @@ public class Foo implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID") - private long id; + private Long id; @Column(name = "NAME") private String name; @@ -41,11 +41,11 @@ public class Foo implements Serializable { this.bar = bar; } - public long getId() { + public Long getId() { return id; } - public void setId(final int id) { + public void setId(final Long id) { this.id = id; } From c83672fa4cea07ffce6117ca7ea6104fe884e3bd Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 27 Oct 2018 11:01:30 +0300 Subject: [PATCH 222/546] Update README.md --- lombok/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lombok/README.md b/lombok/README.md index 314a7e7893..a297aeb31e 100644 --- a/lombok/README.md +++ b/lombok/README.md @@ -3,4 +3,4 @@ - [Using Lombok’s @Builder Annotation](http://www.baeldung.com/lombok-builder) - [Using Lombok’s @Getter for Boolean Fields](https://www.baeldung.com/lombok-getter-boolean) - [Lombok @Builder with Inheritance](https://www.baeldung.com/lombok-builder-inheritance) -- [https://www.baeldung.com/lombok-builder-default-value](https://www.baeldung.com/lombok-builder-default-value) +- [Lombok Builder with Default Value](https://www.baeldung.com/lombok-builder-default-value) From 1e3f51943b8050e401ed86a341eaf264791a2fa2 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sat, 27 Oct 2018 14:41:38 +0200 Subject: [PATCH 223/546] custom binder example --- .../org/baeldung/boot/config/WebConfig.java | 10 +++-- ...tringToAbstractEntityConverterFactory.java | 39 +++++++++++++++++++ .../boot/converter/StringToEnumConverter.java | 12 ++++++ .../StringToEnumConverterFactory.java | 27 ------------- .../controller/AbstractEntityController.java | 31 +++++++++++++++ .../baeldung/boot/domain/AbstractEntity.java | 10 +++++ .../java/org/baeldung/boot/domain/Bar.java | 29 ++++++++++++++ .../java/org/baeldung/boot/domain/Foo.java | 31 +++++++++++++++ 8 files changed, 158 insertions(+), 31 deletions(-) create mode 100644 spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java create mode 100644 spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java delete mode 100644 spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java create mode 100644 spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java create mode 100644 spring-boot-ops/src/main/java/org/baeldung/boot/domain/AbstractEntity.java create mode 100644 spring-boot-ops/src/main/java/org/baeldung/boot/domain/Bar.java create mode 100644 spring-boot-ops/src/main/java/org/baeldung/boot/domain/Foo.java diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/config/WebConfig.java b/spring-boot-ops/src/main/java/org/baeldung/boot/config/WebConfig.java index 6d8708b06a..6373553837 100644 --- a/spring-boot-ops/src/main/java/org/baeldung/boot/config/WebConfig.java +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/config/WebConfig.java @@ -1,16 +1,17 @@ package org.baeldung.boot.config; +import java.util.List; + import org.baeldung.boot.converter.GenericBigDecimalConverter; +import org.baeldung.boot.converter.StringToAbstractEntityConverterFactory; import org.baeldung.boot.converter.StringToEmployeeConverter; -import org.baeldung.boot.converter.StringToEnumConverterFactory; +import org.baeldung.boot.converter.StringToEnumConverter; import org.baeldung.boot.web.resolver.HeaderVersionArgumentResolver; import org.springframework.context.annotation.Configuration; import org.springframework.format.FormatterRegistry; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import java.util.List; - @Configuration public class WebConfig implements WebMvcConfigurer { @@ -22,7 +23,8 @@ public class WebConfig implements WebMvcConfigurer { @Override public void addFormatters(FormatterRegistry registry) { registry.addConverter(new StringToEmployeeConverter()); - registry.addConverterFactory(new StringToEnumConverterFactory()); + registry.addConverter(new StringToEnumConverter()); + registry.addConverterFactory(new StringToAbstractEntityConverterFactory()); registry.addConverter(new GenericBigDecimalConverter()); } } diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java new file mode 100644 index 0000000000..9e7fd8f858 --- /dev/null +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToAbstractEntityConverterFactory.java @@ -0,0 +1,39 @@ +package org.baeldung.boot.converter; + +import org.baeldung.boot.domain.AbstractEntity; +import org.baeldung.boot.domain.Bar; +import org.baeldung.boot.domain.Foo; +import org.springframework.core.convert.converter.Converter; +import org.springframework.core.convert.converter.ConverterFactory; + +public class StringToAbstractEntityConverterFactory implements ConverterFactory{ + + @Override + public Converter getConverter(Class targetClass) { + + return new StringToAbstractEntityConverter<>(targetClass); + } + + + private static class StringToAbstractEntityConverter implements Converter { + + private Class targetClass; + + public StringToAbstractEntityConverter(Class targetClass) { + this.targetClass = targetClass; + } + + @Override + public T convert(String source) { + long id = Long.parseLong(source); + if(this.targetClass == Foo.class) { + return (T) new Foo(id); + } + else if(this.targetClass == Bar.class) { + return (T) new Bar(id); + } else { + return null; + } + } + } +} diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java new file mode 100644 index 0000000000..498b44abec --- /dev/null +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverter.java @@ -0,0 +1,12 @@ +package org.baeldung.boot.converter; + +import org.baeldung.boot.domain.Modes; +import org.springframework.core.convert.converter.Converter; + +public class StringToEnumConverter implements Converter { + + @Override + public Modes convert(String from) { + return Modes.valueOf(from); + } +} \ No newline at end of file diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java deleted file mode 100644 index 6fa51bfdcc..0000000000 --- a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.baeldung.boot.converter; - -import org.springframework.core.convert.converter.Converter; -import org.springframework.core.convert.converter.ConverterFactory; -import org.springframework.stereotype.Component; - -@Component -public class StringToEnumConverterFactory implements ConverterFactory { - - private static class StringToEnumConverter implements Converter { - - private Class enumType; - - public StringToEnumConverter(Class enumType) { - this.enumType = enumType; - } - - public T convert(String source) { - return (T) Enum.valueOf(this.enumType, source.trim()); - } - } - - @Override - public Converter getConverter(final Class targetType) { - return new StringToEnumConverter(targetType); - } -} diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java new file mode 100644 index 0000000000..d3c012ba31 --- /dev/null +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/AbstractEntityController.java @@ -0,0 +1,31 @@ +package org.baeldung.boot.converter.controller; + +import org.baeldung.boot.domain.Bar; +import org.baeldung.boot.domain.Foo; +import org.baeldung.boot.domain.Modes; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/string-to-abstract") +public class AbstractEntityController { + + @GetMapping("/foo/{foo}") + public ResponseEntity getStringToFoo(@PathVariable Foo foo) { + return ResponseEntity.ok(foo); + } + + @GetMapping("/bar/{bar}") + public ResponseEntity getStringToBar(@PathVariable Bar bar) { + return ResponseEntity.ok(bar); + } + + @GetMapping + public ResponseEntity getStringToMode(@RequestParam("mode") Modes mode) { + return ResponseEntity.ok(mode); + } +} diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/AbstractEntity.java b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/AbstractEntity.java new file mode 100644 index 0000000000..30e0d1e5fe --- /dev/null +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/AbstractEntity.java @@ -0,0 +1,10 @@ +package org.baeldung.boot.domain; + +public abstract class AbstractEntity { + + long id; + public AbstractEntity(long id){ + this.id = id; + } + +} diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Bar.java b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Bar.java new file mode 100644 index 0000000000..724f5e4bca --- /dev/null +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Bar.java @@ -0,0 +1,29 @@ +package org.baeldung.boot.domain; + +public class Bar extends AbstractEntity { + + private int value; + + public Bar(long id) { + super(id); + } + + public Bar(long id, int value) { + super(id); + this.value = value; + } + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + @Override + public String toString() { + return "Bar [value=" + value + ", id=" + id + "]"; + } + +} diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Foo.java b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Foo.java new file mode 100644 index 0000000000..a2ff354e59 --- /dev/null +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Foo.java @@ -0,0 +1,31 @@ +package org.baeldung.boot.domain; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric; +public class Foo extends AbstractEntity { + + private String name; + + public Foo(long id) { + super(id); + name = randomAlphanumeric(4); + } + + public Foo(long id, String name) { + super(id); + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "Foo [name=" + name + ", id=" + id + "]"; + } + +} From 5b3acc2a1c3743380acfbd3af71e6002d6abc2d9 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 27 Oct 2018 17:33:03 +0300 Subject: [PATCH 224/546] remove extra out folder --- out/production/main/com/baeldung/.gitignore | 13 ------------- out/production/main/com/baeldung/README.md | 2 -- out/production/main/com/baeldung/enums/README.md | 2 -- .../main/com/baeldung/networking/README.md | 5 ----- .../main/com/baeldung/objectsize/MANIFEST.MF | 1 - .../main/com/baeldung/printscreen/README.md | 2 -- out/production/main/javac-args/arguments | 2 -- out/production/main/javac-args/options | 2 -- out/production/main/javac-args/types | 1 - out/production/main/javac-args/xlint-ops | 3 --- out/production/main/log4j.properties | 9 --------- .../main1/com/baeldung/datetime/README.md | 2 -- out/test/test/com/baeldung/hexToAscii/README.md | 2 -- .../test/com/baeldung/java/conversion/README.md | 2 -- out/test/test/com/baeldung/stringisnumeric.zip | Bin 3227 -> 0 bytes 15 files changed, 48 deletions(-) delete mode 100644 out/production/main/com/baeldung/.gitignore delete mode 100644 out/production/main/com/baeldung/README.md delete mode 100644 out/production/main/com/baeldung/enums/README.md delete mode 100644 out/production/main/com/baeldung/networking/README.md delete mode 100644 out/production/main/com/baeldung/objectsize/MANIFEST.MF delete mode 100644 out/production/main/com/baeldung/printscreen/README.md delete mode 100644 out/production/main/javac-args/arguments delete mode 100644 out/production/main/javac-args/options delete mode 100644 out/production/main/javac-args/types delete mode 100644 out/production/main/javac-args/xlint-ops delete mode 100644 out/production/main/log4j.properties delete mode 100644 out/production/main1/com/baeldung/datetime/README.md delete mode 100644 out/test/test/com/baeldung/hexToAscii/README.md delete mode 100644 out/test/test/com/baeldung/java/conversion/README.md delete mode 100644 out/test/test/com/baeldung/stringisnumeric.zip diff --git a/out/production/main/com/baeldung/.gitignore b/out/production/main/com/baeldung/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/out/production/main/com/baeldung/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/out/production/main/com/baeldung/README.md b/out/production/main/com/baeldung/README.md deleted file mode 100644 index 51809b2882..0000000000 --- a/out/production/main/com/baeldung/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [SHA-256 Hashing in Java](http://www.baeldung.com/sha-256-hashing-java) diff --git a/out/production/main/com/baeldung/enums/README.md b/out/production/main/com/baeldung/enums/README.md deleted file mode 100644 index 6ccfa725f5..0000000000 --- a/out/production/main/com/baeldung/enums/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [A Guide to Java Enums](http://www.baeldung.com/a-guide-to-java-enums) diff --git a/out/production/main/com/baeldung/networking/README.md b/out/production/main/com/baeldung/networking/README.md deleted file mode 100644 index b9e827f085..0000000000 --- a/out/production/main/com/baeldung/networking/README.md +++ /dev/null @@ -1,5 +0,0 @@ -### Relevant Articles: -- [A Guide To UDP In Java](http://www.baeldung.com/udp-in-java) -- [A Guide To HTTP Cookies In Java](http://www.baeldung.com/cookies-java) -- [A Guide to the Java URL](http://www.baeldung.com/java-url) -- [Working with Network Interfaces in Java](http://www.baeldung.com/java-network-interfaces) diff --git a/out/production/main/com/baeldung/objectsize/MANIFEST.MF b/out/production/main/com/baeldung/objectsize/MANIFEST.MF deleted file mode 100644 index b814f624d0..0000000000 --- a/out/production/main/com/baeldung/objectsize/MANIFEST.MF +++ /dev/null @@ -1 +0,0 @@ -Premain-class: com.baeldung.objectsize.InstrumentationAgent diff --git a/out/production/main/com/baeldung/printscreen/README.md b/out/production/main/com/baeldung/printscreen/README.md deleted file mode 100644 index 7b3b40c102..0000000000 --- a/out/production/main/com/baeldung/printscreen/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) diff --git a/out/production/main/javac-args/arguments b/out/production/main/javac-args/arguments deleted file mode 100644 index 51639800a7..0000000000 --- a/out/production/main/javac-args/arguments +++ /dev/null @@ -1,2 +0,0 @@ --d javac-target -verbose -com/baeldung/javac/Data.java \ No newline at end of file diff --git a/out/production/main/javac-args/options b/out/production/main/javac-args/options deleted file mode 100644 index f02f2344ff..0000000000 --- a/out/production/main/javac-args/options +++ /dev/null @@ -1,2 +0,0 @@ --d javac-target --verbose \ No newline at end of file diff --git a/out/production/main/javac-args/types b/out/production/main/javac-args/types deleted file mode 100644 index ef2d861f84..0000000000 --- a/out/production/main/javac-args/types +++ /dev/null @@ -1 +0,0 @@ -com/baeldung/javac/Data.java \ No newline at end of file diff --git a/out/production/main/javac-args/xlint-ops b/out/production/main/javac-args/xlint-ops deleted file mode 100644 index cdccbc0cce..0000000000 --- a/out/production/main/javac-args/xlint-ops +++ /dev/null @@ -1,3 +0,0 @@ --d javac-target --Xlint:rawtypes,unchecked,static,cast,serial,fallthrough -com/baeldung/javac/Data.java \ No newline at end of file diff --git a/out/production/main/log4j.properties b/out/production/main/log4j.properties deleted file mode 100644 index 5fe42d854c..0000000000 --- a/out/production/main/log4j.properties +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to DEBUG and its only appender to A1. -log4j.rootLogger=DEBUG, A1 - -# A1 is set to be a ConsoleAppender. -log4j.appender.A1=org.apache.log4j.ConsoleAppender - -# A1 uses PatternLayout. -log4j.appender.A1.layout=org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n diff --git a/out/production/main1/com/baeldung/datetime/README.md b/out/production/main1/com/baeldung/datetime/README.md deleted file mode 100644 index 1e4adbb612..0000000000 --- a/out/production/main1/com/baeldung/datetime/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [Introduction to the Java 8 Date/Time API](http://www.baeldung.com/java-8-date-time-intro) diff --git a/out/test/test/com/baeldung/hexToAscii/README.md b/out/test/test/com/baeldung/hexToAscii/README.md deleted file mode 100644 index c6d5826333..0000000000 --- a/out/test/test/com/baeldung/hexToAscii/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [Convert Hex to ASCII in Java](http://www.baeldung.com/java-convert-hex-to-ascii) diff --git a/out/test/test/com/baeldung/java/conversion/README.md b/out/test/test/com/baeldung/java/conversion/README.md deleted file mode 100644 index 7c81180249..0000000000 --- a/out/test/test/com/baeldung/java/conversion/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Relevant Articles: -- [Java String Conversions](http://www.baeldung.com/java-string-conversions) diff --git a/out/test/test/com/baeldung/stringisnumeric.zip b/out/test/test/com/baeldung/stringisnumeric.zip deleted file mode 100644 index b8a7b9b35a09fea091423fe1c08e771d6be48112..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3227 zcmb7`3p|r;AIFE8Q#sT~iO3?$jHZaC7KOJ* zaw>Ajnb{*sN(|9UdG7V*(~9?fdar#x`|rL#*S-Ju{{61&fBg|wTwo}OHSRgxvi|nt z`qk&N1KdqG_QbNzKv>uDt^NjGc^=ySm$o9%`v@T?&+2AZwIeizN0te6c_{1Z@4cN(MNL$2~mO{t>34e+Fg4dh^c zmAlykHVhA)D&DR-aQ1%rdb1 z<{xhfi8NNB3GdHJIVtX#AGVl`q#ZK!QPev?do6Jr6G^^#O6aSg?zN%`hkef%3SS&7 z7?4P>TgsU0Kbuu&-hIaXWi5A4 zjgpB=-F}P#TTl|QIA5qzuzUHY(e(hz!W;Q#){r#r6>k5D%ohthKb(mGoOyC(gQ_Ut z%z3~WwRM~U{BXwN?FcweKMTLZcr1p1arVUiWKV9AzDJ#^aQz$cWl3X&;9Jh<1LttO z(8nY}{~lkIpd&?2BKN%@nO@D@amgw}K{`3GivDOpOZYlMc5}(NXr9(W;rQ!2u={eI z9u+pO7-5J_KnXE^yXNlW9v*_m?nBXW-8*C8%sRQo?w3q^*a&Lc`g6j@AoIzyhzQE{ zN=VN%&B@-~YL_TBEZNGZV3fPVvwJ?BDH6rB>g8{qa2MH*=Z)0cEiMt5;W`MJ7oj!fA9@zrVMI{@0Uo_J)kaugbM-YyRXB57_xXi~DcAn#h%KHJ8 z7df~GAb`pj0hJH@lgbDT-fykQ?YbaG6+R-q%O}1F{(|d zcrHnhyi!e-+?Kf)CpK{PW932=*_AhP&+myRJFmLCVFDjWF40(O zhurj+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yzg)@Cg7M7vy7I{SAPt7WDuC From 14db73cf021d2d94de3d6617387648732f34b08e Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sat, 27 Oct 2018 21:10:33 +0530 Subject: [PATCH 225/546] [BAEL-9557] - Migrated the spring-rest-query-language to Java 8 idioms --- .../dao/MyUserPredicatesBuilder.java | 50 ++++++++++++------- .../org/baeldung/persistence/dao/UserDAO.java | 26 +++------- .../dao/UserSearchQueryCriteriaConsumer.java | 43 ++++++++++++++++ .../dao/UserSpecificationsBuilder.java | 17 ++++--- .../dao/rsql/GenericRsqlSpecBuilder.java | 49 +++++++++--------- .../dao/rsql/GenericRsqlSpecification.java | 29 +++++++---- .../web/controller/UserController.java | 5 +- .../org/baeldung/web/util/CriteriaParser.java | 5 +- 8 files changed, 142 insertions(+), 82 deletions(-) create mode 100644 spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java index c7b9f8358e..4f181b9c4c 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java @@ -1,10 +1,13 @@ package org.baeldung.persistence.dao; -import com.querydsl.core.types.dsl.BooleanExpression; -import org.baeldung.web.util.SearchCriteria; - import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; + +import org.baeldung.web.util.SearchCriteria; + +import com.querydsl.core.types.dsl.BooleanExpression; +import com.querydsl.core.types.dsl.Expressions; public final class MyUserPredicatesBuilder { private final List params; @@ -22,21 +25,34 @@ public final class MyUserPredicatesBuilder { if (params.size() == 0) { return null; } - - final List predicates = new ArrayList<>(); - MyUserPredicate predicate; - for (final SearchCriteria param : params) { - predicate = new MyUserPredicate(param); - final BooleanExpression exp = predicate.getPredicate(); - if (exp != null) { - predicates.add(exp); - } - } - - BooleanExpression result = predicates.get(0); - for (int i = 1; i < predicates.size(); i++) { - result = result.and(predicates.get(i)); + + final List predicates = params.stream().map(param -> { + MyUserPredicate predicate = new MyUserPredicate(param); + return predicate.getPredicate(); + }).filter(predicate -> predicate != null).collect(Collectors.toCollection(ArrayList::new)); + + BooleanExpression result = Expressions.asBoolean(true).isTrue(); + for (BooleanExpression predicate : predicates) { + result = result.and(predicate); } + return result; } + + static class BooleanExpressionWrapper { + + private BooleanExpression result; + + public BooleanExpressionWrapper(final BooleanExpression result) { + super(); + this.result = result; + } + + public BooleanExpression getResult() { + return result; + } + public void setResult(BooleanExpression result) { + this.result = result; + } + } } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserDAO.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserDAO.java index 8a01f8c97c..4f2f6003e4 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserDAO.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserDAO.java @@ -1,8 +1,6 @@ package org.baeldung.persistence.dao; -import org.baeldung.persistence.model.User; -import org.baeldung.web.util.SearchCriteria; -import org.springframework.stereotype.Repository; +import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @@ -10,7 +8,10 @@ import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; -import java.util.List; + +import org.baeldung.persistence.model.User; +import org.baeldung.web.util.SearchCriteria; +import org.springframework.stereotype.Repository; @Repository public class UserDAO implements IUserDAO { @@ -25,20 +26,9 @@ public class UserDAO implements IUserDAO { final Root r = query.from(User.class); Predicate predicate = builder.conjunction(); - - for (final SearchCriteria param : params) { - if (param.getOperation().equalsIgnoreCase(">")) { - predicate = builder.and(predicate, builder.greaterThanOrEqualTo(r.get(param.getKey()), param.getValue().toString())); - } else if (param.getOperation().equalsIgnoreCase("<")) { - predicate = builder.and(predicate, builder.lessThanOrEqualTo(r.get(param.getKey()), param.getValue().toString())); - } else if (param.getOperation().equalsIgnoreCase(":")) { - if (r.get(param.getKey()).getJavaType() == String.class) { - predicate = builder.and(predicate, builder.like(r.get(param.getKey()), "%" + param.getValue() + "%")); - } else { - predicate = builder.and(predicate, builder.equal(r.get(param.getKey()), param.getValue())); - } - } - } + UserSearchQueryCriteriaConsumer searchConsumer = new UserSearchQueryCriteriaConsumer(predicate, builder, r); + params.stream().forEach(searchConsumer); + predicate = searchConsumer.getPredicate(); query.where(predicate); return entityManager.createQuery(query).getResultList(); diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java new file mode 100644 index 0000000000..8b15ef1605 --- /dev/null +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java @@ -0,0 +1,43 @@ +package org.baeldung.persistence.dao; + +import java.util.function.Consumer; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; + +import org.baeldung.web.util.SearchCriteria; + +public class UserSearchQueryCriteriaConsumer implements Consumer{ + + private Predicate predicate; + private CriteriaBuilder builder; + private Root r; + + public UserSearchQueryCriteriaConsumer(Predicate predicate, CriteriaBuilder builder, Root r) { + super(); + this.predicate = predicate; + this.builder = builder; + this.r= r; + } + + @Override + public void accept(SearchCriteria param) { + + if (param.getOperation().equalsIgnoreCase(">")) { + predicate = builder.and(predicate, builder.greaterThanOrEqualTo(r.get(param.getKey()), param.getValue().toString())); + } else if (param.getOperation().equalsIgnoreCase("<")) { + predicate = builder.and(predicate, builder.lessThanOrEqualTo(r.get(param.getKey()), param.getValue().toString())); + } else if (param.getOperation().equalsIgnoreCase(":")) { + if (r.get(param.getKey()).getJavaType() == String.class) { + predicate = builder.and(predicate, builder.like(r.get(param.getKey()), "%" + param.getValue() + "%")); + } else { + predicate = builder.and(predicate, builder.equal(r.get(param.getKey()), param.getValue())); + } + } + } + + public Predicate getPredicate() { + return predicate; + } +} \ No newline at end of file diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java index 918e77720f..cb8918b807 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java @@ -1,14 +1,15 @@ package org.baeldung.persistence.dao; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + import org.baeldung.persistence.model.User; import org.baeldung.web.util.SearchOperation; import org.baeldung.web.util.SpecSearchCriteria; import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specifications; -import java.util.ArrayList; -import java.util.List; - public final class UserSpecificationsBuilder { private final List params; @@ -48,15 +49,19 @@ public final class UserSpecificationsBuilder { if (params.size() == 0) return null; - Specification result = new UserSpecification(params.get(0)); + final List> specs = params.stream() + .map(UserSpecification::new) + .collect(Collectors.toCollection(ArrayList::new)); + + Specification result = specs.get(0); for (int i = 1; i < params.size(); i++) { result = params.get(i) .isOrPredicate() ? Specifications.where(result) - .or(new UserSpecification(params.get(i))) + .or(specs.get(i)) : Specifications.where(result) - .and(new UserSpecification(params.get(i))); + .and(specs.get(i)); } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java index 4efec00ed6..3076300c36 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java @@ -1,13 +1,15 @@ package org.baeldung.persistence.dao.rsql; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.data.jpa.domain.Specifications; + import cz.jirutka.rsql.parser.ast.ComparisonNode; import cz.jirutka.rsql.parser.ast.LogicalNode; import cz.jirutka.rsql.parser.ast.LogicalOperator; import cz.jirutka.rsql.parser.ast.Node; -import org.springframework.data.jpa.domain.Specifications; - -import java.util.ArrayList; -import java.util.List; public class GenericRsqlSpecBuilder { @@ -22,29 +24,24 @@ public class GenericRsqlSpecBuilder { } public Specifications createSpecification(final LogicalNode logicalNode) { - final List> specs = new ArrayList>(); - Specifications temp; - for (final Node node : logicalNode.getChildren()) { - temp = createSpecification(node); - if (temp != null) { - specs.add(temp); + + List> specs = logicalNode.getChildren() + .stream() + .map(node -> createSpecification(node)) + .filter(specifications -> specifications != null) + .collect(Collectors.toCollection(ArrayList::new)); + + Specifications initialSpec = specs.stream().findFirst().get(); + + Specifications result = specs.stream().skip(1).reduce(initialSpec, (firstSpec, secondSpec) -> { + if (logicalNode.getOperator() == LogicalOperator.AND) { + return Specifications.where(firstSpec).and(secondSpec); + } else if (logicalNode.getOperator() == LogicalOperator.OR) { + return Specifications.where(firstSpec).or(secondSpec); } - } - - Specifications result = specs.get(0); - - if (logicalNode.getOperator() == LogicalOperator.AND) { - for (int i = 1; i < specs.size(); i++) { - result = Specifications.where(result).and(specs.get(i)); - } - } - - else if (logicalNode.getOperator() == LogicalOperator.OR) { - for (int i = 1; i < specs.size(); i++) { - result = Specifications.where(result).or(specs.get(i)); - } - } - + return firstSpec; + }); + return result; } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java index 937c6d953c..3e99208684 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java @@ -1,14 +1,17 @@ package org.baeldung.persistence.dao.rsql; -import cz.jirutka.rsql.parser.ast.ComparisonOperator; -import org.springframework.data.jpa.domain.Specification; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; -import java.util.ArrayList; -import java.util.List; + +import org.springframework.data.jpa.domain.Specification; + +import cz.jirutka.rsql.parser.ast.ComparisonOperator; public class GenericRsqlSpecification implements Specification { @@ -71,18 +74,22 @@ public class GenericRsqlSpecification implements Specification { // === private private List castArguments(final Root root) { - final List args = new ArrayList(); + final Class type = root.get(property).getJavaType(); - - for (final String argument : arguments) { + + final List args = arguments.stream().map(arg -> { + + Object obj; if (type.equals(Integer.class)) { - args.add(Integer.parseInt(argument)); + obj = Integer.parseInt(arg); } else if (type.equals(Long.class)) { - args.add(Long.parseLong(argument)); + obj = Long.parseLong(arg); } else { - args.add(argument); + obj = arg; } - } + return obj; + + }).collect(Collectors.toCollection(ArrayList::new)); return args; } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java b/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java index 8953a52a1b..13f986eb20 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java @@ -2,6 +2,7 @@ package org.baeldung.web.controller; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -63,7 +64,7 @@ public class UserController { @ResponseBody public List findAll(@RequestParam(value = "search", required = false) String search) { List params = new ArrayList(); - if (search != null) { + if (Optional.ofNullable(search).isPresent()) { Pattern pattern = Pattern.compile("(\\w+?)(:|<|>)(\\w+?),"); Matcher matcher = pattern.matcher(search + ","); while (matcher.find()) { @@ -126,7 +127,7 @@ public class UserController { @ResponseBody public Iterable findAllByQuerydsl(@RequestParam(value = "search") String search) { MyUserPredicatesBuilder builder = new MyUserPredicatesBuilder(); - if (search != null) { + if (Optional.ofNullable(search).isPresent()) { Pattern pattern = Pattern.compile("(\\w+?)(:|<|>)(\\w+?),"); Matcher matcher = pattern.matcher(search + ","); while (matcher.find()) { diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/util/CriteriaParser.java b/spring-rest-query-language/src/main/java/org/baeldung/web/util/CriteriaParser.java index eabc938bce..a72d07f440 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/util/CriteriaParser.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/web/util/CriteriaParser.java @@ -1,5 +1,6 @@ package org.baeldung.web.util; +import java.util.Arrays; import java.util.Collections; import java.util.Deque; import java.util.HashMap; @@ -45,7 +46,7 @@ public class CriteriaParser { Deque output = new LinkedList<>(); Deque stack = new LinkedList<>(); - for (String token : searchParam.split("\\s+")) { + Arrays.stream(searchParam.split("\\s+")).forEach(token -> { if (ops.containsKey(token)) { while (!stack.isEmpty() && isHigerPrecedenceOperator(token, stack.peek())) output.push(stack.pop() @@ -65,7 +66,7 @@ public class CriteriaParser { output.push(new SpecSearchCriteria(matcher.group(1), matcher.group(2), matcher.group(3), matcher.group(4), matcher.group(5))); } } - } + }); while (!stack.isEmpty()) output.push(stack.pop()); From 44cef7b60204ff517cbd8073d7cf9b7293f4c46a Mon Sep 17 00:00:00 2001 From: Shubhra Srivastava Date: Sat, 27 Oct 2018 21:32:16 +0530 Subject: [PATCH 226/546] BAEL-2223: Processing JSONArray (#5547) --- .../jsonjava/JSONArrayGetValueByKey.java | 30 ++++++++++++++++ .../JSONArrayGetValueByKeyUnitTest.java | 35 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 json/src/main/java/com/baeldung/jsonjava/JSONArrayGetValueByKey.java create mode 100644 json/src/test/java/com/baeldung/jsonjava/JSONArrayGetValueByKeyUnitTest.java diff --git a/json/src/main/java/com/baeldung/jsonjava/JSONArrayGetValueByKey.java b/json/src/main/java/com/baeldung/jsonjava/JSONArrayGetValueByKey.java new file mode 100644 index 0000000000..b3df318e22 --- /dev/null +++ b/json/src/main/java/com/baeldung/jsonjava/JSONArrayGetValueByKey.java @@ -0,0 +1,30 @@ +package com.baeldung.jsonjava; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.json.JSONArray; +import org.json.JSONObject; + +public class JSONArrayGetValueByKey { + + public List getValuesByKeyInJSONArray(String jsonArrayStr, String key) { + List values = new ArrayList<>(); + JSONArray jsonArray = new JSONArray(jsonArrayStr); + for (int idx = 0; idx < jsonArray.length(); idx++) { + JSONObject jsonObj = jsonArray.getJSONObject(idx); + values.add(jsonObj.optString(key)); + } + return values; + } + + public List getValuesByKeyInJSONArrayUsingJava8(String jsonArrayStr, String key) { + JSONArray jsonArray = new JSONArray(jsonArrayStr); + return IntStream.range(0, jsonArray.length()) + .mapToObj(index -> ((JSONObject) jsonArray.get(index)).optString(key)) + .collect(Collectors.toList()); + } + +} diff --git a/json/src/test/java/com/baeldung/jsonjava/JSONArrayGetValueByKeyUnitTest.java b/json/src/test/java/com/baeldung/jsonjava/JSONArrayGetValueByKeyUnitTest.java new file mode 100644 index 0000000000..265c603acd --- /dev/null +++ b/json/src/test/java/com/baeldung/jsonjava/JSONArrayGetValueByKeyUnitTest.java @@ -0,0 +1,35 @@ +package com.baeldung.jsonjava; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Test; + +import static org.junit.Assert.assertThat; +import static org.hamcrest.CoreMatchers.equalTo; + +public class JSONArrayGetValueByKeyUnitTest { + + private static final JSONArrayGetValueByKey obj = new JSONArrayGetValueByKey(); + + @Test + public void givenJSONArrayAndAKey_thenReturnAllValuesForGivenKey() { + String jsonStr = "[" + " {" + " \"name\": \"John\"," + " \"city\": \"chicago\"," + " \"age\": \"22\" " + "}," + " { " + "\"name\": \"Gary\"," + " \"city\": \"florida\"," + " \"age\": \"35\" " + "}," + " { " + "\"name\": \"Selena\"," + + " \"city\": \"vegas\"," + " \"age\": \"18\" " + "} " + "]"; + + List actualValues = obj.getValuesByKeyInJSONArray(jsonStr, "name"); + + assertThat(actualValues, equalTo(Arrays.asList("John", "Gary", "Selena"))); + } + + @Test + public void givenJSONArrayAndAKey_whenUsingJava8Syntax_thenReturnAllValuesForGivenKey() { + String jsonStr = "[" + " {" + " \"name\": \"John\"," + " \"city\": \"chicago\"," + " \"age\": \"22\" " + "}," + " { " + "\"name\": \"Gary\"," + " \"city\": \"florida\"," + " \"age\": \"35\" " + "}," + " { " + "\"name\": \"Selena\"," + + " \"city\": \"vegas\"," + " \"age\": \"18\" " + "} " + "]"; + + List actualValues = obj.getValuesByKeyInJSONArrayUsingJava8(jsonStr, "name"); + + assertThat(actualValues, equalTo(Arrays.asList("John", "Gary", "Selena"))); + } + +} From d93ab9a8cfa0594609094fd7d1edefcd9983e353 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 27 Oct 2018 20:58:24 +0300 Subject: [PATCH 227/546] remove extra spring-custom-aop module --- pom.xml | 1 - spring-custom-aop/.gitignore | 4 - spring-custom-aop/README.MD | 13 -- spring-custom-aop/pom.xml | 155 ------------------ .../SpringBootAnnotatedApp.java | 25 --- .../SpringBootPlainApp.java | 13 -- .../components/AttrListener.java | 21 --- .../components/EchoServlet.java | 27 --- .../components/HelloFilter.java | 30 ---- .../components/HelloServlet.java | 30 ---- .../com/baeldung/git/CommitIdApplication.java | 23 --- .../baeldung/git/CommitInfoController.java | 30 ---- .../src/main/java/com/baeldung/git/README.md | 2 - .../InternationalizationApp.java | 15 -- .../config/MvcConfig.java | 38 ----- .../config/PageController.java | 14 -- .../src/main/java/com/baeldung/intro/App.java | 11 -- .../intro/controller/HomeController.java | 18 -- .../baeldung/servlets/ApplicationMain.java | 19 --- .../configuration/WebAppInitializer.java | 32 ---- .../configuration/WebMvcConfigure.java | 38 ----- .../baeldung/servlets/props/Constants.java | 20 --- .../servlets/props/PropertyLoader.java | 27 --- .../servlets/props/PropertySourcesLoader.java | 24 --- .../servlets/GenericCustomServlet.java | 18 -- .../servlets/javaee/AnnotationServlet.java | 18 -- .../servlets/javaee/EEWebXmlServlet.java | 20 --- .../SpringRegistrationBeanServlet.java | 17 -- .../embedded/EmbeddedTomcatExample.java | 16 -- .../java/com/baeldung/utils/Application.java | 18 -- .../utils/controller/UtilsController.java | 48 ------ .../com/baeldung/webjar/TestController.java | 15 -- .../webjar/WebjarsdemoApplication.java | 12 -- .../main/java/org/baeldung/Application.java | 13 -- .../org/baeldung/boot/DemoApplication.java | 14 -- .../baeldung/boot/components/FooService.java | 21 --- .../boot/exceptions/CommonException.java | 13 -- .../boot/exceptions/FooNotFoundException.java | 13 -- .../java/org/baeldung/boot/model/Foo.java | 45 ----- .../boot/repository/FooRepository.java | 8 - .../baeldung/boot/service/FooController.java | 26 --- .../java/org/baeldung/client/Details.java | 32 ---- .../baeldung/client/DetailsServiceClient.java | 20 --- .../common/error/MyCustomErrorController.java | 24 --- .../SpringHelloServletRegistrationBean.java | 15 -- .../error/controller/ErrorController.java | 22 --- .../MyServletContainerCustomizationBean.java | 25 --- .../ExecutorServiceExitCodeGenerator.java | 29 ---- .../java/org/baeldung/config/WebConfig.java | 17 -- .../controller/GenericEntityController.java | 59 ------- .../controller/servlet/HelloWorldServlet.java | 43 ----- .../servlet/SpringHelloWorldServlet.java | 43 ----- .../StringToEnumConverterFactory.java | 27 --- .../StringToLocalDateTimeConverter.java | 16 -- .../org/baeldung/domain/GenericEntity.java | 42 ----- .../main/java/org/baeldung/domain/Modes.java | 6 - .../baeldung/endpoints/CustomEndpoint.java | 35 ---- .../org/baeldung/endpoints/EndpointDTO.java | 39 ----- .../org/baeldung/endpoints/ListEndpoints.java | 24 --- .../org/baeldung/endpoints/MyHealthCheck.java | 22 --- .../baeldung/main/SpringBootApplication.java | 68 -------- .../monitor/jmx/MonitoringConfig.java | 21 --- .../repository/GenericEntityRepository.java | 7 - .../org/baeldung/service/LoginService.java | 5 - .../baeldung/service/LoginServiceImpl.java | 29 ---- .../session/exception/Application.java | 23 --- .../exception/repository/FooRepository.java | 10 -- .../repository/FooRepositoryImpl.java | 25 --- .../HeaderVersionArgumentResolver.java | 26 --- .../org/baeldung/web/resolver/Version.java | 11 -- .../src/main/resources/application.properties | 43 ----- .../src/main/resources/banner.txt | 14 -- .../src/main/resources/custom.properties | 4 - .../src/main/resources/demo.properties | 6 - .../src/main/resources/logback.xml | 19 --- .../src/main/resources/messages.properties | 4 - .../src/main/resources/messages_fr.properties | 4 - .../src/main/resources/public/error/404.html | 8 - .../src/main/resources/templates/index.html | 19 --- .../resources/templates/international.html | 29 ---- .../src/main/resources/templates/other.html | 16 -- .../src/main/resources/templates/utils.html | 23 --- .../src/main/webapp/WEB-INF/context.xml | 12 -- .../src/main/webapp/WEB-INF/dispatcher.xml | 16 -- .../src/main/webapp/WEB-INF/web.xml | 40 ----- .../src/main/webapp/annotationservlet.jsp | 1 - spring-custom-aop/src/main/webapp/index.jsp | 1 - ...otWithServletComponentIntegrationTest.java | 61 ------- ...ithoutServletComponentIntegrationTest.java | 52 ------ .../baeldung/git/CommitIdIntegrationTest.java | 41 ----- .../java/com/baeldung/intro/AppLiveTest.java | 37 ----- .../utils/UtilsControllerIntegrationTest.java | 35 ---- ...WebjarsdemoApplicationIntegrationTest.java | 18 -- .../SpringBootApplicationIntegrationTest.java | 66 -------- .../SpringBootJPAIntegrationTest.java | 27 --- .../SpringBootMailIntegrationTest.java | 79 --------- .../SpringContextIntegrationTest.java | 25 --- .../boot/ApplicationIntegrationTest.java | 17 -- .../boot/DemoApplicationIntegrationTest.java | 17 -- .../boot/FooComponentIntegrationTest.java | 68 -------- .../org/baeldung/boot/FooIntegrationTest.java | 43 ----- .../baeldung/boot/FooJPAIntegrationTest.java | 34 ---- .../baeldung/boot/FooJsonIntegrationTest.java | 34 ---- .../FooRepositoryIntegrationTest.java | 34 ---- .../HibernateSessionIntegrationTest.java | 32 ---- .../NoHibernateSessionIntegrationTest.java | 21 --- .../DetailsServiceClientIntegrationTest.java | 46 ------ .../src/test/resources/application.properties | 5 - .../resources/exception-hibernate.properties | 2 - .../src/test/resources/exception.properties | 6 - .../src/test/resources/import.sql | 1 - .../resources/org/baeldung/boot/expected.json | 4 - 112 files changed, 2794 deletions(-) delete mode 100644 spring-custom-aop/.gitignore delete mode 100644 spring-custom-aop/README.MD delete mode 100644 spring-custom-aop/pom.xml delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/git/CommitIdApplication.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/git/CommitInfoController.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/git/README.md delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/internationalization/InternationalizationApp.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/internationalization/config/MvcConfig.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/internationalization/config/PageController.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/intro/App.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/intro/controller/HomeController.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/ApplicationMain.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/props/Constants.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertyLoader.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/utils/Application.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/utils/controller/UtilsController.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/webjar/TestController.java delete mode 100644 spring-custom-aop/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/Application.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/boot/DemoApplication.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/boot/components/FooService.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/CommonException.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/FooNotFoundException.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/boot/model/Foo.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/boot/repository/FooRepository.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/boot/service/FooController.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/client/Details.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/client/DetailsServiceClient.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/common/error/MyCustomErrorController.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/common/error/controller/ErrorController.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/config/WebConfig.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/controller/GenericEntityController.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/controller/servlet/HelloWorldServlet.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/controller/servlet/SpringHelloWorldServlet.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/converter/StringToEnumConverterFactory.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/converter/StringToLocalDateTimeConverter.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/domain/GenericEntity.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/domain/Modes.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/endpoints/CustomEndpoint.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/endpoints/EndpointDTO.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/endpoints/ListEndpoints.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/endpoints/MyHealthCheck.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/main/SpringBootApplication.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/monitor/jmx/MonitoringConfig.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/repository/GenericEntityRepository.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/service/LoginService.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/service/LoginServiceImpl.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/session/exception/Application.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepository.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/web/resolver/HeaderVersionArgumentResolver.java delete mode 100644 spring-custom-aop/src/main/java/org/baeldung/web/resolver/Version.java delete mode 100644 spring-custom-aop/src/main/resources/application.properties delete mode 100644 spring-custom-aop/src/main/resources/banner.txt delete mode 100644 spring-custom-aop/src/main/resources/custom.properties delete mode 100644 spring-custom-aop/src/main/resources/demo.properties delete mode 100644 spring-custom-aop/src/main/resources/logback.xml delete mode 100644 spring-custom-aop/src/main/resources/messages.properties delete mode 100644 spring-custom-aop/src/main/resources/messages_fr.properties delete mode 100644 spring-custom-aop/src/main/resources/public/error/404.html delete mode 100644 spring-custom-aop/src/main/resources/templates/index.html delete mode 100644 spring-custom-aop/src/main/resources/templates/international.html delete mode 100644 spring-custom-aop/src/main/resources/templates/other.html delete mode 100644 spring-custom-aop/src/main/resources/templates/utils.html delete mode 100644 spring-custom-aop/src/main/webapp/WEB-INF/context.xml delete mode 100644 spring-custom-aop/src/main/webapp/WEB-INF/dispatcher.xml delete mode 100644 spring-custom-aop/src/main/webapp/WEB-INF/web.xml delete mode 100644 spring-custom-aop/src/main/webapp/annotationservlet.jsp delete mode 100644 spring-custom-aop/src/main/webapp/index.jsp delete mode 100644 spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/com/baeldung/intro/AppLiveTest.java delete mode 100644 spring-custom-aop/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/SpringBootJPAIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/SpringBootMailIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/FooComponentIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/FooIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/FooJPAIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/FooJsonIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/java/org/baeldung/client/DetailsServiceClientIntegrationTest.java delete mode 100644 spring-custom-aop/src/test/resources/application.properties delete mode 100644 spring-custom-aop/src/test/resources/exception-hibernate.properties delete mode 100644 spring-custom-aop/src/test/resources/exception.properties delete mode 100644 spring-custom-aop/src/test/resources/import.sql delete mode 100644 spring-custom-aop/src/test/resources/org/baeldung/boot/expected.json diff --git a/pom.xml b/pom.xml index 302530fd24..61eeb93f49 100644 --- a/pom.xml +++ b/pom.xml @@ -661,7 +661,6 @@ spring-boot-autoconfiguration spring-boot-custom-starter spring-boot-jasypt - spring-custom-aop spring-data-rest-querydsl spring-groovy spring-mobile diff --git a/spring-custom-aop/.gitignore b/spring-custom-aop/.gitignore deleted file mode 100644 index 60be5b80aa..0000000000 --- a/spring-custom-aop/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target/ -.settings/ -.classpath -.project diff --git a/spring-custom-aop/README.MD b/spring-custom-aop/README.MD deleted file mode 100644 index 9fe18aaacc..0000000000 --- a/spring-custom-aop/README.MD +++ /dev/null @@ -1,13 +0,0 @@ -###The Course -The "REST With Spring" Classes: http://bit.ly/restwithspring - -###Relevant Articles: -- [Quick Guide to @RestClientTest in Spring Boot](http://www.baeldung.com/restclienttest-in-spring-boot) -- [Intro to Spring Boot Starters](http://www.baeldung.com/spring-boot-starters) -- [A Guide to Spring in Eclipse STS](http://www.baeldung.com/eclipse-sts-spring) -- [Introduction to WebJars](http://www.baeldung.com/maven-webjars) -- [Create a Fat Jar App with Spring Boot](http://www.baeldung.com/deployable-fat-jar-spring-boot) -- [The @ServletComponentScan Annotation in Spring Boot](http://www.baeldung.com/spring-servletcomponentscan) -- [A Custom Data Binder in Spring MVC](http://www.baeldung.com/spring-mvc-custom-data-binder) -- [Intro to Building an Application with Spring Boot](http://www.baeldung.com/intro-to-spring-boot) -- [How to Register a Servlet in a Java Web Application](http://www.baeldung.com/register-servlet) diff --git a/spring-custom-aop/pom.xml b/spring-custom-aop/pom.xml deleted file mode 100644 index f0b1dbb5ac..0000000000 --- a/spring-custom-aop/pom.xml +++ /dev/null @@ -1,155 +0,0 @@ - - 4.0.0 - com.baeldung - spring-custom-aop - 0.0.1-SNAPSHOT - war - spring-boot - This is simple boot application for Spring boot actuator test - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.boot - spring-boot-starter-tomcat - - - - org.apache.tomcat.embed - tomcat-embed-core - ${tomcat.version} - - - - org.apache.tomcat.embed - tomcat-embed-jasper - ${tomcat.version} - - - - io.dropwizard.metrics - metrics-core - - - - com.h2database - h2 - - - - org.springframework.boot - spring-boot-starter - - - com.jayway.jsonpath - json-path - test - - - org.springframework.boot - spring-boot-starter-mail - - - org.subethamail - subethasmtp - ${subethasmtp.version} - test - - - - org.webjars - bootstrap - ${bootstrap.version} - - - org.webjars - jquery - ${jquery.version} - - - - com.google.guava - guava - ${guava.version} - - - - org.apache.tomcat - tomcat-servlet-api - ${tomee-servlet-api.version} - provided - - - - - - spring-boot - - - src/main/resources - true - - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - pl.project13.maven - git-commit-id-plugin - ${git-commit-id-plugin.version} - - - - - - - - - org.baeldung.boot.DemoApplication - 4.3.4.RELEASE - 2.2.1 - 3.1.1 - 3.3.7-1 - 3.1.7 - 8.5.11 - 18.0 - 8.0.43 - - - diff --git a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java b/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java deleted file mode 100644 index b4d416dd96..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.ServletComponentScan; - -/** - * using the following annotations are equivalent: - *
  • - * @ServletComponentScan - *
  • - * @ServletComponentScan(basePackages = "com.baeldung.annotation.servletcomponentscan.components") - *
  • - * @ServletComponentScan(basePackageClasses = {AttrListener.class, HelloFilter.class, HelloServlet.class, EchoServlet.class}) - *
- */ -@SpringBootApplication -@ServletComponentScan("com.baeldung.annotation.servletcomponentscan.components") -public class SpringBootAnnotatedApp { - - public static void main(String[] args) { - SpringApplication.run(SpringBootAnnotatedApp.class, args); - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java b/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java deleted file mode 100644 index 8a39078aac..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = "com.baeldung.annotation.servletcomponentscan.components") -public class SpringBootPlainApp { - - public static void main(String[] args) { - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java b/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java deleted file mode 100644 index b1bdc7d781..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan.components; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.annotation.WebListener; - -@WebListener -public class AttrListener implements ServletContextListener { - - @Override - public void contextInitialized(ServletContextEvent servletContextEvent) { - servletContextEvent.getServletContext().setAttribute("servlet-context-attr", "test"); - System.out.println("context init"); - } - - @Override - public void contextDestroyed(ServletContextEvent servletContextEvent) { - System.out.println("context destroy"); - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java b/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java deleted file mode 100644 index d8192c2cb1..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan.components; - -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; - -@WebServlet(name = "echo servlet", urlPatterns = "/echo") -public class EchoServlet extends HttpServlet { - - @Override - public void doPost(HttpServletRequest request, HttpServletResponse response) { - try { - Path path = File.createTempFile("echo", "tmp").toPath(); - Files.copy(request.getInputStream(), path, StandardCopyOption.REPLACE_EXISTING); - Files.copy(path, response.getOutputStream()); - Files.delete(path); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java b/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java deleted file mode 100644 index 146e5ae386..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan.components; - -import javax.servlet.*; -import javax.servlet.annotation.WebFilter; -import javax.servlet.annotation.WebInitParam; -import java.io.IOException; - -@WebFilter(urlPatterns = "/hello", description = "a filter for hello servlet", initParams = { @WebInitParam(name = "msg", value = "filtering ") }, filterName = "hello filter", servletNames = { "echo servlet" }) -public class HelloFilter implements Filter { - - private FilterConfig filterConfig; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - System.out.println("filter init"); - this.filterConfig = filterConfig; - } - - @Override - public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - servletResponse.getOutputStream().print(filterConfig.getInitParameter("msg")); - filterChain.doFilter(servletRequest, servletResponse); - } - - @Override - public void destroy() { - System.out.println("filter destroy"); - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java b/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java deleted file mode 100644 index 5269c1bf29..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan.components; - -import javax.servlet.ServletConfig; -import javax.servlet.annotation.WebInitParam; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -@WebServlet(urlPatterns = "/hello", initParams = { @WebInitParam(name = "msg", value = "hello") }) -public class HelloServlet extends HttpServlet { - - private ServletConfig servletConfig; - - @Override - public void init(ServletConfig servletConfig) { - this.servletConfig = servletConfig; - } - - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) { - try { - response.getOutputStream().write(servletConfig.getInitParameter("msg").getBytes()); - } catch (IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/git/CommitIdApplication.java b/spring-custom-aop/src/main/java/com/baeldung/git/CommitIdApplication.java deleted file mode 100644 index cd696eae70..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/git/CommitIdApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.git; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.core.io.ClassPathResource; - -@SpringBootApplication(scanBasePackages = { "com.baeldung.git" }) -public class CommitIdApplication { - public static void main(String[] args) { - SpringApplication.run(CommitIdApplication.class, args); - } - - @Bean - public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() { - PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer(); - c.setLocation(new ClassPathResource("git.properties")); - c.setIgnoreResourceNotFound(true); - c.setIgnoreUnresolvablePlaceholders(true); - return c; - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/git/CommitInfoController.java b/spring-custom-aop/src/main/java/com/baeldung/git/CommitInfoController.java deleted file mode 100644 index 6d44e02ec2..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/git/CommitInfoController.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.git; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.HashMap; -import java.util.Map; - -@RestController -public class CommitInfoController { - - @Value("${git.commit.message.short}") - private String commitMessage; - - @Value("${git.branch}") - private String branch; - - @Value("${git.commit.id}") - private String commitId; - - @RequestMapping("/commitId") - public Map getCommitId() { - Map result = new HashMap<>(); - result.put("Commit message", commitMessage); - result.put("Commit branch", branch); - result.put("Commit id", commitId); - return result; - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/git/README.md b/spring-custom-aop/src/main/java/com/baeldung/git/README.md deleted file mode 100644 index 7e6a597c28..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/git/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [Injecting Git Information Into Spring](http://www.baeldung.com/spring-git-information) diff --git a/spring-custom-aop/src/main/java/com/baeldung/internationalization/InternationalizationApp.java b/spring-custom-aop/src/main/java/com/baeldung/internationalization/InternationalizationApp.java deleted file mode 100644 index c92d1c32e6..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/internationalization/InternationalizationApp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.internationalization; - -import javax.annotation.security.RolesAllowed; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class InternationalizationApp { - @RolesAllowed("*") - public static void main(String[] args) { - System.setProperty("security.basic.enabled", "false"); - SpringApplication.run(InternationalizationApp.class, args); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/internationalization/config/MvcConfig.java b/spring-custom-aop/src/main/java/com/baeldung/internationalization/config/MvcConfig.java deleted file mode 100644 index 59f7fd3ba5..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/internationalization/config/MvcConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.baeldung.internationalization.config; - -import java.util.Locale; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; - -@Configuration -@EnableWebMvc -@ComponentScan(basePackages = "com.baeldung.internationalization.config") -public class MvcConfig extends WebMvcConfigurerAdapter { - - @Bean - public LocaleResolver localeResolver() { - SessionLocaleResolver slr = new SessionLocaleResolver(); - slr.setDefaultLocale(Locale.US); - return slr; - } - - @Bean - public LocaleChangeInterceptor localeChangeInterceptor() { - LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); - lci.setParamName("lang"); - return lci; - } - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(localeChangeInterceptor()); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/internationalization/config/PageController.java b/spring-custom-aop/src/main/java/com/baeldung/internationalization/config/PageController.java deleted file mode 100644 index 96a534b853..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/internationalization/config/PageController.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.internationalization.config; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -@Controller -public class PageController { - - @GetMapping("/international") - public String getInternationalPage() { - return "international"; - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/intro/App.java b/spring-custom-aop/src/main/java/com/baeldung/intro/App.java deleted file mode 100644 index 77cdf4ddb9..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/intro/App.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.intro; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class App { - public static void main(String[] args) { - SpringApplication.run(App.class, args); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/intro/controller/HomeController.java b/spring-custom-aop/src/main/java/com/baeldung/intro/controller/HomeController.java deleted file mode 100644 index 5c0cb2d2de..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/intro/controller/HomeController.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.intro.controller; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HomeController { - - @RequestMapping("/") - public String root() { - return "Index Page"; - } - - @RequestMapping("/local") - public String local() { - return "/local"; - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/ApplicationMain.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/ApplicationMain.java deleted file mode 100644 index a6ea3757fe..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/ApplicationMain.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.servlets; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication -public class ApplicationMain extends SpringBootServletInitializer { - - public static void main(String[] args) { - SpringApplication.run(ApplicationMain.class, args); - } - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(ApplicationMain.class); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java deleted file mode 100644 index eadd40355a..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.baeldung.servlets.configuration; - -import org.springframework.web.WebApplicationInitializer; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; -import org.springframework.web.context.support.XmlWebApplicationContext; -import org.springframework.web.servlet.DispatcherServlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration; - -public class WebAppInitializer implements WebApplicationInitializer { - - public void onStartup(ServletContext container) throws ServletException { - - AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext(); - ctx.register(WebMvcConfigure.class); - ctx.setServletContext(container); - - ServletRegistration.Dynamic servletOne = container.addServlet("SpringProgrammaticDispatcherServlet", new DispatcherServlet(ctx)); - servletOne.setLoadOnStartup(1); - servletOne.addMapping("/"); - - XmlWebApplicationContext xctx = new XmlWebApplicationContext(); - xctx.setConfigLocation("/WEB-INF/context.xml"); - xctx.setServletContext(container); - - ServletRegistration.Dynamic servletTwo = container.addServlet("SpringProgrammaticXMLDispatcherServlet", new DispatcherServlet(xctx)); - servletTwo.setLoadOnStartup(1); - servletTwo.addMapping("/"); - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java deleted file mode 100644 index 8dea814bc7..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.baeldung.servlets.configuration; - -import org.springframework.boot.web.support.ErrorPageFilter; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.ViewResolver; -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.web.servlet.resource.PathResourceResolver; -import org.springframework.web.servlet.view.InternalResourceViewResolver; - -@Configuration -public class WebMvcConfigure extends WebMvcConfigurerAdapter { - - @Bean - public ViewResolver getViewResolver() { - InternalResourceViewResolver resolver = new InternalResourceViewResolver(); - resolver.setPrefix("/WEB-INF/"); - resolver.setSuffix(".jsp"); - return resolver; - } - - @Override - public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/resources/**").addResourceLocations("/resources/").setCachePeriod(3600).resourceChain(true).addResolver(new PathResourceResolver()); - } - - @Bean - public ErrorPageFilter errorPageFilter() { - return new ErrorPageFilter(); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/props/Constants.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/props/Constants.java deleted file mode 100644 index 6345d1f969..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/props/Constants.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.servlets.props; - -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Properties; - -public final class Constants { - - @Autowired - PropertySourcesLoader psl; - - public static final String breakLine = System.getProperty("line.separator"); - private static final PropertyLoader pl = new PropertyLoader(); - private static final Properties mainProps = pl.getProperties("custom.properties"); - public static final String DISPATCHER_SERVLET_NAME = mainProps.getProperty("dispatcher.servlet.name"); - public static final String DISPATCHER_SERVLET_MAPPING = mainProps.getProperty("dispatcher.servlet.mapping"); - private final String EXAMPLE_SERVLET_NAME = psl.getProperty("example.servlet.name"); - private final String EXAMPLE_SERVLET_MAPPING = psl.getProperty("example.servlet.mapping"); - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertyLoader.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertyLoader.java deleted file mode 100644 index c29da45929..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertyLoader.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.baeldung.servlets.props; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -public class PropertyLoader { - private static final Logger log = LoggerFactory.getLogger(PropertyLoader.class); - - public Properties getProperties(String file) { - Properties prop = new Properties(); - InputStream input = null; - try { - input = getClass().getResourceAsStream(file); - prop.load(input); - if (input != null) { - input.close(); - } - } catch (IOException ex) { - log.error("IOException: " + ex); - } - return prop; - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java deleted file mode 100644 index 21e8949653..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.servlets.props; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.env.ConfigurableEnvironment; - -@Configuration -@ComponentScan(basePackages = { "com.baeldung.*" }) -@PropertySource("classpath:custom.properties") -public class PropertySourcesLoader { - - private static final Logger log = LoggerFactory.getLogger(PropertySourcesLoader.class); - - @Autowired - ConfigurableEnvironment env; - - public String getProperty(String key) { - return env.getProperty(key); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java deleted file mode 100644 index 49dd9404b7..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.servlets.servlets; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; - -public class GenericCustomServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

Hello World

"); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java deleted file mode 100644 index 992976ca0e..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.servlets.servlets.javaee; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -@WebServlet(name = "AnnotationServlet", description = "Example Servlet Using Annotations", urlPatterns = { "/annotationservlet" }) -public class AnnotationServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - request.getRequestDispatcher("/annotationservlet.jsp").forward(request, response); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java deleted file mode 100644 index c7b373064f..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.servlets.servlets.javaee; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; - -public class EEWebXmlServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

Hello World

"); - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java deleted file mode 100644 index e3c225d429..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.servlets.servlets.springboot; - -import com.baeldung.servlets.servlets.GenericCustomServlet; -import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class SpringRegistrationBeanServlet { - - @Bean - public ServletRegistrationBean genericCustomServlet() { - ServletRegistrationBean bean = new ServletRegistrationBean(new GenericCustomServlet(), "/springregistrationbeanservlet/*"); - bean.setLoadOnStartup(1); - return bean; - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java b/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java deleted file mode 100644 index 9e460d03a8..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.servlets.servlets.springboot.embedded; - -import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; -import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class EmbeddedTomcatExample { - - @Bean - public EmbeddedServletContainerFactory servletContainer() { - TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory(); - return tomcat; - } -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/utils/Application.java b/spring-custom-aop/src/main/java/com/baeldung/utils/Application.java deleted file mode 100644 index 46cf3fb4aa..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/utils/Application.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.utils; - -import javax.annotation.security.RolesAllowed; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = "com.baeldung.utils") -public class Application { - - @RolesAllowed("*") - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/utils/controller/UtilsController.java b/spring-custom-aop/src/main/java/com/baeldung/utils/controller/UtilsController.java deleted file mode 100644 index 8c7f2f932a..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/utils/controller/UtilsController.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.baeldung.utils.controller; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.ServletRequestUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.util.WebUtils; - -@Controller -public class UtilsController { - - @GetMapping("/utils") - public String webUtils(Model model) { - return "utils"; - } - - @PostMapping("/setParam") - public String post(HttpServletRequest request, Model model) { - String param = ServletRequestUtils.getStringParameter(request, "param", "DEFAULT"); - - // Long param = ServletRequestUtils.getLongParameter(request, "param",1L); - // boolean param = ServletRequestUtils.getBooleanParameter(request, "param", true); - // double param = ServletRequestUtils.getDoubleParameter(request, "param", 1000); - // float param = ServletRequestUtils.getFloatParameter(request, "param", (float) 1.00); - // int param = ServletRequestUtils.getIntParameter(request, "param", 100); - - // try { - // ServletRequestUtils.getRequiredStringParameter(request, "param"); - // } catch (ServletRequestBindingException e) { - // e.printStackTrace(); - // } - - WebUtils.setSessionAttribute(request, "parameter", param); - model.addAttribute("parameter", "You set: " + (String) WebUtils.getSessionAttribute(request, "parameter")); - return "utils"; - } - - @GetMapping("/other") - public String other(HttpServletRequest request, Model model) { - String param = (String) WebUtils.getSessionAttribute(request, "parameter"); - model.addAttribute("parameter", param); - return "other"; - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/webjar/TestController.java b/spring-custom-aop/src/main/java/com/baeldung/webjar/TestController.java deleted file mode 100644 index e8e7fd5ce9..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/webjar/TestController.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.webjar; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -public class TestController { - - @RequestMapping(value = "/") - public String welcome(Model model) { - return "index"; - } - -} diff --git a/spring-custom-aop/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java b/spring-custom-aop/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java deleted file mode 100644 index 2397861f1d..0000000000 --- a/spring-custom-aop/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.webjar; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class WebjarsdemoApplication { - - public static void main(String[] args) { - SpringApplication.run(WebjarsdemoApplication.class, args); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/Application.java b/spring-custom-aop/src/main/java/org/baeldung/Application.java deleted file mode 100644 index aae0c427a9..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/Application.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.baeldung; - -import org.springframework.boot.SpringApplication; -import org.springframework.context.ApplicationContext; - -@org.springframework.boot.autoconfigure.SpringBootApplication -public class Application { - private static ApplicationContext applicationContext; - - public static void main(String[] args) { - applicationContext = SpringApplication.run(Application.class, args); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/boot/DemoApplication.java b/spring-custom-aop/src/main/java/org/baeldung/boot/DemoApplication.java deleted file mode 100644 index e61d140396..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/boot/DemoApplication.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.boot; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class DemoApplication { - - public static void main(String[] args) { - System.setProperty("spring.config.name", "demo"); - SpringApplication.run(DemoApplication.class, args); - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/boot/components/FooService.java b/spring-custom-aop/src/main/java/org/baeldung/boot/components/FooService.java deleted file mode 100644 index 4ff8e9fdd4..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/boot/components/FooService.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.baeldung.boot.components; - -import org.baeldung.boot.model.Foo; -import org.baeldung.boot.repository.FooRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class FooService { - - @Autowired - private FooRepository fooRepository; - - public Foo getFooWithId(Integer id) throws Exception { - return fooRepository.findOne(id); - } - - public Foo getFooWithName(String name) { - return fooRepository.findByName(name); - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/CommonException.java b/spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/CommonException.java deleted file mode 100644 index e03b859eab..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/CommonException.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.baeldung.boot.exceptions; - -public class CommonException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 3080004140659213332L; - - public CommonException(String message) { - super(message); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/FooNotFoundException.java b/spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/FooNotFoundException.java deleted file mode 100644 index 0b04bd2759..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/boot/exceptions/FooNotFoundException.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.baeldung.boot.exceptions; - -public class FooNotFoundException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 9042200028456133589L; - - public FooNotFoundException(String message) { - super(message); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/boot/model/Foo.java b/spring-custom-aop/src/main/java/org/baeldung/boot/model/Foo.java deleted file mode 100644 index d373e25b85..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/boot/model/Foo.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.baeldung.boot.model; - -import java.io.Serializable; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; - -@Entity -public class Foo implements Serializable { - private static final long serialVersionUID = 1L; - @Id - @GeneratedValue - private Integer id; - private String name; - - public Foo() { - } - - public Foo(String name) { - this.name = name; - } - - public Foo(Integer id, String name) { - super(); - this.id = id; - this.name = name; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/boot/repository/FooRepository.java b/spring-custom-aop/src/main/java/org/baeldung/boot/repository/FooRepository.java deleted file mode 100644 index 09d6975dba..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/boot/repository/FooRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.baeldung.boot.repository; - -import org.baeldung.boot.model.Foo; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface FooRepository extends JpaRepository { - public Foo findByName(String name); -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/boot/service/FooController.java b/spring-custom-aop/src/main/java/org/baeldung/boot/service/FooController.java deleted file mode 100644 index d400c3bf9e..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/boot/service/FooController.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.baeldung.boot.service; - -import org.baeldung.boot.components.FooService; -import org.baeldung.boot.model.Foo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class FooController { - - @Autowired - private FooService fooService; - - @GetMapping("/{id}") - public Foo getFooWithId(@PathVariable Integer id) throws Exception { - return fooService.getFooWithId(id); - } - - @GetMapping("/") - public Foo getFooWithName(@RequestParam String name) throws Exception { - return fooService.getFooWithName(name); - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/main/java/org/baeldung/client/Details.java b/spring-custom-aop/src/main/java/org/baeldung/client/Details.java deleted file mode 100644 index 2ae3adc38f..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/client/Details.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.baeldung.client; - -public class Details { - - private String name; - - private String login; - - public Details() { - } - - public Details(String name, String login) { - this.name = name; - this.login = login; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLogin() { - return login; - } - - public void setLogin(String login) { - this.login = login; - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/client/DetailsServiceClient.java b/spring-custom-aop/src/main/java/org/baeldung/client/DetailsServiceClient.java deleted file mode 100644 index 51fa7c6181..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/client/DetailsServiceClient.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.baeldung.client; - -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class DetailsServiceClient { - - private final RestTemplate restTemplate; - - public DetailsServiceClient(RestTemplateBuilder restTemplateBuilder) { - restTemplate = restTemplateBuilder.build(); - } - - public Details getUserDetails(String name) { - return restTemplate.getForObject("/{name}/details", Details.class, name); - } - -} \ No newline at end of file diff --git a/spring-custom-aop/src/main/java/org/baeldung/common/error/MyCustomErrorController.java b/spring-custom-aop/src/main/java/org/baeldung/common/error/MyCustomErrorController.java deleted file mode 100644 index a50b88f94b..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/common/error/MyCustomErrorController.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.baeldung.common.error; - -import org.springframework.boot.autoconfigure.web.ErrorController; -import org.springframework.web.bind.annotation.RequestMapping; - -public class MyCustomErrorController implements ErrorController { - - private static final String PATH = "/error"; - - public MyCustomErrorController() { - // TODO Auto-generated constructor stub - } - - @RequestMapping(value = PATH) - public String error() { - return "Error heaven"; - } - - @Override - public String getErrorPath() { - return PATH; - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java b/spring-custom-aop/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java deleted file mode 100644 index 774cf1b970..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.baeldung.common.error; - -import org.springframework.boot.web.servlet.ServletRegistrationBean; - -import javax.servlet.Servlet; - -public class SpringHelloServletRegistrationBean extends ServletRegistrationBean { - - public SpringHelloServletRegistrationBean() { - } - - public SpringHelloServletRegistrationBean(Servlet servlet, String... urlMappings) { - super(servlet, urlMappings); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/common/error/controller/ErrorController.java b/spring-custom-aop/src/main/java/org/baeldung/common/error/controller/ErrorController.java deleted file mode 100644 index 9e63418a02..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/common/error/controller/ErrorController.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.baeldung.common.error.controller; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ErrorController { - - public ErrorController() { - } - - @RequestMapping("/400") - String error400() { - return "Error Code: 400 occured."; - } - - @RequestMapping("/errorHeaven") - String errorHeaven() { - return "You have reached the heaven of errors!!!"; - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java b/spring-custom-aop/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java deleted file mode 100644 index 3d239f8944..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.baeldung.common.properties; - -import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; -import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; -import org.springframework.boot.web.servlet.ErrorPage; -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Component; - -@Component -public class MyServletContainerCustomizationBean implements EmbeddedServletContainerCustomizer { - - public MyServletContainerCustomizationBean() { - - } - - @Override - public void customize(ConfigurableEmbeddedServletContainer container) { - container.setPort(8084); - container.setContextPath("/springbootapp"); - - container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400")); - container.addErrorPages(new ErrorPage("/errorHeaven")); - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java b/spring-custom-aop/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java deleted file mode 100644 index 07f57ec1ef..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.baeldung.common.resources; - -import java.util.Objects; -import java.util.concurrent.ExecutorService; - -import org.springframework.boot.ExitCodeGenerator; - -public class ExecutorServiceExitCodeGenerator implements ExitCodeGenerator { - - private ExecutorService executorService; - - public ExecutorServiceExitCodeGenerator(ExecutorService executorService) { - } - - @Override - public int getExitCode() { - int returnCode = 0; - try { - if (!Objects.isNull(executorService)) { - executorService.shutdownNow(); - returnCode = 1; - } - } catch (SecurityException ex) { - returnCode = 0; - } - return returnCode; - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/config/WebConfig.java b/spring-custom-aop/src/main/java/org/baeldung/config/WebConfig.java deleted file mode 100644 index 4ef407823e..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/config/WebConfig.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung.config; - -import org.baeldung.web.resolver.HeaderVersionArgumentResolver; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import java.util.List; - -@Configuration -public class WebConfig extends WebMvcConfigurerAdapter { - - @Override - public void addArgumentResolvers(final List argumentResolvers) { - argumentResolvers.add(new HeaderVersionArgumentResolver()); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/controller/GenericEntityController.java b/spring-custom-aop/src/main/java/org/baeldung/controller/GenericEntityController.java deleted file mode 100644 index 7d1ad7d899..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/controller/GenericEntityController.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.baeldung.controller; - -import org.baeldung.domain.GenericEntity; -import org.baeldung.domain.Modes; -import org.baeldung.web.resolver.Version; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; - -@RestController -public class GenericEntityController { - private List entityList = new ArrayList<>(); - - { - entityList.add(new GenericEntity(1l, "entity_1")); - entityList.add(new GenericEntity(2l, "entity_2")); - entityList.add(new GenericEntity(3l, "entity_3")); - entityList.add(new GenericEntity(4l, "entity_4")); - } - - @RequestMapping("/entity/all") - public List findAll() { - return entityList; - } - - @RequestMapping(value = "/entity", method = RequestMethod.POST) - public GenericEntity addEntity(GenericEntity entity) { - entityList.add(entity); - return entity; - } - - @RequestMapping("/entity/findby/{id}") - public GenericEntity findById(@PathVariable Long id) { - return entityList.stream().filter(entity -> entity.getId().equals(id)).findFirst().get(); - } - - @GetMapping("/entity/findbydate/{date}") - public GenericEntity findByDate(@PathVariable("date") LocalDateTime date) { - return entityList.stream().findFirst().get(); - } - - @GetMapping("/entity/findbymode/{mode}") - public GenericEntity findByEnum(@PathVariable("mode") Modes mode) { - return entityList.stream().findFirst().get(); - } - - @GetMapping("/entity/findbyversion") - public ResponseEntity findByVersion(@Version String version) { - return version != null ? new ResponseEntity(entityList.stream().findFirst().get(), HttpStatus.OK) : new ResponseEntity(HttpStatus.NOT_FOUND); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/controller/servlet/HelloWorldServlet.java b/spring-custom-aop/src/main/java/org/baeldung/controller/servlet/HelloWorldServlet.java deleted file mode 100644 index fc8fefd77e..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/controller/servlet/HelloWorldServlet.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.baeldung.controller.servlet; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Objects; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class HelloWorldServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - public HelloWorldServlet() { - super(); - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - PrintWriter out = null; - try { - out = response.getWriter(); - out.println("HelloWorldServlet: GET METHOD"); - out.flush(); - } finally { - if (!Objects.isNull(out)) - out.close(); - } - } - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - PrintWriter out = null; - try { - out = response.getWriter(); - out.println("HelloWorldServlet: POST METHOD"); - out.flush(); - } finally { - if (!Objects.isNull(out)) - out.close(); - } - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/controller/servlet/SpringHelloWorldServlet.java b/spring-custom-aop/src/main/java/org/baeldung/controller/servlet/SpringHelloWorldServlet.java deleted file mode 100644 index 16cff5b1fa..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/controller/servlet/SpringHelloWorldServlet.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.baeldung.controller.servlet; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Objects; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class SpringHelloWorldServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - public SpringHelloWorldServlet() { - super(); - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - PrintWriter out = null; - try { - out = response.getWriter(); - out.println("SpringHelloWorldServlet: GET METHOD"); - out.flush(); - } finally { - if (!Objects.isNull(out)) - out.close(); - } - } - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - PrintWriter out = null; - try { - out = response.getWriter(); - out.println("SpringHelloWorldServlet: POST METHOD"); - out.flush(); - } finally { - if (!Objects.isNull(out)) - out.close(); - } - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/converter/StringToEnumConverterFactory.java b/spring-custom-aop/src/main/java/org/baeldung/converter/StringToEnumConverterFactory.java deleted file mode 100644 index 17c6fd06de..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/converter/StringToEnumConverterFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.baeldung.converter; - -import org.springframework.core.convert.converter.Converter; -import org.springframework.core.convert.converter.ConverterFactory; -import org.springframework.stereotype.Component; - -@Component -public class StringToEnumConverterFactory implements ConverterFactory { - - private static class StringToEnumConverter implements Converter { - - private Class enumType; - - public StringToEnumConverter(Class enumType) { - this.enumType = enumType; - } - - public T convert(String source) { - return (T) Enum.valueOf(this.enumType, source.trim()); - } - } - - @Override - public Converter getConverter(final Class targetType) { - return new StringToEnumConverter(targetType); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/converter/StringToLocalDateTimeConverter.java b/spring-custom-aop/src/main/java/org/baeldung/converter/StringToLocalDateTimeConverter.java deleted file mode 100644 index cbb9e6ddb4..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/converter/StringToLocalDateTimeConverter.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung.converter; - -import org.springframework.core.convert.converter.Converter; -import org.springframework.stereotype.Component; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -@Component -public class StringToLocalDateTimeConverter implements Converter { - - @Override - public LocalDateTime convert(final String source) { - return LocalDateTime.parse(source, DateTimeFormatter.ISO_LOCAL_DATE_TIME); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/domain/GenericEntity.java b/spring-custom-aop/src/main/java/org/baeldung/domain/GenericEntity.java deleted file mode 100644 index 7b1d27cb66..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/domain/GenericEntity.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.baeldung.domain; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; - -@Entity -public class GenericEntity { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - private String value; - - public GenericEntity() { - } - - public GenericEntity(String value) { - this.value = value; - } - - public GenericEntity(Long id, String value) { - this.id = id; - this.value = value; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/domain/Modes.java b/spring-custom-aop/src/main/java/org/baeldung/domain/Modes.java deleted file mode 100644 index 473406ef26..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/domain/Modes.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.baeldung.domain; - -public enum Modes { - - ALPHA, BETA; -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/endpoints/CustomEndpoint.java b/spring-custom-aop/src/main/java/org/baeldung/endpoints/CustomEndpoint.java deleted file mode 100644 index 222a54c6ef..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/endpoints/CustomEndpoint.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.baeldung.endpoints; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.boot.actuate.endpoint.Endpoint; -import org.springframework.stereotype.Component; - -@Component -public class CustomEndpoint implements Endpoint> { - - public CustomEndpoint() { - - } - - public String getId() { - return "customEndpoint"; - } - - public boolean isEnabled() { - return true; - } - - public boolean isSensitive() { - return true; - } - - public List invoke() { - // Your logic to display the output - List messages = new ArrayList(); - messages.add("This is message 1"); - messages.add("This is message 2"); - return messages; - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/endpoints/EndpointDTO.java b/spring-custom-aop/src/main/java/org/baeldung/endpoints/EndpointDTO.java deleted file mode 100644 index d12d6419e1..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/endpoints/EndpointDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.baeldung.endpoints; - -public class EndpointDTO { - private String id; - private boolean enabled; - private boolean sensitive; - - public EndpointDTO(String id, boolean enabled, boolean sensitive) { - super(); - this.id = id; - this.enabled = enabled; - this.sensitive = sensitive; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public boolean isSensitive() { - return sensitive; - } - - public void setSensitive(boolean sensitive) { - this.sensitive = sensitive; - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/endpoints/ListEndpoints.java b/spring-custom-aop/src/main/java/org/baeldung/endpoints/ListEndpoints.java deleted file mode 100644 index f434351a51..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/endpoints/ListEndpoints.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.baeldung.endpoints; - -import java.util.List; -import java.util.stream.Collectors; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.actuate.endpoint.AbstractEndpoint; -import org.springframework.boot.actuate.endpoint.Endpoint; -import org.springframework.stereotype.Component; - -@Component -public class ListEndpoints extends AbstractEndpoint> { - private List endpointDTOs; - - @Autowired - public ListEndpoints(List endpoints) { - super("listEndpoints"); - this.endpointDTOs = endpoints.stream().map(endpoint -> new EndpointDTO(endpoint.getId(), endpoint.isEnabled(), endpoint.isSensitive())).collect(Collectors.toList()); - } - - public List invoke() { - return this.endpointDTOs; - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/main/java/org/baeldung/endpoints/MyHealthCheck.java b/spring-custom-aop/src/main/java/org/baeldung/endpoints/MyHealthCheck.java deleted file mode 100644 index 4410a02d47..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/endpoints/MyHealthCheck.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.baeldung.endpoints; - -import org.springframework.boot.actuate.health.Health; -import org.springframework.boot.actuate.health.HealthIndicator; -import org.springframework.stereotype.Component; - -@Component -public class MyHealthCheck implements HealthIndicator { - - public Health health() { - int errorCode = check(); // perform some specific health check - if (errorCode != 0) { - return Health.down().withDetail("Error Code", errorCode).withDetail("Description", "You custom MyHealthCheck endpoint is down").build(); - } - return Health.up().build(); - } - - public int check() { - // Your logic to check health - return 1; - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/main/SpringBootApplication.java b/spring-custom-aop/src/main/java/org/baeldung/main/SpringBootApplication.java deleted file mode 100644 index b828a5b841..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/main/SpringBootApplication.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.baeldung.main; - -import org.baeldung.common.error.SpringHelloServletRegistrationBean; -import org.baeldung.common.resources.ExecutorServiceExitCodeGenerator; -import org.baeldung.controller.servlet.HelloWorldServlet; -import org.baeldung.controller.servlet.SpringHelloWorldServlet; -import org.baeldung.service.LoginService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -@RestController -@EnableAutoConfiguration -@ComponentScan({ "org.baeldung.common.error", "org.baeldung.common.error.controller", "org.baeldung.common.properties", "org.baeldung.common.resources", "org.baeldung.endpoints", "org.baeldung.service", "org.baeldung.monitor.jmx", "org.baeldung.service" }) -public class SpringBootApplication { - - private static ApplicationContext applicationContext; - - @Autowired - private LoginService service; - - @RequestMapping("/") - String home() { - service.login("admin", "admin".toCharArray()); - return "TADA!!! You are in Spring Boot Actuator test application."; - } - - public static void main(String[] args) { - applicationContext = SpringApplication.run(SpringBootApplication.class, args); - } - - @Bean - public ExecutorService executorService() { - return Executors.newFixedThreadPool(10); - } - - @Bean - public HelloWorldServlet helloWorldServlet() { - return new HelloWorldServlet(); - } - - @Bean - public SpringHelloServletRegistrationBean servletRegistrationBean() { - SpringHelloServletRegistrationBean bean = new SpringHelloServletRegistrationBean(new SpringHelloWorldServlet(), "/springHelloWorld/*"); - bean.setLoadOnStartup(1); - bean.addInitParameter("message", "SpringHelloWorldServlet special message"); - return bean; - } - - @Bean - @Autowired - public ExecutorServiceExitCodeGenerator executorServiceExitCodeGenerator(ExecutorService executorService) { - return new ExecutorServiceExitCodeGenerator(executorService); - } - - public void shutDown(ExecutorServiceExitCodeGenerator executorServiceExitCodeGenerator) { - SpringApplication.exit(applicationContext, executorServiceExitCodeGenerator); - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/monitor/jmx/MonitoringConfig.java b/spring-custom-aop/src/main/java/org/baeldung/monitor/jmx/MonitoringConfig.java deleted file mode 100644 index febe3336eb..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/monitor/jmx/MonitoringConfig.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.baeldung.monitor.jmx; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import com.codahale.metrics.JmxReporter; -import com.codahale.metrics.MetricRegistry; - -@Configuration -public class MonitoringConfig { - @Autowired - private MetricRegistry registry; - - @Bean - public JmxReporter jmxReporter() { - JmxReporter reporter = JmxReporter.forRegistry(registry).build(); - reporter.start(); - return reporter; - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/repository/GenericEntityRepository.java b/spring-custom-aop/src/main/java/org/baeldung/repository/GenericEntityRepository.java deleted file mode 100644 index 7bb1e6dcdc..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/repository/GenericEntityRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.baeldung.repository; - -import org.baeldung.domain.GenericEntity; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface GenericEntityRepository extends JpaRepository { -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/service/LoginService.java b/spring-custom-aop/src/main/java/org/baeldung/service/LoginService.java deleted file mode 100644 index 34840fad67..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/service/LoginService.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.baeldung.service; - -public interface LoginService { - public boolean login(String userName, char[] password); -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/service/LoginServiceImpl.java b/spring-custom-aop/src/main/java/org/baeldung/service/LoginServiceImpl.java deleted file mode 100644 index 2e5ef89c48..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/service/LoginServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.baeldung.service; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.actuate.metrics.CounterService; -import org.springframework.stereotype.Service; - -@Service -public class LoginServiceImpl implements LoginService { - - private CounterService counterService; - - @Autowired - public LoginServiceImpl(CounterService counterService) { - this.counterService = counterService; - } - - public boolean login(String userName, char[] password) { - boolean success; - if (userName.equals("admin") && "secret".toCharArray().equals(password)) { - counterService.increment("counter.login.success"); - success = true; - } else { - counterService.increment("counter.login.failure"); - success = false; - } - return success; - } - -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/session/exception/Application.java b/spring-custom-aop/src/main/java/org/baeldung/session/exception/Application.java deleted file mode 100644 index 23d741b98c..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/session/exception/Application.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.baeldung.session.exception; - -import org.baeldung.boot.model.Foo; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; -import org.springframework.orm.jpa.vendor.HibernateJpaSessionFactoryBean; - -@EntityScan(basePackageClasses = Foo.class) -@SpringBootApplication -public class Application { - public static void main(String[] args) { - System.setProperty("spring.config.name", "exception"); - System.setProperty("spring.profiles.active", "exception"); - SpringApplication.run(Application.class, args); - } - - @Bean - public HibernateJpaSessionFactoryBean sessionFactory() { - return new HibernateJpaSessionFactoryBean(); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepository.java b/spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepository.java deleted file mode 100644 index 679d691b26..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.baeldung.session.exception.repository; - -import org.baeldung.boot.model.Foo; - -public interface FooRepository { - - void save(Foo foo); - - Foo get(Integer id); -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java b/spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java deleted file mode 100644 index 83de888e5e..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.baeldung.session.exception.repository; - -import org.baeldung.boot.model.Foo; -import org.hibernate.SessionFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Repository; - -@Profile("exception") -@Repository -public class FooRepositoryImpl implements FooRepository { - @Autowired - private SessionFactory sessionFactory; - - @Override - public void save(Foo foo) { - sessionFactory.getCurrentSession().saveOrUpdate(foo); - } - - @Override - public Foo get(Integer id) { - return sessionFactory.getCurrentSession().get(Foo.class, id); - } - -} \ No newline at end of file diff --git a/spring-custom-aop/src/main/java/org/baeldung/web/resolver/HeaderVersionArgumentResolver.java b/spring-custom-aop/src/main/java/org/baeldung/web/resolver/HeaderVersionArgumentResolver.java deleted file mode 100644 index 89a77f38d1..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/web/resolver/HeaderVersionArgumentResolver.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.baeldung.web.resolver; - -import org.springframework.core.MethodParameter; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.support.WebDataBinderFactory; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.web.method.support.ModelAndViewContainer; - -import javax.servlet.http.HttpServletRequest; - -@Component -public class HeaderVersionArgumentResolver implements HandlerMethodArgumentResolver { - - @Override - public boolean supportsParameter(final MethodParameter methodParameter) { - return methodParameter.getParameterAnnotation(Version.class) != null; - } - - @Override - public Object resolveArgument(final MethodParameter methodParameter, final ModelAndViewContainer modelAndViewContainer, final NativeWebRequest nativeWebRequest, final WebDataBinderFactory webDataBinderFactory) throws Exception { - HttpServletRequest request = (HttpServletRequest) nativeWebRequest.getNativeRequest(); - - return request.getHeader("Version"); - } -} diff --git a/spring-custom-aop/src/main/java/org/baeldung/web/resolver/Version.java b/spring-custom-aop/src/main/java/org/baeldung/web/resolver/Version.java deleted file mode 100644 index 2a9e6e60b3..0000000000 --- a/spring-custom-aop/src/main/java/org/baeldung/web/resolver/Version.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.baeldung.web.resolver; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.PARAMETER) -public @interface Version { -} diff --git a/spring-custom-aop/src/main/resources/application.properties b/spring-custom-aop/src/main/resources/application.properties deleted file mode 100644 index 72ed8795c9..0000000000 --- a/spring-custom-aop/src/main/resources/application.properties +++ /dev/null @@ -1,43 +0,0 @@ -server.port=8080 -server.contextPath=/springbootapp -management.port=8081 -management.address=127.0.0.1 - -endpoints.shutdown.enabled=true - -endpoints.jmx.domain=Spring Sample Application -endpoints.jmx.uniqueNames=true - -##jolokia.config.debug=true -##endpoints.jolokia.enabled=true -##endpoints.jolokia.path=jolokia - -spring.jmx.enabled=true -endpoints.jmx.enabled=true - -## for pretty printing of json when endpoints accessed over HTTP -http.mappers.jsonPrettyPrint=true - -## Configuring info endpoint -info.app.name=Spring Sample Application -info.app.description=This is my first spring boot application G1 -info.app.version=1.0.0 - -## Spring Security Configurations -security.user.name=admin1 -security.user.password=secret1 -management.security.role=SUPERUSER - -logging.level.org.springframework=INFO - -#Servlet Configuration -servlet.name=dispatcherExample -servlet.mapping=/dispatcherExampleURL - -#banner.charset=UTF-8 -#banner.location=classpath:banner.txt -#banner.image.location=classpath:banner.gif -#banner.image.width= //TODO -#banner.image.height= //TODO -#banner.image.margin= //TODO -#banner.image.invert= //TODO \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/banner.txt b/spring-custom-aop/src/main/resources/banner.txt deleted file mode 100644 index abfa666eb6..0000000000 --- a/spring-custom-aop/src/main/resources/banner.txt +++ /dev/null @@ -1,14 +0,0 @@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@########@@@@@@@@@@@@@@@@@@@@@@@@...@@@@@@@@@:..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@#. @@@@@* *@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@#o @@@@@* @@@@@* @@@:*.*@@@@@@@: *8@@@ @@@@&:.#@. @o**@@@@**:@o*o@@:.:@@@@@:.o#@&*:@@@@ -@@@@@@@@@@@@* @@@@@* 8888 8@ @@@8 #@o 8@# .@ @@* :. @* @@@@ @. : &@ ** .@@@@ -@@@@@@@@@@. @ o@@@@@* *@@@o::& .* 8@@@@. @@ 8@@@@. @* @@@@ @. @@@& * @@@@# .@@@@ -@@@@@@@@@& @ @@@@@@* @@@@@@ 8 @@@@ .. o&&&&&&& @@ #@@@@. @* @@@@ @. @@@# * @@@@@ .@@@@ -@@@@@@@@@ @@o @@@@@@@* oooo* 8 @@@& @* @@@ # 88. 88. *& o#: @. @@@# *@ &#& .@@@@ -@@@@@@@@# @@@8 @@@@@@@* .*@@@#. *@@ @@@& :#@@@o .@@: *&@8 @o o@@: @. @@@# *@@#. :8# .@@@@ -@@@@@@@@@ @@@@ &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# o@@@@ @@@@@ -@@@@@& &@@@@ 8@@@@@@@@@8&8@@@@@#8#@@@o8@#&@@o&@@@&@@8@@&@@@@88@@8#@8&@@##@@@@@@#8@@#8@@88@@@@@ *@@@@@@@ -@@@# #@@@@#. @@@@@@@@@@@@@8@@8#o@&#@@@@o.@o*@@*.@@@.@&:8o8*@@@8&@@#@@@8@@@@8@#@@@8&@@@@@@#@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/custom.properties b/spring-custom-aop/src/main/resources/custom.properties deleted file mode 100644 index 34f31bcd50..0000000000 --- a/spring-custom-aop/src/main/resources/custom.properties +++ /dev/null @@ -1,4 +0,0 @@ -dispatcher.servlet.name=dispatcherExample -dispatcher.servlet.mapping=/dispatcherExampleURL -example.servlet.name=dispatcherExample -example.servlet.mapping=/dispatcherExampleURL \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/demo.properties b/spring-custom-aop/src/main/resources/demo.properties deleted file mode 100644 index 649b64f59b..0000000000 --- a/spring-custom-aop/src/main/resources/demo.properties +++ /dev/null @@ -1,6 +0,0 @@ -spring.output.ansi.enabled=never -server.port=7070 - -# Security -security.user.name=admin -security.user.password=password \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/logback.xml b/spring-custom-aop/src/main/resources/logback.xml deleted file mode 100644 index 56af2d397e..0000000000 --- a/spring-custom-aop/src/main/resources/logback.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/messages.properties b/spring-custom-aop/src/main/resources/messages.properties deleted file mode 100644 index e4dbc44c3f..0000000000 --- a/spring-custom-aop/src/main/resources/messages.properties +++ /dev/null @@ -1,4 +0,0 @@ -greeting=Hello! Welcome to our website! -lang.change=Change the language -lang.eng=English -lang.fr=French \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/messages_fr.properties b/spring-custom-aop/src/main/resources/messages_fr.properties deleted file mode 100644 index ac5853717d..0000000000 --- a/spring-custom-aop/src/main/resources/messages_fr.properties +++ /dev/null @@ -1,4 +0,0 @@ -greeting=Bonjour! Bienvenue sur notre site! -lang.change=Changez la langue -lang.eng=Anglais -lang.fr=Francais \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/public/error/404.html b/spring-custom-aop/src/main/resources/public/error/404.html deleted file mode 100644 index df83ce219b..0000000000 --- a/spring-custom-aop/src/main/resources/public/error/404.html +++ /dev/null @@ -1,8 +0,0 @@ - - - RESOURCE NOT FOUND - - -

404 RESOURCE NOT FOUND

- - \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/templates/index.html b/spring-custom-aop/src/main/resources/templates/index.html deleted file mode 100644 index 2c4387ed10..0000000000 --- a/spring-custom-aop/src/main/resources/templates/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - WebJars Demo - - - - -

-
- × - Success! It is working as we expected. -
-
- - - - - - diff --git a/spring-custom-aop/src/main/resources/templates/international.html b/spring-custom-aop/src/main/resources/templates/international.html deleted file mode 100644 index a2a5fbb591..0000000000 --- a/spring-custom-aop/src/main/resources/templates/international.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -Home - - - - -

- -

-: - - - \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/templates/other.html b/spring-custom-aop/src/main/resources/templates/other.html deleted file mode 100644 index d13373f9fe..0000000000 --- a/spring-custom-aop/src/main/resources/templates/other.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - -Spring Utils Demo - - - - Parameter set by you:

- - \ No newline at end of file diff --git a/spring-custom-aop/src/main/resources/templates/utils.html b/spring-custom-aop/src/main/resources/templates/utils.html deleted file mode 100644 index 93030f424f..0000000000 --- a/spring-custom-aop/src/main/resources/templates/utils.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - -Spring Utils Demo - - - -

-

Set Parameter:

-

- - -

-
-Another Page - - \ No newline at end of file diff --git a/spring-custom-aop/src/main/webapp/WEB-INF/context.xml b/spring-custom-aop/src/main/webapp/WEB-INF/context.xml deleted file mode 100644 index 263bed4430..0000000000 --- a/spring-custom-aop/src/main/webapp/WEB-INF/context.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/spring-custom-aop/src/main/webapp/WEB-INF/dispatcher.xml b/spring-custom-aop/src/main/webapp/WEB-INF/dispatcher.xml deleted file mode 100644 index ade8e66777..0000000000 --- a/spring-custom-aop/src/main/webapp/WEB-INF/dispatcher.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/spring-custom-aop/src/main/webapp/WEB-INF/web.xml b/spring-custom-aop/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 60a4b079de..0000000000 --- a/spring-custom-aop/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - JSP - - index.html - index.htm - index.jsp - - - - - EEWebXmlServlet - com.baeldung.servlets.javaee.EEWebXmlServlet - - - - EEWebXmlServlet - /eewebxmlservlet - - - - - SpringBootWebXmlServlet - org.springframework.web.servlet.DispatcherServlet - - contextConfigLocation - /WEB-INF/dispatcher.xml - - 1 - - - - SpringBootWebXmlServlet - / - - - - diff --git a/spring-custom-aop/src/main/webapp/annotationservlet.jsp b/spring-custom-aop/src/main/webapp/annotationservlet.jsp deleted file mode 100644 index f21748df50..0000000000 --- a/spring-custom-aop/src/main/webapp/annotationservlet.jsp +++ /dev/null @@ -1 +0,0 @@ -

Annotation Servlet!

\ No newline at end of file diff --git a/spring-custom-aop/src/main/webapp/index.jsp b/spring-custom-aop/src/main/webapp/index.jsp deleted file mode 100644 index e534282777..0000000000 --- a/spring-custom-aop/src/main/webapp/index.jsp +++ /dev/null @@ -1 +0,0 @@ -

Hello!

\ No newline at end of file diff --git a/spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java b/spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java deleted file mode 100644 index f6d2a8c465..0000000000 --- a/spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.servlet.FilterRegistration; -import javax.servlet.ServletContext; - -import static org.junit.Assert.*; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = SpringBootAnnotatedApp.class) -@AutoConfigureMockMvc -@TestPropertySource(properties = { "security.basic.enabled=false" }) -public class SpringBootWithServletComponentIntegrationTest { - - @Autowired - private ServletContext servletContext; - - @Test - public void givenServletContext_whenAccessAttrs_thenFoundAttrsPutInServletListner() { - assertNotNull(servletContext); - assertNotNull(servletContext.getAttribute("servlet-context-attr")); - assertEquals("test", servletContext.getAttribute("servlet-context-attr")); - } - - @Test - public void givenServletContext_whenCheckHelloFilterMappings_thenCorrect() { - assertNotNull(servletContext); - FilterRegistration filterRegistration = servletContext.getFilterRegistration("hello filter"); - - assertNotNull(filterRegistration); - assertTrue(filterRegistration.getServletNameMappings().contains("echo servlet")); - } - - @Autowired - private TestRestTemplate restTemplate; - - @Test - public void givenServletFilter_whenGetHello_thenRequestFiltered() { - ResponseEntity responseEntity = this.restTemplate.getForEntity("/hello", String.class); - assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); - assertEquals("filtering hello", responseEntity.getBody()); - } - - @Test - public void givenFilterAndServlet_whenPostEcho_thenEchoFiltered() { - ResponseEntity responseEntity = this.restTemplate.postForEntity("/echo", "echo", String.class); - assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); - assertEquals("filtering echo", responseEntity.getBody()); - } - -} diff --git a/spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java b/spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java deleted file mode 100644 index e7e1d5486c..0000000000 --- a/spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.baeldung.annotation.servletcomponentscan; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - -import javax.servlet.FilterRegistration; -import javax.servlet.ServletContext; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = SpringBootPlainApp.class) -@AutoConfigureMockMvc -@TestPropertySource(properties = { "security.basic.enabled=false" }) -public class SpringBootWithoutServletComponentIntegrationTest { - - @Autowired - private ServletContext servletContext; - - @Autowired - private TestRestTemplate restTemplate; - - @Test - public void givenServletContext_whenAccessAttrs_thenNotFound() { - assertNull(servletContext.getAttribute("servlet-context-attr")); - } - - @Test - public void givenServletFilter_whenGetHello_thenEndpointNotFound() { - ResponseEntity responseEntity = this.restTemplate.getForEntity("/hello", String.class); - assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode()); - } - - @Test - public void givenServletContext_whenCheckFilterMappings_thenEmpty() { - assertNotNull(servletContext); - FilterRegistration filterRegistration = servletContext.getFilterRegistration("hello filter"); - - assertNull(filterRegistration); - } - -} diff --git a/spring-custom-aop/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java b/spring-custom-aop/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java deleted file mode 100644 index 348d594c05..0000000000 --- a/spring-custom-aop/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.baeldung.git; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import static org.assertj.core.api.Assertions.assertThat; - -@RunWith(SpringRunner.class) -@ContextConfiguration(classes = CommitIdApplication.class) -public class CommitIdIntegrationTest { - - private static final Logger LOG = LoggerFactory.getLogger(CommitIdIntegrationTest.class); - - @Value("${git.commit.message.short:UNKNOWN}") - private String commitMessage; - - @Value("${git.branch:UNKNOWN}") - private String branch; - - @Value("${git.commit.id:UNKNOWN}") - private String commitId; - - @Test - public void whenInjecting_shouldDisplay() throws Exception { - - LOG.info(commitId); - LOG.info(commitMessage); - LOG.info(branch); - - assertThat(commitMessage).isNotEqualTo("UNKNOWN"); - - assertThat(branch).isNotEqualTo("UNKNOWN"); - - assertThat(commitId).isNotEqualTo("UNKNOWN"); - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/test/java/com/baeldung/intro/AppLiveTest.java b/spring-custom-aop/src/test/java/com/baeldung/intro/AppLiveTest.java deleted file mode 100644 index 83b893ae5c..0000000000 --- a/spring-custom-aop/src/test/java/com/baeldung/intro/AppLiveTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.baeldung.intro; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.MediaType; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; - -import static org.hamcrest.Matchers.equalTo; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) -@AutoConfigureMockMvc -@TestPropertySource(properties = { "security.basic.enabled=false" }) -public class AppLiveTest { - - @Autowired - private MockMvc mvc; - - @Test - public void getIndex() throws Exception { - mvc.perform(MockMvcRequestBuilders.get("/").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andExpect(content().string(equalTo("Index Page"))); - } - - @Test - public void getLocal() throws Exception { - mvc.perform(MockMvcRequestBuilders.get("/local").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andExpect(content().string(equalTo("/local"))); - } - -} \ No newline at end of file diff --git a/spring-custom-aop/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java b/spring-custom-aop/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java deleted file mode 100644 index 99e719d7e9..0000000000 --- a/spring-custom-aop/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.baeldung.utils; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.MockitoAnnotations; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import com.baeldung.utils.controller.UtilsController; - -public class UtilsControllerIntegrationTest { - - @InjectMocks - private UtilsController utilsController; - - private MockMvc mockMvc; - - @Before - public void setup() { - MockitoAnnotations.initMocks(this); - this.mockMvc = MockMvcBuilders.standaloneSetup(utilsController).build(); - - } - - @Test - public void givenParameter_setRequestParam_andSetSessionAttribute() throws Exception { - String param = "testparam"; - this.mockMvc.perform(post("/setParam").param("param", param).sessionAttr("parameter", param)).andExpect(status().isOk()); - } - -} diff --git a/spring-custom-aop/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java b/spring-custom-aop/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java deleted file mode 100644 index d6e71dcf6b..0000000000 --- a/spring-custom-aop/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.webjar; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = WebjarsdemoApplication.class) -@WebAppConfiguration -public class WebjarsdemoApplicationIntegrationTest { - - @Test - public void contextLoads() { - } - -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java deleted file mode 100644 index 87c59a4662..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/SpringBootApplicationIntegrationTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.baeldung; - -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasSize; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; - -import org.baeldung.domain.Modes; -import org.junit.Before; -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.http.MediaType; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import org.springframework.test.web.servlet.result.MockMvcResultMatchers; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.web.context.WebApplicationContext; - -import java.nio.charset.Charset; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class) -@WebAppConfiguration -public class SpringBootApplicationIntegrationTest { - @Autowired - private WebApplicationContext webApplicationContext; - private MockMvc mockMvc; - - @Before - public void setupMockMvc() { - mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); - } - - @Test - public void givenRequestHasBeenMade_whenMeetsAllOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/all")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)).andExpect(jsonPath("$", hasSize(4))); - } - - @Test - public void givenRequestHasBeenMade_whenMeetsFindByDateOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbydate/{date}", "2011-12-03T10:15:30")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)) - .andExpect(jsonPath("$.id", equalTo(1))); - } - - @Test - public void givenRequestHasBeenMade_whenMeetsFindByModeOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbymode/{mode}", Modes.ALPHA.name())).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)).andExpect(jsonPath("$.id", equalTo(1))); - } - - @Test - public void givenRequestHasBeenMade_whenMeetsFindByVersionOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)) - .andExpect(jsonPath("$.id", equalTo(1))); - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/SpringBootJPAIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/SpringBootJPAIntegrationTest.java deleted file mode 100644 index d4b19e6a1d..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/SpringBootJPAIntegrationTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.baeldung; - -import org.baeldung.domain.GenericEntity; -import org.baeldung.repository.GenericEntityRepository; -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.test.context.junit4.SpringJUnit4ClassRunner; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringBootJPAIntegrationTest { - @Autowired - private GenericEntityRepository genericEntityRepository; - - @Test - public void givenGenericEntityRepository_whenSaveAndRetreiveEntity_thenOK() { - GenericEntity genericEntity = genericEntityRepository.save(new GenericEntity("test")); - GenericEntity foundedEntity = genericEntityRepository.findOne(genericEntity.getId()); - assertNotNull(foundedEntity); - assertEquals(genericEntity.getValue(), foundedEntity.getValue()); - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/SpringBootMailIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/SpringBootMailIntegrationTest.java deleted file mode 100644 index 14386d73c1..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/SpringBootMailIntegrationTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.baeldung; - -import org.junit.After; -import org.junit.Before; -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.mail.SimpleMailMessage; -import org.springframework.mail.javamail.JavaMailSender; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.subethamail.wiser.Wiser; -import org.subethamail.wiser.WiserMessage; - -import javax.mail.MessagingException; -import java.io.IOException; -import java.util.List; - -import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringBootMailIntegrationTest { - @Autowired - private JavaMailSender javaMailSender; - - private Wiser wiser; - - private String userTo = "user2@localhost"; - private String userFrom = "user1@localhost"; - private String subject = "Test subject"; - private String textMail = "Text subject mail"; - - @Before - public void setUp() throws Exception { - final int TEST_PORT = 8025; - wiser = new Wiser(TEST_PORT); - wiser.start(); - } - - @After - public void tearDown() throws Exception { - wiser.stop(); - } - - @Test - public void givenMail_whenSendAndReceived_thenCorrect() throws Exception { - SimpleMailMessage message = composeEmailMessage(); - javaMailSender.send(message); - List messages = wiser.getMessages(); - - assertThat(messages, hasSize(1)); - WiserMessage wiserMessage = messages.get(0); - assertEquals(userFrom, wiserMessage.getEnvelopeSender()); - assertEquals(userTo, wiserMessage.getEnvelopeReceiver()); - assertEquals(subject, getSubject(wiserMessage)); - assertEquals(textMail, getMessage(wiserMessage)); - } - - private String getMessage(WiserMessage wiserMessage) throws MessagingException, IOException { - return wiserMessage.getMimeMessage().getContent().toString().trim(); - } - - private String getSubject(WiserMessage wiserMessage) throws MessagingException { - return wiserMessage.getMimeMessage().getSubject(); - } - - private SimpleMailMessage composeEmailMessage() { - SimpleMailMessage mailMessage = new SimpleMailMessage(); - mailMessage.setTo(userTo); - mailMessage.setReplyTo(userFrom); - mailMessage.setFrom(userFrom); - mailMessage.setSubject(subject); - mailMessage.setText(textMail); - return mailMessage; - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 0384c67e26..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.baeldung; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.annotation.servletcomponentscan.SpringBootAnnotatedApp; -import com.baeldung.annotation.servletcomponentscan.SpringBootPlainApp; -import com.baeldung.git.CommitIdApplication; -import com.baeldung.internationalization.InternationalizationApp; -import com.baeldung.intro.App; -import com.baeldung.servlets.ApplicationMain; -import com.baeldung.webjar.WebjarsdemoApplication; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = { SpringBootAnnotatedApp.class, SpringBootPlainApp.class, CommitIdApplication.class, - InternationalizationApp.class, App.class, ApplicationMain.class, Application.class, - WebjarsdemoApplication.class }) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java deleted file mode 100644 index 57a8abc1ee..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung.boot; - -import org.baeldung.session.exception.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class) -@TestPropertySource("classpath:exception.properties") -public class ApplicationIntegrationTest { - @Test - public void contextLoads() { - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java deleted file mode 100644 index 4fcea35b4a..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung.boot; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = DemoApplication.class) -@WebAppConfiguration -public class DemoApplicationIntegrationTest { - - @Test - public void contextLoads() { - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/FooComponentIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/FooComponentIntegrationTest.java deleted file mode 100644 index 07a5495e8a..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/FooComponentIntegrationTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.baeldung.boot; - -import org.baeldung.boot.components.FooService; -import org.baeldung.boot.model.Foo; -import org.junit.Before; -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.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.mock.mockito.SpyBean; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringRunner; - -import java.util.HashMap; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Mockito.doReturn; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = DemoApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) -public class FooComponentIntegrationTest { - - @Autowired - private TestRestTemplate testRestTemplate; - - @SpyBean - private FooService fooService; - - @Before - public void init() throws Exception { - Foo foo = new Foo(); - foo.setId(5); - foo.setName("MOCKED_FOO"); - - doReturn(foo).when(fooService).getFooWithId(anyInt()); - - // doCallRealMethod().when(fooComponent).getFooWithName(anyString()); - } - - @Test - public void givenInquiryingFooWithId_whenFooComponentIsMocked_thenAssertMockedResult() { - Map pathVariables = new HashMap<>(); - pathVariables.put("id", "1"); - ResponseEntity fooResponse = testRestTemplate.getForEntity("/{id}", Foo.class, pathVariables); - - assertNotNull(fooResponse); - assertEquals(HttpStatus.OK, fooResponse.getStatusCode()); - assertEquals(5, fooResponse.getBody().getId().longValue()); - assertEquals("MOCKED_FOO", fooResponse.getBody().getName()); - } - - @Test - public void givenInquiryingFooWithName_whenFooComponentIsMocked_thenAssertMockedResult() { - Map pathVariables = new HashMap<>(); - pathVariables.put("name", "Foo_Name"); - ResponseEntity fooResponse = testRestTemplate.getForEntity("/?name={name}", Foo.class, pathVariables); - - assertNotNull(fooResponse); - assertEquals(HttpStatus.OK, fooResponse.getStatusCode()); - assertEquals(1, fooResponse.getBody().getId().longValue()); - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/FooIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/FooIntegrationTest.java deleted file mode 100644 index 52728fbb5b..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/FooIntegrationTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.baeldung.boot; - -import java.util.HashMap; -import java.util.Map; - -import org.baeldung.boot.DemoApplication; -import org.baeldung.boot.model.Foo; -import org.junit.Assert; -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.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = DemoApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) -public class FooIntegrationTest { - - @Autowired - private TestRestTemplate testRestTemplate; - - @Test - public void givenInquiryingFooWithId_whenIdIsValid_thenHttpStatusOK() { - Map pathVariables = new HashMap(); - pathVariables.put("id", "1"); - ResponseEntity fooResponse = testRestTemplate.getForEntity("/{id}", Foo.class, pathVariables); - Assert.assertNotNull(fooResponse); - Assert.assertEquals(HttpStatus.OK, fooResponse.getStatusCode()); - } - - @Test - public void givenInquiryingFooWithName_whenNameIsValid_thenHttpStatusOK() { - Map pathVariables = new HashMap(); - pathVariables.put("name", "Foo_Name"); - ResponseEntity fooResponse = testRestTemplate.getForEntity("/?name={name}", Foo.class, pathVariables); - Assert.assertNotNull(fooResponse); - Assert.assertEquals(HttpStatus.OK, fooResponse.getStatusCode()); - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/FooJPAIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/FooJPAIntegrationTest.java deleted file mode 100644 index 40f1892be8..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/FooJPAIntegrationTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.baeldung.boot; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.baeldung.boot.model.Foo; -import org.baeldung.boot.repository.FooRepository; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@DataJpaTest -public class FooJPAIntegrationTest { - - @Autowired - private TestEntityManager entityManager; - - @Autowired - private FooRepository repository; - - @Test - public void findFooByName() { - this.entityManager.persist(new Foo("Foo_Name_2")); - Foo foo = this.repository.findByName("Foo_Name_2"); - assertNotNull(foo); - assertEquals("Foo_Name_2", foo.getName()); - // Due to having Insert query for Foo with Id 1, so TestEntityManager generates new Id of 2 - assertEquals(2l, foo.getId().longValue()); - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/FooJsonIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/FooJsonIntegrationTest.java deleted file mode 100644 index 939e66f356..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/FooJsonIntegrationTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.baeldung.boot; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.baeldung.boot.model.Foo; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.json.JsonTest; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@JsonTest -public class FooJsonIntegrationTest { - - @Autowired - private JacksonTester json; - - @Test - public void testSerialize() throws Exception { - Foo foo = new Foo(3, "Foo_Name_3"); - assertThat(this.json.write(foo)).isEqualToJson("expected.json"); - assertThat(this.json.write(foo)).hasJsonPathStringValue("@.name"); - assertThat(this.json.write(foo)).extractingJsonPathStringValue("@.name").isEqualTo("Foo_Name_3"); - } - - @Test - public void testDeserialize() throws Exception { - String content = "{\"id\":4,\"name\":\"Foo_Name_4\"}"; - assertThat(this.json.parseObject(content).getName()).isEqualTo("Foo_Name_4"); - assertThat(this.json.parseObject(content).getId() == 4); - } -} \ No newline at end of file diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java deleted file mode 100644 index a844b26b2d..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.baeldung.boot.repository; - -import static org.junit.Assert.assertThat; - -import org.baeldung.boot.DemoApplicationIntegrationTest; -import org.baeldung.boot.model.Foo; - -import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.Matchers.is; - -import org.junit.Before; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; - -@Transactional -public class FooRepositoryIntegrationTest extends DemoApplicationIntegrationTest { - @Autowired - private FooRepository fooRepository; - - @Before - public void setUp() { - fooRepository.save(new Foo("Foo")); - fooRepository.save(new Foo("Bar")); - } - - @Test - public void testFindByName() { - Foo foo = fooRepository.findByName("Bar"); - assertThat(foo, notNullValue()); - assertThat(foo.getId(), is(2)); - } - -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java deleted file mode 100644 index be992bcc36..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.baeldung.boot.repository; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertThat; - -import org.baeldung.boot.ApplicationIntegrationTest; -import org.baeldung.boot.model.Foo; -import org.baeldung.session.exception.repository.FooRepository; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.TestPropertySource; -import org.springframework.transaction.annotation.Transactional; - -@Transactional -@TestPropertySource("classpath:exception-hibernate.properties") -public class HibernateSessionIntegrationTest extends ApplicationIntegrationTest { - @Autowired - private FooRepository fooRepository; - - @Test - public void whenSavingWithCurrentSession_thenThrowNoException() { - Foo foo = new Foo("Exception Solved"); - fooRepository.save(foo); - foo = null; - foo = fooRepository.get(1); - - assertThat(foo, notNullValue()); - assertThat(foo.getId(), is(1)); - assertThat(foo.getName(), is("Exception Solved")); - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java deleted file mode 100644 index 55b7fa7216..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.baeldung.boot.repository; - -import org.baeldung.boot.ApplicationIntegrationTest; -import org.baeldung.boot.model.Foo; -import org.baeldung.session.exception.repository.FooRepository; -import org.hibernate.HibernateException; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; - -@Transactional -public class NoHibernateSessionIntegrationTest extends ApplicationIntegrationTest { - @Autowired - private FooRepository fooRepository; - - @Test(expected = HibernateException.class) - public void whenSavingWithoutCurrentSession_thenThrowException() { - Foo foo = new Foo("Exception Thrown"); - fooRepository.save(foo); - } -} diff --git a/spring-custom-aop/src/test/java/org/baeldung/client/DetailsServiceClientIntegrationTest.java b/spring-custom-aop/src/test/java/org/baeldung/client/DetailsServiceClientIntegrationTest.java deleted file mode 100644 index 5627855aa3..0000000000 --- a/spring-custom-aop/src/test/java/org/baeldung/client/DetailsServiceClientIntegrationTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.baeldung.client; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.client.RestClientTest; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.client.MockRestServiceServer; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; - -@RunWith(SpringRunner.class) -@RestClientTest(DetailsServiceClient.class) -public class DetailsServiceClientIntegrationTest { - - @Autowired - private DetailsServiceClient client; - - @Autowired - private MockRestServiceServer server; - - @Autowired - private ObjectMapper objectMapper; - - @Before - public void setUp() throws Exception { - String detailsString = objectMapper.writeValueAsString(new Details("John Smith", "john")); - this.server.expect(requestTo("/john/details")).andRespond(withSuccess(detailsString, MediaType.APPLICATION_JSON)); - } - - @Test - public void whenCallingGetUserDetails_thenClientExecutesCorrectCall() throws Exception { - - Details details = this.client.getUserDetails("john"); - - assertThat(details.getLogin()).isEqualTo("john"); - assertThat(details.getName()).isEqualTo("John Smith"); - - } - -} diff --git a/spring-custom-aop/src/test/resources/application.properties b/spring-custom-aop/src/test/resources/application.properties deleted file mode 100644 index 0e6cb86bc5..0000000000 --- a/spring-custom-aop/src/test/resources/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -spring.mail.host=localhost -spring.mail.port=8025 -spring.mail.properties.mail.smtp.auth=false - -security.basic.enabled=false \ No newline at end of file diff --git a/spring-custom-aop/src/test/resources/exception-hibernate.properties b/spring-custom-aop/src/test/resources/exception-hibernate.properties deleted file mode 100644 index cde746acb9..0000000000 --- a/spring-custom-aop/src/test/resources/exception-hibernate.properties +++ /dev/null @@ -1,2 +0,0 @@ -spring.profiles.active=exception -spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate4.SpringSessionContext diff --git a/spring-custom-aop/src/test/resources/exception.properties b/spring-custom-aop/src/test/resources/exception.properties deleted file mode 100644 index c55e415a3a..0000000000 --- a/spring-custom-aop/src/test/resources/exception.properties +++ /dev/null @@ -1,6 +0,0 @@ -# Security -security.user.name=admin -security.user.password=password - -spring.dao.exceptiontranslation.enabled=false -spring.profiles.active=exception \ No newline at end of file diff --git a/spring-custom-aop/src/test/resources/import.sql b/spring-custom-aop/src/test/resources/import.sql deleted file mode 100644 index a382410271..0000000000 --- a/spring-custom-aop/src/test/resources/import.sql +++ /dev/null @@ -1 +0,0 @@ -Insert into Foo values(1,'Foo_Name'); \ No newline at end of file diff --git a/spring-custom-aop/src/test/resources/org/baeldung/boot/expected.json b/spring-custom-aop/src/test/resources/org/baeldung/boot/expected.json deleted file mode 100644 index f5409421a6..0000000000 --- a/spring-custom-aop/src/test/resources/org/baeldung/boot/expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "id":3, - "name":"Foo_Name_3" -} \ No newline at end of file From 158ac9ec33ff7b56319d1405ac9d6ac77f985a54 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 27 Oct 2018 21:00:27 +0300 Subject: [PATCH 228/546] remove extra spring-custom-aop module --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 61eeb93f49..b6baa37ec4 100644 --- a/pom.xml +++ b/pom.xml @@ -1158,7 +1158,6 @@ spring-boot-autoconfiguration spring-boot-custom-starter spring-boot-jasypt - spring-custom-aop spring-data-rest-querydsl spring-groovy spring-mobile From 1e7f8c47bfbf1ae37647727d86867f4453056e0e Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 28 Oct 2018 00:50:45 +0530 Subject: [PATCH 229/546] [BAEL-9557] - Modified not null checks with Objects::nonNull and Collector.toList() --- .../baeldung/persistence/dao/MyUserPredicatesBuilder.java | 3 ++- .../baeldung/persistence/dao/UserSpecificationsBuilder.java | 2 +- .../persistence/dao/rsql/GenericRsqlSpecBuilder.java | 6 +++--- .../persistence/dao/rsql/GenericRsqlSpecification.java | 3 +-- .../java/org/baeldung/web/controller/UserController.java | 5 ++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java index 4f181b9c4c..7be37c7155 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java @@ -2,6 +2,7 @@ package org.baeldung.persistence.dao; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import org.baeldung.web.util.SearchCriteria; @@ -29,7 +30,7 @@ public final class MyUserPredicatesBuilder { final List predicates = params.stream().map(param -> { MyUserPredicate predicate = new MyUserPredicate(param); return predicate.getPredicate(); - }).filter(predicate -> predicate != null).collect(Collectors.toCollection(ArrayList::new)); + }).filter(Objects::nonNull).collect(Collectors.toList()); BooleanExpression result = Expressions.asBoolean(true).isTrue(); for (BooleanExpression predicate : predicates) { diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java index cb8918b807..def31a23c5 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java @@ -51,7 +51,7 @@ public final class UserSpecificationsBuilder { final List> specs = params.stream() .map(UserSpecification::new) - .collect(Collectors.toCollection(ArrayList::new)); + .collect(Collectors.toList()); Specification result = specs.get(0); diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java index 3076300c36..960792a4b9 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java @@ -1,7 +1,7 @@ package org.baeldung.persistence.dao.rsql; -import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import org.springframework.data.jpa.domain.Specifications; @@ -28,8 +28,8 @@ public class GenericRsqlSpecBuilder { List> specs = logicalNode.getChildren() .stream() .map(node -> createSpecification(node)) - .filter(specifications -> specifications != null) - .collect(Collectors.toCollection(ArrayList::new)); + .filter(Objects::nonNull) + .collect(Collectors.toList()); Specifications initialSpec = specs.stream().findFirst().get(); diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java index 3e99208684..553d343edb 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java @@ -1,6 +1,5 @@ package org.baeldung.persistence.dao.rsql; -import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -89,7 +88,7 @@ public class GenericRsqlSpecification implements Specification { } return obj; - }).collect(Collectors.toCollection(ArrayList::new)); + }).collect(Collectors.toList()); return args; } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java b/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java index 13f986eb20..8953a52a1b 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java @@ -2,7 +2,6 @@ package org.baeldung.web.controller; import java.util.ArrayList; import java.util.List; -import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -64,7 +63,7 @@ public class UserController { @ResponseBody public List findAll(@RequestParam(value = "search", required = false) String search) { List params = new ArrayList(); - if (Optional.ofNullable(search).isPresent()) { + if (search != null) { Pattern pattern = Pattern.compile("(\\w+?)(:|<|>)(\\w+?),"); Matcher matcher = pattern.matcher(search + ","); while (matcher.find()) { @@ -127,7 +126,7 @@ public class UserController { @ResponseBody public Iterable findAllByQuerydsl(@RequestParam(value = "search") String search) { MyUserPredicatesBuilder builder = new MyUserPredicatesBuilder(); - if (Optional.ofNullable(search).isPresent()) { + if (search != null) { Pattern pattern = Pattern.compile("(\\w+?)(:|<|>)(\\w+?),"); Matcher matcher = pattern.matcher(search + ","); while (matcher.find()) { From 901b733ca4b2b7b16f5af2661ef6d7f9a55386ec Mon Sep 17 00:00:00 2001 From: Vizsoro Date: Sun, 28 Oct 2018 02:34:49 +0100 Subject: [PATCH 230/546] bael-2022 initialize array in kotlin (#5529) * bael-2022 initialize array in kotlin * bael-2022 formatting with eclipse * bael-2022 formatting fix --- .../kotlin/ArrayInitializationTest.kt | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/kotlin/ArrayInitializationTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/ArrayInitializationTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/kotlin/ArrayInitializationTest.kt new file mode 100644 index 0000000000..ba3694c831 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/kotlin/ArrayInitializationTest.kt @@ -0,0 +1,49 @@ +package com.baeldung.kotlin + +import org.junit.Test +import kotlin.test.assertEquals + +class ArrayInitializationTest { + + @Test + fun givenArrayOfStrings_thenValuesPopulated() { + val strings = arrayOf("January", "February", "March") + + assertEquals(3, strings.size) + assertEquals("March", strings[2]) + } + + @Test + fun givenArrayOfIntegers_thenValuesPopulated() { + val integers = intArrayOf(1, 2, 3, 4) + + assertEquals(4, integers.size) + assertEquals(1, integers[0]) + } + + @Test + fun givenArrayOfNulls_whenPopulated_thenValuesPresent() { + val array = arrayOfNulls(5) + + for (i in array.indices) { + array[i] = i * i + } + + assertEquals(16, array[4]) + } + + @Test + fun whenGeneratorUsed_thenValuesPresent() { + val generatedArray = IntArray(10) { i -> i * i } + + assertEquals(81, generatedArray[9]) + } + + @Test + fun whenStringGenerated_thenValuesPresent() { + val generatedStringArray = Array(10) { i -> "Number of index: $i" } + + assertEquals("Number of index: 0", generatedStringArray[0]) + } + +} \ No newline at end of file From 0690a6332ebd31436716a001630048ac53859351 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Sun, 28 Oct 2018 03:22:33 +0000 Subject: [PATCH 231/546] BAEL-2250: Adding files for the article on SSL handshake failure. (#5541) * BAEL-2250: Adding files for the article on SSL handshake failure. * BAEL-2250 cleanup formatting * Applied review feedback on the article. * Adding cipher suite and protocol selection in server and client * Corrected some code conventions. * Revert: BAEL-2250 cleanup formatting --- .../baeldung/ssl/example/SimpleClient.java | 29 ++++++++++++++++ .../baeldung/ssl/example/SimpleServer.java | 34 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java create mode 100644 core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java diff --git a/core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java b/core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java new file mode 100644 index 0000000000..c641a58a78 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java @@ -0,0 +1,29 @@ +package com.baeldung.ssl.example; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.Socket; + +import javax.net.SocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +public class SimpleClient { + static void startClient(String host, int port) throws IOException { + SocketFactory factory = SSLSocketFactory.getDefault(); + try (Socket connection = factory.createSocket(host, port)) { + ((SSLSocket) connection).setEnabledCipherSuites( + new String[] { "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"}); + ((SSLSocket) connection).setEnabledProtocols( + new String[] { "TLSv1.2"}); + BufferedReader input = new BufferedReader( + new InputStreamReader(connection.getInputStream())); + System.out.println(input.readLine()); + } + } + + public static void main(String[] args) throws IOException { + startClient("localhost", 1234); + } +} diff --git a/core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java b/core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java new file mode 100644 index 0000000000..3bbabdfbb8 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java @@ -0,0 +1,34 @@ +package com.baeldung.ssl.example; + +import java.io.IOException; +import java.io.PrintWriter; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.Date; + +import javax.net.ServerSocketFactory; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; + +public class SimpleServer { + static void startServer(int port) throws IOException { + ServerSocketFactory factory = SSLServerSocketFactory.getDefault(); + try (ServerSocket listener = factory.createServerSocket(port)) { + ((SSLServerSocket) listener).setNeedClientAuth(true); + ((SSLServerSocket) listener).setEnabledCipherSuites( + new String[] { "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"}); + ((SSLServerSocket) listener).setEnabledProtocols( + new String[] { "TLSv1.2"}); + while (true) { + try (Socket socket = listener.accept()) { + PrintWriter out = new PrintWriter(socket.getOutputStream(), true); + out.println(new Date().toString()); + } + } + } + } + + public static void main(String[] args) throws IOException { + startServer(1234); + } +} From b12849dea655741c5a2fc31bdc4e225c8285677a Mon Sep 17 00:00:00 2001 From: eric-martin Date: Sat, 27 Oct 2018 22:29:02 -0500 Subject: [PATCH 232/546] Fixed SemaphoresManualTest --- .../concurrent/semaphores/SemaphoresManualTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java index 8d64bb6809..cf3bdeda5b 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java @@ -4,6 +4,7 @@ import org.junit.Test; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; import static org.junit.Assert.assertEquals; @@ -15,26 +16,28 @@ public class SemaphoresManualTest { // ========= login queue ====== @Test - public void givenLoginQueue_whenReachLimit_thenBlocked() { + public void givenLoginQueue_whenReachLimit_thenBlocked() throws InterruptedException { final int slots = 10; final ExecutorService executorService = Executors.newFixedThreadPool(slots); final LoginQueueUsingSemaphore loginQueue = new LoginQueueUsingSemaphore(slots); IntStream.range(0, slots) .forEach(user -> executorService.execute(loginQueue::tryLogin)); executorService.shutdown(); + executorService.awaitTermination(10, TimeUnit.SECONDS); assertEquals(0, loginQueue.availableSlots()); assertFalse(loginQueue.tryLogin()); } @Test - public void givenLoginQueue_whenLogout_thenSlotsAvailable() { + public void givenLoginQueue_whenLogout_thenSlotsAvailable() throws InterruptedException { final int slots = 10; final ExecutorService executorService = Executors.newFixedThreadPool(slots); final LoginQueueUsingSemaphore loginQueue = new LoginQueueUsingSemaphore(slots); IntStream.range(0, slots) .forEach(user -> executorService.execute(loginQueue::tryLogin)); executorService.shutdown(); + executorService.awaitTermination(10, TimeUnit.SECONDS); assertEquals(0, loginQueue.availableSlots()); loginQueue.logout(); @@ -45,13 +48,14 @@ public class SemaphoresManualTest { // ========= delay queue ======= @Test - public void givenDelayQueue_whenReachLimit_thenBlocked() { + public void givenDelayQueue_whenReachLimit_thenBlocked() throws InterruptedException { final int slots = 50; final ExecutorService executorService = Executors.newFixedThreadPool(slots); final DelayQueueUsingTimedSemaphore delayQueue = new DelayQueueUsingTimedSemaphore(1, slots); IntStream.range(0, slots) .forEach(user -> executorService.execute(delayQueue::tryAdd)); executorService.shutdown(); + executorService.awaitTermination(10, TimeUnit.SECONDS); assertEquals(0, delayQueue.availableSlots()); assertFalse(delayQueue.tryAdd()); @@ -65,6 +69,7 @@ public class SemaphoresManualTest { IntStream.range(0, slots) .forEach(user -> executorService.execute(delayQueue::tryAdd)); executorService.shutdown(); + executorService.awaitTermination(10, TimeUnit.SECONDS); assertEquals(0, delayQueue.availableSlots()); Thread.sleep(1000); From a8b29dd1407b773bb7b447a11d8359767e5583e8 Mon Sep 17 00:00:00 2001 From: mstefanec <42640465+mstefanec@users.noreply.github.com> Date: Sun, 28 Oct 2018 06:49:40 +0100 Subject: [PATCH 233/546] Added UnitTest for programatically creating sequences in project reactor (#5552) --- .../baeldung/reactor/ItemProducerCreate.java | 32 ++-------- .../reactor/NetworTrafficProducerPush.java | 34 ----------- .../reactor/NetworkTrafficProducerPush.java | 23 ++++++++ .../reactor/ProgramaticSequences.java | 58 ------------------- .../reactor/ProgrammaticSequences.java | 38 ++++++++++++ .../baeldung/reactor/StatelessGenerate.java | 18 +----- .../reactor/ItemProducerCreateUnitTest.java | 33 +++++++++++ .../NetworkTrafficProducerPushUnitTest.java | 23 ++++++++ .../ProgrammaticSequencesUnitTest.java | 42 ++++++++++++++ 9 files changed, 167 insertions(+), 134 deletions(-) delete mode 100644 reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java create mode 100644 reactor-core/src/main/java/com/baeldung/reactor/NetworkTrafficProducerPush.java delete mode 100644 reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java create mode 100644 reactor-core/src/main/java/com/baeldung/reactor/ProgrammaticSequences.java create mode 100644 reactor-core/src/test/java/com/baeldung/reactor/ItemProducerCreateUnitTest.java create mode 100644 reactor-core/src/test/java/com/baeldung/reactor/NetworkTrafficProducerPushUnitTest.java create mode 100644 reactor-core/src/test/java/com/baeldung/reactor/ProgrammaticSequencesUnitTest.java diff --git a/reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java b/reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java index 6078f8ef0b..e475303a3d 100644 --- a/reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java +++ b/reactor-core/src/main/java/com/baeldung/reactor/ItemProducerCreate.java @@ -1,44 +1,22 @@ package com.baeldung.reactor; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Consumer; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import reactor.core.publisher.Flux; -public class ItemProducerCreate { +import java.util.List; +import java.util.function.Consumer; - Logger logger = LoggerFactory.getLogger(NetworTrafficProducerPush.class); +public class ItemProducerCreate { Consumer> listener; - public void create() { + public Flux create() { Flux articlesFlux = Flux.create((sink) -> { ItemProducerCreate.this.listener = (items) -> { items.stream() .forEach(article -> sink.next(article)); }; }); - articlesFlux.subscribe(ItemProducerCreate.this.logger::info); + return articlesFlux; } - public static void main(String[] args) { - ItemProducerCreate producer = new ItemProducerCreate(); - producer.create(); - - new Thread(new Runnable() { - - @Override - public void run() { - List items = new ArrayList<>(); - items.add("Item 1"); - items.add("Item 2"); - items.add("Item 3"); - producer.listener.accept(items); - } - }).start(); - } } diff --git a/reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java b/reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java deleted file mode 100644 index 807ceae84d..0000000000 --- a/reactor-core/src/main/java/com/baeldung/reactor/NetworTrafficProducerPush.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.baeldung.reactor; - -import java.util.function.Consumer; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.FluxSink.OverflowStrategy; - -public class NetworTrafficProducerPush { - - Logger logger = LoggerFactory.getLogger(NetworTrafficProducerPush.class); - - Consumer listener; - - public void subscribe(Consumer consumer) { - Flux flux = Flux.push(sink -> { - NetworTrafficProducerPush.this.listener = (t) -> sink.next(t); - }, OverflowStrategy.DROP); - flux.subscribe(consumer); - } - - public void onPacket(String packet) { - listener.accept(packet); - } - - public static void main(String[] args) { - NetworTrafficProducerPush trafficProducer = new NetworTrafficProducerPush(); - trafficProducer.subscribe(trafficProducer.logger::info); - trafficProducer.onPacket("Packet[A18]"); - } - -} diff --git a/reactor-core/src/main/java/com/baeldung/reactor/NetworkTrafficProducerPush.java b/reactor-core/src/main/java/com/baeldung/reactor/NetworkTrafficProducerPush.java new file mode 100644 index 0000000000..a81d41ac11 --- /dev/null +++ b/reactor-core/src/main/java/com/baeldung/reactor/NetworkTrafficProducerPush.java @@ -0,0 +1,23 @@ +package com.baeldung.reactor; + +import java.util.function.Consumer; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.FluxSink.OverflowStrategy; + +public class NetworkTrafficProducerPush { + + Consumer listener; + + public void subscribe(Consumer consumer) { + Flux flux = Flux.push(sink -> { + NetworkTrafficProducerPush.this.listener = (t) -> sink.next(t); + }, OverflowStrategy.DROP); + flux.subscribe(consumer); + } + + public void onPacket(String packet) { + listener.accept(packet); + } + +} diff --git a/reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java b/reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java deleted file mode 100644 index b52def377d..0000000000 --- a/reactor-core/src/main/java/com/baeldung/reactor/ProgramaticSequences.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.baeldung.reactor; - -import java.util.concurrent.atomic.AtomicInteger; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import reactor.core.publisher.Flux; - -public class ProgramaticSequences { - - Logger logger = LoggerFactory.getLogger(ProgramaticSequences.class); - - public void statefullImutableGenerate() { - Flux flux = Flux.generate(() -> 1, (state, sink) -> { - sink.next("2 + " + state + " = " + 2 + state); - if (state == 101) - sink.complete(); - return state + 1; - }); - - flux.subscribe(logger::info); - } - - public void statefullMutableGenerate() { - Flux flux = Flux.generate(AtomicInteger::new, (state, sink) -> { - int i = state.getAndIncrement(); - sink.next("2 + " + state + " = " + 2 + state); - if (i == 101) - sink.complete(); - return state; - }); - - flux.subscribe(logger::info); - } - - public void handle() { - Flux elephants = Flux.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - .handle((i, sink) -> { - String animal = "Elephant nr " + i; - if (i % 2 == 0) { - sink.next(animal); - } - }); - - elephants.subscribe(logger::info); - } - - public static void main(String[] args) { - ProgramaticSequences ps = new ProgramaticSequences(); - - ps.statefullImutableGenerate(); - ps.statefullMutableGenerate(); - ps.handle(); - - } - -} diff --git a/reactor-core/src/main/java/com/baeldung/reactor/ProgrammaticSequences.java b/reactor-core/src/main/java/com/baeldung/reactor/ProgrammaticSequences.java new file mode 100644 index 0000000000..5c11240753 --- /dev/null +++ b/reactor-core/src/main/java/com/baeldung/reactor/ProgrammaticSequences.java @@ -0,0 +1,38 @@ +package com.baeldung.reactor; + +import java.util.concurrent.atomic.AtomicInteger; + +import reactor.core.publisher.Flux; + +public class ProgrammaticSequences { + + public Flux statefulImutableGenerate() { + return Flux.generate(() -> 1, (state, sink) -> { + sink.next("2 + " + state + " = " + (2 + state)); + if (state == 101) + sink.complete(); + return state + 1; + }); + } + + public Flux statefulMutableGenerate() { + return Flux.generate(AtomicInteger::new, (state, sink) -> { + int i = state.getAndIncrement(); + sink.next("2 + " + i + " = " + (2 + i)); + if (i == 101) + sink.complete(); + return state; + }); + } + + public Flux handle() { + return Flux.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + .handle((i, sink) -> { + String animal = "Elephant nr " + i; + if (i % 2 == 0) { + sink.next(animal); + } + }); + } + +} diff --git a/reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java b/reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java index c82f8e160b..3b9f0bb522 100644 --- a/reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java +++ b/reactor-core/src/main/java/com/baeldung/reactor/StatelessGenerate.java @@ -1,24 +1,12 @@ package com.baeldung.reactor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import reactor.core.publisher.Flux; public class StatelessGenerate { - Logger logger = LoggerFactory.getLogger(StatelessGenerate.class); - - public void statelessGenerate() { - Flux flux = Flux.generate((sink) -> { - sink.next("hallo"); + public Flux statelessGenerate() { + return Flux.generate((sink) -> { + sink.next("hello"); }); - flux.subscribe(logger::info); } - - public static void main(String[] args) { - StatelessGenerate ps = new StatelessGenerate(); - ps.statelessGenerate(); - } - } diff --git a/reactor-core/src/test/java/com/baeldung/reactor/ItemProducerCreateUnitTest.java b/reactor-core/src/test/java/com/baeldung/reactor/ItemProducerCreateUnitTest.java new file mode 100644 index 0000000000..8c436306d1 --- /dev/null +++ b/reactor-core/src/test/java/com/baeldung/reactor/ItemProducerCreateUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.reactor; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ItemProducerCreateUnitTest { + + @Test + public void givenFluxWithAsynchronousCreate_whenProduceItemsFromDifferentThread_thenAllItemsAreCollectedByTheSubscriber() throws InterruptedException { + List elements = new ArrayList<>(); + ItemProducerCreate producer = new ItemProducerCreate(); + producer.create() + .subscribe(elements::add); + + Thread producerThread = new Thread(() -> { + List items = new ArrayList<>(); + items.add("Item 1"); + items.add("Item 2"); + items.add("Item 3"); + producer.listener.accept(items); + }); + + producerThread.start(); + producerThread.join(); + + assertThat(elements).containsExactly("Item 1", "Item 2", "Item 3"); + } + +} diff --git a/reactor-core/src/test/java/com/baeldung/reactor/NetworkTrafficProducerPushUnitTest.java b/reactor-core/src/test/java/com/baeldung/reactor/NetworkTrafficProducerPushUnitTest.java new file mode 100644 index 0000000000..168ab1f297 --- /dev/null +++ b/reactor-core/src/test/java/com/baeldung/reactor/NetworkTrafficProducerPushUnitTest.java @@ -0,0 +1,23 @@ +package com.baeldung.reactor; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +public class NetworkTrafficProducerPushUnitTest { + + @Test + public void givenFluxWithAsynchronousPushWithListener_whenListenerIsInvoked_thenItemCollectedByTheSubscriber() throws InterruptedException { + List elements = new ArrayList<>(); + + NetworkTrafficProducerPush trafficProducer = new NetworkTrafficProducerPush(); + trafficProducer.subscribe(elements::add); + trafficProducer.onPacket("Packet[A18]"); + + assertThat(elements).containsExactly("Packet[A18]"); + } + +} diff --git a/reactor-core/src/test/java/com/baeldung/reactor/ProgrammaticSequencesUnitTest.java b/reactor-core/src/test/java/com/baeldung/reactor/ProgrammaticSequencesUnitTest.java new file mode 100644 index 0000000000..996ca9e20c --- /dev/null +++ b/reactor-core/src/test/java/com/baeldung/reactor/ProgrammaticSequencesUnitTest.java @@ -0,0 +1,42 @@ +package com.baeldung.reactor; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ProgrammaticSequencesUnitTest { + + @Test + public void givenFluxWithStatefulImmutableGenerate_whenSubscribeAddItemsToCollect_thenAllItemsAreCollectedByTheSubscriber() throws InterruptedException { + List elements = new ArrayList<>(); + ProgrammaticSequences producer = new ProgrammaticSequences(); + producer.statefulImutableGenerate() + .subscribe(elements::add); + assertThat(elements).hasSize(101); + assertThat(elements).contains("2 + 1 = 3", "2 + 101 = 103"); + } + + @Test + public void givenFluxWithStatefulMutableGenerate_whenSubscribeAddItemsToCollect_thenAllItemsAreCollectedByTheSubscriber() throws InterruptedException { + List elements = new ArrayList<>(); + ProgrammaticSequences producer = new ProgrammaticSequences(); + producer.statefulMutableGenerate() + .subscribe(elements::add); + assertThat(elements).hasSize(102); + assertThat(elements).contains("2 + 0 = 2", "2 + 101 = 103"); + } + + @Test + public void givenFluxWithHandle_whenSubscribeAddItemsToCollect_thenAllItemsAreCollectedByTheSubscriber() throws InterruptedException { + List elements = new ArrayList<>(); + ProgrammaticSequences producer = new ProgrammaticSequences(); + producer.handle() + .subscribe(elements::add); + assertThat(elements).hasSize(5); + assertThat(elements).contains("Elephant nr 2", "Elephant nr 10"); + } + +} From 6ea24fdab5f11014e61849d02e414a6aa323ad1e Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sun, 28 Oct 2018 09:16:31 +0200 Subject: [PATCH 234/546] balancing the first and second profiles --- pom.xml | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index b6baa37ec4..066742807b 100644 --- a/pom.xml +++ b/pom.xml @@ -517,25 +517,7 @@ spring-jms spring-jooq persistence-modules/spring-jpa - spring-kafka - spring-katharsis - spring-ldap - spring-mockito - spring-mvc-forms-jsp - spring-mvc-forms-thymeleaf - spring-mvc-java - spring-mvc-velocity - spring-mvc-webflow - spring-mvc-xml - spring-mvc-kotlin - spring-protobuf - spring-quartz - spring-rest-angular - spring-rest-full - spring-rest-query-language - - - spring-resttemplate + @@ -729,7 +711,27 @@ spring-security-rest-custom spring-security-rest spring-security-sso - spring-security-x509 + spring-security-x509 + + spring-kafka + spring-katharsis + spring-ldap + spring-mockito + spring-mvc-forms-jsp + spring-mvc-forms-thymeleaf + spring-mvc-java + spring-mvc-velocity + spring-mvc-webflow + spring-mvc-xml + spring-mvc-kotlin + spring-protobuf + spring-quartz + spring-rest-angular + spring-rest-full + spring-rest-query-language + + + spring-resttemplate From 600f416c1b1f042542d1c9e07cfc193ad2ccef41 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 28 Oct 2018 09:31:42 +0200 Subject: [PATCH 235/546] refactor spring rest query lang --- .../dao/UserSpecificationsBuilder.java | 21 ++++++------------- .../dao/rsql/GenericRsqlSpecBuilder.java | 21 ++++++++++--------- .../dao/rsql/GenericRsqlSpecification.java | 12 ++++------- 3 files changed, 21 insertions(+), 33 deletions(-) diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java index def31a23c5..28097d500a 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java @@ -45,26 +45,17 @@ public final class UserSpecificationsBuilder { } public Specification build() { - if (params.size() == 0) return null; - final List> specs = params.stream() - .map(UserSpecification::new) - .collect(Collectors.toList()); - - Specification result = specs.get(0); - + Specification result = new UserSpecification(params.get(0)); + for (int i = 1; i < params.size(); i++) { - result = params.get(i) - .isOrPredicate() - ? Specifications.where(result) - .or(specs.get(i)) - : Specifications.where(result) - .and(specs.get(i)); - + result = params.get(i).isOrPredicate() + ? Specifications.where(result).or(new UserSpecification(params.get(i))) + : Specifications.where(result).and(new UserSpecification(params.get(i))); } - + return result; } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java index 960792a4b9..ce5a4410b9 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java @@ -31,16 +31,17 @@ public class GenericRsqlSpecBuilder { .filter(Objects::nonNull) .collect(Collectors.toList()); - Specifications initialSpec = specs.stream().findFirst().get(); - - Specifications result = specs.stream().skip(1).reduce(initialSpec, (firstSpec, secondSpec) -> { - if (logicalNode.getOperator() == LogicalOperator.AND) { - return Specifications.where(firstSpec).and(secondSpec); - } else if (logicalNode.getOperator() == LogicalOperator.OR) { - return Specifications.where(firstSpec).or(secondSpec); - } - return firstSpec; - }); + Specifications result = specs.get(0); + if (logicalNode.getOperator() == LogicalOperator.AND) { + for (int i = 1; i < specs.size(); i++) { + result = Specifications.where(result).and(specs.get(i)); + } + } + else if (logicalNode.getOperator() == LogicalOperator.OR) { + for (int i = 1; i < specs.size(); i++) { + result = Specifications.where(result).or(specs.get(i)); + } + } return result; } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java index 553d343edb..8055e959a6 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java @@ -77,17 +77,13 @@ public class GenericRsqlSpecification implements Specification { final Class type = root.get(property).getJavaType(); final List args = arguments.stream().map(arg -> { - - Object obj; if (type.equals(Integer.class)) { - obj = Integer.parseInt(arg); + return Integer.parseInt(arg); } else if (type.equals(Long.class)) { - obj = Long.parseLong(arg); + return Long.parseLong(arg); } else { - obj = arg; - } - return obj; - + return arg; + } }).collect(Collectors.toList()); return args; From 39a828fbc995ee452b363e21432a3c0118bfec98 Mon Sep 17 00:00:00 2001 From: RanjeetKaur17 Date: Sun, 28 Oct 2018 16:45:15 +0400 Subject: [PATCH 236/546] Fixing Test Cases --- .../CountdownLatchResetExampleUnitTest.java | 8 +++----- .../cyclicbarrier/CyclicBarrierResetExampleUnitTest.java | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java index 658ab5301a..d2d43f6312 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java @@ -1,8 +1,6 @@ package com.baeldung.concurrent.countdownlatch; -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; +import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -10,8 +8,8 @@ public class CountdownLatchResetExampleUnitTest { @Test public void whenCountDownLatch_noReset() { - CountdownLatchResetExample ex = new CountdownLatchResetExample(5,20); + CountdownLatchResetExample ex = new CountdownLatchResetExample(7,20); int lineCount = ex.countWaits(); - assertEquals(5, lineCount); + assertTrue(lineCount <= 7); } } diff --git a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java index 913325f8e2..8d2b148f06 100644 --- a/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java +++ b/core-java-concurrency/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java @@ -1,6 +1,6 @@ package com.baeldung.concurrent.cyclicbarrier; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -8,8 +8,8 @@ public class CyclicBarrierResetExampleUnitTest { @Test public void whenCyclicBarrier_reset() { - CyclicBarrierResetExample ex = new CyclicBarrierResetExample(7,10); + CyclicBarrierResetExample ex = new CyclicBarrierResetExample(7,20); int lineCount = ex.countWaits(); - assertEquals(8, lineCount); + assertTrue(lineCount > 7); } } From 49b42d75df32ed65e18a55b7ef9dff5366ec0a0c Mon Sep 17 00:00:00 2001 From: Laurentiu Date: Sun, 28 Oct 2018 18:16:59 +0200 Subject: [PATCH 237/546] BAEL-2218 Example of sorting in Kotlin --- .../com/baeldung/sorting/SortingExample.kt | 44 +++++++++++++++++++ .../baeldung/sorting/SortingExampleKtTest.kt | 14 ++++++ 2 files changed, 58 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt b/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt new file mode 100644 index 0000000000..2309d23c36 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt @@ -0,0 +1,44 @@ +package com.baeldung.sorting + +import kotlin.comparisons.* + +fun sortMethodUsage() { + val sortedValues = mutableListOf(1, 2, 7, 6, 5, 6) + sortedValues.sort() + println(sortedValues) +} + +fun sortByMethodUsage() { + val sortedValues = mutableListOf(1 to "a", 2 to "b", 7 to "c", 6 to "d", 5 to "c", 6 to "e") + sortedValues.sortBy { it.second } + println(sortedValues) +} + +fun sortWithMethodUsage() { + val sortedValues = mutableListOf(1 to "a", 2 to "b", 7 to "c", 6 to "d", 5 to "c", 6 to "e") + sortedValues.sortWith(compareBy({it.second}, {it.first})) + println(sortedValues) +} + +fun > getSimpleComparator() : Comparator { + val ascComparator = naturalOrder() + return ascComparator +} + +fun getComplexComparator() { + val complexComparator = compareBy>({it.first}, {it.second}) +} + +fun nullHandlingUsage() { + val sortedValues = mutableListOf(1 to "a", 2 to null, 7 to "c", 6 to "d", 5 to "c", 6 to "e") + sortedValues.sortWith(nullsLast(compareBy { it.second })) + println(sortedValues) +} + +fun extendedComparatorUsage() { + val students = mutableListOf(21 to "Helen", 21 to "Tom", 20 to "Jim") + + val ageComparator = compareBy> {it.first} + val ageAndNameComparator = ageComparator.thenByDescending {it.second} + println(students.sortedWith(ageAndNameComparator)) +} \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt new file mode 100644 index 0000000000..8a94e29c2f --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt @@ -0,0 +1,14 @@ +package com.baeldung.sorting + +import org.junit.jupiter.api.Test + +import org.junit.jupiter.api.Assertions.* + +class SortingExampleKtTest { + + @Test + fun naturalOrderComparator_ShouldBeAscendingTest() { + val resultingList = listOf(1, 5, 6, 6, 2, 3, 4).sortedWith(getSimpleComparator()) + assertTrue(listOf(1, 2, 3, 4, 5, 6, 6) == resultingList) + } +} \ No newline at end of file From 0d4fa7c74862fe5ac85fe4d77ed1c9fc018e809a Mon Sep 17 00:00:00 2001 From: TINO Date: Sun, 28 Oct 2018 19:52:59 +0300 Subject: [PATCH 238/546] BAEL - 2251 Removed Spring boot dependency. --- .../caching/eviction/CacheEvictionMain.java | 17 ---- .../CachingController.java | 2 +- .../CacheEvictAnnotationIntegrationTest.java | 87 +++++++++++++------ .../CacheManagerEvictIntegrationTest.java | 51 +++++++++-- 4 files changed, 108 insertions(+), 49 deletions(-) delete mode 100644 spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java rename spring-all/src/main/java/org/baeldung/caching/eviction/{cotrollers => controllers}/CachingController.java (87%) diff --git a/spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java b/spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java deleted file mode 100644 index 18fac83ad4..0000000000 --- a/spring-all/src/main/java/org/baeldung/caching/eviction/CacheEvictionMain.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung.caching.eviction; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.scheduling.annotation.EnableScheduling; - - -@SpringBootApplication -@EnableCaching -@EnableScheduling -public class CacheEvictionMain { - - public static void main(String[] args) { - SpringApplication.run(CacheEvictionMain.class, args); - } -} diff --git a/spring-all/src/main/java/org/baeldung/caching/eviction/cotrollers/CachingController.java b/spring-all/src/main/java/org/baeldung/caching/eviction/controllers/CachingController.java similarity index 87% rename from spring-all/src/main/java/org/baeldung/caching/eviction/cotrollers/CachingController.java rename to spring-all/src/main/java/org/baeldung/caching/eviction/controllers/CachingController.java index 92265f4f18..675cb7a516 100644 --- a/spring-all/src/main/java/org/baeldung/caching/eviction/cotrollers/CachingController.java +++ b/spring-all/src/main/java/org/baeldung/caching/eviction/controllers/CachingController.java @@ -1,4 +1,4 @@ -package org.baeldung.caching.eviction.cotrollers; +package org.baeldung.caching.eviction.controllers; import org.baeldung.caching.eviction.service.CachingService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java b/spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java index 3ad4ded745..f24cdef917 100644 --- a/spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java +++ b/spring-all/src/test/java/org/baeldung/caching/test/CacheEvictAnnotationIntegrationTest.java @@ -4,41 +4,76 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertThat; -import org.baeldung.caching.eviction.CacheEvictionMain; +import java.util.ArrayList; +import java.util.List; + import org.baeldung.caching.eviction.service.CachingService; import org.junit.Before; 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.test.context.junit4.SpringRunner; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean; +import org.springframework.cache.support.SimpleCacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -@RunWith(SpringRunner.class) -@SpringBootTest(classes = { CacheEvictionMain.class, CachingService.class }) +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration public class CacheEvictAnnotationIntegrationTest { - @Autowired - CachingService cachingService; + @Configuration + @EnableCaching + static class ContextConfiguration { - @Before - public void before() { - cachingService.putToCache("first", "key1", "Baeldung"); - cachingService.putToCache("first", "key2", "Article"); - } + @Bean + public CachingService cachingService() { + return new CachingService(); + } + + @Bean + public CacheManager cacheManager(){ + SimpleCacheManager cacheManager = new SimpleCacheManager(); + List caches = new ArrayList<>(); + caches.add(cacheBean().getObject()); + cacheManager.setCaches(caches ); + return cacheManager; + } + + @Bean + public ConcurrentMapCacheFactoryBean cacheBean(){ + ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean(); + cacheFactoryBean.setName("first"); + return cacheFactoryBean; + } + } - @Test - public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { - cachingService.evictSingleCacheValue("key1"); - String key1 = cachingService.getFromCache("first", "key1"); - assertThat(key1, is(nullValue())); - } + @Autowired + CachingService cachingService; - @Test - public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { - cachingService.evictAllCacheValues(); - String key1 = cachingService.getFromCache("first", "key1"); - String key2 = cachingService.getFromCache("first", "key2"); - assertThat(key1, is(nullValue())); - assertThat(key2, is(nullValue())); - } + @Before + public void before() { + cachingService.putToCache("first", "key1", "Baeldung"); + cachingService.putToCache("first", "key2", "Article"); + } + + @Test + public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { + cachingService.evictSingleCacheValue("key1"); + String key1 = cachingService.getFromCache("first", "key1"); + assertThat(key1, is(nullValue())); + } + + @Test + public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { + cachingService.evictAllCacheValues(); + String key1 = cachingService.getFromCache("first", "key1"); + String key2 = cachingService.getFromCache("first", "key2"); + assertThat(key1, is(nullValue())); + assertThat(key2, is(nullValue())); + } } diff --git a/spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java b/spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java index e65e8800a2..9c6aaea892 100644 --- a/spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java +++ b/spring-all/src/test/java/org/baeldung/caching/test/CacheManagerEvictIntegrationTest.java @@ -4,18 +4,59 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertThat; -import org.baeldung.caching.eviction.CacheEvictionMain; +import java.util.ArrayList; +import java.util.List; + import org.baeldung.caching.eviction.service.CachingService; import org.junit.Before; 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.test.context.junit4.SpringRunner; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean; +import org.springframework.cache.support.SimpleCacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -@RunWith(SpringRunner.class) -@SpringBootTest(classes = { CacheEvictionMain.class, CachingService.class }) +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration public class CacheManagerEvictIntegrationTest { + + @Configuration + static class ContextConfiguration { + + @Bean + public CachingService cachingService() { + return new CachingService(); + } + + @Bean + public CacheManager cacheManager(){ + SimpleCacheManager cacheManager = new SimpleCacheManager(); + List caches = new ArrayList<>(); + caches.add(cacheBeanFirst().getObject()); + caches.add(cacheBeanSecond().getObject()); + cacheManager.setCaches(caches ); + return cacheManager; + } + + @Bean + public ConcurrentMapCacheFactoryBean cacheBeanFirst(){ + ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean(); + cacheFactoryBean.setName("first"); + return cacheFactoryBean; + } + + @Bean + public ConcurrentMapCacheFactoryBean cacheBeanSecond(){ + ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean(); + cacheFactoryBean.setName("second"); + return cacheFactoryBean; + } + } @Autowired CachingService cachingService; From c10101a9acccd2fef6bbe8353aafd7354574cd9c Mon Sep 17 00:00:00 2001 From: Kevin Wittek Date: Sun, 28 Oct 2018 18:22:24 +0100 Subject: [PATCH 239/546] Add Kotlin data mapping examples (BAEL-2247) (#5560) --- core-kotlin/README.md | 1 + .../kotlin/com/baeldung/datamapping/User.kt | 10 +++++ .../baeldung/datamapping/UserExtensions.kt | 22 ++++++++++ .../com/baeldung/datamapping/UserView.kt | 8 ++++ .../com/baeldung/datamapping/UserTest.kt | 43 +++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt diff --git a/core-kotlin/README.md b/core-kotlin/README.md index 9906b59a93..ed6894c2c1 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -40,3 +40,4 @@ - [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) - [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings) - [Kotlin return, break, continue Keywords](https://www.baeldung.com/kotlin-return-break-continue) +- [Mapping of Data Objects in Kotlin](https://www.baeldung.com/kotlin-data-objects-mapping) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt new file mode 100644 index 0000000000..38c88b7c37 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt @@ -0,0 +1,10 @@ +package com.baeldung.datamapping + +data class User( + val firstName: String, + val lastName: String, + val street: String, + val houseNumber: String, + val phone: String, + val age: Int, + val password: String) \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt new file mode 100644 index 0000000000..1f3d7f3b47 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt @@ -0,0 +1,22 @@ +package com.baeldung.datamapping + +import kotlin.reflect.full.memberProperties + +fun User.toUserView() = UserView( + name = "$firstName $lastName", + address = "$street $houseNumber", + telephone = phone, + age = age +) + +fun User.toUserViewReflection() = with(::UserView) { + val propertiesByName = User::class.memberProperties.associateBy { it.name } + callBy(parameters.associate { parameter -> + parameter to when (parameter.name) { + UserView::name.name -> "$firstName $lastName" + UserView::address.name -> "$street $houseNumber" + UserView::telephone.name -> phone + else -> propertiesByName[parameter.name]?.get(this@toUserViewReflection) + } + }) +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt new file mode 100644 index 0000000000..ca27b1961c --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt @@ -0,0 +1,8 @@ +package com.baeldung.datamapping + +data class UserView( + val name: String, + val address: String, + val telephone: String, + val age: Int +) \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt new file mode 100644 index 0000000000..2d03039a80 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt @@ -0,0 +1,43 @@ +package com.baeldung.datamapping + +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertAll +import kotlin.test.assertEquals + +class UserTest { + + @Test + fun `maps User to UserResponse using extension function`() { + val p = buildUser() + val view = p.toUserView() + assertUserView(view) + } + + @Test + fun `maps User to UserResponse using reflection`() { + val p = buildUser() + val view = p.toUserViewReflection() + assertUserView(view) + } + + private fun buildUser(): User { + return User( + "Java", + "Duke", + "Javastreet", + "42", + "1234567", + 30, + "s3cr37" + ) + } + + private fun assertUserView(pr: UserView) { + assertAll( + { assertEquals("Java Duke", pr.name) }, + { assertEquals("Javastreet 42", pr.address) }, + { assertEquals("1234567", pr.telephone) }, + { assertEquals(30, pr.age) } + ) + } +} \ No newline at end of file From 539ce3e78713eb42393d7d61e816ca8f4bb6bd5c Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 28 Oct 2018 23:29:09 +0530 Subject: [PATCH 240/546] [BAEL-9551] - Splitted algorithms into 4 modules --- algorithms-genetic/.gitignore | 4 + algorithms-genetic/README.md | 4 + {algorithms => algorithms-genetic}/pom.xml | 190 ++++++------ .../roundUpToHundred/.gitignore | 0 .../src/com/java/src/RoundUpToHundred.java | 40 +-- .../com/java/src/RoundUpToHundredTest.java | 28 +- .../com/baeldung/algorithms/RunAlgorithm.java | 0 .../algorithms/ga/annealing/City.java | 0 .../ga/annealing/SimulatedAnnealing.java | 0 .../algorithms/ga/annealing/Travel.java | 0 .../algorithms/ga/ant_colony/Ant.java | 0 .../ga/ant_colony/AntColonyOptimization.java | 0 .../algorithms/ga/binary/Individual.java | 0 .../algorithms/ga/binary/Population.java | 0 .../ga/binary/SimpleGeneticAlgorithm.java | 0 .../algorithms/ga/dijkstra/Dijkstra.java | 0 .../algorithms/ga/dijkstra/Graph.java | 0 .../baeldung/algorithms/ga/dijkstra/Node.java | 0 .../algorithms/ga/jenetics/Knapsack.java | 0 .../algorithms/ga/jenetics/KnapsackFF.java | 0 .../algorithms/ga/jenetics/KnapsackItem.java | 0 .../ga/jenetics/SimpleGeneticAlgorithm.java | 0 .../ga/jenetics/SpringsteenProblem.java | 0 .../ga/jenetics/SpringsteenRecord.java | 0 .../algorithms/ga/jenetics/SubsetSum.java | 0 .../ga/jenetics/TravelingSalesman.java | 0 .../algorithms/slope_one/InputData.java | 0 .../baeldung/algorithms/slope_one/Item.java | 0 .../algorithms/slope_one/SlopeOne.java | 0 .../baeldung/algorithms/slope_one/User.java | 0 .../src/main/resources/logback.xml | 0 ...ColonyOptimizationLongRunningUnitTest.java | 0 ...ryGeneticAlgorithmLongRunningUnitTest.java | 0 .../DijkstraAlgorithmLongRunningUnitTest.java | 0 ...SimulatedAnnealingLongRunningUnitTest.java | 0 algorithms-miscellaneous-1/.gitignore | 4 + algorithms-miscellaneous-1/README.md | 12 + algorithms-miscellaneous-1/pom.xml | 96 ++++++ .../roundUpToHundred/.gitignore | 1 + .../src/com/java/src/RoundUpToHundred.java | 20 ++ .../com/java/src/RoundUpToHundredTest.java | 14 + .../automata/FiniteStateMachine.java | 0 .../automata/RtFiniteStateMachine.java | 0 .../baeldung/algorithms/automata/RtState.java | 0 .../algorithms/automata/RtTransition.java | 0 .../baeldung/algorithms/automata/State.java | 0 .../algorithms/automata/Transition.java | 0 .../algorithms/binarysearch/BinarySearch.java | 0 .../algorithms/hillclimbing/HillClimbing.java | 0 .../algorithms/hillclimbing/State.java | 0 .../algorithms/kthlargest/FindKthLargest.java | 0 .../LinesIntersectionService.java | 0 .../mcts/montecarlo/MonteCarloTreeSearch.java | 0 .../algorithms/mcts/montecarlo/State.java | 0 .../algorithms/mcts/montecarlo/UCT.java | 0 .../algorithms/mcts/tictactoe/Board.java | 0 .../algorithms/mcts/tictactoe/Position.java | 0 .../baeldung/algorithms/mcts/tree/Node.java | 0 .../baeldung/algorithms/mcts/tree/Tree.java | 0 .../MiddleElementLookup.java | 0 .../algorithms/middleelementlookup/Node.java | 0 .../algorithms/minimax/GameOfBones.java | 0 .../baeldung/algorithms/minimax/MiniMax.java | 0 .../com/baeldung/algorithms/minimax/Node.java | 0 .../com/baeldung/algorithms/minimax/Tree.java | 0 .../algorithms/multiswarm/Constants.java | 0 .../multiswarm/FitnessFunction.java | 0 .../algorithms/multiswarm/Multiswarm.java | 0 .../algorithms/multiswarm/Particle.java | 0 .../baeldung/algorithms/multiswarm/Swarm.java | 0 .../string/EnglishAlphabetLetters.java | 0 .../string/search/StringSearchAlgorithms.java | 0 .../src/main/resources/logback.xml | 13 + .../src/main/resources/maze/maze1.txt | 22 +- .../src/main/resources/maze/maze2.txt | 42 +-- .../HillClimbingAlgorithmUnitTest.java | 0 .../MiddleElementLookupUnitTest.java | 0 ...FiniteStateMachineLongRunningUnitTest.java | 0 .../StringSearchAlgorithmsUnitTest.java | 0 .../binarysearch/BinarySearchUnitTest.java | 0 .../kthlargest/FindKthLargestUnitTest.java | 0 .../LinesIntersectionServiceUnitTest.java | 0 .../algorithms/mcts/MCTSUnitTest.java | 0 .../algorithms/minimax/MinimaxUnitTest.java | 0 .../multiswarm/LolFitnessFunction.java | 0 .../multiswarm/MultiswarmUnitTest.java | 0 .../EnglishAlphabetLettersUnitTest.java | 0 .../algorithms/support/MayFailRule.java | 0 algorithms-miscellaneous-2/.gitignore | 4 + .../README.md | 16 - algorithms-miscellaneous-2/pom.xml | 96 ++++++ .../roundUpToHundred/.gitignore | 1 + .../src/com/java/src/RoundUpToHundred.java | 20 ++ .../com/java/src/RoundUpToHundredTest.java | 14 + .../conversion/HexStringConverter.java | 0 .../DistanceBetweenPointsService.java | 0 .../editdistance/EditDistanceBase.java | 30 +- .../EditDistanceDynamicProgramming.java | 52 ++-- .../editdistance/EditDistanceRecursive.java | 42 +-- .../linkedlist/CycleDetectionBruteForce.java | 76 ++--- .../CycleDetectionByFastAndSlowIterators.java | 50 ++-- .../linkedlist/CycleDetectionByHashing.java | 54 ++-- .../linkedlist/CycleDetectionResult.java | 24 +- .../linkedlist/CycleRemovalBruteForce.java | 112 +++---- .../CycleRemovalByCountingLoopNodes.java | 88 +++--- .../CycleRemovalWithoutCountingLoopNodes.java | 54 ++-- .../baeldung/algorithms/linkedlist/Node.java | 74 ++--- .../algorithms/maze/solver/BFSMazeSolver.java | 104 +++---- .../algorithms/maze/solver/Coordinate.java | 62 ++-- .../algorithms/maze/solver/DFSMazeSolver.java | 96 +++--- .../baeldung/algorithms/maze/solver/Maze.java | 282 +++++++++--------- .../algorithms/maze/solver/MazeDriver.java | 68 ++--- .../NumberWordConverter.java | 0 .../algorithms/rectanglesoverlap/Point.java | 0 .../rectanglesoverlap/Rectangle.java | 0 .../romannumerals/RomanArabicConverter.java | 104 +++---- .../romannumerals/RomanNumeral.java | 52 ++-- .../sudoku/BacktrackingAlgorithm.java | 0 .../algorithms/sudoku/ColumnNode.java | 0 .../algorithms/sudoku/DancingLinks.java | 0 .../sudoku/DancingLinksAlgorithm.java | 0 .../algorithms/sudoku/DancingNode.java | 0 .../src/main/resources/logback.xml | 13 + .../src/main/resources/maze/maze1.txt | 12 + .../src/main/resources/maze/maze2.txt | 22 ++ .../analysis/AnalysisRunnerLiveTest.java | 0 .../ByteArrayConverterUnitTest.java | 0 .../DistanceBetweenPointsServiceUnitTest.java | 0 .../EditDistanceDataProvider.java | 42 +-- .../editdistance/EditDistanceUnitTest.java | 64 ++-- .../CycleDetectionBruteForceUnitTest.java | 46 +-- ...tectionByFastAndSlowIteratorsUnitTest.java | 46 +-- .../CycleDetectionByHashingUnitTest.java | 46 +-- .../linkedlist/CycleDetectionTestBase.java | 124 ++++---- .../CycleRemovalBruteForceUnitTest.java | 48 +-- ...cleRemovalByCountingLoopNodesUnitTest.java | 48 +-- ...movalWithoutCountingLoopNodesUnitTest.java | 46 +-- .../NumberWordConverterUnitTest.java | 0 .../rectanglesoverlap/RectangleUnitTest.java | 0 .../RomanArabicConverterUnitTest.java | 58 ++-- .../jgrapht/CompleteGraphUnitTest.java | 0 .../jgrapht/DirectedGraphUnitTest.java | 0 .../jgrapht/EulerianCircuitUnitTest.java | 0 algorithms-sorting/.gitignore | 4 + algorithms-sorting/README.md | 7 + algorithms-sorting/pom.xml | 96 ++++++ .../roundUpToHundred/.gitignore | 1 + .../src/com/java/src/RoundUpToHundred.java | 20 ++ .../com/java/src/RoundUpToHundredTest.java | 14 + .../algorithms/bubblesort/BubbleSort.java | 80 ++--- .../baeldung/algorithms/heapsort/Heap.java | 0 .../insertionsort/InsertionSort.java | 0 .../algorithms/mergesort/MergeSort.java | 0 .../algorithms/quicksort/QuickSort.java | 0 .../quicksort/ThreeWayQuickSort.java | 0 .../src/main/resources/logback.xml | 13 + .../bubblesort/BubbleSortUnitTest.java | 50 ++-- .../algorithms/heapsort/HeapUnitTest.java | 0 .../insertionsort/InsertionSortUnitTest.java | 0 .../mergesort/MergeSortUnitTest.java | 0 .../quicksort/QuickSortUnitTest.java | 0 .../quicksort/ThreeWayQuickSortUnitTest.java | 0 algorithms/.gitignore | 1 - pom.xml | 10 +- 164 files changed, 1735 insertions(+), 1241 deletions(-) create mode 100644 algorithms-genetic/.gitignore create mode 100644 algorithms-genetic/README.md rename {algorithms => algorithms-genetic}/pom.xml (96%) rename {algorithms => algorithms-genetic}/roundUpToHundred/.gitignore (100%) rename {algorithms => algorithms-genetic}/roundUpToHundred/src/com/java/src/RoundUpToHundred.java (95%) rename {algorithms => algorithms-genetic}/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java (97%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/RunAlgorithm.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/annealing/City.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/annealing/SimulatedAnnealing.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/annealing/Travel.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/ant_colony/Ant.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/ant_colony/AntColonyOptimization.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/binary/Individual.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/binary/Population.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/binary/SimpleGeneticAlgorithm.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/Knapsack.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackFF.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackItem.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/SimpleGeneticAlgorithm.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenProblem.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenRecord.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/SubsetSum.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/ga/jenetics/TravelingSalesman.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/slope_one/InputData.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/slope_one/Item.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java (100%) rename {algorithms => algorithms-genetic}/src/main/java/com/baeldung/algorithms/slope_one/User.java (100%) rename {algorithms => algorithms-genetic}/src/main/resources/logback.xml (100%) rename {algorithms => algorithms-genetic}/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java (100%) rename {algorithms => algorithms-genetic}/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java (100%) rename {algorithms => algorithms-genetic}/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java (100%) rename {algorithms => algorithms-genetic}/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java (100%) create mode 100644 algorithms-miscellaneous-1/.gitignore create mode 100644 algorithms-miscellaneous-1/README.md create mode 100644 algorithms-miscellaneous-1/pom.xml create mode 100644 algorithms-miscellaneous-1/roundUpToHundred/.gitignore create mode 100644 algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundred.java create mode 100644 algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/automata/FiniteStateMachine.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/automata/RtFiniteStateMachine.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/automata/RtState.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/automata/RtTransition.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/automata/State.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/automata/Transition.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/binarysearch/BinarySearch.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/hillclimbing/State.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/kthlargest/FindKthLargest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/linesintersection/LinesIntersectionService.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/mcts/montecarlo/MonteCarloTreeSearch.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/mcts/montecarlo/State.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/mcts/montecarlo/UCT.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Board.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Position.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/mcts/tree/Node.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/mcts/tree/Tree.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/minimax/Node.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/minimax/Tree.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java (100%) create mode 100644 algorithms-miscellaneous-1/src/main/resources/logback.xml rename {algorithms => algorithms-miscellaneous-1}/src/main/resources/maze/maze1.txt (92%) rename {algorithms => algorithms-miscellaneous-1}/src/main/resources/maze/maze2.txt (96%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/binarysearch/BinarySearchUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/linesintersection/LinesIntersectionServiceUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/mcts/MCTSUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-1}/src/test/java/com/baeldung/algorithms/support/MayFailRule.java (100%) create mode 100644 algorithms-miscellaneous-2/.gitignore rename {algorithms => algorithms-miscellaneous-2}/README.md (54%) create mode 100644 algorithms-miscellaneous-2/pom.xml create mode 100644 algorithms-miscellaneous-2/roundUpToHundred/.gitignore create mode 100644 algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java create mode 100644 algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsService.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceBase.java (95%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceDynamicProgramming.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceRecursive.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForce.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIterators.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashing.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionResult.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForce.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodes.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodes.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/linkedlist/Node.java (95%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/maze/solver/BFSMazeSolver.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/maze/solver/Coordinate.java (94%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/maze/solver/DFSMazeSolver.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/maze/solver/Maze.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/maze/solver/MazeDriver.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/numberwordconverter/NumberWordConverter.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Point.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Rectangle.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/romannumerals/RomanArabicConverter.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/romannumerals/RomanNumeral.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/sudoku/BacktrackingAlgorithm.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/sudoku/ColumnNode.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/sudoku/DancingLinks.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/sudoku/DancingLinksAlgorithm.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/sudoku/DancingNode.java (100%) create mode 100644 algorithms-miscellaneous-2/src/main/resources/logback.xml create mode 100644 algorithms-miscellaneous-2/src/main/resources/maze/maze1.txt create mode 100644 algorithms-miscellaneous-2/src/main/resources/maze/maze2.txt rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/analysis/AnalysisRunnerLiveTest.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsServiceUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceUnitTest.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForceUnitTest.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIteratorsUnitTest.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashingUnitTest.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionTestBase.java (96%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForceUnitTest.java (97%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodesUnitTest.java (97%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodesUnitTest.java (97%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/moneywords/NumberWordConverterUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/rectanglesoverlap/RectangleUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/romannumerals/RomanArabicConverterUnitTest.java (95%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/jgrapht/CompleteGraphUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/jgrapht/DirectedGraphUnitTest.java (100%) rename {algorithms => algorithms-miscellaneous-2}/src/test/java/com/baeldung/jgrapht/EulerianCircuitUnitTest.java (100%) create mode 100644 algorithms-sorting/.gitignore create mode 100644 algorithms-sorting/README.md create mode 100644 algorithms-sorting/pom.xml create mode 100644 algorithms-sorting/roundUpToHundred/.gitignore create mode 100644 algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java create mode 100644 algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java rename {algorithms => algorithms-sorting}/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java (96%) rename {algorithms => algorithms-sorting}/src/main/java/com/baeldung/algorithms/heapsort/Heap.java (100%) rename {algorithms => algorithms-sorting}/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java (100%) rename {algorithms => algorithms-sorting}/src/main/java/com/baeldung/algorithms/mergesort/MergeSort.java (100%) rename {algorithms => algorithms-sorting}/src/main/java/com/baeldung/algorithms/quicksort/QuickSort.java (100%) rename {algorithms => algorithms-sorting}/src/main/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSort.java (100%) create mode 100644 algorithms-sorting/src/main/resources/logback.xml rename {algorithms => algorithms-sorting}/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java (97%) rename {algorithms => algorithms-sorting}/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java (100%) rename {algorithms => algorithms-sorting}/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java (100%) rename {algorithms => algorithms-sorting}/src/test/java/com/baeldung/algorithms/mergesort/MergeSortUnitTest.java (100%) rename {algorithms => algorithms-sorting}/src/test/java/com/baeldung/algorithms/quicksort/QuickSortUnitTest.java (100%) rename {algorithms => algorithms-sorting}/src/test/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSortUnitTest.java (100%) delete mode 100644 algorithms/.gitignore diff --git a/algorithms-genetic/.gitignore b/algorithms-genetic/.gitignore new file mode 100644 index 0000000000..30b2b7442c --- /dev/null +++ b/algorithms-genetic/.gitignore @@ -0,0 +1,4 @@ +/target/ +.settings/ +.classpath +.project \ No newline at end of file diff --git a/algorithms-genetic/README.md b/algorithms-genetic/README.md new file mode 100644 index 0000000000..0f68918fff --- /dev/null +++ b/algorithms-genetic/README.md @@ -0,0 +1,4 @@ +## Relevant articles: + +- [Introduction to Jenetics Library](http://www.baeldung.com/jenetics) +- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization) \ No newline at end of file diff --git a/algorithms/pom.xml b/algorithms-genetic/pom.xml similarity index 96% rename from algorithms/pom.xml rename to algorithms-genetic/pom.xml index db4a1c2eff..94d21159a9 100644 --- a/algorithms/pom.xml +++ b/algorithms-genetic/pom.xml @@ -1,96 +1,96 @@ - - 4.0.0 - com.baeldung - algorithms - 0.0.1-SNAPSHOT - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.apache.commons - commons-math3 - ${commons-math3.version} - - - commons-codec - commons-codec - ${commons-codec.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - - - io.jenetics - jenetics - ${io.jenetics.version} - - - org.jgrapht - jgrapht-core - ${org.jgrapht.core.version} - - - pl.allegro.finance - tradukisto - ${tradukisto.version} - - - org.assertj - assertj-core - ${org.assertj.core.version} - test - - - - - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - - - - - - - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - - - com/baeldung/algorithms/dijkstra/* - - - com/baeldung/algorithms/dijkstra/* - - - - - - - - - 1.16.12 - 3.6.1 - 1.0.1 - 3.7.0 - 1.0.1 - 3.9.0 - 1.11 - - + + 4.0.0 + com.baeldung + algorithms-genetic + 0.0.1-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + org.apache.commons + commons-math3 + ${commons-math3.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + io.jenetics + jenetics + ${io.jenetics.version} + + + org.jgrapht + jgrapht-core + ${org.jgrapht.core.version} + + + pl.allegro.finance + tradukisto + ${tradukisto.version} + + + org.assertj + assertj-core + ${org.assertj.core.version} + test + + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + + com/baeldung/algorithms/dijkstra/* + + + com/baeldung/algorithms/dijkstra/* + + + + + + + + + 1.16.12 + 3.6.1 + 1.0.1 + 3.7.0 + 1.0.1 + 3.9.0 + 1.11 + + \ No newline at end of file diff --git a/algorithms/roundUpToHundred/.gitignore b/algorithms-genetic/roundUpToHundred/.gitignore similarity index 100% rename from algorithms/roundUpToHundred/.gitignore rename to algorithms-genetic/roundUpToHundred/.gitignore diff --git a/algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundred.java similarity index 95% rename from algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundred.java rename to algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundred.java index f5024c227d..6c02a340d3 100644 --- a/algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundred.java +++ b/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundred.java @@ -1,20 +1,20 @@ -package com.java.src; - -import java.util.Scanner; - -public class RoundUpToHundred { - - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - double input = scanner.nextDouble(); - scanner.close(); - - RoundUpToHundred.round(input); - } - - static long round(double input) { - long i = (long) Math.ceil(input); - return ((i + 99) / 100) * 100; - }; - -} +package com.java.src; + +import java.util.Scanner; + +public class RoundUpToHundred { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + double input = scanner.nextDouble(); + scanner.close(); + + RoundUpToHundred.round(input); + } + + static long round(double input) { + long i = (long) Math.ceil(input); + return ((i + 99) / 100) * 100; + }; + +} diff --git a/algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java similarity index 97% rename from algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java rename to algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java index f35a9a249f..cb541ad49c 100644 --- a/algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java +++ b/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java @@ -1,14 +1,14 @@ -package com.java.src; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class RoundUpToHundredTest { - @Test - public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { - assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); - assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); - assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); - } -} +package com.java.src; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class RoundUpToHundredTest { + @Test + public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { + assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); + assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); + assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/RunAlgorithm.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/RunAlgorithm.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/RunAlgorithm.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/RunAlgorithm.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/annealing/City.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/annealing/City.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/annealing/City.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/annealing/City.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/annealing/SimulatedAnnealing.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/annealing/SimulatedAnnealing.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/annealing/SimulatedAnnealing.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/annealing/SimulatedAnnealing.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/annealing/Travel.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/annealing/Travel.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/annealing/Travel.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/annealing/Travel.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/ant_colony/Ant.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/ant_colony/Ant.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/ant_colony/Ant.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/ant_colony/Ant.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/ant_colony/AntColonyOptimization.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/ant_colony/AntColonyOptimization.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/ant_colony/AntColonyOptimization.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/ant_colony/AntColonyOptimization.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/binary/Individual.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/binary/Individual.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/binary/Individual.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/binary/Individual.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/binary/Population.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/binary/Population.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/binary/Population.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/binary/Population.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/binary/SimpleGeneticAlgorithm.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/binary/SimpleGeneticAlgorithm.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/binary/SimpleGeneticAlgorithm.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/binary/SimpleGeneticAlgorithm.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/Knapsack.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/Knapsack.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/Knapsack.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/Knapsack.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackFF.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackFF.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackFF.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackFF.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackItem.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackItem.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackItem.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/KnapsackItem.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SimpleGeneticAlgorithm.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SimpleGeneticAlgorithm.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SimpleGeneticAlgorithm.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SimpleGeneticAlgorithm.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenProblem.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenProblem.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenProblem.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenProblem.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenRecord.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenRecord.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenRecord.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SpringsteenRecord.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SubsetSum.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SubsetSum.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/SubsetSum.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/SubsetSum.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/TravelingSalesman.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/TravelingSalesman.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/ga/jenetics/TravelingSalesman.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/jenetics/TravelingSalesman.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/slope_one/InputData.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/InputData.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/slope_one/InputData.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/InputData.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/slope_one/Item.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/Item.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/slope_one/Item.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/Item.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/slope_one/User.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/User.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/slope_one/User.java rename to algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/User.java diff --git a/algorithms/src/main/resources/logback.xml b/algorithms-genetic/src/main/resources/logback.xml similarity index 100% rename from algorithms/src/main/resources/logback.xml rename to algorithms-genetic/src/main/resources/logback.xml diff --git a/algorithms/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java b/algorithms-genetic/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java rename to algorithms-genetic/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java b/algorithms-genetic/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java rename to algorithms-genetic/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java b/algorithms-genetic/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java rename to algorithms-genetic/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java b/algorithms-genetic/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java rename to algorithms-genetic/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java diff --git a/algorithms-miscellaneous-1/.gitignore b/algorithms-miscellaneous-1/.gitignore new file mode 100644 index 0000000000..30b2b7442c --- /dev/null +++ b/algorithms-miscellaneous-1/.gitignore @@ -0,0 +1,4 @@ +/target/ +.settings/ +.classpath +.project \ No newline at end of file diff --git a/algorithms-miscellaneous-1/README.md b/algorithms-miscellaneous-1/README.md new file mode 100644 index 0000000000..9efb2233bf --- /dev/null +++ b/algorithms-miscellaneous-1/README.md @@ -0,0 +1,12 @@ +## Relevant articles: + +- [Validating Input With Finite Automata in Java](http://www.baeldung.com/java-finite-automata) +- [Example of Hill Climbing Algorithm](http://www.baeldung.com/java-hill-climbing-algorithm) +- [Monte Carlo Tree Search for Tic-Tac-Toe Game](http://www.baeldung.com/java-monte-carlo-tree-search) +- [Binary Search Algorithm in Java](http://www.baeldung.com/java-binary-search) +- [Introduction to Minimax Algorithm](http://www.baeldung.com/java-minimax-algorithm) +- [How to Calculate Levenshtein Distance in Java?](http://www.baeldung.com/java-levenshtein-distance) +- [How to Find the Kth Largest Element in Java](http://www.baeldung.com/java-kth-largest-element) +- [Multi-Swarm Optimization Algorithm in Java](http://www.baeldung.com/java-multi-swarm-algorithm) +- [String Search Algorithms for Large Texts](http://www.baeldung.com/java-full-text-search-algorithms) +- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters) \ No newline at end of file diff --git a/algorithms-miscellaneous-1/pom.xml b/algorithms-miscellaneous-1/pom.xml new file mode 100644 index 0000000000..e154e9e43d --- /dev/null +++ b/algorithms-miscellaneous-1/pom.xml @@ -0,0 +1,96 @@ + + 4.0.0 + com.baeldung + algorithms-miscellaneous-1 + 0.0.1-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + org.apache.commons + commons-math3 + ${commons-math3.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + io.jenetics + jenetics + ${io.jenetics.version} + + + org.jgrapht + jgrapht-core + ${org.jgrapht.core.version} + + + pl.allegro.finance + tradukisto + ${tradukisto.version} + + + org.assertj + assertj-core + ${org.assertj.core.version} + test + + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + + com/baeldung/algorithms/dijkstra/* + + + com/baeldung/algorithms/dijkstra/* + + + + + + + + + 1.16.12 + 3.6.1 + 1.0.1 + 3.7.0 + 1.0.1 + 3.9.0 + 1.11 + + + \ No newline at end of file diff --git a/algorithms-miscellaneous-1/roundUpToHundred/.gitignore b/algorithms-miscellaneous-1/roundUpToHundred/.gitignore new file mode 100644 index 0000000000..ae3c172604 --- /dev/null +++ b/algorithms-miscellaneous-1/roundUpToHundred/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundred.java new file mode 100644 index 0000000000..6c02a340d3 --- /dev/null +++ b/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundred.java @@ -0,0 +1,20 @@ +package com.java.src; + +import java.util.Scanner; + +public class RoundUpToHundred { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + double input = scanner.nextDouble(); + scanner.close(); + + RoundUpToHundred.round(input); + } + + static long round(double input) { + long i = (long) Math.ceil(input); + return ((i + 99) / 100) * 100; + }; + +} diff --git a/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java new file mode 100644 index 0000000000..cb541ad49c --- /dev/null +++ b/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java @@ -0,0 +1,14 @@ +package com.java.src; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class RoundUpToHundredTest { + @Test + public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { + assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); + assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); + assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/automata/FiniteStateMachine.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/FiniteStateMachine.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/automata/FiniteStateMachine.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/FiniteStateMachine.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/automata/RtFiniteStateMachine.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/RtFiniteStateMachine.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/automata/RtFiniteStateMachine.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/RtFiniteStateMachine.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/automata/RtState.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/RtState.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/automata/RtState.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/RtState.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/automata/RtTransition.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/RtTransition.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/automata/RtTransition.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/RtTransition.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/automata/State.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/State.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/automata/State.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/State.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/automata/Transition.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/Transition.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/automata/Transition.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/automata/Transition.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/binarysearch/BinarySearch.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/binarysearch/BinarySearch.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/binarysearch/BinarySearch.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/binarysearch/BinarySearch.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/hillclimbing/HillClimbing.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/State.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/hillclimbing/State.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/hillclimbing/State.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/hillclimbing/State.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/kthlargest/FindKthLargest.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/kthlargest/FindKthLargest.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/kthlargest/FindKthLargest.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/kthlargest/FindKthLargest.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linesintersection/LinesIntersectionService.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/linesintersection/LinesIntersectionService.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/linesintersection/LinesIntersectionService.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/linesintersection/LinesIntersectionService.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mcts/montecarlo/MonteCarloTreeSearch.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/montecarlo/MonteCarloTreeSearch.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mcts/montecarlo/MonteCarloTreeSearch.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/montecarlo/MonteCarloTreeSearch.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mcts/montecarlo/State.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/montecarlo/State.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mcts/montecarlo/State.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/montecarlo/State.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mcts/montecarlo/UCT.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/montecarlo/UCT.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mcts/montecarlo/UCT.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/montecarlo/UCT.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Board.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Board.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Board.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Board.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Position.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Position.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Position.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tictactoe/Position.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mcts/tree/Node.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tree/Node.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mcts/tree/Node.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tree/Node.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mcts/tree/Tree.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tree/Tree.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mcts/tree/Tree.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/mcts/tree/Tree.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/GameOfBones.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/MiniMax.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/Node.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/Node.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/minimax/Node.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/Node.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/minimax/Tree.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/Tree.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/minimax/Tree.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/minimax/Tree.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java rename to algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java diff --git a/algorithms-miscellaneous-1/src/main/resources/logback.xml b/algorithms-miscellaneous-1/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/algorithms-miscellaneous-1/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/algorithms/src/main/resources/maze/maze1.txt b/algorithms-miscellaneous-1/src/main/resources/maze/maze1.txt similarity index 92% rename from algorithms/src/main/resources/maze/maze1.txt rename to algorithms-miscellaneous-1/src/main/resources/maze/maze1.txt index 0a6309d25b..8b48c325d2 100644 --- a/algorithms/src/main/resources/maze/maze1.txt +++ b/algorithms-miscellaneous-1/src/main/resources/maze/maze1.txt @@ -1,12 +1,12 @@ -S ######## -# # -# ### ## # -# # # # -# # # # # -# ## ##### -# # # -# # # # # -##### #### -# # E -# # # # +S ######## +# # +# ### ## # +# # # # +# # # # # +# ## ##### +# # # +# # # # # +##### #### +# # E +# # # # ########## \ No newline at end of file diff --git a/algorithms/src/main/resources/maze/maze2.txt b/algorithms-miscellaneous-1/src/main/resources/maze/maze2.txt similarity index 96% rename from algorithms/src/main/resources/maze/maze2.txt rename to algorithms-miscellaneous-1/src/main/resources/maze/maze2.txt index 22e6d0382a..df5b6bc66b 100644 --- a/algorithms/src/main/resources/maze/maze2.txt +++ b/algorithms-miscellaneous-1/src/main/resources/maze/maze2.txt @@ -1,22 +1,22 @@ -S ########################## -# # # # -# # #### ############### # -# # # # # # -# # #### # # ############### -# # # # # # # -# # # #### ### ########### # -# # # # # # -# ################## # -######### # # # # # -# # #### # ####### # # -# # ### ### # # # # # -# # ## # ##### # # -##### ####### # # # # # -# # ## ## #### # # -# ##### ####### # # -# # ############ -####### ######### # # -# # ######## # -# ####### ###### ## # E -# # # ## # +S ########################## +# # # # +# # #### ############### # +# # # # # # +# # #### # # ############### +# # # # # # # +# # # #### ### ########### # +# # # # # # +# ################## # +######### # # # # # +# # #### # ####### # # +# # ### ### # # # # # +# # ## # ##### # # +##### ####### # # # # # +# # ## ## #### # # +# ##### ####### # # +# # ############ +####### ######### # # +# # ######## # +# ####### ###### ## # E +# # # ## # ############################ \ No newline at end of file diff --git a/algorithms/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/binarysearch/BinarySearchUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/binarysearch/BinarySearchUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/binarysearch/BinarySearchUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/binarysearch/BinarySearchUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linesintersection/LinesIntersectionServiceUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/linesintersection/LinesIntersectionServiceUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/linesintersection/LinesIntersectionServiceUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/linesintersection/LinesIntersectionServiceUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/mcts/MCTSUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/mcts/MCTSUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/mcts/MCTSUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/mcts/MCTSUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/support/MayFailRule.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/support/MayFailRule.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/support/MayFailRule.java rename to algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/support/MayFailRule.java diff --git a/algorithms-miscellaneous-2/.gitignore b/algorithms-miscellaneous-2/.gitignore new file mode 100644 index 0000000000..30b2b7442c --- /dev/null +++ b/algorithms-miscellaneous-2/.gitignore @@ -0,0 +1,4 @@ +/target/ +.settings/ +.classpath +.project \ No newline at end of file diff --git a/algorithms/README.md b/algorithms-miscellaneous-2/README.md similarity index 54% rename from algorithms/README.md rename to algorithms-miscellaneous-2/README.md index b9a37a7bf2..2634fd6b56 100644 --- a/algorithms/README.md +++ b/algorithms-miscellaneous-2/README.md @@ -2,20 +2,8 @@ - [Dijkstra Algorithm in Java](http://www.baeldung.com/java-dijkstra) - [Introduction to Cobertura](http://www.baeldung.com/cobertura) -- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization) -- [Validating Input With Finite Automata in Java](http://www.baeldung.com/java-finite-automata) -- [Introduction to Jenetics Library](http://www.baeldung.com/jenetics) -- [Example of Hill Climbing Algorithm](http://www.baeldung.com/java-hill-climbing-algorithm) -- [Monte Carlo Tree Search for Tic-Tac-Toe Game](http://www.baeldung.com/java-monte-carlo-tree-search) -- [String Search Algorithms for Large Texts](http://www.baeldung.com/java-full-text-search-algorithms) - [Test a Linked List for Cyclicity](http://www.baeldung.com/java-linked-list-cyclicity) -- [Binary Search Algorithm in Java](http://www.baeldung.com/java-binary-search) -- [Bubble Sort in Java](http://www.baeldung.com/java-bubble-sort) - [Introduction to JGraphT](http://www.baeldung.com/jgrapht) -- [Introduction to Minimax Algorithm](http://www.baeldung.com/java-minimax-algorithm) -- [How to Calculate Levenshtein Distance in Java?](http://www.baeldung.com/java-levenshtein-distance) -- [How to Find the Kth Largest Element in Java](http://www.baeldung.com/java-kth-largest-element) -- [Multi-Swarm Optimization Algorithm in Java](http://www.baeldung.com/java-multi-swarm-algorithm) - [A Maze Solver in Java](http://www.baeldung.com/java-solve-maze) - [Create a Sudoku Solver in Java](http://www.baeldung.com/java-sudoku) - [Displaying Money Amounts in Words](http://www.baeldung.com/java-money-into-words) @@ -27,10 +15,6 @@ - [Check If Two Rectangles Overlap In Java](https://www.baeldung.com/java-check-if-two-rectangles-overlap) - [Calculate the Distance Between Two Points in Java](https://www.baeldung.com/java-distance-between-two-points) - [Find the Intersection of Two Lines in Java](https://www.baeldung.com/java-intersection-of-two-lines) -- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters) - [Round Up to the Nearest Hundred](https://www.baeldung.com/java-round-up-nearest-hundred) -- [Merge Sort in Java](https://www.baeldung.com/java-merge-sort) - [Calculate Percentage in Java](https://www.baeldung.com/java-calculate-percentage) -- [Quicksort Algorithm Implementation in Java](https://www.baeldung.com/java-quicksort) -- [Insertion Sort in Java](https://www.baeldung.com/java-insertion-sort) - [Converting Between Byte Arrays and Hexadecimal Strings in Java](https://www.baeldung.com/java-byte-arrays-hex-strings) diff --git a/algorithms-miscellaneous-2/pom.xml b/algorithms-miscellaneous-2/pom.xml new file mode 100644 index 0000000000..848399228e --- /dev/null +++ b/algorithms-miscellaneous-2/pom.xml @@ -0,0 +1,96 @@ + + 4.0.0 + com.baeldung + algorithms-miscellaneous-2 + 0.0.1-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + org.apache.commons + commons-math3 + ${commons-math3.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + io.jenetics + jenetics + ${io.jenetics.version} + + + org.jgrapht + jgrapht-core + ${org.jgrapht.core.version} + + + pl.allegro.finance + tradukisto + ${tradukisto.version} + + + org.assertj + assertj-core + ${org.assertj.core.version} + test + + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + + com/baeldung/algorithms/dijkstra/* + + + com/baeldung/algorithms/dijkstra/* + + + + + + + + + 1.16.12 + 3.6.1 + 1.0.1 + 3.7.0 + 1.0.1 + 3.9.0 + 1.11 + + + \ No newline at end of file diff --git a/algorithms-miscellaneous-2/roundUpToHundred/.gitignore b/algorithms-miscellaneous-2/roundUpToHundred/.gitignore new file mode 100644 index 0000000000..ae3c172604 --- /dev/null +++ b/algorithms-miscellaneous-2/roundUpToHundred/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java new file mode 100644 index 0000000000..6c02a340d3 --- /dev/null +++ b/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java @@ -0,0 +1,20 @@ +package com.java.src; + +import java.util.Scanner; + +public class RoundUpToHundred { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + double input = scanner.nextDouble(); + scanner.close(); + + RoundUpToHundred.round(input); + } + + static long round(double input) { + long i = (long) Math.ceil(input); + return ((i + 99) / 100) * 100; + }; + +} diff --git a/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java new file mode 100644 index 0000000000..cb541ad49c --- /dev/null +++ b/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java @@ -0,0 +1,14 @@ +package com.java.src; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class RoundUpToHundredTest { + @Test + public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { + assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); + assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); + assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsService.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsService.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsService.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsService.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceBase.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceBase.java similarity index 95% rename from algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceBase.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceBase.java index ec66621928..4df1de9994 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceBase.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceBase.java @@ -1,15 +1,15 @@ -package com.baeldung.algorithms.editdistance; - -import java.util.Arrays; - -public class EditDistanceBase { - - static int costOfSubstitution(char a, char b) { - return a == b ? 0 : 1; - } - - static int min(int... numbers) { - return Arrays.stream(numbers) - .min().orElse(Integer.MAX_VALUE); - } -} +package com.baeldung.algorithms.editdistance; + +import java.util.Arrays; + +public class EditDistanceBase { + + static int costOfSubstitution(char a, char b) { + return a == b ? 0 : 1; + } + + static int min(int... numbers) { + return Arrays.stream(numbers) + .min().orElse(Integer.MAX_VALUE); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceDynamicProgramming.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceDynamicProgramming.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceDynamicProgramming.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceDynamicProgramming.java index 1f8824c4f4..10ce43bf5f 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceDynamicProgramming.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceDynamicProgramming.java @@ -1,26 +1,26 @@ -package com.baeldung.algorithms.editdistance; - -public class EditDistanceDynamicProgramming extends EditDistanceBase { - - static int calculate(String x, String y) { - int[][] dp = new int[x.length() + 1][y.length() + 1]; - - for (int i = 0; i <= x.length(); i++) { - for (int j = 0; j <= y.length(); j++) { - if (i == 0) - dp[i][j] = j; - - else if (j == 0) - dp[i][j] = i; - - else { - dp[i][j] = min(dp[i - 1][j - 1] - + costOfSubstitution(x.charAt(i - 1), y.charAt(j - 1)), - dp[i - 1][j] + 1, dp[i][j - 1] + 1); - } - } - } - - return dp[x.length()][y.length()]; - } -} +package com.baeldung.algorithms.editdistance; + +public class EditDistanceDynamicProgramming extends EditDistanceBase { + + static int calculate(String x, String y) { + int[][] dp = new int[x.length() + 1][y.length() + 1]; + + for (int i = 0; i <= x.length(); i++) { + for (int j = 0; j <= y.length(); j++) { + if (i == 0) + dp[i][j] = j; + + else if (j == 0) + dp[i][j] = i; + + else { + dp[i][j] = min(dp[i - 1][j - 1] + + costOfSubstitution(x.charAt(i - 1), y.charAt(j - 1)), + dp[i - 1][j] + 1, dp[i][j - 1] + 1); + } + } + } + + return dp[x.length()][y.length()]; + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceRecursive.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceRecursive.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceRecursive.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceRecursive.java index 8ed48dc554..fc907c45f8 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceRecursive.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/editdistance/EditDistanceRecursive.java @@ -1,21 +1,21 @@ -package com.baeldung.algorithms.editdistance; - -public class EditDistanceRecursive extends EditDistanceBase { - - static int calculate(String x, String y) { - - if (x.isEmpty()) { - return y.length(); - } - - if (y.isEmpty()) { - return x.length(); - } - - int substitution = calculate(x.substring(1), y.substring(1)) + costOfSubstitution(x.charAt(0), y.charAt(0)); - int insertion = calculate(x, y.substring(1)) + 1; - int deletion = calculate(x.substring(1), y) + 1; - - return min(substitution, insertion, deletion); - } -} +package com.baeldung.algorithms.editdistance; + +public class EditDistanceRecursive extends EditDistanceBase { + + static int calculate(String x, String y) { + + if (x.isEmpty()) { + return y.length(); + } + + if (y.isEmpty()) { + return x.length(); + } + + int substitution = calculate(x.substring(1), y.substring(1)) + costOfSubstitution(x.charAt(0), y.charAt(0)); + int insertion = calculate(x, y.substring(1)) + 1; + int deletion = calculate(x.substring(1), y) + 1; + + return min(substitution, insertion, deletion); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForce.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForce.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForce.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForce.java index 1df425ad2e..907bd9042d 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForce.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForce.java @@ -1,38 +1,38 @@ -package com.baeldung.algorithms.linkedlist; - -public class CycleDetectionBruteForce { - - public static CycleDetectionResult detectCycle(Node head) { - if (head == null) { - return new CycleDetectionResult<>(false, null); - } - - Node it1 = head; - int nodesTraversedByOuter = 0; - while (it1 != null && it1.next != null) { - it1 = it1.next; - nodesTraversedByOuter++; - - int x = nodesTraversedByOuter; - Node it2 = head; - int noOfTimesCurrentNodeVisited = 0; - - while (x > 0) { - it2 = it2.next; - - if (it2 == it1) { - noOfTimesCurrentNodeVisited++; - } - - if (noOfTimesCurrentNodeVisited == 2) { - return new CycleDetectionResult<>(true, it1); - } - - x--; - } - } - - return new CycleDetectionResult<>(false, null); - } - -} +package com.baeldung.algorithms.linkedlist; + +public class CycleDetectionBruteForce { + + public static CycleDetectionResult detectCycle(Node head) { + if (head == null) { + return new CycleDetectionResult<>(false, null); + } + + Node it1 = head; + int nodesTraversedByOuter = 0; + while (it1 != null && it1.next != null) { + it1 = it1.next; + nodesTraversedByOuter++; + + int x = nodesTraversedByOuter; + Node it2 = head; + int noOfTimesCurrentNodeVisited = 0; + + while (x > 0) { + it2 = it2.next; + + if (it2 == it1) { + noOfTimesCurrentNodeVisited++; + } + + if (noOfTimesCurrentNodeVisited == 2) { + return new CycleDetectionResult<>(true, it1); + } + + x--; + } + } + + return new CycleDetectionResult<>(false, null); + } + +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIterators.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIterators.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIterators.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIterators.java index ab088de44a..2817f6f783 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIterators.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIterators.java @@ -1,25 +1,25 @@ -package com.baeldung.algorithms.linkedlist; - -public class CycleDetectionByFastAndSlowIterators { - - public static CycleDetectionResult detectCycle(Node head) { - if (head == null) { - return new CycleDetectionResult<>(false, null); - } - - Node slow = head; - Node fast = head; - - while (fast != null && fast.next != null) { - slow = slow.next; - fast = fast.next.next; - - if (slow == fast) { - return new CycleDetectionResult<>(true, fast); - } - } - - return new CycleDetectionResult<>(false, null); - } - -} +package com.baeldung.algorithms.linkedlist; + +public class CycleDetectionByFastAndSlowIterators { + + public static CycleDetectionResult detectCycle(Node head) { + if (head == null) { + return new CycleDetectionResult<>(false, null); + } + + Node slow = head; + Node fast = head; + + while (fast != null && fast.next != null) { + slow = slow.next; + fast = fast.next.next; + + if (slow == fast) { + return new CycleDetectionResult<>(true, fast); + } + } + + return new CycleDetectionResult<>(false, null); + } + +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashing.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashing.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashing.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashing.java index 90d5ecd711..fba4cad2e6 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashing.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashing.java @@ -1,27 +1,27 @@ -package com.baeldung.algorithms.linkedlist; - -import java.util.HashSet; -import java.util.Set; - -public class CycleDetectionByHashing { - - public static CycleDetectionResult detectCycle(Node head) { - if (head == null) { - return new CycleDetectionResult<>(false, null); - } - - Set> set = new HashSet<>(); - Node node = head; - - while (node != null) { - if (set.contains(node)) { - return new CycleDetectionResult<>(true, node); - } - set.add(node); - node = node.next; - } - - return new CycleDetectionResult<>(false, null); - } - -} +package com.baeldung.algorithms.linkedlist; + +import java.util.HashSet; +import java.util.Set; + +public class CycleDetectionByHashing { + + public static CycleDetectionResult detectCycle(Node head) { + if (head == null) { + return new CycleDetectionResult<>(false, null); + } + + Set> set = new HashSet<>(); + Node node = head; + + while (node != null) { + if (set.contains(node)) { + return new CycleDetectionResult<>(true, node); + } + set.add(node); + node = node.next; + } + + return new CycleDetectionResult<>(false, null); + } + +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionResult.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionResult.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionResult.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionResult.java index e7556311b3..4e258ec2ef 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionResult.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleDetectionResult.java @@ -1,12 +1,12 @@ -package com.baeldung.algorithms.linkedlist; - -public class CycleDetectionResult { - boolean cycleExists; - Node node; - - public CycleDetectionResult(boolean cycleExists, Node node) { - super(); - this.cycleExists = cycleExists; - this.node = node; - } -} +package com.baeldung.algorithms.linkedlist; + +public class CycleDetectionResult { + boolean cycleExists; + Node node; + + public CycleDetectionResult(boolean cycleExists, Node node) { + super(); + this.cycleExists = cycleExists; + this.node = node; + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForce.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForce.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForce.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForce.java index a2bfaee9a1..216ebcdde3 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForce.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForce.java @@ -1,56 +1,56 @@ -package com.baeldung.algorithms.linkedlist; - -public class CycleRemovalBruteForce { - - public static boolean detectAndRemoveCycle(Node head) { - CycleDetectionResult result = CycleDetectionByFastAndSlowIterators.detectCycle(head); - - if (result.cycleExists) { - removeCycle(result.node, head); - } - - return result.cycleExists; - } - - /** - * @param loopNodeParam - reference to the node where Flyods cycle - * finding algorithm ends, i.e. the fast and the slow iterators - * meet. - * @param head - reference to the head of the list - */ - private static void removeCycle(Node loopNodeParam, Node head) { - Node it = head; - - while (it != null) { - if (isNodeReachableFromLoopNode(it, loopNodeParam)) { - Node loopStart = it; - findEndNodeAndBreakCycle(loopStart); - break; - } - it = it.next; - } - } - - private static boolean isNodeReachableFromLoopNode(Node it, Node loopNodeParam) { - Node loopNode = loopNodeParam; - - do { - if (it == loopNode) { - return true; - } - loopNode = loopNode.next; - } while (loopNode.next != loopNodeParam); - - return false; - } - - private static void findEndNodeAndBreakCycle(Node loopStartParam) { - Node loopStart = loopStartParam; - - while (loopStart.next != loopStartParam) { - loopStart = loopStart.next; - } - - loopStart.next = null; - } -} +package com.baeldung.algorithms.linkedlist; + +public class CycleRemovalBruteForce { + + public static boolean detectAndRemoveCycle(Node head) { + CycleDetectionResult result = CycleDetectionByFastAndSlowIterators.detectCycle(head); + + if (result.cycleExists) { + removeCycle(result.node, head); + } + + return result.cycleExists; + } + + /** + * @param loopNodeParam - reference to the node where Flyods cycle + * finding algorithm ends, i.e. the fast and the slow iterators + * meet. + * @param head - reference to the head of the list + */ + private static void removeCycle(Node loopNodeParam, Node head) { + Node it = head; + + while (it != null) { + if (isNodeReachableFromLoopNode(it, loopNodeParam)) { + Node loopStart = it; + findEndNodeAndBreakCycle(loopStart); + break; + } + it = it.next; + } + } + + private static boolean isNodeReachableFromLoopNode(Node it, Node loopNodeParam) { + Node loopNode = loopNodeParam; + + do { + if (it == loopNode) { + return true; + } + loopNode = loopNode.next; + } while (loopNode.next != loopNodeParam); + + return false; + } + + private static void findEndNodeAndBreakCycle(Node loopStartParam) { + Node loopStart = loopStartParam; + + while (loopStart.next != loopStartParam) { + loopStart = loopStart.next; + } + + loopStart.next = null; + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodes.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodes.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodes.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodes.java index d8db37fc4c..f961feb97d 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodes.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodes.java @@ -1,44 +1,44 @@ -package com.baeldung.algorithms.linkedlist; - -public class CycleRemovalByCountingLoopNodes { - - public static boolean detectAndRemoveCycle(Node head) { - CycleDetectionResult result = CycleDetectionByFastAndSlowIterators.detectCycle(head); - - if (result.cycleExists) { - removeCycle(result.node, head); - } - - return result.cycleExists; - } - - private static void removeCycle(Node loopNodeParam, Node head) { - int cycleLength = calculateCycleLength(loopNodeParam); - Node cycleLengthAdvancedIterator = head; - Node it = head; - - for (int i = 0; i < cycleLength; i++) { - cycleLengthAdvancedIterator = cycleLengthAdvancedIterator.next; - } - - while (it.next != cycleLengthAdvancedIterator.next) { - it = it.next; - cycleLengthAdvancedIterator = cycleLengthAdvancedIterator.next; - } - - cycleLengthAdvancedIterator.next = null; - } - - private static int calculateCycleLength(Node loopNodeParam) { - Node loopNode = loopNodeParam; - int length = 1; - - while (loopNode.next != loopNodeParam) { - length++; - loopNode = loopNode.next; - } - - return length; - } - -} +package com.baeldung.algorithms.linkedlist; + +public class CycleRemovalByCountingLoopNodes { + + public static boolean detectAndRemoveCycle(Node head) { + CycleDetectionResult result = CycleDetectionByFastAndSlowIterators.detectCycle(head); + + if (result.cycleExists) { + removeCycle(result.node, head); + } + + return result.cycleExists; + } + + private static void removeCycle(Node loopNodeParam, Node head) { + int cycleLength = calculateCycleLength(loopNodeParam); + Node cycleLengthAdvancedIterator = head; + Node it = head; + + for (int i = 0; i < cycleLength; i++) { + cycleLengthAdvancedIterator = cycleLengthAdvancedIterator.next; + } + + while (it.next != cycleLengthAdvancedIterator.next) { + it = it.next; + cycleLengthAdvancedIterator = cycleLengthAdvancedIterator.next; + } + + cycleLengthAdvancedIterator.next = null; + } + + private static int calculateCycleLength(Node loopNodeParam) { + Node loopNode = loopNodeParam; + int length = 1; + + while (loopNode.next != loopNodeParam) { + length++; + loopNode = loopNode.next; + } + + return length; + } + +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodes.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodes.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodes.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodes.java index b979f7f677..1e41c832db 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodes.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodes.java @@ -1,27 +1,27 @@ -package com.baeldung.algorithms.linkedlist; - -public class CycleRemovalWithoutCountingLoopNodes { - - public static boolean detectAndRemoveCycle(Node head) { - CycleDetectionResult result = CycleDetectionByFastAndSlowIterators.detectCycle(head); - - if (result.cycleExists) { - removeCycle(result.node, head); - } - - return result.cycleExists; - } - - private static void removeCycle(Node meetingPointParam, Node head) { - Node loopNode = meetingPointParam; - Node it = head; - - while (loopNode.next != it.next) { - it = it.next; - loopNode = loopNode.next; - } - - loopNode.next = null; - } - -} +package com.baeldung.algorithms.linkedlist; + +public class CycleRemovalWithoutCountingLoopNodes { + + public static boolean detectAndRemoveCycle(Node head) { + CycleDetectionResult result = CycleDetectionByFastAndSlowIterators.detectCycle(head); + + if (result.cycleExists) { + removeCycle(result.node, head); + } + + return result.cycleExists; + } + + private static void removeCycle(Node meetingPointParam, Node head) { + Node loopNode = meetingPointParam; + Node it = head; + + while (loopNode.next != it.next) { + it = it.next; + loopNode = loopNode.next; + } + + loopNode.next = null; + } + +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/Node.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/Node.java similarity index 95% rename from algorithms/src/main/java/com/baeldung/algorithms/linkedlist/Node.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/Node.java index 4add22c77d..9573bcd981 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/linkedlist/Node.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/linkedlist/Node.java @@ -1,38 +1,38 @@ -package com.baeldung.algorithms.linkedlist; - -public class Node { - T data; - Node next; - - public static Node createNewNode(T data, Node next) { - Node node = new Node(); - node.data = data; - node.next = next; - return node; - } - - public static void traverseList(Node root) { - if (root == null) { - return; - } - - Node node = root; - while (node != null) { - System.out.println(node.data); - node = node.next; - } - } - - public static Node getTail(Node root) { - if (root == null) { - return null; - } - - Node node = root; - while (node.next != null) { - node = node.next; - } - return node; - } - +package com.baeldung.algorithms.linkedlist; + +public class Node { + T data; + Node next; + + public static Node createNewNode(T data, Node next) { + Node node = new Node(); + node.data = data; + node.next = next; + return node; + } + + public static void traverseList(Node root) { + if (root == null) { + return; + } + + Node node = root; + while (node != null) { + System.out.println(node.data); + node = node.next; + } + } + + public static Node getTail(Node root) { + if (root == null) { + return null; + } + + Node node = root; + while (node.next != null) { + node = node.next; + } + return node; + } + } \ No newline at end of file diff --git a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/BFSMazeSolver.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/BFSMazeSolver.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/maze/solver/BFSMazeSolver.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/BFSMazeSolver.java index 08972251b8..0e3101925c 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/BFSMazeSolver.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/BFSMazeSolver.java @@ -1,52 +1,52 @@ -package com.baeldung.algorithms.maze.solver; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -public class BFSMazeSolver { - private static final int[][] DIRECTIONS = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } }; - - public List solve(Maze maze) { - LinkedList nextToVisit = new LinkedList<>(); - Coordinate start = maze.getEntry(); - nextToVisit.add(start); - - while (!nextToVisit.isEmpty()) { - Coordinate cur = nextToVisit.remove(); - - if (!maze.isValidLocation(cur.getX(), cur.getY()) || maze.isExplored(cur.getX(), cur.getY())) { - continue; - } - - if (maze.isWall(cur.getX(), cur.getY())) { - maze.setVisited(cur.getX(), cur.getY(), true); - continue; - } - - if (maze.isExit(cur.getX(), cur.getY())) { - return backtrackPath(cur); - } - - for (int[] direction : DIRECTIONS) { - Coordinate coordinate = new Coordinate(cur.getX() + direction[0], cur.getY() + direction[1], cur); - nextToVisit.add(coordinate); - maze.setVisited(cur.getX(), cur.getY(), true); - } - } - return Collections.emptyList(); - } - - private List backtrackPath(Coordinate cur) { - List path = new ArrayList<>(); - Coordinate iter = cur; - - while (iter != null) { - path.add(iter); - iter = iter.parent; - } - - return path; - } -} +package com.baeldung.algorithms.maze.solver; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +public class BFSMazeSolver { + private static final int[][] DIRECTIONS = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } }; + + public List solve(Maze maze) { + LinkedList nextToVisit = new LinkedList<>(); + Coordinate start = maze.getEntry(); + nextToVisit.add(start); + + while (!nextToVisit.isEmpty()) { + Coordinate cur = nextToVisit.remove(); + + if (!maze.isValidLocation(cur.getX(), cur.getY()) || maze.isExplored(cur.getX(), cur.getY())) { + continue; + } + + if (maze.isWall(cur.getX(), cur.getY())) { + maze.setVisited(cur.getX(), cur.getY(), true); + continue; + } + + if (maze.isExit(cur.getX(), cur.getY())) { + return backtrackPath(cur); + } + + for (int[] direction : DIRECTIONS) { + Coordinate coordinate = new Coordinate(cur.getX() + direction[0], cur.getY() + direction[1], cur); + nextToVisit.add(coordinate); + maze.setVisited(cur.getX(), cur.getY(), true); + } + } + return Collections.emptyList(); + } + + private List backtrackPath(Coordinate cur) { + List path = new ArrayList<>(); + Coordinate iter = cur; + + while (iter != null) { + path.add(iter); + iter = iter.parent; + } + + return path; + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/Coordinate.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/Coordinate.java similarity index 94% rename from algorithms/src/main/java/com/baeldung/algorithms/maze/solver/Coordinate.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/Coordinate.java index 09b2ced5e6..8202c89076 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/Coordinate.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/Coordinate.java @@ -1,31 +1,31 @@ -package com.baeldung.algorithms.maze.solver; - -public class Coordinate { - int x; - int y; - Coordinate parent; - - public Coordinate(int x, int y) { - this.x = x; - this.y = y; - this.parent = null; - } - - public Coordinate(int x, int y, Coordinate parent) { - this.x = x; - this.y = y; - this.parent = parent; - } - - int getX() { - return x; - } - - int getY() { - return y; - } - - Coordinate getParent() { - return parent; - } -} +package com.baeldung.algorithms.maze.solver; + +public class Coordinate { + int x; + int y; + Coordinate parent; + + public Coordinate(int x, int y) { + this.x = x; + this.y = y; + this.parent = null; + } + + public Coordinate(int x, int y, Coordinate parent) { + this.x = x; + this.y = y; + this.parent = parent; + } + + int getX() { + return x; + } + + int getY() { + return y; + } + + Coordinate getParent() { + return parent; + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/DFSMazeSolver.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/DFSMazeSolver.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/maze/solver/DFSMazeSolver.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/DFSMazeSolver.java index f9640066b9..ee821631db 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/DFSMazeSolver.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/DFSMazeSolver.java @@ -1,48 +1,48 @@ -package com.baeldung.algorithms.maze.solver; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class DFSMazeSolver { - private static final int[][] DIRECTIONS = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } }; - - public List solve(Maze maze) { - List path = new ArrayList<>(); - if (explore(maze, maze.getEntry() - .getX(), - maze.getEntry() - .getY(), - path)) { - return path; - } - return Collections.emptyList(); - } - - private boolean explore(Maze maze, int row, int col, List path) { - if (!maze.isValidLocation(row, col) || maze.isWall(row, col) || maze.isExplored(row, col)) { - return false; - } - - path.add(new Coordinate(row, col)); - maze.setVisited(row, col, true); - - if (maze.isExit(row, col)) { - return true; - } - - for (int[] direction : DIRECTIONS) { - Coordinate coordinate = getNextCoordinate(row, col, direction[0], direction[1]); - if (explore(maze, coordinate.getX(), coordinate.getY(), path)) { - return true; - } - } - - path.remove(path.size() - 1); - return false; - } - - private Coordinate getNextCoordinate(int row, int col, int i, int j) { - return new Coordinate(row + i, col + j); - } -} +package com.baeldung.algorithms.maze.solver; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class DFSMazeSolver { + private static final int[][] DIRECTIONS = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } }; + + public List solve(Maze maze) { + List path = new ArrayList<>(); + if (explore(maze, maze.getEntry() + .getX(), + maze.getEntry() + .getY(), + path)) { + return path; + } + return Collections.emptyList(); + } + + private boolean explore(Maze maze, int row, int col, List path) { + if (!maze.isValidLocation(row, col) || maze.isWall(row, col) || maze.isExplored(row, col)) { + return false; + } + + path.add(new Coordinate(row, col)); + maze.setVisited(row, col, true); + + if (maze.isExit(row, col)) { + return true; + } + + for (int[] direction : DIRECTIONS) { + Coordinate coordinate = getNextCoordinate(row, col, direction[0], direction[1]); + if (explore(maze, coordinate.getX(), coordinate.getY(), path)) { + return true; + } + } + + path.remove(path.size() - 1); + return false; + } + + private Coordinate getNextCoordinate(int row, int col, int i, int j) { + return new Coordinate(row + i, col + j); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/Maze.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/Maze.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/maze/solver/Maze.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/Maze.java index 8aaa44d9b1..d0a0ed65d9 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/Maze.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/Maze.java @@ -1,141 +1,141 @@ -package com.baeldung.algorithms.maze.solver; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.Arrays; -import java.util.List; -import java.util.Scanner; - -public class Maze { - private static final int ROAD = 0; - private static final int WALL = 1; - private static final int START = 2; - private static final int EXIT = 3; - private static final int PATH = 4; - - private int[][] maze; - private boolean[][] visited; - private Coordinate start; - private Coordinate end; - - public Maze(File maze) throws FileNotFoundException { - String fileText = ""; - try (Scanner input = new Scanner(maze)) { - while (input.hasNextLine()) { - fileText += input.nextLine() + "\n"; - } - } - initializeMaze(fileText); - } - - private void initializeMaze(String text) { - if (text == null || (text = text.trim()).length() == 0) { - throw new IllegalArgumentException("empty lines data"); - } - - String[] lines = text.split("[\r]?\n"); - maze = new int[lines.length][lines[0].length()]; - visited = new boolean[lines.length][lines[0].length()]; - - for (int row = 0; row < getHeight(); row++) { - if (lines[row].length() != getWidth()) { - throw new IllegalArgumentException("line " + (row + 1) + " wrong length (was " + lines[row].length() + " but should be " + getWidth() + ")"); - } - - for (int col = 0; col < getWidth(); col++) { - if (lines[row].charAt(col) == '#') - maze[row][col] = WALL; - else if (lines[row].charAt(col) == 'S') { - maze[row][col] = START; - start = new Coordinate(row, col); - } else if (lines[row].charAt(col) == 'E') { - maze[row][col] = EXIT; - end = new Coordinate(row, col); - } else - maze[row][col] = ROAD; - } - } - } - - public int getHeight() { - return maze.length; - } - - public int getWidth() { - return maze[0].length; - } - - public Coordinate getEntry() { - return start; - } - - public Coordinate getExit() { - return end; - } - - public boolean isExit(int x, int y) { - return x == end.getX() && y == end.getY(); - } - - public boolean isStart(int x, int y) { - return x == start.getX() && y == start.getY(); - } - - public boolean isExplored(int row, int col) { - return visited[row][col]; - } - - public boolean isWall(int row, int col) { - return maze[row][col] == WALL; - } - - public void setVisited(int row, int col, boolean value) { - visited[row][col] = value; - } - - public boolean isValidLocation(int row, int col) { - if (row < 0 || row >= getHeight() || col < 0 || col >= getWidth()) { - return false; - } - return true; - } - - public void printPath(List path) { - int[][] tempMaze = Arrays.stream(maze) - .map(int[]::clone) - .toArray(int[][]::new); - for (Coordinate coordinate : path) { - if (isStart(coordinate.getX(), coordinate.getY()) || isExit(coordinate.getX(), coordinate.getY())) { - continue; - } - tempMaze[coordinate.getX()][coordinate.getY()] = PATH; - } - System.out.println(toString(tempMaze)); - } - - public String toString(int[][] maze) { - StringBuilder result = new StringBuilder(getWidth() * (getHeight() + 1)); - for (int row = 0; row < getHeight(); row++) { - for (int col = 0; col < getWidth(); col++) { - if (maze[row][col] == ROAD) { - result.append(' '); - } else if (maze[row][col] == WALL) { - result.append('#'); - } else if (maze[row][col] == START) { - result.append('S'); - } else if (maze[row][col] == EXIT) { - result.append('E'); - } else { - result.append('.'); - } - } - result.append('\n'); - } - return result.toString(); - } - - public void reset() { - for (int i = 0; i < visited.length; i++) - Arrays.fill(visited[i], false); - } -} +package com.baeldung.algorithms.maze.solver; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Arrays; +import java.util.List; +import java.util.Scanner; + +public class Maze { + private static final int ROAD = 0; + private static final int WALL = 1; + private static final int START = 2; + private static final int EXIT = 3; + private static final int PATH = 4; + + private int[][] maze; + private boolean[][] visited; + private Coordinate start; + private Coordinate end; + + public Maze(File maze) throws FileNotFoundException { + String fileText = ""; + try (Scanner input = new Scanner(maze)) { + while (input.hasNextLine()) { + fileText += input.nextLine() + "\n"; + } + } + initializeMaze(fileText); + } + + private void initializeMaze(String text) { + if (text == null || (text = text.trim()).length() == 0) { + throw new IllegalArgumentException("empty lines data"); + } + + String[] lines = text.split("[\r]?\n"); + maze = new int[lines.length][lines[0].length()]; + visited = new boolean[lines.length][lines[0].length()]; + + for (int row = 0; row < getHeight(); row++) { + if (lines[row].length() != getWidth()) { + throw new IllegalArgumentException("line " + (row + 1) + " wrong length (was " + lines[row].length() + " but should be " + getWidth() + ")"); + } + + for (int col = 0; col < getWidth(); col++) { + if (lines[row].charAt(col) == '#') + maze[row][col] = WALL; + else if (lines[row].charAt(col) == 'S') { + maze[row][col] = START; + start = new Coordinate(row, col); + } else if (lines[row].charAt(col) == 'E') { + maze[row][col] = EXIT; + end = new Coordinate(row, col); + } else + maze[row][col] = ROAD; + } + } + } + + public int getHeight() { + return maze.length; + } + + public int getWidth() { + return maze[0].length; + } + + public Coordinate getEntry() { + return start; + } + + public Coordinate getExit() { + return end; + } + + public boolean isExit(int x, int y) { + return x == end.getX() && y == end.getY(); + } + + public boolean isStart(int x, int y) { + return x == start.getX() && y == start.getY(); + } + + public boolean isExplored(int row, int col) { + return visited[row][col]; + } + + public boolean isWall(int row, int col) { + return maze[row][col] == WALL; + } + + public void setVisited(int row, int col, boolean value) { + visited[row][col] = value; + } + + public boolean isValidLocation(int row, int col) { + if (row < 0 || row >= getHeight() || col < 0 || col >= getWidth()) { + return false; + } + return true; + } + + public void printPath(List path) { + int[][] tempMaze = Arrays.stream(maze) + .map(int[]::clone) + .toArray(int[][]::new); + for (Coordinate coordinate : path) { + if (isStart(coordinate.getX(), coordinate.getY()) || isExit(coordinate.getX(), coordinate.getY())) { + continue; + } + tempMaze[coordinate.getX()][coordinate.getY()] = PATH; + } + System.out.println(toString(tempMaze)); + } + + public String toString(int[][] maze) { + StringBuilder result = new StringBuilder(getWidth() * (getHeight() + 1)); + for (int row = 0; row < getHeight(); row++) { + for (int col = 0; col < getWidth(); col++) { + if (maze[row][col] == ROAD) { + result.append(' '); + } else if (maze[row][col] == WALL) { + result.append('#'); + } else if (maze[row][col] == START) { + result.append('S'); + } else if (maze[row][col] == EXIT) { + result.append('E'); + } else { + result.append('.'); + } + } + result.append('\n'); + } + return result.toString(); + } + + public void reset() { + for (int i = 0; i < visited.length; i++) + Arrays.fill(visited[i], false); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/MazeDriver.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/MazeDriver.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/maze/solver/MazeDriver.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/MazeDriver.java index 60263deba3..a47c3c8581 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/maze/solver/MazeDriver.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/maze/solver/MazeDriver.java @@ -1,34 +1,34 @@ -package com.baeldung.algorithms.maze.solver; - -import java.io.File; -import java.util.List; - -public class MazeDriver { - public static void main(String[] args) throws Exception { - File maze1 = new File("src/main/resources/maze/maze1.txt"); - File maze2 = new File("src/main/resources/maze/maze2.txt"); - - execute(maze1); - execute(maze2); - } - - private static void execute(File file) throws Exception { - Maze maze = new Maze(file); - dfs(maze); - bfs(maze); - } - - private static void bfs(Maze maze) { - BFSMazeSolver bfs = new BFSMazeSolver(); - List path = bfs.solve(maze); - maze.printPath(path); - maze.reset(); - } - - private static void dfs(Maze maze) { - DFSMazeSolver dfs = new DFSMazeSolver(); - List path = dfs.solve(maze); - maze.printPath(path); - maze.reset(); - } -} +package com.baeldung.algorithms.maze.solver; + +import java.io.File; +import java.util.List; + +public class MazeDriver { + public static void main(String[] args) throws Exception { + File maze1 = new File("src/main/resources/maze/maze1.txt"); + File maze2 = new File("src/main/resources/maze/maze2.txt"); + + execute(maze1); + execute(maze2); + } + + private static void execute(File file) throws Exception { + Maze maze = new Maze(file); + dfs(maze); + bfs(maze); + } + + private static void bfs(Maze maze) { + BFSMazeSolver bfs = new BFSMazeSolver(); + List path = bfs.solve(maze); + maze.printPath(path); + maze.reset(); + } + + private static void dfs(Maze maze) { + DFSMazeSolver dfs = new DFSMazeSolver(); + List path = dfs.solve(maze); + maze.printPath(path); + maze.reset(); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/numberwordconverter/NumberWordConverter.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/numberwordconverter/NumberWordConverter.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/numberwordconverter/NumberWordConverter.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/numberwordconverter/NumberWordConverter.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Point.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Point.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Point.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Point.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Rectangle.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Rectangle.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Rectangle.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/rectanglesoverlap/Rectangle.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/romannumerals/RomanArabicConverter.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/romannumerals/RomanArabicConverter.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/romannumerals/RomanArabicConverter.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/romannumerals/RomanArabicConverter.java index ab0922ecf4..acd275e609 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/romannumerals/RomanArabicConverter.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/romannumerals/RomanArabicConverter.java @@ -1,52 +1,52 @@ -package com.baeldung.algorithms.romannumerals; - -import java.util.List; - -class RomanArabicConverter { - - public static int romanToArabic(String input) { - String romanNumeral = input.toUpperCase(); - int result = 0; - - List romanNumerals = RomanNumeral.getReverseSortedValues(); - - int i = 0; - - while ((romanNumeral.length() > 0) && (i < romanNumerals.size())) { - RomanNumeral symbol = romanNumerals.get(i); - if (romanNumeral.startsWith(symbol.name())) { - result += symbol.getValue(); - romanNumeral = romanNumeral.substring(symbol.name().length()); - } else { - i++; - } - } - if (romanNumeral.length() > 0) { - throw new IllegalArgumentException(input + " cannot be converted to a Roman Numeral"); - } - - return result; - } - - public static String arabicToRoman(int number) { - if ((number <= 0) || (number > 4000)) { - throw new IllegalArgumentException(number + " is not in range (0,4000]"); - } - - List romanNumerals = RomanNumeral.getReverseSortedValues(); - - int i = 0; - StringBuilder sb = new StringBuilder(); - - while (number > 0 && i < romanNumerals.size()) { - RomanNumeral currentSymbol = romanNumerals.get(i); - if (currentSymbol.getValue() <= number) { - sb.append(currentSymbol.name()); - number -= currentSymbol.getValue(); - } else { - i++; - } - } - return sb.toString(); - } -} +package com.baeldung.algorithms.romannumerals; + +import java.util.List; + +class RomanArabicConverter { + + public static int romanToArabic(String input) { + String romanNumeral = input.toUpperCase(); + int result = 0; + + List romanNumerals = RomanNumeral.getReverseSortedValues(); + + int i = 0; + + while ((romanNumeral.length() > 0) && (i < romanNumerals.size())) { + RomanNumeral symbol = romanNumerals.get(i); + if (romanNumeral.startsWith(symbol.name())) { + result += symbol.getValue(); + romanNumeral = romanNumeral.substring(symbol.name().length()); + } else { + i++; + } + } + if (romanNumeral.length() > 0) { + throw new IllegalArgumentException(input + " cannot be converted to a Roman Numeral"); + } + + return result; + } + + public static String arabicToRoman(int number) { + if ((number <= 0) || (number > 4000)) { + throw new IllegalArgumentException(number + " is not in range (0,4000]"); + } + + List romanNumerals = RomanNumeral.getReverseSortedValues(); + + int i = 0; + StringBuilder sb = new StringBuilder(); + + while (number > 0 && i < romanNumerals.size()) { + RomanNumeral currentSymbol = romanNumerals.get(i); + if (currentSymbol.getValue() <= number) { + sb.append(currentSymbol.name()); + number -= currentSymbol.getValue(); + } else { + i++; + } + } + return sb.toString(); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/romannumerals/RomanNumeral.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/romannumerals/RomanNumeral.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/romannumerals/RomanNumeral.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/romannumerals/RomanNumeral.java index 219f0b5090..2ee5bb6d75 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/romannumerals/RomanNumeral.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/romannumerals/RomanNumeral.java @@ -1,26 +1,26 @@ -package com.baeldung.algorithms.romannumerals; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - -enum RomanNumeral { - I(1), IV(4), V(5), IX(9), X(10), XL(40), L(50), XC(90), C(100), CD(400), D(500), CM(900), M(1000); - - private int value; - - RomanNumeral(int value) { - this.value = value; - } - - public int getValue() { - return value; - } - - public static List getReverseSortedValues() { - return Arrays.stream(values()) - .sorted(Comparator.comparing((RomanNumeral e) -> e.value).reversed()) - .collect(Collectors.toList()); - } -} +package com.baeldung.algorithms.romannumerals; + +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +enum RomanNumeral { + I(1), IV(4), V(5), IX(9), X(10), XL(40), L(50), XC(90), C(100), CD(400), D(500), CM(900), M(1000); + + private int value; + + RomanNumeral(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + + public static List getReverseSortedValues() { + return Arrays.stream(values()) + .sorted(Comparator.comparing((RomanNumeral e) -> e.value).reversed()) + .collect(Collectors.toList()); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/sudoku/BacktrackingAlgorithm.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/BacktrackingAlgorithm.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/sudoku/BacktrackingAlgorithm.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/BacktrackingAlgorithm.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/sudoku/ColumnNode.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/ColumnNode.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/sudoku/ColumnNode.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/ColumnNode.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/sudoku/DancingLinks.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/DancingLinks.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/sudoku/DancingLinks.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/DancingLinks.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/sudoku/DancingLinksAlgorithm.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/DancingLinksAlgorithm.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/sudoku/DancingLinksAlgorithm.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/DancingLinksAlgorithm.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/sudoku/DancingNode.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/DancingNode.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/sudoku/DancingNode.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/sudoku/DancingNode.java diff --git a/algorithms-miscellaneous-2/src/main/resources/logback.xml b/algorithms-miscellaneous-2/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/algorithms-miscellaneous-2/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/algorithms-miscellaneous-2/src/main/resources/maze/maze1.txt b/algorithms-miscellaneous-2/src/main/resources/maze/maze1.txt new file mode 100644 index 0000000000..8b48c325d2 --- /dev/null +++ b/algorithms-miscellaneous-2/src/main/resources/maze/maze1.txt @@ -0,0 +1,12 @@ +S ######## +# # +# ### ## # +# # # # +# # # # # +# ## ##### +# # # +# # # # # +##### #### +# # E +# # # # +########## \ No newline at end of file diff --git a/algorithms-miscellaneous-2/src/main/resources/maze/maze2.txt b/algorithms-miscellaneous-2/src/main/resources/maze/maze2.txt new file mode 100644 index 0000000000..df5b6bc66b --- /dev/null +++ b/algorithms-miscellaneous-2/src/main/resources/maze/maze2.txt @@ -0,0 +1,22 @@ +S ########################## +# # # # +# # #### ############### # +# # # # # # +# # #### # # ############### +# # # # # # # +# # # #### ### ########### # +# # # # # # +# ################## # +######### # # # # # +# # #### # ####### # # +# # ### ### # # # # # +# # ## # ##### # # +##### ####### # # # # # +# # ## ## #### # # +# ##### ####### # # +# # ############ +####### ######### # # +# # ######## # +# ####### ###### ## # E +# # # ## # +############################ \ No newline at end of file diff --git a/algorithms/src/test/java/com/baeldung/algorithms/analysis/AnalysisRunnerLiveTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/analysis/AnalysisRunnerLiveTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/analysis/AnalysisRunnerLiveTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/analysis/AnalysisRunnerLiveTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsServiceUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsServiceUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsServiceUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/distancebetweenpoints/DistanceBetweenPointsServiceUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java similarity index 96% rename from algorithms/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java index 89bd871616..d11da61191 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java @@ -1,21 +1,21 @@ -package com.baeldung.algorithms.editdistance; - -import org.junit.runners.Parameterized.Parameters; - -import java.util.Arrays; -import java.util.Collection; - -public class EditDistanceDataProvider { - - @Parameters - public static Collection getLists() { - return Arrays.asList(new Object[][] { - { "", "", 0 }, - { "ago", "", 3 }, - { "", "do", 2 }, - { "abc", "adc", 1 }, - { "peek", "pesek", 1 }, - { "sunday", "saturday", 3 } - }); - } -} +package com.baeldung.algorithms.editdistance; + +import org.junit.runners.Parameterized.Parameters; + +import java.util.Arrays; +import java.util.Collection; + +public class EditDistanceDataProvider { + + @Parameters + public static Collection getLists() { + return Arrays.asList(new Object[][] { + { "", "", 0 }, + { "ago", "", 3 }, + { "", "do", 2 }, + { "abc", "adc", 1 }, + { "peek", "pesek", 1 }, + { "sunday", "saturday", 3 } + }); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceUnitTest.java similarity index 96% rename from algorithms/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceUnitTest.java index 0df4715b80..3dd63e86ab 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceUnitTest.java @@ -1,32 +1,32 @@ -package com.baeldung.algorithms.editdistance; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import static org.junit.Assert.assertEquals; - -@RunWith(Parameterized.class) -public class EditDistanceUnitTest extends EditDistanceDataProvider { - - private String x; - private String y; - private int result; - - public EditDistanceUnitTest(String a, String b, int res) { - super(); - x = a; - y = b; - result = res; - } - - @Test - public void testEditDistance_RecursiveImplementation() { - assertEquals(result, EditDistanceRecursive.calculate(x, y)); - } - - @Test - public void testEditDistance_givenDynamicProgrammingImplementation() { - assertEquals(result, EditDistanceDynamicProgramming.calculate(x, y)); - } -} +package com.baeldung.algorithms.editdistance; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import static org.junit.Assert.assertEquals; + +@RunWith(Parameterized.class) +public class EditDistanceUnitTest extends EditDistanceDataProvider { + + private String x; + private String y; + private int result; + + public EditDistanceUnitTest(String a, String b, int res) { + super(); + x = a; + y = b; + result = res; + } + + @Test + public void testEditDistance_RecursiveImplementation() { + assertEquals(result, EditDistanceRecursive.calculate(x, y)); + } + + @Test + public void testEditDistance_givenDynamicProgrammingImplementation() { + assertEquals(result, EditDistanceDynamicProgramming.calculate(x, y)); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForceUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForceUnitTest.java similarity index 96% rename from algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForceUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForceUnitTest.java index af2430ec55..33889fbec6 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForceUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionBruteForceUnitTest.java @@ -1,23 +1,23 @@ -package com.baeldung.algorithms.linkedlist; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(value = Parameterized.class) -public class CycleDetectionBruteForceUnitTest extends CycleDetectionTestBase { - boolean cycleExists; - Node head; - - public CycleDetectionBruteForceUnitTest(Node head, boolean cycleExists) { - super(); - this.cycleExists = cycleExists; - this.head = head; - } - - @Test - public void givenList_detectLoop() { - Assert.assertEquals(cycleExists, CycleDetectionBruteForce.detectCycle(head).cycleExists); - } -} +package com.baeldung.algorithms.linkedlist; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@RunWith(value = Parameterized.class) +public class CycleDetectionBruteForceUnitTest extends CycleDetectionTestBase { + boolean cycleExists; + Node head; + + public CycleDetectionBruteForceUnitTest(Node head, boolean cycleExists) { + super(); + this.cycleExists = cycleExists; + this.head = head; + } + + @Test + public void givenList_detectLoop() { + Assert.assertEquals(cycleExists, CycleDetectionBruteForce.detectCycle(head).cycleExists); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIteratorsUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIteratorsUnitTest.java similarity index 96% rename from algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIteratorsUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIteratorsUnitTest.java index ce31c84067..1496840771 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIteratorsUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByFastAndSlowIteratorsUnitTest.java @@ -1,23 +1,23 @@ -package com.baeldung.algorithms.linkedlist; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(value = Parameterized.class) -public class CycleDetectionByFastAndSlowIteratorsUnitTest extends CycleDetectionTestBase { - boolean cycleExists; - Node head; - - public CycleDetectionByFastAndSlowIteratorsUnitTest(Node head, boolean cycleExists) { - super(); - this.cycleExists = cycleExists; - this.head = head; - } - - @Test - public void givenList_detectLoop() { - Assert.assertEquals(cycleExists, CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); - } -} +package com.baeldung.algorithms.linkedlist; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@RunWith(value = Parameterized.class) +public class CycleDetectionByFastAndSlowIteratorsUnitTest extends CycleDetectionTestBase { + boolean cycleExists; + Node head; + + public CycleDetectionByFastAndSlowIteratorsUnitTest(Node head, boolean cycleExists) { + super(); + this.cycleExists = cycleExists; + this.head = head; + } + + @Test + public void givenList_detectLoop() { + Assert.assertEquals(cycleExists, CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashingUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashingUnitTest.java similarity index 96% rename from algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashingUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashingUnitTest.java index 4451c3d3c9..136f55f834 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashingUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionByHashingUnitTest.java @@ -1,23 +1,23 @@ -package com.baeldung.algorithms.linkedlist; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(value = Parameterized.class) -public class CycleDetectionByHashingUnitTest extends CycleDetectionTestBase { - boolean cycleExists; - Node head; - - public CycleDetectionByHashingUnitTest(Node head, boolean cycleExists) { - super(); - this.cycleExists = cycleExists; - this.head = head; - } - - @Test - public void givenList_detectLoop() { - Assert.assertEquals(cycleExists, CycleDetectionByHashing.detectCycle(head).cycleExists); - } -} +package com.baeldung.algorithms.linkedlist; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@RunWith(value = Parameterized.class) +public class CycleDetectionByHashingUnitTest extends CycleDetectionTestBase { + boolean cycleExists; + Node head; + + public CycleDetectionByHashingUnitTest(Node head, boolean cycleExists) { + super(); + this.cycleExists = cycleExists; + this.head = head; + } + + @Test + public void givenList_detectLoop() { + Assert.assertEquals(cycleExists, CycleDetectionByHashing.detectCycle(head).cycleExists); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionTestBase.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionTestBase.java similarity index 96% rename from algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionTestBase.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionTestBase.java index 51906de8e5..1c6f56b20d 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionTestBase.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleDetectionTestBase.java @@ -1,62 +1,62 @@ -package com.baeldung.algorithms.linkedlist; - -import java.util.Arrays; -import java.util.Collection; - -import org.junit.runners.Parameterized.Parameters; - -public class CycleDetectionTestBase { - - @Parameters - public static Collection getLists() { - return Arrays.asList(new Object[][] { - { createList(), false }, - { createListWithLoop(), true }, - { createListWithFullCycle(), true }, - { createListWithSingleNodeInCycle(), true } - }); - } - - public static Node createList() { - Node root = Node.createNewNode(10, null); - - for (int i = 9; i >= 1; --i) { - Node current = Node.createNewNode(i, root); - root = current; - } - - return root; - } - - public static Node createListWithLoop() { - Node node = createList(); - createLoop(node); - return node; - } - - public static Node createListWithFullCycle() { - Node head = createList(); - Node tail = Node.getTail(head); - tail.next = head; - return head; - } - - public static Node createListWithSingleNodeInCycle() { - Node head = createList(); - Node tail = Node.getTail(head); - tail.next = tail; - return head; - } - - public static void createLoop(Node root) { - Node tail = Node.getTail(root); - - Node middle = root; - for (int i = 1; i <= 4; i++) { - middle = middle.next; - } - - tail.next = middle; - } - -} +package com.baeldung.algorithms.linkedlist; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.runners.Parameterized.Parameters; + +public class CycleDetectionTestBase { + + @Parameters + public static Collection getLists() { + return Arrays.asList(new Object[][] { + { createList(), false }, + { createListWithLoop(), true }, + { createListWithFullCycle(), true }, + { createListWithSingleNodeInCycle(), true } + }); + } + + public static Node createList() { + Node root = Node.createNewNode(10, null); + + for (int i = 9; i >= 1; --i) { + Node current = Node.createNewNode(i, root); + root = current; + } + + return root; + } + + public static Node createListWithLoop() { + Node node = createList(); + createLoop(node); + return node; + } + + public static Node createListWithFullCycle() { + Node head = createList(); + Node tail = Node.getTail(head); + tail.next = head; + return head; + } + + public static Node createListWithSingleNodeInCycle() { + Node head = createList(); + Node tail = Node.getTail(head); + tail.next = tail; + return head; + } + + public static void createLoop(Node root) { + Node tail = Node.getTail(root); + + Node middle = root; + for (int i = 1; i <= 4; i++) { + middle = middle.next; + } + + tail.next = middle; + } + +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForceUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForceUnitTest.java similarity index 97% rename from algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForceUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForceUnitTest.java index f69e3c35ba..36f08d2b76 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForceUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalBruteForceUnitTest.java @@ -1,24 +1,24 @@ -package com.baeldung.algorithms.linkedlist; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(value = Parameterized.class) -public class CycleRemovalBruteForceUnitTest extends CycleDetectionTestBase { - boolean cycleExists; - Node head; - - public CycleRemovalBruteForceUnitTest(Node head, boolean cycleExists) { - super(); - this.cycleExists = cycleExists; - this.head = head; - } - - @Test - public void givenList_ifLoopExists_thenDetectAndRemoveLoop() { - Assert.assertEquals(cycleExists, CycleRemovalBruteForce.detectAndRemoveCycle(head)); - Assert.assertFalse(CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); - } -} +package com.baeldung.algorithms.linkedlist; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@RunWith(value = Parameterized.class) +public class CycleRemovalBruteForceUnitTest extends CycleDetectionTestBase { + boolean cycleExists; + Node head; + + public CycleRemovalBruteForceUnitTest(Node head, boolean cycleExists) { + super(); + this.cycleExists = cycleExists; + this.head = head; + } + + @Test + public void givenList_ifLoopExists_thenDetectAndRemoveLoop() { + Assert.assertEquals(cycleExists, CycleRemovalBruteForce.detectAndRemoveCycle(head)); + Assert.assertFalse(CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodesUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodesUnitTest.java similarity index 97% rename from algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodesUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodesUnitTest.java index c17aa6eeab..cc7589c53d 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodesUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalByCountingLoopNodesUnitTest.java @@ -1,24 +1,24 @@ -package com.baeldung.algorithms.linkedlist; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(value = Parameterized.class) -public class CycleRemovalByCountingLoopNodesUnitTest extends CycleDetectionTestBase { - boolean cycleExists; - Node head; - - public CycleRemovalByCountingLoopNodesUnitTest(Node head, boolean cycleExists) { - super(); - this.cycleExists = cycleExists; - this.head = head; - } - - @Test - public void givenList_ifLoopExists_thenDetectAndRemoveLoop() { - Assert.assertEquals(cycleExists, CycleRemovalByCountingLoopNodes.detectAndRemoveCycle(head)); - Assert.assertFalse(CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); - } -} +package com.baeldung.algorithms.linkedlist; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@RunWith(value = Parameterized.class) +public class CycleRemovalByCountingLoopNodesUnitTest extends CycleDetectionTestBase { + boolean cycleExists; + Node head; + + public CycleRemovalByCountingLoopNodesUnitTest(Node head, boolean cycleExists) { + super(); + this.cycleExists = cycleExists; + this.head = head; + } + + @Test + public void givenList_ifLoopExists_thenDetectAndRemoveLoop() { + Assert.assertEquals(cycleExists, CycleRemovalByCountingLoopNodes.detectAndRemoveCycle(head)); + Assert.assertFalse(CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodesUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodesUnitTest.java similarity index 97% rename from algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodesUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodesUnitTest.java index 06ff840a59..350e63dcc3 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodesUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/linkedlist/CycleRemovalWithoutCountingLoopNodesUnitTest.java @@ -1,24 +1,24 @@ -package com.baeldung.algorithms.linkedlist; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(value = Parameterized.class) -public class CycleRemovalWithoutCountingLoopNodesUnitTest extends CycleDetectionTestBase { - boolean cycleExists; - Node head; - - public CycleRemovalWithoutCountingLoopNodesUnitTest(Node head, boolean cycleExists) { - super(); - this.cycleExists = cycleExists; - this.head = head; - } - - @Test - public void givenList_ifLoopExists_thenDetectAndRemoveLoop() { - Assert.assertEquals(cycleExists, CycleRemovalWithoutCountingLoopNodes.detectAndRemoveCycle(head)); - Assert.assertFalse(CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); - } +package com.baeldung.algorithms.linkedlist; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@RunWith(value = Parameterized.class) +public class CycleRemovalWithoutCountingLoopNodesUnitTest extends CycleDetectionTestBase { + boolean cycleExists; + Node head; + + public CycleRemovalWithoutCountingLoopNodesUnitTest(Node head, boolean cycleExists) { + super(); + this.cycleExists = cycleExists; + this.head = head; + } + + @Test + public void givenList_ifLoopExists_thenDetectAndRemoveLoop() { + Assert.assertEquals(cycleExists, CycleRemovalWithoutCountingLoopNodes.detectAndRemoveCycle(head)); + Assert.assertFalse(CycleDetectionByFastAndSlowIterators.detectCycle(head).cycleExists); + } } \ No newline at end of file diff --git a/algorithms/src/test/java/com/baeldung/algorithms/moneywords/NumberWordConverterUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/moneywords/NumberWordConverterUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/moneywords/NumberWordConverterUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/moneywords/NumberWordConverterUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/rectanglesoverlap/RectangleUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/rectanglesoverlap/RectangleUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/rectanglesoverlap/RectangleUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/rectanglesoverlap/RectangleUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/romannumerals/RomanArabicConverterUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/romannumerals/RomanArabicConverterUnitTest.java similarity index 95% rename from algorithms/src/test/java/com/baeldung/algorithms/romannumerals/RomanArabicConverterUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/romannumerals/RomanArabicConverterUnitTest.java index b289ec6bc9..9043cfe9cc 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/romannumerals/RomanArabicConverterUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/romannumerals/RomanArabicConverterUnitTest.java @@ -1,29 +1,29 @@ -package com.baeldung.algorithms.romannumerals; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.Test; - -public class RomanArabicConverterUnitTest { - - @Test - public void given2018Roman_WhenConvertingToArabic_ThenReturn2018() { - - String roman2018 = "MMXVIII"; - - int result = RomanArabicConverter.romanToArabic(roman2018); - - assertThat(result).isEqualTo(2018); - } - - @Test - public void given1999Arabic_WhenConvertingToRoman_ThenReturnMCMXCIX() { - - int arabic1999 = 1999; - - String result = RomanArabicConverter.arabicToRoman(arabic1999); - - assertThat(result).isEqualTo("MCMXCIX"); - } - -} +package com.baeldung.algorithms.romannumerals; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.Test; + +public class RomanArabicConverterUnitTest { + + @Test + public void given2018Roman_WhenConvertingToArabic_ThenReturn2018() { + + String roman2018 = "MMXVIII"; + + int result = RomanArabicConverter.romanToArabic(roman2018); + + assertThat(result).isEqualTo(2018); + } + + @Test + public void given1999Arabic_WhenConvertingToRoman_ThenReturnMCMXCIX() { + + int arabic1999 = 1999; + + String result = RomanArabicConverter.arabicToRoman(arabic1999); + + assertThat(result).isEqualTo("MCMXCIX"); + } + +} diff --git a/algorithms/src/test/java/com/baeldung/jgrapht/CompleteGraphUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/CompleteGraphUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/jgrapht/CompleteGraphUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/CompleteGraphUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/jgrapht/DirectedGraphUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/DirectedGraphUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/jgrapht/DirectedGraphUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/DirectedGraphUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/jgrapht/EulerianCircuitUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/EulerianCircuitUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/jgrapht/EulerianCircuitUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/jgrapht/EulerianCircuitUnitTest.java diff --git a/algorithms-sorting/.gitignore b/algorithms-sorting/.gitignore new file mode 100644 index 0000000000..30b2b7442c --- /dev/null +++ b/algorithms-sorting/.gitignore @@ -0,0 +1,4 @@ +/target/ +.settings/ +.classpath +.project \ No newline at end of file diff --git a/algorithms-sorting/README.md b/algorithms-sorting/README.md new file mode 100644 index 0000000000..f88b93e25e --- /dev/null +++ b/algorithms-sorting/README.md @@ -0,0 +1,7 @@ +## Relevant articles: + +- [Bubble Sort in Java](http://www.baeldung.com/java-bubble-sort) +- [Merge Sort in Java](https://www.baeldung.com/java-merge-sort) +- [Quicksort Algorithm Implementation in Java](https://www.baeldung.com/java-quicksort) +- [Insertion Sort in Java](https://www.baeldung.com/java-insertion-sort) + diff --git a/algorithms-sorting/pom.xml b/algorithms-sorting/pom.xml new file mode 100644 index 0000000000..d835983078 --- /dev/null +++ b/algorithms-sorting/pom.xml @@ -0,0 +1,96 @@ + + 4.0.0 + com.baeldung + algorithms-sorting + 0.0.1-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + org.apache.commons + commons-math3 + ${commons-math3.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + io.jenetics + jenetics + ${io.jenetics.version} + + + org.jgrapht + jgrapht-core + ${org.jgrapht.core.version} + + + pl.allegro.finance + tradukisto + ${tradukisto.version} + + + org.assertj + assertj-core + ${org.assertj.core.version} + test + + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + + com/baeldung/algorithms/dijkstra/* + + + com/baeldung/algorithms/dijkstra/* + + + + + + + + + 1.16.12 + 3.6.1 + 1.0.1 + 3.7.0 + 1.0.1 + 3.9.0 + 1.11 + + + \ No newline at end of file diff --git a/algorithms-sorting/roundUpToHundred/.gitignore b/algorithms-sorting/roundUpToHundred/.gitignore new file mode 100644 index 0000000000..ae3c172604 --- /dev/null +++ b/algorithms-sorting/roundUpToHundred/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java new file mode 100644 index 0000000000..6c02a340d3 --- /dev/null +++ b/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java @@ -0,0 +1,20 @@ +package com.java.src; + +import java.util.Scanner; + +public class RoundUpToHundred { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + double input = scanner.nextDouble(); + scanner.close(); + + RoundUpToHundred.round(input); + } + + static long round(double input) { + long i = (long) Math.ceil(input); + return ((i + 99) / 100) * 100; + }; + +} diff --git a/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java new file mode 100644 index 0000000000..cb541ad49c --- /dev/null +++ b/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java @@ -0,0 +1,14 @@ +package com.java.src; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class RoundUpToHundredTest { + @Test + public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { + assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); + assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); + assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java similarity index 96% rename from algorithms/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java index 275cb7f3a2..2528032676 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java +++ b/algorithms-sorting/src/main/java/com/baeldung/algorithms/bubblesort/BubbleSort.java @@ -1,40 +1,40 @@ -package com.baeldung.algorithms.bubblesort; - -import java.util.stream.IntStream; - -public class BubbleSort { - - void bubbleSort(Integer[] arr) { - int n = arr.length; - IntStream.range(0, n - 1) - .flatMap(i -> IntStream.range(1, n - i)) - .forEach(j -> { - if (arr[j - 1] > arr[j]) { - int temp = arr[j]; - arr[j] = arr[j - 1]; - arr[j - 1] = temp; - } - }); - } - - void optimizedBubbleSort(Integer[] arr) { - int i = 0, n = arr.length; - - boolean swapNeeded = true; - while (i < n - 1 && swapNeeded) { - swapNeeded = false; - for (int j = 1; j < n - i; j++) { - if (arr[j - 1] > arr[j]) { - - int temp = arr[j - 1]; - arr[j - 1] = arr[j]; - arr[j] = temp; - swapNeeded = true; - } - } - if (!swapNeeded) - break; - i++; - } - } -} +package com.baeldung.algorithms.bubblesort; + +import java.util.stream.IntStream; + +public class BubbleSort { + + void bubbleSort(Integer[] arr) { + int n = arr.length; + IntStream.range(0, n - 1) + .flatMap(i -> IntStream.range(1, n - i)) + .forEach(j -> { + if (arr[j - 1] > arr[j]) { + int temp = arr[j]; + arr[j] = arr[j - 1]; + arr[j - 1] = temp; + } + }); + } + + void optimizedBubbleSort(Integer[] arr) { + int i = 0, n = arr.length; + + boolean swapNeeded = true; + while (i < n - 1 && swapNeeded) { + swapNeeded = false; + for (int j = 1; j < n - i; j++) { + if (arr[j - 1] > arr[j]) { + + int temp = arr[j - 1]; + arr[j - 1] = arr[j]; + arr[j] = temp; + swapNeeded = true; + } + } + if (!swapNeeded) + break; + i++; + } + } +} diff --git a/algorithms/src/main/java/com/baeldung/algorithms/heapsort/Heap.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/heapsort/Heap.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/heapsort/Heap.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/heapsort/Heap.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/insertionsort/InsertionSort.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/mergesort/MergeSort.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/mergesort/MergeSort.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/mergesort/MergeSort.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/mergesort/MergeSort.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/quicksort/QuickSort.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/quicksort/QuickSort.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/quicksort/QuickSort.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/quicksort/QuickSort.java diff --git a/algorithms/src/main/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSort.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSort.java similarity index 100% rename from algorithms/src/main/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSort.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSort.java diff --git a/algorithms-sorting/src/main/resources/logback.xml b/algorithms-sorting/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/algorithms-sorting/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/algorithms/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java similarity index 97% rename from algorithms/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java index c3260a18dd..210ee2378a 100644 --- a/algorithms/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java +++ b/algorithms-sorting/src/test/java/com/baeldung/algorithms/bubblesort/BubbleSortUnitTest.java @@ -1,26 +1,26 @@ -package com.baeldung.algorithms.bubblesort; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; - -import org.junit.jupiter.api.Test; - -public class BubbleSortUnitTest { - - @Test - public void givenIntegerArray_whenSortedWithBubbleSort_thenGetSortedArray() { - Integer[] array = { 2, 1, 4, 6, 3, 5 }; - Integer[] sortedArray = { 1, 2, 3, 4, 5, 6 }; - BubbleSort bubbleSort = new BubbleSort(); - bubbleSort.bubbleSort(array); - assertArrayEquals(array, sortedArray); - } - - @Test - public void givenIntegerArray_whenSortedWithOptimizedBubbleSort_thenGetSortedArray() { - Integer[] array = { 2, 1, 4, 6, 3, 5 }; - Integer[] sortedArray = { 1, 2, 3, 4, 5, 6 }; - BubbleSort bubbleSort = new BubbleSort(); - bubbleSort.optimizedBubbleSort(array); - assertArrayEquals(array, sortedArray); - } +package com.baeldung.algorithms.bubblesort; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; + +import org.junit.jupiter.api.Test; + +public class BubbleSortUnitTest { + + @Test + public void givenIntegerArray_whenSortedWithBubbleSort_thenGetSortedArray() { + Integer[] array = { 2, 1, 4, 6, 3, 5 }; + Integer[] sortedArray = { 1, 2, 3, 4, 5, 6 }; + BubbleSort bubbleSort = new BubbleSort(); + bubbleSort.bubbleSort(array); + assertArrayEquals(array, sortedArray); + } + + @Test + public void givenIntegerArray_whenSortedWithOptimizedBubbleSort_thenGetSortedArray() { + Integer[] array = { 2, 1, 4, 6, 3, 5 }; + Integer[] sortedArray = { 1, 2, 3, 4, 5, 6 }; + BubbleSort bubbleSort = new BubbleSort(); + bubbleSort.optimizedBubbleSort(array); + assertArrayEquals(array, sortedArray); + } } \ No newline at end of file diff --git a/algorithms/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/heapsort/HeapUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/insertionsort/InsertionSortUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/mergesort/MergeSortUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/mergesort/MergeSortUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/mergesort/MergeSortUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/mergesort/MergeSortUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/quicksort/QuickSortUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/quicksort/QuickSortUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/quicksort/QuickSortUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/quicksort/QuickSortUnitTest.java diff --git a/algorithms/src/test/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSortUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSortUnitTest.java similarity index 100% rename from algorithms/src/test/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSortUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/quicksort/ThreeWayQuickSortUnitTest.java diff --git a/algorithms/.gitignore b/algorithms/.gitignore deleted file mode 100644 index b83d22266a..0000000000 --- a/algorithms/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/pom.xml b/pom.xml index 0b5cd16ea0..a546f8e925 100644 --- a/pom.xml +++ b/pom.xml @@ -334,7 +334,10 @@ aws aws-lambda akka-streams - algorithms + algorithms-genetic + algorithms-miscellaneous-1 + algorithms-miscellaneous-2 + algorithms-sorting annotations apache-cxf apache-fop @@ -1255,7 +1258,10 @@ aws aws-lambda akka-streams - algorithms + algorithms-genetic + algorithms-miscellaneous-1 + algorithms-miscellaneous-2 + algorithms-sorting annotations apache-cxf apache-fop From fddb7f18a54a2c8ffef4d624c50dce03362af562 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 28 Oct 2018 23:46:55 +0530 Subject: [PATCH 241/546] [BAEL-9551] - Removed unused dependencies --- algorithms-genetic/pom.xml | 32 ------------------------- algorithms-miscellaneous-1/pom.xml | 18 -------------- algorithms-miscellaneous-2/pom.xml | 6 ----- algorithms-sorting/pom.xml | 38 ------------------------------ 4 files changed, 94 deletions(-) diff --git a/algorithms-genetic/pom.xml b/algorithms-genetic/pom.xml index 94d21159a9..2a10a81980 100644 --- a/algorithms-genetic/pom.xml +++ b/algorithms-genetic/pom.xml @@ -33,16 +33,6 @@ jenetics ${io.jenetics.version} - - org.jgrapht - jgrapht-core - ${org.jgrapht.core.version} - - - pl.allegro.finance - tradukisto - ${tradukisto.version} - org.assertj assertj-core @@ -63,32 +53,10 @@ - - - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - - - com/baeldung/algorithms/dijkstra/* - - - com/baeldung/algorithms/dijkstra/* - - - - - - - 1.16.12 3.6.1 - 1.0.1 3.7.0 - 1.0.1 3.9.0 1.11 diff --git a/algorithms-miscellaneous-1/pom.xml b/algorithms-miscellaneous-1/pom.xml index e154e9e43d..16749d452e 100644 --- a/algorithms-miscellaneous-1/pom.xml +++ b/algorithms-miscellaneous-1/pom.xml @@ -28,21 +28,6 @@ ${lombok.version} provided - - io.jenetics - jenetics - ${io.jenetics.version} - - - org.jgrapht - jgrapht-core - ${org.jgrapht.core.version} - - - pl.allegro.finance - tradukisto - ${tradukisto.version} - org.assertj assertj-core @@ -86,9 +71,6 @@ 1.16.12 3.6.1 - 1.0.1 - 3.7.0 - 1.0.1 3.9.0 1.11 diff --git a/algorithms-miscellaneous-2/pom.xml b/algorithms-miscellaneous-2/pom.xml index 848399228e..eeae544612 100644 --- a/algorithms-miscellaneous-2/pom.xml +++ b/algorithms-miscellaneous-2/pom.xml @@ -28,11 +28,6 @@ ${lombok.version} provided - - io.jenetics - jenetics - ${io.jenetics.version} - org.jgrapht jgrapht-core @@ -87,7 +82,6 @@ 1.16.12 3.6.1 1.0.1 - 3.7.0 1.0.1 3.9.0 1.11 diff --git a/algorithms-sorting/pom.xml b/algorithms-sorting/pom.xml index d835983078..60ae37f2a4 100644 --- a/algorithms-sorting/pom.xml +++ b/algorithms-sorting/pom.xml @@ -28,21 +28,6 @@ ${lombok.version} provided - - io.jenetics - jenetics - ${io.jenetics.version} - - - org.jgrapht - jgrapht-core - ${org.jgrapht.core.version} - - - pl.allegro.finance - tradukisto - ${tradukisto.version} - org.assertj assertj-core @@ -63,32 +48,9 @@ - - - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - - - com/baeldung/algorithms/dijkstra/* - - - com/baeldung/algorithms/dijkstra/* - - - - - - - 1.16.12 3.6.1 - 1.0.1 - 3.7.0 - 1.0.1 3.9.0 1.11 From a79f802038e3be1b59abef89b97a98d2644ee4a0 Mon Sep 17 00:00:00 2001 From: saikat Date: Sun, 28 Oct 2018 23:47:00 +0530 Subject: [PATCH 242/546] Add new module for restx-demo --- pom.xml | 1 + restx-demo/data/credentials.json | 12 ++ restx-demo/data/users.json | 4 + restx-demo/md.restx.json | 38 +++++ restx-demo/pom.xml | 156 ++++++++++++++++++ .../src/main/java/restx/demo/AppModule.java | 74 +++++++++ .../src/main/java/restx/demo/AppServer.java | 32 ++++ .../src/main/java/restx/demo/Roles.java | 10 ++ .../main/java/restx/demo/domain/Message.java | 21 +++ .../java/restx/demo/rest/HelloResource.java | 62 +++++++ restx-demo/src/main/resources/logback.xml | 94 +++++++++++ .../resources/restx/demo/settings.properties | 1 + restx-demo/src/main/webapp/WEB-INF/web.xml | 15 ++ .../demo/rest/HelloResourceSpecTest.java | 23 +++ .../hello/should_admin_say_hello.spec.yaml | 10 ++ .../hello/should_anyone_say_hello.spec.yaml | 8 + ..._value_triggers_validation_error.spec.yaml | 17 ++ .../hello/should_user1_say_hello.spec.yaml | 10 ++ .../should_user2_not_say_hello.spec.yaml | 10 ++ 19 files changed, 598 insertions(+) create mode 100644 restx-demo/data/credentials.json create mode 100644 restx-demo/data/users.json create mode 100644 restx-demo/md.restx.json create mode 100644 restx-demo/pom.xml create mode 100644 restx-demo/src/main/java/restx/demo/AppModule.java create mode 100644 restx-demo/src/main/java/restx/demo/AppServer.java create mode 100644 restx-demo/src/main/java/restx/demo/Roles.java create mode 100644 restx-demo/src/main/java/restx/demo/domain/Message.java create mode 100644 restx-demo/src/main/java/restx/demo/rest/HelloResource.java create mode 100644 restx-demo/src/main/resources/logback.xml create mode 100644 restx-demo/src/main/resources/restx/demo/settings.properties create mode 100644 restx-demo/src/main/webapp/WEB-INF/web.xml create mode 100644 restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java create mode 100644 restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml diff --git a/pom.xml b/pom.xml index 0b5cd16ea0..10e23da0ad 100644 --- a/pom.xml +++ b/pom.xml @@ -1608,6 +1608,7 @@ persistence-modules/spring-data-elasticsearch core-java-concurrency core-java-concurrency-collections + restx-demo diff --git a/restx-demo/data/credentials.json b/restx-demo/data/credentials.json new file mode 100644 index 0000000000..c1a4fcf531 --- /dev/null +++ b/restx-demo/data/credentials.json @@ -0,0 +1,12 @@ +{ + "//": "lines with // keys are just comments (we don't have real comments in json)", + "//": "this file stores password passed through md5+bcrypt hash", + "//": "you can use `restx hash md5+bcrypt {password}` shell command to get hashed passwords to put here", + + "//": "to help startup with restx, there are comments with clear text passwords,", + "//": "which should obviously not be stored here.", + "user1": "$2a$10$iZluFUJShbjb1ue68bLrDuGCeJL9EMLHelVIf8u0SUbCseDOvKnoe", + "//": "user 1 password is 'user1-pwd'", + "user2": "$2a$10$oym3SYMFXf/9gGfDKKHO4eM1vWNqAZMsRZCL.BORCaP4yp5cdiCXu", + "//": "user 2 password is 'user2-pwd'" +} \ No newline at end of file diff --git a/restx-demo/data/users.json b/restx-demo/data/users.json new file mode 100644 index 0000000000..834e03c4b4 --- /dev/null +++ b/restx-demo/data/users.json @@ -0,0 +1,4 @@ +[ + {"name":"user1", "roles": ["hello"]}, + {"name":"user2", "roles": []} +] \ No newline at end of file diff --git a/restx-demo/md.restx.json b/restx-demo/md.restx.json new file mode 100644 index 0000000000..c87244001c --- /dev/null +++ b/restx-demo/md.restx.json @@ -0,0 +1,38 @@ +{ + "module": "restx-demo:restx-demo:0.1-SNAPSHOT", + "packaging": "war", + + "properties": { + "java.version": "1.8", + "restx.version": "0.35-rc4" + }, + "fragments": { + "maven": [ + "classpath:///restx/build/fragments/maven/javadoc-apidoclet.xml" ] + }, + "dependencies": { + "compile": [ + "io.restx:restx-core:${restx.version}", + "io.restx:restx-security-basic:${restx.version}", + "io.restx:restx-core-annotation-processor:${restx.version}", + "io.restx:restx-factory:${restx.version}", + "io.restx:restx-factory-admin:${restx.version}", + "io.restx:restx-validation:${restx.version}", + "io.restx:restx-monitor-codahale:${restx.version}", + "io.restx:restx-monitor-admin:${restx.version}", + "io.restx:restx-log-admin:${restx.version}", + "io.restx:restx-i18n-admin:${restx.version}", + "io.restx:restx-stats-admin:${restx.version}", + "io.restx:restx-servlet:${restx.version}", + "io.restx:restx-server-jetty8:${restx.version}!optional", + "io.restx:restx-apidocs:${restx.version}", + "io.restx:restx-specs-admin:${restx.version}", + "io.restx:restx-admin:${restx.version}", + "ch.qos.logback:logback-classic:1.0.13" + ], + "test": [ + "io.restx:restx-specs-tests:${restx.version}", + "junit:junit:4.11" + ] + } +} diff --git a/restx-demo/pom.xml b/restx-demo/pom.xml new file mode 100644 index 0000000000..da106b8191 --- /dev/null +++ b/restx-demo/pom.xml @@ -0,0 +1,156 @@ + + + 4.0.0 + + restx-demo + restx-demo + 0.1-SNAPSHOT + war + restx-demo + + + 1.8 + 1.8 + 0.35-rc4 + + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + io.restx + restx-core + ${restx.version} + + + io.restx + restx-security-basic + ${restx.version} + + + io.restx + restx-core-annotation-processor + ${restx.version} + + + io.restx + restx-factory + ${restx.version} + + + io.restx + restx-factory-admin + ${restx.version} + + + io.restx + restx-validation + ${restx.version} + + + io.restx + restx-monitor-codahale + ${restx.version} + + + io.restx + restx-monitor-admin + ${restx.version} + + + io.restx + restx-log-admin + ${restx.version} + + + io.restx + restx-i18n-admin + ${restx.version} + + + io.restx + restx-stats-admin + ${restx.version} + + + io.restx + restx-servlet + ${restx.version} + + + io.restx + restx-server-jetty8 + ${restx.version} + true + + + io.restx + restx-apidocs + ${restx.version} + + + io.restx + restx-specs-admin + ${restx.version} + + + io.restx + restx-admin + ${restx.version} + + + ch.qos.logback + logback-classic + 1.0.13 + + + io.restx + restx-specs-tests + ${restx.version} + test + + + junit + junit + 4.11 + test + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-docs + + prepare-package + + jar + + + + + ${maven.compiler.source} + restx.apidocs.doclet.ApidocsDoclet + + io.restx + restx-apidocs-doclet + ${restx.version} + + -restx-target-dir ${project.basedir}/target/classes + + + + + diff --git a/restx-demo/src/main/java/restx/demo/AppModule.java b/restx-demo/src/main/java/restx/demo/AppModule.java new file mode 100644 index 0000000000..26bc681481 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/AppModule.java @@ -0,0 +1,74 @@ +package restx.demo; + +import restx.config.ConfigLoader; +import restx.config.ConfigSupplier; +import restx.factory.Provides; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableSet; +import restx.security.*; +import restx.factory.Module; +import restx.factory.Provides; +import javax.inject.Named; + +import java.nio.file.Paths; + +@Module +public class AppModule { + @Provides + public SignatureKey signatureKey() { + return new SignatureKey("restx-demo -447494532235718370 restx-demo 801c9eaf-4116-48f2-906b-e979fba72757".getBytes(Charsets.UTF_8)); + } + + @Provides + @Named("restx.admin.password") + public String restxAdminPassword() { + return "4780"; + } + + @Provides + public ConfigSupplier appConfigSupplier(ConfigLoader configLoader) { + // Load settings.properties in restx.demo package as a set of config entries + return configLoader.fromResource("restx/demo/settings"); + } + + @Provides + public CredentialsStrategy credentialsStrategy() { + return new BCryptCredentialsStrategy(); + } + + @Provides + public BasicPrincipalAuthenticator basicPrincipalAuthenticator( + SecuritySettings securitySettings, CredentialsStrategy credentialsStrategy, + @Named("restx.admin.passwordHash") String defaultAdminPasswordHash, ObjectMapper mapper) { + return new StdBasicPrincipalAuthenticator(new StdUserService<>( + // use file based users repository. + // Developer's note: prefer another storage mechanism for your users if you need real user management + // and better perf + new FileBasedUserRepository<>( + StdUser.class, // this is the class for the User objects, that you can get in your app code + // with RestxSession.current().getPrincipal().get() + // it can be a custom user class, it just need to be json deserializable + mapper, + + // this is the default restx admin, useful to access the restx admin console. + // if one user with restx-admin role is defined in the repository, this default user won't be + // available anymore + new StdUser("admin", ImmutableSet.of("*")), + + // the path where users are stored + Paths.get("data/users.json"), + + // the path where credentials are stored. isolating both is a good practice in terms of security + // it is strongly recommended to follow this approach even if you use your own repository + Paths.get("data/credentials.json"), + + // tells that we want to reload the files dynamically if they are touched. + // this has a performance impact, if you know your users / credentials never change without a + // restart you can disable this to get better perfs + true), + credentialsStrategy, defaultAdminPasswordHash), + securitySettings); + } +} diff --git a/restx-demo/src/main/java/restx/demo/AppServer.java b/restx-demo/src/main/java/restx/demo/AppServer.java new file mode 100644 index 0000000000..d66aadac68 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/AppServer.java @@ -0,0 +1,32 @@ +package restx.demo; + +import com.google.common.base.Optional; +import restx.server.WebServer; +import restx.server.Jetty8WebServer; + +/** + * This class can be used to run the app. + * + * Alternatively, you can deploy the app as a war in a regular container like tomcat or jetty. + * + * Reading the port from system env PORT makes it compatible with heroku. + */ +public class AppServer { + public static final String WEB_INF_LOCATION = "src/main/webapp/WEB-INF/web.xml"; + public static final String WEB_APP_LOCATION = "src/main/webapp"; + + public static void main(String[] args) throws Exception { + int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("8080")); + WebServer server = new Jetty8WebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0"); + + /* + * load mode from system property if defined, or default to dev + * be careful with that setting, if you use this class to launch your server in production, make sure to launch + * it with -Drestx.mode=prod or change the default here + */ + System.setProperty("restx.mode", System.getProperty("restx.mode", "dev")); + System.setProperty("restx.app.package", "restx.demo"); + + server.startAndAwait(); + } +} diff --git a/restx-demo/src/main/java/restx/demo/Roles.java b/restx-demo/src/main/java/restx/demo/Roles.java new file mode 100644 index 0000000000..1240da70d1 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/Roles.java @@ -0,0 +1,10 @@ +package restx.demo; + +/** + * A list of roles for the application. + * + * We don't use an enum here because it must be used inside an annotation. + */ +public final class Roles { + public static final String HELLO_ROLE = "hello"; +} diff --git a/restx-demo/src/main/java/restx/demo/domain/Message.java b/restx-demo/src/main/java/restx/demo/domain/Message.java new file mode 100644 index 0000000000..733c00deff --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/domain/Message.java @@ -0,0 +1,21 @@ +package restx.demo.domain; + +public class Message { + private String message; + + public String getMessage() { + return message; + } + + public Message setMessage(final String message) { + this.message = message; + return this; + } + + @Override + public String toString() { + return "Message{" + + "message='" + message + '\'' + + '}'; + } +} diff --git a/restx-demo/src/main/java/restx/demo/rest/HelloResource.java b/restx-demo/src/main/java/restx/demo/rest/HelloResource.java new file mode 100644 index 0000000000..5cb2c2a5e6 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/rest/HelloResource.java @@ -0,0 +1,62 @@ +package restx.demo.rest; + +import restx.demo.domain.Message; +import restx.demo.Roles; +import org.joda.time.DateTime; +import restx.annotations.GET; +import restx.annotations.POST; +import restx.annotations.RestxResource; +import restx.factory.Component; +import restx.security.PermitAll; +import restx.security.RolesAllowed; +import restx.security.RestxSession; + +import javax.validation.constraints.NotNull; + +@Component @RestxResource +public class HelloResource { + + /** + * Say hello to currently logged in user. + * + * Authorized only for principals with Roles.HELLO_ROLE role. + * + * @return a Message to say hello + */ + @GET("/message") + @RolesAllowed(Roles.HELLO_ROLE) + public Message sayHello() { + return new Message().setMessage(String.format( + "hello %s, it's %s", + RestxSession.current().getPrincipal().get().getName(), + DateTime.now().toString("HH:mm:ss"))); + } + + /** + * Say hello to anybody. + * + * Does not require authentication. + * + * @return a Message to say hello + */ + @GET("/hello") + @PermitAll + public Message helloPublic(String who) { + return new Message().setMessage(String.format( + "hello %s, it's %s", + who, DateTime.now().toString("HH:mm:ss"))); + } + + public static class MyPOJO { + @NotNull + String value; + public String getValue(){ return value; } + public void setValue(String value){ this.value = value; } + } + @POST("/mypojo") + @PermitAll + public MyPOJO helloPojo(MyPOJO pojo){ + pojo.setValue("hello "+pojo.getValue()); + return pojo; + } +} diff --git a/restx-demo/src/main/resources/logback.xml b/restx-demo/src/main/resources/logback.xml new file mode 100644 index 0000000000..524bca6b1f --- /dev/null +++ b/restx-demo/src/main/resources/logback.xml @@ -0,0 +1,94 @@ + + + true + + + + + ${LOGS_FOLDER}/errors.log + + ERROR + + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + ${LOGS_FOLDER}/errors.%d.log + 30 + + + + + + + + ${LOGS_FOLDER}/app.log + + INFO + + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + ${LOGS_FOLDER}/app.%d.log + 10 + + + + ${LOGS_FOLDER}/debug.log + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + ${LOGS_FOLDER}/debug.%i.log.zip + 1 + 3 + + + + 50MB + + + + + + + + + + + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + + ${LOGS_FOLDER}/app.log + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/restx-demo/src/main/resources/restx/demo/settings.properties b/restx-demo/src/main/resources/restx/demo/settings.properties new file mode 100644 index 0000000000..a03c2eea97 --- /dev/null +++ b/restx-demo/src/main/resources/restx/demo/settings.properties @@ -0,0 +1 @@ +app.name=restx-demo \ No newline at end of file diff --git a/restx-demo/src/main/webapp/WEB-INF/web.xml b/restx-demo/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..c651794526 --- /dev/null +++ b/restx-demo/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,15 @@ + + + + restx + restx.servlet.RestxMainRouterServlet + 1 + + + restx + /api/* + + diff --git a/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java b/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java new file mode 100644 index 0000000000..138a22d074 --- /dev/null +++ b/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java @@ -0,0 +1,23 @@ +package restx.demo.rest; + +import restx.demo.AppServer; +import org.junit.runner.RunWith; +import restx.tests.RestxSpecTestsRunner; +import restx.tests.FindSpecsIn; + +@RunWith(RestxSpecTestsRunner.class) +@FindSpecsIn("specs/hello") +public class HelloResourceSpecTest { + + /** + * Useless, thanks to both @RunWith(RestxSpecTestsRunner.class) & @FindSpecsIn() + * + * @Rule + * public RestxSpecRule rule = new RestxSpecRule(); + * + * @Test + * public void test_spec() throws Exception { + * rule.runTest(specTestPath); + * } + */ +} diff --git a/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml new file mode 100644 index 0000000000..1b7b8f0f90 --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml @@ -0,0 +1,10 @@ +title: should admin say hello +given: + - time: 2013-08-28T01:18:00.822+02:00 + - uuids: [ "e2b4430f-9541-4602-9a3a-413d17c56a6b" ] +wts: + - when: | + GET message + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"admin","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + then: | + {"message":"hello admin, it's 01:18:00"} diff --git a/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml new file mode 100644 index 0000000000..29b6faca34 --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml @@ -0,0 +1,8 @@ +title: should admin say hello +given: + - time: 2013-08-28T01:18:00.822+02:00 +wts: + - when: | + GET hello?who=xavier + then: | + {"message":"hello xavier, it's 01:18:00"} diff --git a/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml new file mode 100644 index 0000000000..d0c6323caf --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml @@ -0,0 +1,17 @@ +title: should missing post value triggers a validation error +given: + - time: 2013-08-28T01:18:00.822+02:00 + - uuids: [ "e2b4430f-9541-4602-9a3a-413d17c56a6b" ] +wts: + - when: | + POST mypojo + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + {} + then: | + 400 + - when: | + POST mypojo + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + {"value":"world"} + then: | + {"value":"hello world"} diff --git a/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml new file mode 100644 index 0000000000..791a3a2776 --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml @@ -0,0 +1,10 @@ +title: should user1 say hello +given: + - time: 2013-08-28T01:18:00.822+02:00 + - uuids: [ "e2b4430f-9541-4602-9a3a-413d17c56a6b" ] +wts: + - when: | + GET message + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + then: | + {"message":"hello user1, it's 01:18:00"} diff --git a/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml new file mode 100644 index 0000000000..ead5af8d0c --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml @@ -0,0 +1,10 @@ +title: should user2 not say hello +given: + - time: 2013-08-28T01:19:44.770+02:00 + - uuids: [ "56f71fcc-42d3-422f-9458-8ad37fc4a0b5" ] +wts: + - when: | + GET message + $RestxSession: {"_expires":"2013-09-27T01:19:44.770+02:00","principal":"user2","sessionKey":"56f71fcc-42d3-422f-9458-8ad37fc4a0b5"} + then: | + 403 From be22bd209b1d350505905945af2ef8b91f0547c6 Mon Sep 17 00:00:00 2001 From: rozagerardo Date: Sun, 28 Oct 2018 16:04:31 -0300 Subject: [PATCH 243/546] [BAEL-2111] guest | Why SLF4J? 10 Reasons to use it (#5536) * Added new submodule for SLF4J guest post, containg modules for logback, log4j and log4j2 * * added tests for logging endpoints * removed application tests, no use now that we have other tests --- guest/slf4j/guide/pom.xml | 64 +++++++ guest/slf4j/guide/slf4j-log4j/.gitignore | 25 +++ guest/slf4j/guide/slf4j-log4j/pom.xml | 41 +++++ .../com/stackify/slf4j/guide/Application.java | 12 ++ .../guide/controllers/SimpleController.java | 42 +++++ .../src/main/resources/application.properties | 0 .../slf4j-log4j/src/main/resources/log4j.xml | 17 ++ .../SimpleControllerIntegrationTest.java | 80 +++++++++ .../slf4j/guide/utils/ListAppender.java | 33 ++++ .../slf4j-log4j/src/test/resources/log4j.xml | 16 ++ guest/slf4j/guide/slf4j-log4j2/.gitignore | 25 +++ guest/slf4j/guide/slf4j-log4j2/pom.xml | 54 ++++++ .../com/stackify/slf4j/guide/Application.java | 12 ++ .../guide/controllers/SimpleController.java | 42 +++++ .../src/main/resources/application.properties | 0 .../src/main/resources/log4j2-spring.xml | 28 +++ .../SimpleControllerIntegrationTest.java | 81 +++++++++ .../src/test/resources/log4j2-test.xml | 18 ++ guest/slf4j/guide/slf4j-logback/.gitignore | 25 +++ guest/slf4j/guide/slf4j-logback/pom.xml | 32 ++++ .../com/stackify/slf4j/guide/Application.java | 12 ++ .../guide/controllers/SimpleController.java | 133 ++++++++++++++ .../stackify/slf4j/guide/l10n/Messages.java | 11 ++ .../guide/xlogger/XLoggerController.java | 28 +++ .../src/main/resources/application.properties | 0 .../src/main/resources/logback-spring.xml | 11 ++ .../main/resources/messages_en_US.properties | 3 + .../main/resources/messages_es_ES.properties | 3 + .../SimpleControllerIntegrationTest.java | 163 ++++++++++++++++++ .../slf4j/guide/utils/ListAppender.java | 25 +++ .../src/test/resources/logback-test.xml | 8 + 31 files changed, 1044 insertions(+) create mode 100644 guest/slf4j/guide/pom.xml create mode 100644 guest/slf4j/guide/slf4j-log4j/.gitignore create mode 100644 guest/slf4j/guide/slf4j-log4j/pom.xml create mode 100644 guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/Application.java create mode 100644 guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java create mode 100644 guest/slf4j/guide/slf4j-log4j/src/main/resources/application.properties create mode 100644 guest/slf4j/guide/slf4j-log4j/src/main/resources/log4j.xml create mode 100644 guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java create mode 100644 guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java create mode 100644 guest/slf4j/guide/slf4j-log4j/src/test/resources/log4j.xml create mode 100644 guest/slf4j/guide/slf4j-log4j2/.gitignore create mode 100644 guest/slf4j/guide/slf4j-log4j2/pom.xml create mode 100644 guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/Application.java create mode 100644 guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java create mode 100644 guest/slf4j/guide/slf4j-log4j2/src/main/resources/application.properties create mode 100644 guest/slf4j/guide/slf4j-log4j2/src/main/resources/log4j2-spring.xml create mode 100644 guest/slf4j/guide/slf4j-log4j2/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java create mode 100644 guest/slf4j/guide/slf4j-log4j2/src/test/resources/log4j2-test.xml create mode 100644 guest/slf4j/guide/slf4j-logback/.gitignore create mode 100644 guest/slf4j/guide/slf4j-logback/pom.xml create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/Application.java create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/l10n/Messages.java create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/xlogger/XLoggerController.java create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/resources/application.properties create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/resources/logback-spring.xml create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/resources/messages_en_US.properties create mode 100644 guest/slf4j/guide/slf4j-logback/src/main/resources/messages_es_ES.properties create mode 100644 guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java create mode 100644 guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java create mode 100644 guest/slf4j/guide/slf4j-logback/src/test/resources/logback-test.xml diff --git a/guest/slf4j/guide/pom.xml b/guest/slf4j/guide/pom.xml new file mode 100644 index 0000000000..0db9b46247 --- /dev/null +++ b/guest/slf4j/guide/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + com.stackify.slf4j.guide + slf4j-parent-module + 1.0.0-SNAPSHOT + pom + + + + org.springframework.boot + spring-boot-starter-parent + 2.0.6.RELEASE + + + + slf4j-logback + slf4j-log4j2 + slf4j-log4j + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito2 + ${powermock.version} + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + UTF-8 + UTF-8 + 1.8 + 2.0.0-beta.5 + + diff --git a/guest/slf4j/guide/slf4j-log4j/.gitignore b/guest/slf4j/guide/slf4j-log4j/.gitignore new file mode 100644 index 0000000000..82eca336e3 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/.gitignore @@ -0,0 +1,25 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-log4j/pom.xml b/guest/slf4j/guide/slf4j-log4j/pom.xml new file mode 100644 index 0000000000..0d08fa6191 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + slf4j-log4j + 0.0.1-SNAPSHOT + jar + + + com.stackify.slf4j.guide + slf4j-parent-module + 1.0.0-SNAPSHOT + .. + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-logging + + + + + org.slf4j + slf4j-log4j12 + + + org.springframework.boot + spring-boot-starter-test + test + + + + 1.7.25 + + diff --git a/guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/Application.java b/guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/Application.java new file mode 100644 index 0000000000..01ccf519b3 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/Application.java @@ -0,0 +1,12 @@ +package com.stackify.slf4j.guide; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java b/guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java new file mode 100644 index 0000000000..14f4439545 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java @@ -0,0 +1,42 @@ +package com.stackify.slf4j.guide.controllers; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class SimpleController { + + Logger logger = LoggerFactory.getLogger(SimpleController.class); + + @GetMapping("/slf4j-guide-request") + public String processList(List list) { + logger.info("Client requested process the following list: {}", list); + try { + logger.debug("Starting process"); + // ...processing list here... + Thread.sleep(500); + } catch (RuntimeException | InterruptedException e) { + logger.error("There was an issue processing the list.", e); + } finally { + logger.info("Finished processing"); + } + return "done"; + } + + @GetMapping("/slf4j-guide-mdc-request") + public String clientMDCRequest(@RequestHeader String clientId) throws InterruptedException { + MDC.put("clientId", clientId); + logger.info("Client {} has made a request", clientId); + logger.info("Starting request"); + Thread.sleep(500); + logger.info("Finished request"); + MDC.clear(); + return "finished"; + } +} diff --git a/guest/slf4j/guide/slf4j-log4j/src/main/resources/application.properties b/guest/slf4j/guide/slf4j-log4j/src/main/resources/application.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/guest/slf4j/guide/slf4j-log4j/src/main/resources/log4j.xml b/guest/slf4j/guide/slf4j-log4j/src/main/resources/log4j.xml new file mode 100644 index 0000000000..ea432bff77 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/src/main/resources/log4j.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java b/guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java new file mode 100644 index 0000000000..991a1e2686 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java @@ -0,0 +1,80 @@ +package com.stackify.slf4j.guide.controllers; + +import static org.powermock.api.mockito.PowerMockito.doNothing; +import static org.powermock.api.mockito.PowerMockito.spy; + +import java.util.Collections; + +import org.apache.log4j.Level; +import org.apache.log4j.spi.LoggingEvent; +import org.assertj.core.api.Condition; +import org.assertj.core.api.SoftAssertions; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; +import org.slf4j.MDC; + +import com.stackify.slf4j.guide.utils.ListAppender; + +@RunWith(PowerMockRunner.class) +@PrepareForTest(MDC.class) +public class SimpleControllerIntegrationTest { + + private SimpleController controller = new SimpleController(); + + @Before + public void clearLogList() { + ListAppender.clearEventList(); + } + + @Test + public void whenSimpleRequestMade_thenAllRegularMessagesLogged() { + String output = controller.processList(Collections.emptyList()); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .haveAtLeastOne(eventContains("Client requested process the following list: []", Level.INFO)) + .haveAtLeastOne(eventContains("Starting process", Level.DEBUG)) + .haveAtLeastOne(eventContains("Finished processing", Level.INFO)) + .haveExactly(0, eventOfLevel(Level.ERROR)); + errorCollector.assertThat(output) + .isEqualTo("done"); + errorCollector.assertAll(); + } + + @Test + public void givenClientId_whenMDCRequestMade_thenMessagesWithClientIdLogged() throws Exception { + // We avoid cleaning the context so tht we can check it afterwards + spy(MDC.class); + doNothing().when(MDC.class); + MDC.clear(); + String clientId = "id-1234"; + + String output = controller.clientMDCRequest(clientId); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .allMatch(entry -> { + return clientId.equals(entry.getMDC("clientId")); + }) + .haveAtLeastOne(eventContains("Client id-1234 has made a request", Level.INFO)) + .haveAtLeastOne(eventContains("Starting request", Level.INFO)) + .haveAtLeastOne(eventContains("Finished request", Level.INFO)); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + + } + + private Condition eventOfLevel(Level level) { + return eventContains(null, level); + } + + private Condition eventContains(String substring, Level level) { + + return new Condition(entry -> (substring == null || (entry.getRenderedMessage() != null && entry.getRenderedMessage() + .contains(substring))) && (level == null || level.equals(entry.getLevel())), String.format("entry with message '%s', level %s", substring, level)); + } +} diff --git a/guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java b/guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java new file mode 100644 index 0000000000..4ce9e73d6d --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java @@ -0,0 +1,33 @@ +package com.stackify.slf4j.guide.utils; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.log4j.AppenderSkeleton; +import org.apache.log4j.spi.LoggingEvent; + +public class ListAppender extends AppenderSkeleton { + public static List events = new ArrayList(); + + @Override + public void close() { + } + + @Override + public boolean requiresLayout() { + return false; + } + + @Override + protected void append(LoggingEvent event) { + events.add(event); + } + + public static List getEvents() { + return events; + } + + public static void clearEventList() { + events.clear(); + } +} diff --git a/guest/slf4j/guide/slf4j-log4j/src/test/resources/log4j.xml b/guest/slf4j/guide/slf4j-log4j/src/test/resources/log4j.xml new file mode 100644 index 0000000000..10443e5eab --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j/src/test/resources/log4j.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-log4j2/.gitignore b/guest/slf4j/guide/slf4j-log4j2/.gitignore new file mode 100644 index 0000000000..82eca336e3 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j2/.gitignore @@ -0,0 +1,25 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-log4j2/pom.xml b/guest/slf4j/guide/slf4j-log4j2/pom.xml new file mode 100644 index 0000000000..643649335f --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j2/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + slf4j-log4j2 + 0.0.1-SNAPSHOT + jar + + + com.stackify.slf4j.guide + slf4j-parent-module + 1.0.0-SNAPSHOT + .. + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-logging + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + test-jar + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + test-jar + + + + + 2.11.0 + + diff --git a/guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/Application.java b/guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/Application.java new file mode 100644 index 0000000000..01ccf519b3 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/Application.java @@ -0,0 +1,12 @@ +package com.stackify.slf4j.guide; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java b/guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java new file mode 100644 index 0000000000..14f4439545 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j2/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java @@ -0,0 +1,42 @@ +package com.stackify.slf4j.guide.controllers; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class SimpleController { + + Logger logger = LoggerFactory.getLogger(SimpleController.class); + + @GetMapping("/slf4j-guide-request") + public String processList(List list) { + logger.info("Client requested process the following list: {}", list); + try { + logger.debug("Starting process"); + // ...processing list here... + Thread.sleep(500); + } catch (RuntimeException | InterruptedException e) { + logger.error("There was an issue processing the list.", e); + } finally { + logger.info("Finished processing"); + } + return "done"; + } + + @GetMapping("/slf4j-guide-mdc-request") + public String clientMDCRequest(@RequestHeader String clientId) throws InterruptedException { + MDC.put("clientId", clientId); + logger.info("Client {} has made a request", clientId); + logger.info("Starting request"); + Thread.sleep(500); + logger.info("Finished request"); + MDC.clear(); + return "finished"; + } +} diff --git a/guest/slf4j/guide/slf4j-log4j2/src/main/resources/application.properties b/guest/slf4j/guide/slf4j-log4j2/src/main/resources/application.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/guest/slf4j/guide/slf4j-log4j2/src/main/resources/log4j2-spring.xml b/guest/slf4j/guide/slf4j-log4j2/src/main/resources/log4j2-spring.xml new file mode 100644 index 0000000000..7d1494c7a6 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j2/src/main/resources/log4j2-spring.xml @@ -0,0 +1,28 @@ + + + ???? + %5p + yyyy-MM-dd HH:mm:ss.SSS + %clr{%d{${LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${LOG_LEVEL_PATTERN}} %clr{${sys:PID}}{magenta} + %clr{---}{faint} %clr{%X{clientId}}{red}%clr{@%15.15t}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-log4j2/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java b/guest/slf4j/guide/slf4j-log4j2/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java new file mode 100644 index 0000000000..f41c857533 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j2/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java @@ -0,0 +1,81 @@ +package com.stackify.slf4j.guide.controllers; + +import java.util.Collections; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.test.appender.ListAppender; +import org.assertj.core.api.Condition; +import org.assertj.core.api.SoftAssertions; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; + +public class SimpleControllerIntegrationTest { + + private static ListAppender appender; + private SimpleController controller = new SimpleController(); + + @ClassRule + public static LoggerContextRule init = new LoggerContextRule("log4j2-test.xml"); + + @BeforeClass + public static void setupLogging() { + appender = init.getListAppender("ListAppender"); + } + + @Before + public void clearAppender() { + appender.clear(); + } + + @Test + public void whenSimpleRequestMade_thenAllRegularMessagesLogged() { + String output = controller.processList(Collections.emptyList()); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(appender.getEvents()) + .haveAtLeastOne(eventContains("Client requested process the following list: []", Level.INFO)) + .haveAtLeastOne(eventContains("Starting process", Level.DEBUG)) + .haveAtLeastOne(eventContains("Finished processing", Level.INFO)) + .haveExactly(0, eventOfLevel(Level.ERROR)); + errorCollector.assertThat(output) + .isEqualTo("done"); + errorCollector.assertAll(); + } + + @Test + public void givenClientId_whenMDCRequestMade_thenMessagesWithClientIdLogged() throws Exception { + String clientId = "id-1234"; + + String output = controller.clientMDCRequest(clientId); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(appender.getEvents()) + .allMatch(entry -> { + return clientId.equals(entry.getContextData() + .getValue("clientId")); + }) + .haveAtLeastOne(eventContains("Client id-1234 has made a request", Level.INFO)) + .haveAtLeastOne(eventContains("Starting request", Level.INFO)) + .haveAtLeastOne(eventContains("Finished request", Level.INFO)); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + } + + private Condition eventOfLevel(Level level) { + return eventContains(null, level); + } + + private Condition eventContains(String substring, Level level) { + + return new Condition(entry -> (substring == null || (entry.getMessage() + .getFormattedMessage() != null && entry.getMessage() + .getFormattedMessage() + .contains(substring))) + && (level == null || level.equals(entry.getLevel())), String.format("entry with message '%s', level %s", substring, level)); + } +} diff --git a/guest/slf4j/guide/slf4j-log4j2/src/test/resources/log4j2-test.xml b/guest/slf4j/guide/slf4j-log4j2/src/test/resources/log4j2-test.xml new file mode 100644 index 0000000000..2ca386f7f6 --- /dev/null +++ b/guest/slf4j/guide/slf4j-log4j2/src/test/resources/log4j2-test.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-logback/.gitignore b/guest/slf4j/guide/slf4j-logback/.gitignore new file mode 100644 index 0000000000..82eca336e3 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/.gitignore @@ -0,0 +1,25 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-logback/pom.xml b/guest/slf4j/guide/slf4j-logback/pom.xml new file mode 100644 index 0000000000..e8aebf0ef6 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + slf4j-logback + 0.0.1-SNAPSHOT + jar + + + com.stackify.slf4j.guide + slf4j-parent-module + 1.0.0-SNAPSHOT + .. + + + + + org.slf4j + slf4j-ext + + + ch.qos.cal10n + cal10n-api + ${cal10n.version} + + + + + 0.8.1 + + diff --git a/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/Application.java b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/Application.java new file mode 100644 index 0000000000..01ccf519b3 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/Application.java @@ -0,0 +1,12 @@ +package com.stackify.slf4j.guide; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java new file mode 100644 index 0000000000..1fab675c94 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/controllers/SimpleController.java @@ -0,0 +1,133 @@ +package com.stackify.slf4j.guide.controllers; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; +import org.slf4j.cal10n.LocLogger; +import org.slf4j.cal10n.LocLoggerFactory; +import org.slf4j.ext.EventData; +import org.slf4j.ext.EventLogger; +import org.slf4j.profiler.Profiler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.stackify.slf4j.guide.l10n.Messages; + +import ch.qos.cal10n.IMessageConveyor; +import ch.qos.cal10n.MessageConveyor; + +@RestController +public class SimpleController { + + Logger logger = LoggerFactory.getLogger(SimpleController.class); + + @GetMapping("/slf4j-guide-request") + public String processList(List list) { + logger.info("Client requested process the following list: {}", list); + try { + logger.debug("Starting process"); + // ...processing list here... + Thread.sleep(500); + } catch (RuntimeException | InterruptedException e) { + logger.error("There was an issue processing the list.", e); + } finally { + logger.info("Finished processing"); + } + return "done"; + } + + @GetMapping("/slf4j-guide-mdc-request") + public String clientMDCRequest(@RequestHeader String clientId) throws InterruptedException { + MDC.put("clientId", clientId); + logger.info("Client {} has made a request", clientId); + logger.info("Starting request"); + Thread.sleep(500); + logger.info("Finished request"); + MDC.clear(); + return "finished"; + } + + @GetMapping("/slf4j-guide-marker-request") + public String clientMarkerRequest() throws InterruptedException { + logger.info("client has made a request"); + Marker myMarker = MarkerFactory.getMarker("MYMARKER"); + logger.info(myMarker, "Starting request"); + Thread.sleep(500); + logger.debug(myMarker, "Finished request"); + return "finished"; + } + + @GetMapping("/slf4j-guide-profiler-request") + public String clientProfilerRequest() { + logger.info("client has made a request"); + Profiler myProfiler = new Profiler("MYPROFILER"); + // Associate the logger to handle the output( for testing purposes here) + myProfiler.setLogger(logger); + + myProfiler.start("List generation process"); + List list = generateList(); + + myProfiler.start("List sorting process"); + Collections.sort(list); + + // Use the log() method instead of print() to use the logger (for testing purposes here) + myProfiler.stop() + .log(); + return "finished"; + } + + private List generateList() { + List generated = new ArrayList<>(); + for (int i = 0; i < 5000; i++) { + generated.add(ThreadLocalRandom.current() + .nextInt(2000)); + } + return generated; + } + + @GetMapping("/slf4j-guide-event-request") + public String clientEventRequest(@RequestParam("sender") String sender, @RequestParam("receiver") String receiver) { + logger.info("sending from {} to {}", sender, receiver); + + // ...sending process... + + EventData data = new EventData(); + data.setEventDateTime(new Date()); + data.setEventType("sending"); + String confirm = UUID.randomUUID() + .toString(); + data.setEventId(confirm); + data.put("from", sender); + data.put("to", receiver); + EventLogger.logEvent(data); + + return "finished"; + } + + @GetMapping("/slf4j-guide-locale-request") + public String clientLocaleRequest(@RequestHeader("Accept-Language") String localeHeader) { + List list = Locale.LanguageRange.parse(localeHeader); + Locale locale = Locale.lookup(list, Arrays.asList(Locale.getAvailableLocales())); + IMessageConveyor messageConveyor = new MessageConveyor(locale); + LocLoggerFactory llFactory = new LocLoggerFactory(messageConveyor); + LocLogger locLogger = llFactory.getLocLogger(this.getClass()); + locLogger.info(Messages.CLIENT_REQUEST, "parametrizedClientId", localeHeader); + locLogger.debug(Messages.REQUEST_STARTED); + locLogger.info(Messages.REQUEST_FINISHED); + return "finished"; + } + +} diff --git a/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/l10n/Messages.java b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/l10n/Messages.java new file mode 100644 index 0000000000..e4aacaf3be --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/l10n/Messages.java @@ -0,0 +1,11 @@ +package com.stackify.slf4j.guide.l10n; + +import ch.qos.cal10n.BaseName; +import ch.qos.cal10n.Locale; +import ch.qos.cal10n.LocaleData; + +@BaseName("messages") +@LocaleData({ @Locale("en_US"), @Locale("es_ES") }) +public enum Messages { + CLIENT_REQUEST, REQUEST_STARTED, REQUEST_FINISHED +} diff --git a/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/xlogger/XLoggerController.java b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/xlogger/XLoggerController.java new file mode 100644 index 0000000000..8690c0ebc9 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/main/java/com/stackify/slf4j/guide/xlogger/XLoggerController.java @@ -0,0 +1,28 @@ +package com.stackify.slf4j.guide.xlogger; + +import org.slf4j.ext.XLogger; +import org.slf4j.ext.XLoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class XLoggerController { + + private XLogger logger = XLoggerFactory.getXLogger(XLoggerController.class); + + @GetMapping("/slf4j-guide-xlogger-request") + public Integer clientXLoggerRequest(@RequestParam("queryParam") Integer queryParam) { + logger.info("Starting process"); + logger.entry(queryParam); + Integer rest = 0; + try { + rest = queryParam % 3; + } catch (RuntimeException anyException) { + logger.catching(anyException); + } + logger.exit(rest); + return rest; + } + +} diff --git a/guest/slf4j/guide/slf4j-logback/src/main/resources/application.properties b/guest/slf4j/guide/slf4j-logback/src/main/resources/application.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/guest/slf4j/guide/slf4j-logback/src/main/resources/logback-spring.xml b/guest/slf4j/guide/slf4j-logback/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..112e79c340 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/main/resources/logback-spring.xml @@ -0,0 +1,11 @@ + + + + + %marker %d{yyyy-MM-dd HH:mm:ss.SSS} -%5p %X{clientId}@%15.15t %-40.40logger{39} : %m%n + + + + + + \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-logback/src/main/resources/messages_en_US.properties b/guest/slf4j/guide/slf4j-logback/src/main/resources/messages_en_US.properties new file mode 100644 index 0000000000..a35dd60da3 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/main/resources/messages_en_US.properties @@ -0,0 +1,3 @@ +CLIENT_REQUEST=Client {0} has made a request using locale {1} +REQUEST_STARTED=Request started +REQUEST_FINISHED=Request finished \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-logback/src/main/resources/messages_es_ES.properties b/guest/slf4j/guide/slf4j-logback/src/main/resources/messages_es_ES.properties new file mode 100644 index 0000000000..6cdab09236 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/main/resources/messages_es_ES.properties @@ -0,0 +1,3 @@ +CLIENT_REQUEST=El cliente {0} ha realizado una solicitud usando locale {1} +REQUEST_STARTED=Solicitud iniciada +REQUEST_FINISHED=Solicitud finalizada \ No newline at end of file diff --git a/guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java b/guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java new file mode 100644 index 0000000000..b870cc9ebd --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/controllers/SimpleControllerIntegrationTest.java @@ -0,0 +1,163 @@ +package com.stackify.slf4j.guide.controllers; + +import static org.powermock.api.mockito.PowerMockito.doNothing; +import static org.powermock.api.mockito.PowerMockito.spy; + +import java.util.Collections; + +import org.assertj.core.api.Condition; +import org.assertj.core.api.SoftAssertions; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; +import org.slf4j.MDC; + +import com.stackify.slf4j.guide.utils.ListAppender; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; + +@RunWith(PowerMockRunner.class) +@PrepareForTest(MDC.class) +public class SimpleControllerIntegrationTest { + + SimpleController controller = new SimpleController(); + + @Before + public void clearLogList() { + ListAppender.clearEventList(); + } + + @Test + public void whenSimpleRequestMade_thenAllRegularMessagesLogged() { + String output = controller.processList(Collections.emptyList()); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .haveAtLeastOne(eventContains("Client requested process the following list: []", Level.INFO)) + .haveAtLeastOne(eventContains("Starting process", Level.DEBUG)) + .haveAtLeastOne(eventContains("Finished processing", Level.INFO)) + .haveExactly(0, eventOfLevel(Level.ERROR)); + errorCollector.assertThat(output) + .isEqualTo("done"); + errorCollector.assertAll(); + } + + @Test + public void givenClientId_whenMDCRequestMade_thenMessagesWithClientIdLogged() throws Exception { + // We avoid cleaning the context so tht we can check it afterwards + spy(MDC.class); + doNothing().when(MDC.class); + MDC.clear(); + String clientId = "id-1234"; + + String output = controller.clientMDCRequest(clientId); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .allMatch(entry -> { + return clientId.equals(entry.getMDCPropertyMap() + .get("clientId")); + }) + .haveAtLeastOne(eventContains("Client id-1234 has made a request", Level.INFO)) + .haveAtLeastOne(eventContains("Starting request", Level.INFO)) + .haveAtLeastOne(eventContains("Finished request", Level.INFO)); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + } + + @Test + public void whenMarkerRequestMade_thenMessagesWithMarkerLogged() throws Exception { + String output = controller.clientMarkerRequest(); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .haveAtLeastOne(eventContains("client has made a request", Level.INFO)) + .haveAtLeastOne(eventContains("Starting request", Level.INFO, "MYMARKER")) + .haveAtLeastOne(eventContains("Finished request", Level.DEBUG, "MYMARKER")) + .haveExactly(2, eventContains(null, null, "MYMARKER")); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + } + + @Test + public void whenProfilerRequestMade_thenMessagesWithPerformanceLogged() throws Exception { + String output = controller.clientProfilerRequest(); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .haveAtLeastOne(eventContains("client has made a request", Level.INFO)) + .haveAtLeastOne(eventContains("Profiler [MYPROFILER]", Level.DEBUG)); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + } + + @Test + public void whenEventRequestMade_thenMessagesWithEventLogged() throws Exception { + String sender = "sender"; + String receiver = "receiver"; + String output = controller.clientEventRequest(sender, receiver); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .haveAtLeastOne(eventContains("sending from sender to receiver", Level.INFO)) + .haveAtLeastOne(eventContains("", Level.INFO)) + .haveAtLeastOne(eventContains("sender", Level.INFO)) + .haveAtLeastOne(eventContains("receiver", Level.INFO)); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + } + + @Test + public void givenESLocale_whenLocaleRequestMade_thenMessagesWithEventLogged() throws Exception { + String locale = "es-ES"; + String output = controller.clientLocaleRequest(locale); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .haveAtLeastOne(eventContains("El cliente parametrizedClientId ha realizado una solicitud usando locale es-ES", Level.INFO)) + .haveAtLeastOne(eventContains("Solicitud iniciada", Level.DEBUG)) + .haveAtLeastOne(eventContains("Solicitud finalizada", Level.INFO)); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + } + + @Test + public void givenENLocale_whenLocaleRequestMade_thenMessagesWithEventLogged() throws Exception { + String locale = "en-US"; + String output = controller.clientLocaleRequest(locale); + + SoftAssertions errorCollector = new SoftAssertions(); + errorCollector.assertThat(ListAppender.getEvents()) + .haveAtLeastOne(eventContains("Client parametrizedClientId has made a request using locale en-US", Level.INFO)) + .haveAtLeastOne(eventContains("Request started", Level.DEBUG)) + .haveAtLeastOne(eventContains("Request finished", Level.INFO)); + errorCollector.assertThat(output) + .isEqualTo("finished"); + errorCollector.assertAll(); + } + + private Condition eventContains(String substring, Level level) { + return eventContains(substring, level, null); + } + + private Condition eventOfLevel(Level level) { + return eventContains(null, level, null); + } + + private Condition eventContains(String substring, Level level, String markerName) { + + return new Condition(entry -> (substring == null || (entry.getFormattedMessage() != null && entry.getFormattedMessage() + .contains(substring))) && (level == null || level.equals(entry.getLevel())) && (markerName == null || (entry.getMarker() != null + && markerName.equals(entry.getMarker() + .getName()))), + String.format("entry with message '%s', level %s and marker %s", substring, level, markerName)); + } +} diff --git a/guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java b/guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java new file mode 100644 index 0000000000..e6d4e47fb2 --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/test/java/com/stackify/slf4j/guide/utils/ListAppender.java @@ -0,0 +1,25 @@ +package com.stackify.slf4j.guide.utils; + +import java.util.ArrayList; +import java.util.List; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; + +public class ListAppender extends AppenderBase { + + static private List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + events.add(eventObject); + } + + public static List getEvents() { + return events; + } + + public static void clearEventList() { + events.clear(); + } +} diff --git a/guest/slf4j/guide/slf4j-logback/src/test/resources/logback-test.xml b/guest/slf4j/guide/slf4j-logback/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..90168a0fea --- /dev/null +++ b/guest/slf4j/guide/slf4j-logback/src/test/resources/logback-test.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 6f982273259a517dc320a68427d58d0340228ff5 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Sun, 28 Oct 2018 12:18:41 -0700 Subject: [PATCH 244/546] Update README.md (#5564) --- core-kotlin/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-kotlin/README.md b/core-kotlin/README.md index ed6894c2c1..ab9e96c2e1 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -41,3 +41,4 @@ - [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings) - [Kotlin return, break, continue Keywords](https://www.baeldung.com/kotlin-return-break-continue) - [Mapping of Data Objects in Kotlin](https://www.baeldung.com/kotlin-data-objects-mapping) +- [Initializing Arrays in Kotlin](https://www.baeldung.com/kotlin-initialize-array) From 8037776d9d73e54a3ee0254ffeb20689b56a5a55 Mon Sep 17 00:00:00 2001 From: Markus Gulden Date: Sun, 28 Oct 2018 20:53:10 +0100 Subject: [PATCH 245/546] BAEL-1658 --- .../connect-file-sink.properties | 20 +++++ .../connect-file-source.properties | 20 +++++ .../connect-standalone.properties | 44 ++++++++++ .../connect-distributed.properties | 88 +++++++++++++++++++ .../02_Distributed/connect-file-sink.json | 9 ++ .../02_Distributed/connect-file-source.json | 9 ++ .../connect-distributed.properties | 88 +++++++++++++++++++ .../connect-file-source-transform.json | 15 ++++ .../04_Custom/connect-distributed.properties | 88 +++++++++++++++++++ .../04_Custom/connect-mongodb-sink.json | 22 +++++ .../04_Custom/connect-mqtt-source.json | 11 +++ 11 files changed, 414 insertions(+) create mode 100644 libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties create mode 100644 libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties create mode 100644 libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties create mode 100644 libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties create mode 100644 libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json create mode 100644 libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json create mode 100644 libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties create mode 100644 libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json create mode 100644 libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties create mode 100644 libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json create mode 100644 libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json diff --git a/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties new file mode 100644 index 0000000000..594ccc6e95 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name=local-file-sink +connector.class=FileStreamSink +tasks.max=1 +file=test.sink.txt +topics=connect-test \ No newline at end of file diff --git a/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties new file mode 100644 index 0000000000..599cf4cb2a --- /dev/null +++ b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name=local-file-source +connector.class=FileStreamSource +tasks.max=1 +file=test.txt +topic=connect-test \ No newline at end of file diff --git a/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties new file mode 100644 index 0000000000..a2369fa144 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# These are defaults. This file just demonstrates how to override some settings. +bootstrap.servers=localhost:9092 + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=false +value.converter.schemas.enable=false + +offset.storage.file.filename=/tmp/connect.offsets +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Note: symlinks will be followed to discover dependencies or plugins. +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=C:\Software\confluent-5.0.0\share\java +#plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties b/libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties new file mode 100644 index 0000000000..5b91baddbd --- /dev/null +++ b/libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties @@ -0,0 +1,88 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended +# to be used with the examples, and some settings may differ from those used in a production system, especially +# the `bootstrap.servers` and those specifying replication factors. + +# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. +bootstrap.servers=localhost:9092 + +# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs +group.id=connect-cluster + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=true +value.converter.schemas.enable=true + +# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +offset.storage.topic=connect-offsets +offset.storage.replication.factor=1 +#offset.storage.partitions=25 + +# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated, +# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +config.storage.topic=connect-configs +config.storage.replication.factor=1 + +# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +status.storage.topic=connect-status +status.storage.replication.factor=1 +#status.storage.partitions=5 + +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# These are provided to inform the user about the presence of the REST host and port configs +# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests. +#rest.host.name= +#rest.port=8083 + +# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers. +#rest.advertised.host.name= +#rest.advertised.port= + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json new file mode 100644 index 0000000000..8902ecce52 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json @@ -0,0 +1,9 @@ +{ + "name": "local-file-sink", + "config": { + "connector.class": "FileStreamSink", + "tasks.max": 1, + "file": "test-distributed.sink.txt", + "topics": "connect-distributed" + } +} diff --git a/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json new file mode 100644 index 0000000000..77e949c91b --- /dev/null +++ b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json @@ -0,0 +1,9 @@ +{ + "name": "local-file-source", + "config": { + "connector.class": "FileStreamSource", + "tasks.max": 1, + "file": "test-distributed.txt", + "topic": "connect-distributed" + } +} diff --git a/libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties b/libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties new file mode 100644 index 0000000000..fa63be24b8 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties @@ -0,0 +1,88 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended +# to be used with the examples, and some settings may differ from those used in a production system, especially +# the `bootstrap.servers` and those specifying replication factors. + +# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. +bootstrap.servers=localhost:9092 + +# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs +group.id=connect-cluster + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=false +value.converter.schemas.enable=false + +# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +offset.storage.topic=connect-offsets +offset.storage.replication.factor=1 +#offset.storage.partitions=25 + +# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated, +# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +config.storage.topic=connect-configs +config.storage.replication.factor=1 + +# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +status.storage.topic=connect-status +status.storage.replication.factor=1 +#status.storage.partitions=5 + +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# These are provided to inform the user about the presence of the REST host and port configs +# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests. +#rest.host.name= +#rest.port=8083 + +# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers. +#rest.advertised.host.name= +#rest.advertised.port= + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json b/libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json new file mode 100644 index 0000000000..e5e21a0608 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json @@ -0,0 +1,15 @@ +{ + "name": "local-file-source", + "config": { + "connector.class": "FileStreamSource", + "tasks.max": 1, + "file": "transformation.txt", + "topic": "connect-transformation", + "transforms": "MakeMap,InsertSource", + "transforms.MakeMap.type": "org.apache.kafka.connect.transforms.HoistField$Value", + "transforms.MakeMap.field": "line", + "transforms.InsertSource.type": "org.apache.kafka.connect.transforms.InsertField$Value", + "transforms.InsertSource.static.field": "data_source", + "transforms.InsertSource.static.value": "test-file-source" + } +} diff --git a/libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties b/libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties new file mode 100644 index 0000000000..5b91baddbd --- /dev/null +++ b/libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties @@ -0,0 +1,88 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended +# to be used with the examples, and some settings may differ from those used in a production system, especially +# the `bootstrap.servers` and those specifying replication factors. + +# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. +bootstrap.servers=localhost:9092 + +# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs +group.id=connect-cluster + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=true +value.converter.schemas.enable=true + +# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +offset.storage.topic=connect-offsets +offset.storage.replication.factor=1 +#offset.storage.partitions=25 + +# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated, +# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +config.storage.topic=connect-configs +config.storage.replication.factor=1 + +# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +status.storage.topic=connect-status +status.storage.replication.factor=1 +#status.storage.partitions=5 + +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# These are provided to inform the user about the presence of the REST host and port configs +# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests. +#rest.host.name= +#rest.port=8083 + +# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers. +#rest.advertised.host.name= +#rest.advertised.port= + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json b/libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json new file mode 100644 index 0000000000..333768e4b7 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json @@ -0,0 +1,22 @@ +{ + "firstName": "John", + "lastName": "Smith", + "age": 25, + "address": { + "streetAddress": "21 2nd Street", + "city": "New York", + "state": "NY", + "postalCode": "10021" + }, + "phoneNumber": [{ + "type": "home", + "number": "212 555-1234" + }, { + "type": "fax", + "number": "646 555-4567" + } + ], + "gender": { + "type": "male" + } +} diff --git a/libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json b/libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json new file mode 100644 index 0000000000..02d87c5ad7 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json @@ -0,0 +1,11 @@ +{ + "name": "mqtt-source", + "config": { + "connector.class": "io.confluent.connect.mqtt.MqttSourceConnector", + "tasks.max": 1, + "mqtt.server.uri": "ws://broker.hivemq.com:8000/mqtt", + "mqtt.topics": "baeldung", + "kafka.topic": "connect-custom", + "value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter" + } +} From 8d7ced04f94220c9ec78f2be6e869001bdabb16b Mon Sep 17 00:00:00 2001 From: eelhazati Date: Sun, 28 Oct 2018 21:14:59 +0100 Subject: [PATCH 246/546] oracle helidon microservices --- helidon/helidon-mp/pom.xml | 27 +++++++ .../microprofile/LibraryApplication.java | 26 +++++++ .../com/baeldung/microprofile/model/Book.java | 50 +++++++++++++ .../providers/BookListMessageBodyWriter.java | 42 +++++++++++ .../providers/BookMessageBodyReader.java | 30 ++++++++ .../providers/BookMessageBodyWriter.java | 57 +++++++++++++++ .../microprofile/repo/BookManager.java | 53 ++++++++++++++ .../microprofile/util/BookMapper.java | 72 +++++++++++++++++++ .../microprofile/web/BookEndpoint.java | 42 +++++++++++ .../src/main/resources/META-INF/beans.xml | 7 ++ .../helidon-mp/src/main/resources/logback.xml | 13 ++++ helidon/helidon-se/pom.xml | 64 +++++++++++++++++ .../helidon/se/config/ConfigApplication.java | 29 ++++++++ .../com/baeldung/helidon/se/routing/Book.java | 49 +++++++++++++ .../helidon/se/routing/BookManager.java | 49 +++++++++++++ .../helidon/se/routing/BookResource.java | 58 +++++++++++++++ .../se/routing/WebApplicationRouting.java | 29 ++++++++ .../baeldung/helidon/se/security/UserApp.java | 33 +++++++++ .../se/security/WebApplicationSecurity.java | 61 ++++++++++++++++ .../se/webserver/SimpleWebApplication.java | 26 +++++++ .../src/main/resources/application.json | 1 + .../src/main/resources/application.properties | 4 ++ .../src/main/resources/application.yaml | 33 +++++++++ helidon/pom.xml | 22 ++++++ pom.xml | 1 + 25 files changed, 878 insertions(+) create mode 100644 helidon/helidon-mp/pom.xml create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java create mode 100644 helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java create mode 100644 helidon/helidon-mp/src/main/resources/META-INF/beans.xml create mode 100644 helidon/helidon-mp/src/main/resources/logback.xml create mode 100644 helidon/helidon-se/pom.xml create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/UserApp.java create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java create mode 100644 helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java create mode 100644 helidon/helidon-se/src/main/resources/application.json create mode 100644 helidon/helidon-se/src/main/resources/application.properties create mode 100644 helidon/helidon-se/src/main/resources/application.yaml create mode 100644 helidon/pom.xml diff --git a/helidon/helidon-mp/pom.xml b/helidon/helidon-mp/pom.xml new file mode 100644 index 0000000000..1ec1131a67 --- /dev/null +++ b/helidon/helidon-mp/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + helidon-mp + + + com.baeldung.helidon + helidon + 1.0.0-SNAPSHOT + + + + + io.helidon.microprofile.bundles + helidon-microprofile-1.2 + 0.10.4 + + + org.glassfish.jersey.media + jersey-media-json-binding + 2.26 + + + + diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java new file mode 100644 index 0000000000..58913c8b39 --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java @@ -0,0 +1,26 @@ +package com.baeldung.microprofile; + +import com.baeldung.microprofile.web.BookEndpoint; +import io.helidon.common.CollectionsHelper; +import io.helidon.microprofile.server.Server; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; +import java.util.Set; + +@ApplicationPath("/library") +public class LibraryApplication extends Application { + + @Override + public Set> getClasses() { + return CollectionsHelper.setOf(BookEndpoint.class); + } + + public static void main(String... args) { + Server server = Server.builder() + .addApplication(LibraryApplication.class) + .port(9080) + .build(); + server.start(); + } +} diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java new file mode 100644 index 0000000000..44b7f5428d --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java @@ -0,0 +1,50 @@ +package com.baeldung.microprofile.model; + +public class Book { + + private String id; + private String isbn; + private String name; + private String author; + private Integer pages; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIsbn() { + return isbn; + } + + public void setIsbn(String isbn) { + this.isbn = isbn; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public Integer getPages() { + return pages; + } + + public void setPages(Integer pages) { + this.pages = pages; + } +} diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java new file mode 100644 index 0000000000..f7d0bfc5f7 --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java @@ -0,0 +1,42 @@ +package com.baeldung.microprofile.providers; + +import com.baeldung.microprofile.model.Book; +import com.baeldung.microprofile.util.BookMapper; + +import javax.json.Json; +import javax.json.JsonArray; +import javax.json.JsonWriter; +import javax.ws.rs.Produces; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.ext.MessageBodyWriter; +import javax.ws.rs.ext.Provider; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.util.List; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class BookListMessageBodyWriter implements MessageBodyWriter> { + + @Override + public boolean isWriteable(Class clazz, Type genericType, Annotation[] annotations, MediaType mediaType) { + return true; + } + + @Override + public long getSize(List books, Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return 0; + } + + @Override + public void writeTo(List books, Class type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { + JsonWriter jsonWriter = Json.createWriter(entityStream); + JsonArray jsonArray = BookMapper.map(books); + jsonWriter.writeArray(jsonArray); + jsonWriter.close(); + } +} diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java new file mode 100644 index 0000000000..26ce4c1b64 --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java @@ -0,0 +1,30 @@ +package com.baeldung.microprofile.providers; + +import com.baeldung.microprofile.model.Book; +import com.baeldung.microprofile.util.BookMapper; + +import javax.ws.rs.Consumes; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.ext.MessageBodyReader; +import javax.ws.rs.ext.Provider; +import java.io.IOException; +import java.io.InputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +@Provider +@Consumes(MediaType.APPLICATION_JSON) +public class BookMessageBodyReader implements MessageBodyReader { + + @Override + public boolean isReadable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return type.equals(Book.class); + } + + @Override + public Book readFrom(Class type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { + return BookMapper.map(entityStream); + } +} \ No newline at end of file diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java new file mode 100644 index 0000000000..9bc6e89958 --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java @@ -0,0 +1,57 @@ +package com.baeldung.microprofile.providers; + +import com.baeldung.microprofile.model.Book; +import com.baeldung.microprofile.util.BookMapper; + +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonWriter; +import javax.ws.rs.Produces; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.ext.MessageBodyWriter; +import javax.ws.rs.ext.Provider; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +@Provider +@Produces(MediaType.APPLICATION_JSON) +public class BookMessageBodyWriter implements MessageBodyWriter { + @Override + public boolean isWriteable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return type.equals(Book.class); + } + + /* + Deprecated in JAX RS 2.0 + */ + @Override + public long getSize(Book book, Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return 0; + } + + /** + * Marsahl Book to OutputStream + * + * @param book + * @param type + * @param genericType + * @param annotations + * @param mediaType + * @param httpHeaders + * @param entityStream + * @throws IOException + * @throws WebApplicationException + */ + @Override + public void writeTo(Book book, Class type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { + JsonWriter jsonWriter = Json.createWriter(entityStream); + JsonObject jsonObject = BookMapper.map(book); + jsonWriter.writeObject(jsonObject); + jsonWriter.close(); + } + +} diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java new file mode 100644 index 0000000000..924cf0ce71 --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java @@ -0,0 +1,53 @@ +package com.baeldung.microprofile.repo; + +import com.baeldung.microprofile.model.Book; + +import javax.enterprise.context.ApplicationScoped; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicInteger; + +@ApplicationScoped +public class BookManager { + + private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); + private AtomicInteger bookIdGenerator = new AtomicInteger(0); + + private ConcurrentMap inMemoryStore = new ConcurrentHashMap<>(); + + public BookManager() { + Book book = new Book(); + book.setId(getNextId()); + book.setName("Building Microservice With Eclipse MicroProfile"); + book.setIsbn("1"); + book.setAuthor("baeldung"); + book.setPages(420); + inMemoryStore.put(book.getId(), book); + } + + private String getNextId() { + String date = LocalDate.now().format(formatter); + return String.format("%04d-%s", bookIdGenerator.incrementAndGet(), date); + } + + public String add(Book book) { + String id = getNextId(); + book.setId(id); + inMemoryStore.put(id, book); + return id; + } + + public Book get(String id) { + return inMemoryStore.get(id); + } + + public List getAll() { + List books = new ArrayList<>(); + books.addAll(inMemoryStore.values()); + return books; + } +} diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java new file mode 100644 index 0000000000..861b172299 --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java @@ -0,0 +1,72 @@ +package com.baeldung.microprofile.util; + +import com.baeldung.microprofile.model.Book; + +import javax.json.*; +import java.io.InputStream; +import java.util.List; + +public class BookMapper { + + public static JsonObject map(Book book) { + JsonObjectBuilder builder = Json.createObjectBuilder(); + addValue(builder, "id", book.getId()); + addValue(builder, "isbn", book.getIsbn()); + addValue(builder, "name", book.getName()); + addValue(builder, "author", book.getAuthor()); + addValue(builder, "pages", book.getPages()); + return builder.build(); + } + + private static void addValue(JsonObjectBuilder builder, String key, Object value) { + if (value != null) { + builder.add(key, value.toString()); + } else { + builder.addNull(key); + } + } + + public static JsonArray map(List books) { + final JsonArrayBuilder arrayBuilder = Json.createArrayBuilder(); + books.forEach(book -> { + JsonObject jsonObject = map(book); + arrayBuilder.add(jsonObject); + }); + return arrayBuilder.build(); + } + + public static Book map(InputStream is) { + try(JsonReader jsonReader = Json.createReader(is)) { + JsonObject jsonObject = jsonReader.readObject(); + Book book = new Book(); + book.setId(getStringFromJson("id", jsonObject)); + book.setIsbn(getStringFromJson("isbn", jsonObject)); + book.setName(getStringFromJson("name", jsonObject)); + book.setAuthor(getStringFromJson("author", jsonObject)); + book.setPages(getIntFromJson("pages",jsonObject)); + return book; + } + } + + private static String getStringFromJson(String key, JsonObject json) { + String returnedString = null; + if (json.containsKey(key)) { + JsonString value = json.getJsonString(key); + if (value != null) { + returnedString = value.getString(); + } + } + return returnedString; + } + + private static Integer getIntFromJson(String key, JsonObject json) { + Integer returnedValue = null; + if (json.containsKey(key)) { + JsonNumber value = json.getJsonNumber(key); + if (value != null) { + returnedValue = value.intValue(); + } + } + return returnedValue; + } +} diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java new file mode 100644 index 0000000000..13143a5644 --- /dev/null +++ b/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java @@ -0,0 +1,42 @@ +package com.baeldung.microprofile.web; + +import com.baeldung.microprofile.model.Book; +import com.baeldung.microprofile.repo.BookManager; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; + +@Path("books") +@RequestScoped +public class BookEndpoint { + + @Inject + private BookManager bookManager; + + @GET + @Path("{id}") + @Produces(MediaType.APPLICATION_JSON) + public Response getBook(@PathParam("id") String id) { + Book book = bookManager.get(id); + return Response.ok(book).build(); + } + + @GET + @Produces(MediaType.APPLICATION_JSON) + public Response getAllBooks() { + return Response.ok(bookManager.getAll()).build(); + } + + @POST + @Consumes(MediaType.APPLICATION_JSON) + public Response add(Book book) { + String bookId = bookManager.add(book); + return Response.created( + UriBuilder.fromResource(this.getClass()).path(bookId).build()) + .build(); + } +} diff --git a/helidon/helidon-mp/src/main/resources/META-INF/beans.xml b/helidon/helidon-mp/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000000..faae50dfc2 --- /dev/null +++ b/helidon/helidon-mp/src/main/resources/META-INF/beans.xml @@ -0,0 +1,7 @@ + + diff --git a/helidon/helidon-mp/src/main/resources/logback.xml b/helidon/helidon-mp/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/helidon/helidon-mp/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/helidon/helidon-se/pom.xml b/helidon/helidon-se/pom.xml new file mode 100644 index 0000000000..5e14ecb81c --- /dev/null +++ b/helidon/helidon-se/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + helidon-se + + + com.baeldung.helidon + helidon + 1.0.0-SNAPSHOT + + + + 0.10.4 + + + + + + io.helidon.config + helidon-config-yaml + ${helidon.version} + + + + + io.helidon.webserver + helidon-webserver + ${helidon.version} + + + io.helidon.webserver + helidon-webserver-netty + ${helidon.version} + runtime + + + io.helidon.webserver + helidon-webserver-json + ${helidon.version} + + + + + io.helidon.security + helidon-security + ${helidon.version} + + + io.helidon.security + helidon-security-provider-http-auth + ${helidon.version} + + + io.helidon.security + helidon-security-integration-webserver + ${helidon.version} + + + + + \ No newline at end of file diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java new file mode 100644 index 0000000000..acfcdb2373 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java @@ -0,0 +1,29 @@ +package com.baeldung.helidon.se.config; + +import io.helidon.config.Config; +import io.helidon.config.ConfigSources; +import io.helidon.config.spi.ConfigSource; + +public class ConfigApplication { + + public static void main(String... args) throws Exception { + + ConfigSource configSource = ConfigSources.classpath("application.yaml").build(); + Config config = Config.builder() + .disableSystemPropertiesSource() + .disableEnvironmentVariablesSource() + .sources(configSource) + .build(); + + int port = config.get("server.port").asInt(); + int pageSize = config.get("web.page-size").asInt(); + boolean debug = config.get("web.debug").asBoolean(); + String userHome = config.get("user.home").asString(); + + System.out.println("port: " + port); + System.out.println("pageSize: " + pageSize); + System.out.println("debug: " + debug); + System.out.println("userHome: " + userHome); + } + +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java new file mode 100644 index 0000000000..9a591bcc73 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java @@ -0,0 +1,49 @@ +package com.baeldung.helidon.se.routing; + +public class Book { + private String id; + private String isbn; + private String name; + private String author; + private Integer pages; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIsbn() { + return isbn; + } + + public void setIsbn(String isbn) { + this.isbn = isbn; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public Integer getPages() { + return pages; + } + + public void setPages(Integer pages) { + this.pages = pages; + } +} \ No newline at end of file diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java new file mode 100644 index 0000000000..2e6e694041 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java @@ -0,0 +1,49 @@ +package com.baeldung.helidon.se.routing; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicInteger; + +public class BookManager { + + private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); + private AtomicInteger bookIdGenerator = new AtomicInteger(0); + + private ConcurrentMap inMemoryStore = new ConcurrentHashMap<>(); + + public BookManager() { + Book book = new Book(); + book.setId(getNextId()); + book.setName("Building Microservice With Oracle Helidon"); + book.setIsbn("11223344"); + book.setAuthor("baeldung"); + book.setPages(560); + inMemoryStore.put(book.getId(), book); + } + + private String getNextId() { + String date = LocalDate.now().format(formatter); + return String.format("%04d-%s", bookIdGenerator.incrementAndGet(), date); + } + + public String add(Book book) { + String id = getNextId(); + book.setId(id); + inMemoryStore.put(id, book); + return id; + } + + public Book get(String id) { + return inMemoryStore.get(id); + } + + public List getAll() { + List books = new ArrayList<>(); + books.addAll(inMemoryStore.values()); + return books; + } +} \ No newline at end of file diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java new file mode 100644 index 0000000000..0648930841 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java @@ -0,0 +1,58 @@ +package com.baeldung.helidon.se.routing; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +import javax.json.Json; +import javax.json.JsonArray; +import javax.json.JsonArrayBuilder; +import javax.json.JsonObject; +import java.util.List; + +public class BookResource implements Service { + + private BookManager bookManager = new BookManager(); + + @Override + public void update(Routing.Rules rules) { + rules + .get("/", this::books) + .get("/{id}", this::bookById); + } + + private void bookById(ServerRequest serverRequest, ServerResponse serverResponse) { + //get the book with the given id + String id = serverRequest.path().param("id"); + Book book = bookManager.get(id); + JsonObject jsonObject = from(book); + serverResponse.send(jsonObject); + } + + private void books(ServerRequest serverRequest, ServerResponse serverResponse) { + //get all books + List books = bookManager.getAll(); + JsonArray jsonArray = from(books); + serverResponse.send(jsonArray); + } + + private JsonObject from(Book book) { + JsonObject jsonObject = Json.createObjectBuilder() + .add("id", book.getId()) + .add("isbn", book.getIsbn()) + .add("name", book.getName()) + .add("author", book.getAuthor()) + .add("pages", book.getPages()) + .build(); + return jsonObject; + } + + private JsonArray from(List books) { + JsonArrayBuilder jsonArrayBuilder = Json.createArrayBuilder(); + books.forEach(book -> { + jsonArrayBuilder.add(from(book)); + }); + return jsonArrayBuilder.build(); + } +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java new file mode 100644 index 0000000000..1f32d3c528 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java @@ -0,0 +1,29 @@ +package com.baeldung.helidon.se.routing; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerConfiguration; +import io.helidon.webserver.WebServer; +import io.helidon.webserver.json.JsonSupport; + +public class WebApplicationRouting { + + public static void main(String... args) throws Exception { + + ServerConfiguration serverConfig = ServerConfiguration.builder() + .port(9080) + .build(); + + Routing routing = Routing.builder() + .register(JsonSupport.get()) + .register("/books", new BookResource()) + .get("/greet", (request, response) -> response.send("Hello World !")) + .build(); + + WebServer.create(serverConfig, routing) + .start() + .thenAccept(ws -> + System.out.println("Server started at: http://localhost:" + ws.port()) + ); + } + +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/UserApp.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/UserApp.java new file mode 100644 index 0000000000..f776f13457 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/UserApp.java @@ -0,0 +1,33 @@ +package com.baeldung.helidon.se.security; + +import io.helidon.security.provider.httpauth.UserStore; + +import java.util.Collection; + +public class UserApp implements UserStore.User { + + private String login; + private char[] password; + private Collection roles; + + public UserApp(String login, char[] password, Collection roles) { + this.login = login; + this.password = password; + this.roles = roles; + } + + @Override + public String getLogin() { + return login; + } + + @Override + public char[] getPassword() { + return password; + } + + @Override + public Collection getRoles() { + return roles; + } +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java new file mode 100644 index 0000000000..0859726946 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java @@ -0,0 +1,61 @@ +package com.baeldung.helidon.se.security; + +import io.helidon.config.Config; +import io.helidon.security.Security; +import io.helidon.security.SubjectType; +import io.helidon.security.provider.httpauth.HttpBasicAuthProvider; +import io.helidon.security.provider.httpauth.UserStore; +import io.helidon.security.webserver.WebSecurity; +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerConfiguration; +import io.helidon.webserver.WebServer; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class WebApplicationSecurity { + + public static void main(String... args) throws Exception { + + Config config = Config.create(); + ServerConfiguration serverConfig = + ServerConfiguration.fromConfig(config.get("server")); + + Map users = new HashMap<>(); + users.put("user", new UserApp("user", "user".toCharArray(), Arrays.asList("ROLE_USER"))); + users.put("admin", new UserApp("admin", "admin".toCharArray(), Arrays.asList("ROLE_USER", "ROLE_ADMIN"))); + UserStore store = user -> Optional.ofNullable(users.get(user)); + + HttpBasicAuthProvider httpBasicAuthProvider = HttpBasicAuthProvider.builder() + .realm("myRealm") + .subjectType(SubjectType.USER) + .userStore(store) + .build(); + + //1. Using Builder Pattern or Config Pattern + Security security = Security.builder() + .addAuthenticationProvider(httpBasicAuthProvider) + .build(); + //Security security = Security.fromConfig(config); + + //2. WebSecurity from Security or from Config + // WebSecurity webSecurity = WebSecurity.from(security) + // .securityDefaults(WebSecurity.authenticate()); + + WebSecurity webSecurity = WebSecurity.from(config); + + Routing routing = Routing.builder() + .register(webSecurity) + .get("/user", (request, response) -> response.send("Hello, I'm a Helidon SE user with ROLE_USER")) + .get("/admin", (request, response) -> response.send("Hello, I'm a Helidon SE user with ROLE_ADMIN")) + .build(); + + WebServer webServer = WebServer.create(serverConfig, routing); + + webServer.start().thenAccept(ws -> + System.out.println("Server started at: http://localhost:" + ws.port()) + ); + } +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java new file mode 100644 index 0000000000..0a603a5123 --- /dev/null +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java @@ -0,0 +1,26 @@ +package com.baeldung.helidon.se.webserver; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerConfiguration; +import io.helidon.webserver.WebServer; + +public class SimpleWebApplication { + + public static void main(String... args) throws Exception { + + ServerConfiguration serverConfig = ServerConfiguration.builder() + .port(9001) + .build(); + + Routing routing = Routing.builder() + .get("/greet", (request, response) -> response.send("Hello World !")) + .build(); + + WebServer.create(serverConfig, routing) + .start() + .thenAccept(ws -> + System.out.println("Server started at: http://localhost:" + ws.port()) + ); + } + +} diff --git a/helidon/helidon-se/src/main/resources/application.json b/helidon/helidon-se/src/main/resources/application.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/helidon/helidon-se/src/main/resources/application.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/helidon/helidon-se/src/main/resources/application.properties b/helidon/helidon-se/src/main/resources/application.properties new file mode 100644 index 0000000000..062047de4a --- /dev/null +++ b/helidon/helidon-se/src/main/resources/application.properties @@ -0,0 +1,4 @@ +server.port=9080 +web.debug=true +web.page-size=15 +user.home=C:/Users/app \ No newline at end of file diff --git a/helidon/helidon-se/src/main/resources/application.yaml b/helidon/helidon-se/src/main/resources/application.yaml new file mode 100644 index 0000000000..b6dd6cec22 --- /dev/null +++ b/helidon/helidon-se/src/main/resources/application.yaml @@ -0,0 +1,33 @@ +server: + port: 9080 +web: + debug: true + page-size: 15 +user: + home: C:/Users/app + +#Config 4 Security ==> Mapped to Security Object +security: + providers: + - http-basic-auth: + realm: "myRealm" + principal-type: USER # Can be USER or SERVICE, default is USER + users: + - login: "user" + password: "user" + roles: ["ROLE_USER"] + - login: "admin" + password: "admin" + roles: ["ROLE_USER", "ROLE_ADMIN"] + + #Config 4 Security Web Server Integration ==> Mapped to WebSecurity Object + web-server: + securityDefaults: + authenticate: true + paths: + - path: "/user" + methods: ["get"] + roles-allowed: ["ROLE_USER", "ROLE_ADMIN"] + - path: "/admin" + methods: ["get"] + roles-allowed: ["ROLE_ADMIN"] \ No newline at end of file diff --git a/helidon/pom.xml b/helidon/pom.xml new file mode 100644 index 0000000000..ea8cc52ee0 --- /dev/null +++ b/helidon/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + com.baeldung.helidon + helidon + 1.0.0-SNAPSHOT + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + helidon-se + helidon-mp + + + diff --git a/pom.xml b/pom.xml index a546f8e925..fa8a1108b5 100644 --- a/pom.xml +++ b/pom.xml @@ -736,6 +736,7 @@ spring-resttemplate + helidon From dbf2721d25e33f63448c7e980b4e80d585bb3b5a Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Mon, 29 Oct 2018 03:14:08 +0530 Subject: [PATCH 247/546] BAEL-2221 --- .../org/baeldung/web/dto/EmployeeDto.java | 38 ------------------ .../java/org/baeldung/web/model/Employee.java | 25 +++++------- .../baeldung/web/service/EmployeeService.java | 30 ++------------ ...eServiceMockRestServiceServerUnitTest.java | 39 +++++++------------ .../web/service/EmployeeServiceUnitTest.java | 25 +++++------- 5 files changed, 38 insertions(+), 119 deletions(-) delete mode 100644 spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java diff --git a/spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java b/spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java deleted file mode 100644 index 44c8ba5074..0000000000 --- a/spring-resttemplate/src/main/java/org/baeldung/web/dto/EmployeeDto.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.baeldung.web.dto; - -import java.util.Date; - -public class EmployeeDto { - - private String id; - private String name; - private Double salary; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Double getSalary() { - return salary; - } - - public void setSalary(Double salary) { - this.salary = salary; - } - - @Override public String toString() { - return "EmployeeDto{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", salary=" + salary + '}'; - } -} diff --git a/spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java b/spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java index 0981cc2da1..7cab4a0430 100644 --- a/spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java +++ b/spring-resttemplate/src/main/java/org/baeldung/web/model/Employee.java @@ -7,7 +7,14 @@ public class Employee { private String id; private String name; - private Double salary; + + public Employee(String id, String name) { + this.id = id; + this.name = name; + } + + public Employee() { + } public String getId() { return id; @@ -25,29 +32,17 @@ public class Employee { this.name = name; } - public Double getSalary() { - return salary; - } - - public void setSalary(Double salary) { - this.salary = salary; - } - - @Override public String toString() { - return "Employee{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", salary=" + salary + '}'; - } - @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Employee employee = (Employee) o; - return Objects.equals(id, employee.id) && Objects.equals(name, employee.name) && Objects.equals(salary, employee.salary); + return Objects.equals(id, employee.id); } @Override public int hashCode() { - return Objects.hash(id, name, salary); + return Objects.hash(id); } } diff --git a/spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java b/spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java index 3a0222cb6c..91614e90ad 100644 --- a/spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java +++ b/spring-resttemplate/src/main/java/org/baeldung/web/service/EmployeeService.java @@ -1,6 +1,5 @@ package org.baeldung.web.service; -import org.baeldung.web.dto.EmployeeDto; import org.baeldung.web.model.Employee; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,31 +20,10 @@ public class EmployeeService { @Autowired private RestTemplate restTemplate; - public EmployeeDto getEmployee(String id) throws Exception { + public Employee getEmployee(String id) { - Employee emp = null; - try { - - ResponseEntity resp = restTemplate.getForEntity(EMP_URL_PREFIX - + URL_SEP + id, Employee.class); - - if (resp == null || resp.getStatusCode() != HttpStatus.OK - || resp.getBody() == null) { - - throw new Exception("Employee details could not be fetched."); - } - - emp = resp.getBody(); - - EmployeeDto dto = new EmployeeDto(); - dto.setId(emp.getId()); - dto.setName(emp.getName()); - dto.setSalary(emp.getSalary()); - return dto; - - } catch (Exception e) { - logger.error("Error occurred while fetching employee details", e); - throw new Exception("Error occurred while fetching employee details", e); - } + ResponseEntity resp = restTemplate.getForEntity("http://localhost:8080/employee/" + id, + Employee.class); + return resp.getStatusCode() == HttpStatus.OK ? resp.getBody() : null; } } diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java index f04b0fbc2b..a45af318f1 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java @@ -1,9 +1,12 @@ package org.baeldung.web.service; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; +import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; + import java.net.URI; import org.baeldung.SpringTestConfig; -import org.baeldung.web.dto.EmployeeDto; import org.baeldung.web.model.Employee; import org.junit.Assert; import org.junit.Before; @@ -19,11 +22,6 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.client.ExpectedCount; import org.springframework.test.web.client.MockRestServiceServer; - -import static org.baeldung.web.service.EmployeeService.EMP_URL_PREFIX; -import static org.baeldung.web.service.EmployeeService.URL_SEP; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; -import static org.springframework.test.web.client.response.MockRestResponseCreators.*; import org.springframework.web.client.RestTemplate; import com.fasterxml.jackson.databind.ObjectMapper; @@ -45,33 +43,24 @@ public class EmployeeServiceMockRestServiceServerUnitTest { private ObjectMapper mapper = new ObjectMapper(); @Before - public void initMocks() { + public void init() { mockServer = MockRestServiceServer.createServer(restTemplate); } @Test public void givenMockingIsDoneByMockRestServiceServer_whenGetIsCalled_shouldReturnMockedObject() throws Exception { - String id = "E001"; - Employee emp = new Employee(); - emp.setId(id); - emp.setName("Eric Simmons"); - emp.setSalary(10000.00d); + Employee emp = new Employee("E001", "Eric Simmons"); - String fullUri = new StringBuilder().append(EMP_URL_PREFIX).append(URL_SEP) - .append(id).toString(); - - mockServer.expect(ExpectedCount.once(), requestTo(new URI(fullUri))) - .andExpect(method(HttpMethod.GET)) - .andRespond(withStatus(HttpStatus.OK) - .contentType(MediaType.APPLICATION_JSON) - .body(mapper.writeValueAsString(emp))); - - EmployeeDto employeeDto = empService.getEmployee(id); - logger.info("Employee received as: {}", employeeDto); + mockServer.expect(ExpectedCount.once(), + requestTo(new URI("http://localhost:8080/employee/E001"))) + .andExpect(method(HttpMethod.GET)) + .andRespond(withStatus(HttpStatus.OK) + .contentType(MediaType.APPLICATION_JSON) + .body(mapper.writeValueAsString(emp))); + Employee employee = empService.getEmployee("E001"); mockServer.verify(); - Assert.assertEquals(emp.getName(), employeeDto.getName()); - Assert.assertEquals(emp.getId(), employeeDto.getId()); + Assert.assertEquals(emp, employee); } } diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java index ac714bf6db..ee30c22e9f 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java @@ -1,11 +1,13 @@ package org.baeldung.web.service; -import org.baeldung.web.dto.EmployeeDto; import org.baeldung.web.model.Employee; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.mockito.*; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; @@ -29,20 +31,13 @@ public class EmployeeServiceUnitTest { @Test public void givenMockingIsDoneByMockito_whenGetIsCalled_shouldReturnMockedObject() throws Exception { - String id = "E001"; - Employee emp = new Employee(); - emp.setId(id); - emp.setName("Eric Simmons"); - emp.setSalary(10000.00d); - Mockito - .when(restTemplate.getForEntity(EmployeeService.EMP_URL_PREFIX - + EmployeeService.URL_SEP + id, Employee.class)) - .thenReturn(new ResponseEntity(emp, HttpStatus.OK)); + Employee emp = new Employee("E001", "Eric Simmons"); + Mockito.when(restTemplate.getForEntity("http://localhost:8080/employee/E001", Employee.class)) + .thenReturn(new ResponseEntity(emp, HttpStatus.OK)); - EmployeeDto employeeDto = empService.getEmployee(id); - logger.info("Employee received as: {}", employeeDto); - Assert.assertEquals(emp.getName(), employeeDto.getName()); - Assert.assertEquals(emp.getSalary(), employeeDto.getSalary()); + Employee employee = empService.getEmployee("E001"); + + Assert.assertEquals(emp, employee); } } From b3c5ab576f116d0485474062407e12b3d95fa337 Mon Sep 17 00:00:00 2001 From: Loredana Date: Mon, 29 Oct 2018 00:12:42 +0200 Subject: [PATCH 248/546] rename user in helidon app --- .../helidon/se/security/{UserApp.java => MyUser.java} | 4 ++-- .../helidon/se/security/WebApplicationSecurity.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/{UserApp.java => MyUser.java} (77%) diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/UserApp.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java similarity index 77% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/UserApp.java rename to helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java index f776f13457..e8009a98ad 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/UserApp.java +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java @@ -4,13 +4,13 @@ import io.helidon.security.provider.httpauth.UserStore; import java.util.Collection; -public class UserApp implements UserStore.User { +public class MyUser implements UserStore.User { private String login; private char[] password; private Collection roles; - public UserApp(String login, char[] password, Collection roles) { + public MyUser(String login, char[] password, Collection roles) { this.login = login; this.password = password; this.roles = roles; diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java index 0859726946..9a67f3d716 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java +++ b/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java @@ -23,9 +23,9 @@ public class WebApplicationSecurity { ServerConfiguration serverConfig = ServerConfiguration.fromConfig(config.get("server")); - Map users = new HashMap<>(); - users.put("user", new UserApp("user", "user".toCharArray(), Arrays.asList("ROLE_USER"))); - users.put("admin", new UserApp("admin", "admin".toCharArray(), Arrays.asList("ROLE_USER", "ROLE_ADMIN"))); + Map users = new HashMap<>(); + users.put("user", new MyUser("user", "user".toCharArray(), Arrays.asList("ROLE_USER"))); + users.put("admin", new MyUser("admin", "admin".toCharArray(), Arrays.asList("ROLE_USER", "ROLE_ADMIN"))); UserStore store = user -> Optional.ofNullable(users.get(user)); HttpBasicAuthProvider httpBasicAuthProvider = HttpBasicAuthProvider.builder() From 758648eb05cde1690d7095216a9160fef15d93d2 Mon Sep 17 00:00:00 2001 From: cdjole Date: Mon, 29 Oct 2018 01:44:18 +0100 Subject: [PATCH 249/546] Example class for Graal. (#5486) --- .../com/baeldung/graal/CountUppercase.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 core-java-10/src/main/java/com/baeldung/graal/CountUppercase.java diff --git a/core-java-10/src/main/java/com/baeldung/graal/CountUppercase.java b/core-java-10/src/main/java/com/baeldung/graal/CountUppercase.java new file mode 100644 index 0000000000..4cad9cb965 --- /dev/null +++ b/core-java-10/src/main/java/com/baeldung/graal/CountUppercase.java @@ -0,0 +1,25 @@ +package com.baeldung.graal; + +public class CountUppercase { + static final int ITERATIONS = Math.max(Integer.getInteger("iterations", 1), 1); + + public static void main(String[] args) { + String sentence = String.join(" ", args); + for (int iter = 0; iter < ITERATIONS; iter++) { + if (ITERATIONS != 1) System.out.println("-- iteration " + (iter + 1) + " --"); + long total = 0, start = System.currentTimeMillis(), last = start; + for (int i = 1; i < 10_000_000; i++) { + total += sentence + .chars() + .filter(Character::isUpperCase) + .count(); + if (i % 1_000_000 == 0) { + long now = System.currentTimeMillis(); + System.out.printf("%d (%d ms)%n", i / 1_000_000, now - last); + last = now; + } + } + System.out.printf("total: %d (%d ms)%n", total, System.currentTimeMillis() - start); + } + } +} From 3f187e0deb2822104a56f8554f2f93b0fc0ac85b Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Mon, 29 Oct 2018 12:45:14 +0200 Subject: [PATCH 250/546] [Mercator]: Code review changes. --- .../baeldung/algorithms}/mercator/EllipticalMercator.java | 2 +- .../java/com/baeldung/algorithms}/mercator/Mercator.java | 2 +- .../baeldung/algorithms}/mercator/SphericalMercator.java | 6 +++--- .../algorithms}/mercator/EllipticalMercatorUnitTest.java | 2 +- .../algorithms}/mercator/SphericalMercatorUnitTest.java | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) rename {core-java/src/main/java/com/baeldung => algorithms/src/main/java/com/baeldung/algorithms}/mercator/EllipticalMercator.java (95%) rename {core-java/src/main/java/com/baeldung => algorithms/src/main/java/com/baeldung/algorithms}/mercator/Mercator.java (84%) rename {core-java/src/main/java/com/baeldung => algorithms/src/main/java/com/baeldung/algorithms}/mercator/SphericalMercator.java (88%) rename {core-java/src/test/java/com/baeldung => algorithms/src/test/java/com/baeldung/algorithms}/mercator/EllipticalMercatorUnitTest.java (94%) rename {core-java/src/test/java/com/baeldung => algorithms/src/test/java/com/baeldung/algorithms}/mercator/SphericalMercatorUnitTest.java (82%) diff --git a/core-java/src/main/java/com/baeldung/mercator/EllipticalMercator.java b/algorithms/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java similarity index 95% rename from core-java/src/main/java/com/baeldung/mercator/EllipticalMercator.java rename to algorithms/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java index bb9ebb0e58..8c3e4c554f 100644 --- a/core-java/src/main/java/com/baeldung/mercator/EllipticalMercator.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java @@ -1,4 +1,4 @@ -package com.baeldung.mercator; +package com.baeldung.algorithms.mercator; class EllipticalMercator extends Mercator { @Override diff --git a/core-java/src/main/java/com/baeldung/mercator/Mercator.java b/algorithms/src/main/java/com/baeldung/algorithms/mercator/Mercator.java similarity index 84% rename from core-java/src/main/java/com/baeldung/mercator/Mercator.java rename to algorithms/src/main/java/com/baeldung/algorithms/mercator/Mercator.java index 3f50884f6b..b289b1839d 100644 --- a/core-java/src/main/java/com/baeldung/mercator/Mercator.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/mercator/Mercator.java @@ -1,4 +1,4 @@ -package com.baeldung.mercator; +package com.baeldung.algorithms.mercator; abstract class Mercator { final static double RADIUS_MAJOR = 6378137.0; diff --git a/core-java/src/main/java/com/baeldung/mercator/SphericalMercator.java b/algorithms/src/main/java/com/baeldung/algorithms/mercator/SphericalMercator.java similarity index 88% rename from core-java/src/main/java/com/baeldung/mercator/SphericalMercator.java rename to algorithms/src/main/java/com/baeldung/algorithms/mercator/SphericalMercator.java index 6cc405b3b0..1be976d82e 100644 --- a/core-java/src/main/java/com/baeldung/mercator/SphericalMercator.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/mercator/SphericalMercator.java @@ -1,14 +1,14 @@ -package com.baeldung.mercator; +package com.baeldung.algorithms.mercator; public class SphericalMercator extends Mercator { @Override - double yAxisProjection(double input) { + double xAxisProjection(double input) { return Math.toRadians(input) * RADIUS_MAJOR; } @Override - double xAxisProjection(double input) { + double yAxisProjection(double input) { return Math.log(Math.tan(Math.PI / 4 + Math.toRadians(input) / 2)) * RADIUS_MAJOR; } } diff --git a/core-java/src/test/java/com/baeldung/mercator/EllipticalMercatorUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java similarity index 94% rename from core-java/src/test/java/com/baeldung/mercator/EllipticalMercatorUnitTest.java rename to algorithms/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java index 0088cc451c..13618e80a7 100644 --- a/core-java/src/test/java/com/baeldung/mercator/EllipticalMercatorUnitTest.java +++ b/algorithms/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.mercator; +package com.baeldung.algorithms.mercator; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/core-java/src/test/java/com/baeldung/mercator/SphericalMercatorUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java similarity index 82% rename from core-java/src/test/java/com/baeldung/mercator/SphericalMercatorUnitTest.java rename to algorithms/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java index 2e5ebe53cb..f1152441b8 100644 --- a/core-java/src/test/java/com/baeldung/mercator/SphericalMercatorUnitTest.java +++ b/algorithms/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.mercator; +package com.baeldung.algorithms.mercator; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,13 +13,13 @@ public class SphericalMercatorUnitTest { public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.xAxisProjection(22); - assertEquals(result, 2511525.234845713); + assertEquals(result, 2449028.7974520186); } @Test public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.yAxisProjection(44); - assertEquals(result, 4898057.594904037); + assertEquals(result, 5465442.183322753); } } From 018e00c8047ebebce82780b5a5fbc2d00ac78c11 Mon Sep 17 00:00:00 2001 From: Kevin Wittek Date: Mon, 29 Oct 2018 16:02:38 +0100 Subject: [PATCH 251/546] Fix indentation of Kotlin datamapping examples (#5563) * Add Kotlin data mapping examples (BAEL-2247) * Fix indentation in Kotlin datamapping examples --- .../kotlin/com/baeldung/datamapping/User.kt | 14 ++++++------ .../baeldung/datamapping/UserExtensions.kt | 8 +++---- .../com/baeldung/datamapping/UserView.kt | 8 +++---- .../com/baeldung/datamapping/UserTest.kt | 22 +++++++++---------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt index 38c88b7c37..fdbf95f7ba 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/User.kt @@ -1,10 +1,10 @@ package com.baeldung.datamapping data class User( - val firstName: String, - val lastName: String, - val street: String, - val houseNumber: String, - val phone: String, - val age: Int, - val password: String) \ No newline at end of file + val firstName: String, + val lastName: String, + val street: String, + val houseNumber: String, + val phone: String, + val age: Int, + val password: String) \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt index 1f3d7f3b47..6113ed3591 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserExtensions.kt @@ -3,10 +3,10 @@ package com.baeldung.datamapping import kotlin.reflect.full.memberProperties fun User.toUserView() = UserView( - name = "$firstName $lastName", - address = "$street $houseNumber", - telephone = phone, - age = age + name = "$firstName $lastName", + address = "$street $houseNumber", + telephone = phone, + age = age ) fun User.toUserViewReflection() = with(::UserView) { diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt index ca27b1961c..e1b6de6b57 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/datamapping/UserView.kt @@ -1,8 +1,8 @@ package com.baeldung.datamapping data class UserView( - val name: String, - val address: String, - val telephone: String, - val age: Int + val name: String, + val address: String, + val telephone: String, + val age: Int ) \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt index 2d03039a80..44d350ea38 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/datamapping/UserTest.kt @@ -22,22 +22,22 @@ class UserTest { private fun buildUser(): User { return User( - "Java", - "Duke", - "Javastreet", - "42", - "1234567", - 30, - "s3cr37" + "Java", + "Duke", + "Javastreet", + "42", + "1234567", + 30, + "s3cr37" ) } private fun assertUserView(pr: UserView) { assertAll( - { assertEquals("Java Duke", pr.name) }, - { assertEquals("Javastreet 42", pr.address) }, - { assertEquals("1234567", pr.telephone) }, - { assertEquals(30, pr.age) } + { assertEquals("Java Duke", pr.name) }, + { assertEquals("Javastreet 42", pr.address) }, + { assertEquals("1234567", pr.telephone) }, + { assertEquals(30, pr.age) } ) } } \ No newline at end of file From 21d6a0d856a04b416af0480bf84258337f4c0c1b Mon Sep 17 00:00:00 2001 From: Ganesh Pagade Date: Tue, 30 Oct 2018 00:05:39 +0530 Subject: [PATCH 252/546] renamed dir and artifact --- .../pom.xml | 4 ++-- .../cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java | 0 .../zuulratelimitdemo/controller/GreetingController.java | 0 .../src/main/resources/application.yml | 0 .../zuulratelimitdemo/controller/GreetingControllerTest.java | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename spring-cloud/{spring-cloud-zuul-throttling => spring-cloud-zuul-ratelimit}/pom.xml (95%) rename spring-cloud/{spring-cloud-zuul-throttling => spring-cloud-zuul-ratelimit}/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java (100%) rename spring-cloud/{spring-cloud-zuul-throttling => spring-cloud-zuul-ratelimit}/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java (100%) rename spring-cloud/{spring-cloud-zuul-throttling => spring-cloud-zuul-ratelimit}/src/main/resources/application.yml (100%) rename spring-cloud/{spring-cloud-zuul-throttling => spring-cloud-zuul-ratelimit}/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java (100%) diff --git a/spring-cloud/spring-cloud-zuul-throttling/pom.xml b/spring-cloud/spring-cloud-zuul-ratelimit/pom.xml similarity index 95% rename from spring-cloud/spring-cloud-zuul-throttling/pom.xml rename to spring-cloud/spring-cloud-zuul-ratelimit/pom.xml index b34ade662a..46139b4f57 100644 --- a/spring-cloud/spring-cloud-zuul-throttling/pom.xml +++ b/spring-cloud/spring-cloud-zuul-ratelimit/pom.xml @@ -4,11 +4,11 @@ 4.0.0 com.baeldung.spring.cloud - zuul-ratelimit-demo + spring-cloud-zuul-ratelimit 0.0.1-SNAPSHOT jar - zuul-ratelimit-demo + spring-cloud-zuul-ratelimit Demo project for Spring Boot diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java b/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java similarity index 100% rename from spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java rename to spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java b/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java similarity index 100% rename from spring-cloud/spring-cloud-zuul-throttling/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java rename to spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml b/spring-cloud/spring-cloud-zuul-ratelimit/src/main/resources/application.yml similarity index 100% rename from spring-cloud/spring-cloud-zuul-throttling/src/main/resources/application.yml rename to spring-cloud/spring-cloud-zuul-ratelimit/src/main/resources/application.yml diff --git a/spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java b/spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java similarity index 100% rename from spring-cloud/spring-cloud-zuul-throttling/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java rename to spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java From 30ce9764811f523e6c94c2aa2d8f1724ed8745b1 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 30 Oct 2018 00:26:21 +0530 Subject: [PATCH 253/546] BAEL-896 Working with dates in Kotlin - Added code for working with dates tutorial --- .../com/baeldung/kotlin/dates/CreateDate.kt | 31 +++++++++++++ .../com/baeldung/kotlin/dates/ExtractDate.kt | 24 ++++++++++ .../com/baeldung/kotlin/dates/PeriodDate.kt | 44 +++++++++++++++++++ .../com/baeldung/kotlin/dates/PrintDate.kt | 26 +++++++++++ 4 files changed, 125 insertions(+) create mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt create mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt create mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt create mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt new file mode 100644 index 0000000000..78705fc151 --- /dev/null +++ b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt @@ -0,0 +1,31 @@ +package com.baeldung.kotlin.dates + +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +fun createDateUsingParseMethodDefaultFormat() { + + var date = LocalDate.parse("2018-12-31") + println(date) +} + +fun createDateUsingParseMethodCustomFormat() { + + var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy") + + var date = LocalDate.parse("31-12-2018", formatter) + + println(date) +} + +fun createDateUsingOfMethod() { + var date = LocalDate.of(2018, 12, 31) + println(date) + +} + +fun main(args: Array) { + + createDateUsingParseMethodCustomFormat() + createDateUsingOfMethod() +} \ No newline at end of file diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt new file mode 100644 index 0000000000..f5291b63db --- /dev/null +++ b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt @@ -0,0 +1,24 @@ +package com.baeldung.kotlin.dates + +import java.time.LocalDate + +fun extractingCommonComponents() { + var date = LocalDate.parse("2018-12-31") + + println(date.year) + println(date.month) + println(date.dayOfMonth) +} + +fun extractingEraDowDoy() { + var date = LocalDate.parse("2018-12-31") + + println(date.era) + println(date.dayOfWeek) + println(date.dayOfYear) +} + +fun main(args: Array) { + extractingCommonComponents() + extractingEraDowDoy() +} \ No newline at end of file diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt new file mode 100644 index 0000000000..f8689c55be --- /dev/null +++ b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt @@ -0,0 +1,44 @@ +package com.baeldung.kotlin.dates + +import java.time.LocalDate +import java.time.Period + +fun createAPeriod() { + var period = Period.of(1, 2, 3) + + println(period) +} + +fun addAPeriod() { + var period = Period.of(1, 2, 3) + + var date = LocalDate.of(2018, 6, 25) + var modifiedDate = date.plus(period) + + println(modifiedDate) +} + +fun subtractAPeriod() { + var period = Period.of(1, 2, 3) + + var date = LocalDate.of(2018, 6, 25) + var modifiedDate = date.minus(period) + + println(modifiedDate) +} + +fun getAPeriod() { + + var date1 = LocalDate.parse("2018-06-25") + var date2 = LocalDate.parse("2018-12-25") + + var period = Period.between(date1, date2) + println(period) +} + +fun main(args: Array) { + createAPeriod() + addAPeriod() + subtractAPeriod() + getAPeriod() +} \ No newline at end of file diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt new file mode 100644 index 0000000000..73380e3152 --- /dev/null +++ b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt @@ -0,0 +1,26 @@ +package com.baeldung.kotlin.dates + +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +fun printDateDefaultFormat() { + + var date = LocalDate.parse("2018-12-31") + println(date) +} + +fun printDateUsingCustomFormat() { + + var date = LocalDate.parse("2018-12-31") + + var formatter = DateTimeFormatter.ofPattern("dd-MMMM-yyyy") + var formattedDate = date.format(formatter) + println(formattedDate) +} + +fun main(args: Array) { + + printDateDefaultFormat() + + printDateUsingCustomFormat() +} \ No newline at end of file From d7bbfb353d77401675c86d7480093068a7ba6b45 Mon Sep 17 00:00:00 2001 From: Graham Cox Date: Mon, 29 Oct 2018 21:04:07 +0000 Subject: [PATCH 254/546] Examples of using Injekt (#5519) --- core-kotlin/pom.xml | 5 ++ .../injekt/DelegateInjectionApplication.kt | 60 +++++++++++++++++++ .../com/baeldung/injekt/KeyedApplication.kt | 37 ++++++++++++ .../com/baeldung/injekt/ModularApplication.kt | 46 ++++++++++++++ .../baeldung/injekt/PerThreadApplication.kt | 48 +++++++++++++++ .../com/baeldung/injekt/SimpleApplication.kt | 34 +++++++++++ 6 files changed, 230 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml index 0894a57320..5cdb5f700e 100644 --- a/core-kotlin/pom.xml +++ b/core-kotlin/pom.xml @@ -61,6 +61,11 @@ 3.3.0 pom + + uy.kohesive.injekt + injekt-core + 1.16.1 + diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt b/core-kotlin/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt new file mode 100644 index 0000000000..fb9beda621 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt @@ -0,0 +1,60 @@ +package com.baeldung.injekt + +import org.slf4j.LoggerFactory +import uy.kohesive.injekt.* +import uy.kohesive.injekt.api.* +import java.util.* + +class DelegateInjectionApplication { + companion object : InjektMain() { + private val LOG = LoggerFactory.getLogger(DelegateInjectionApplication::class.java) + @JvmStatic fun main(args: Array) { + DelegateInjectionApplication().run() + } + + override fun InjektRegistrar.registerInjectables() { + addFactory { + val value = FactoryInstance("Factory" + UUID.randomUUID().toString()) + LOG.info("Constructing instance: {}", value) + value + } + + addSingletonFactory { + val value = SingletonInstance("Singleton" + UUID.randomUUID().toString()) + LOG.info("Constructing singleton instance: {}", value) + value + } + + addSingletonFactory { App() } + } + } + + data class FactoryInstance(val value: String) + data class SingletonInstance(val value: String) + + class App { + private val instance: FactoryInstance by injectValue() + private val lazyInstance: FactoryInstance by injectLazy() + private val singleton: SingletonInstance by injectValue() + private val lazySingleton: SingletonInstance by injectLazy() + + fun run() { + for (i in 1..5) { + LOG.info("Instance {}: {}", i, instance) + } + for (i in 1..5) { + LOG.info("Lazy Instance {}: {}", i, lazyInstance) + } + for (i in 1..5) { + LOG.info("Singleton {}: {}", i, singleton) + } + for (i in 1..5) { + LOG.info("Lazy Singleton {}: {}", i, lazySingleton) + } + } + } + + fun run() { + Injekt.get().run() + } +} diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt b/core-kotlin/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt new file mode 100644 index 0000000000..744459b7fe --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt @@ -0,0 +1,37 @@ +package com.baeldung.injekt + +import org.slf4j.LoggerFactory +import uy.kohesive.injekt.* +import uy.kohesive.injekt.api.* + +class KeyedApplication { + companion object : InjektMain() { + private val LOG = LoggerFactory.getLogger(KeyedApplication::class.java) + @JvmStatic fun main(args: Array) { + KeyedApplication().run() + } + + override fun InjektRegistrar.registerInjectables() { + val configs = mapOf( + "google" to Config("googleClientId", "googleClientSecret"), + "twitter" to Config("twitterClientId", "twitterClientSecret") + ) + addPerKeyFactory {key -> configs[key]!! } + + addSingletonFactory { App() } + } + } + + data class Config(val clientId: String, val clientSecret: String) + + class App { + fun run() { + LOG.info("Google config: {}", Injekt.get("google")) + LOG.info("Twitter config: {}", Injekt.get("twitter")) + } + } + + fun run() { + Injekt.get().run() + } +} diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt b/core-kotlin/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt new file mode 100644 index 0000000000..e802f3f6d5 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt @@ -0,0 +1,46 @@ +package com.baeldung.injekt + +import org.slf4j.LoggerFactory +import uy.kohesive.injekt.* +import uy.kohesive.injekt.api.* + +class ModularApplication { + class ConfigModule(private val port: Int) : InjektModule { + override fun InjektRegistrar.registerInjectables() { + addSingleton(Config(port)) + } + } + + object ServerModule : InjektModule { + override fun InjektRegistrar.registerInjectables() { + addSingletonFactory { Server(Injekt.get()) } + } + } + + companion object : InjektMain() { + private val LOG = LoggerFactory.getLogger(Server::class.java) + @JvmStatic fun main(args: Array) { + ModularApplication().run() + } + + override fun InjektRegistrar.registerInjectables() { + importModule(ConfigModule(12345)) + importModule(ServerModule) + } + } + + data class Config( + val port: Int + ) + + class Server(private val config: Config) { + + fun start() { + LOG.info("Starting server on ${config.port}") + } + } + + fun run() { + Injekt.get().start() + } +} diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt b/core-kotlin/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt new file mode 100644 index 0000000000..a42f314349 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt @@ -0,0 +1,48 @@ +package com.baeldung.injekt + +import org.slf4j.LoggerFactory +import uy.kohesive.injekt.* +import uy.kohesive.injekt.api.* +import java.util.* +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit + +class PerThreadApplication { + companion object : InjektMain() { + private val LOG = LoggerFactory.getLogger(PerThreadApplication::class.java) + @JvmStatic fun main(args: Array) { + PerThreadApplication().run() + } + + override fun InjektRegistrar.registerInjectables() { + addPerThreadFactory { + val value = FactoryInstance(UUID.randomUUID().toString()) + LOG.info("Constructing instance: {}", value) + value + } + + addSingletonFactory { App() } + } + } + + data class FactoryInstance(val value: String) + + class App { + fun run() { + val threadPool = Executors.newFixedThreadPool(5) + + for (i in 1..20) { + threadPool.submit { + val instance = Injekt.get() + LOG.info("Value for thread {}: {}", Thread.currentThread().id, instance) + TimeUnit.MILLISECONDS.sleep(100) + } + } + threadPool.awaitTermination(10, TimeUnit.SECONDS) + } + } + + fun run() { + Injekt.get().run() + } +} diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt b/core-kotlin/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt new file mode 100644 index 0000000000..2b07cd059f --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt @@ -0,0 +1,34 @@ +package com.baeldung.injekt + +import org.slf4j.LoggerFactory +import uy.kohesive.injekt.* +import uy.kohesive.injekt.api.* + +class SimpleApplication { + companion object : InjektMain() { + private val LOG = LoggerFactory.getLogger(Server::class.java) + @JvmStatic fun main(args: Array) { + SimpleApplication().run() + } + + override fun InjektRegistrar.registerInjectables() { + addSingleton(Config(12345)) + addSingletonFactory { Server(Injekt.get()) } + } + } + + data class Config( + val port: Int + ) + + class Server(private val config: Config) { + + fun start() { + LOG.info("Starting server on ${config.port}") + } + } + + fun run() { + Injekt.get().start() + } +} From cb1b3d5a5c444f1083b2591f47cba61b715aa15f Mon Sep 17 00:00:00 2001 From: nguyennamthai Date: Tue, 30 Oct 2018 04:11:57 +0700 Subject: [PATCH 255/546] Bael 2285 (#5568) * Fix a division method mistake * Spring null-safety --- .../java/org/baeldung/nullibility/Person.java | 33 +++++++++++++++++++ .../baeldung/nullibility/package-info.java | 6 ++++ 2 files changed, 39 insertions(+) create mode 100644 spring-all/src/main/java/org/baeldung/nullibility/Person.java create mode 100644 spring-all/src/main/java/org/baeldung/nullibility/package-info.java diff --git a/spring-all/src/main/java/org/baeldung/nullibility/Person.java b/spring-all/src/main/java/org/baeldung/nullibility/Person.java new file mode 100644 index 0000000000..08c77c9e9c --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/nullibility/Person.java @@ -0,0 +1,33 @@ +package org.baeldung.nullibility; + +import org.springframework.lang.NonNull; +import org.springframework.lang.Nullable; + +public class Person { + @NonNull + private String fullName; + @Nullable + private String nickName; + + void setFullName(String fullName) { + if (fullName != null && fullName.isEmpty()) { + fullName = null; + } + this.fullName = fullName; + } + + void setNickName(String nickName) { + if (nickName != null && nickName.isEmpty()) { + nickName = null; + } + this.nickName = nickName; + } + + String getFullName() { + return fullName; + } + + String getNickName() { + return nickName; + } +} diff --git a/spring-all/src/main/java/org/baeldung/nullibility/package-info.java b/spring-all/src/main/java/org/baeldung/nullibility/package-info.java new file mode 100644 index 0000000000..446f2e316e --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/nullibility/package-info.java @@ -0,0 +1,6 @@ +@NonNullApi +@NonNullFields +package org.baeldung.nullibility; + +import org.springframework.lang.NonNullApi; +import org.springframework.lang.NonNullFields; \ No newline at end of file From ff8380a954c4e10abfdb477f711eb326d4c470f6 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Tue, 30 Oct 2018 09:27:49 +0800 Subject: [PATCH 256/546] add random string test --- .../com/baeldung/random/RandomStringTest.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt new file mode 100644 index 0000000000..b8d0bd49cd --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -0,0 +1,18 @@ + +import org.junit.jupiter.api.Test +import java.util.concurrent.ThreadLocalRandom +import kotlin.test.assertTrue + +class RandomNumberTest { + + @Test + fun whenRandomNumberWithJavaUtilMath_thenResultIsBetween0And1() { + val source = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + var test = Random().ints(outputStrLength, 0, source.length) + .asSequence() + .map(source::get) + .joinToString("") + print("message") + } + +} \ No newline at end of file From 3221968f9e4e3fb58f5039c80c68b0092bcbc77a Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Tue, 30 Oct 2018 13:40:59 +0800 Subject: [PATCH 257/546] BAEL-1913 kotline random string --- core-kotlin/pom.xml | 6 +++ .../com/baeldung/random/RandomStringTest.kt | 50 +++++++++++++++---- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml index 5cdb5f700e..2b559b19e0 100644 --- a/core-kotlin/pom.xml +++ b/core-kotlin/pom.xml @@ -18,6 +18,11 @@ commons-math3 ${commons-math3.version} + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + org.junit.platform junit-platform-runner @@ -70,6 +75,7 @@ 3.6.1 + 3.8.1 1.1.1 5.2.0 3.10.0 diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt index b8d0bd49cd..b47a6ac455 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -1,18 +1,50 @@ - +import org.apache.commons.lang3.RandomStringUtils import org.junit.jupiter.api.Test -import java.util.concurrent.ThreadLocalRandom -import kotlin.test.assertTrue +import kotlin.streams.asSequence +import kotlin.test.assertEquals -class RandomNumberTest { +const val STRING_LENGTH = 10; +const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+"; + +class RandomStringTest { @Test - fun whenRandomNumberWithJavaUtilMath_thenResultIsBetween0And1() { - val source = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - var test = Random().ints(outputStrLength, 0, source.length) + fun generateRandomString_useJava_returnString() { + val charPool = ArrayList(); + charPool.addAll('a'..'z'); + charPool.addAll('A'..'Z'); + charPool.addAll('0'..'9'); + + var randomString = java.util.Random().ints(STRING_LENGTH.toLong(), 0, charPool.size) .asSequence() - .map(source::get) + .map(charPool::get) .joinToString("") - print("message") + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))); + assertEquals(STRING_LENGTH, randomString.length); + } + + @Test + fun generateRandomString_useKotlin_returnString() { + val charPool = ArrayList(); + charPool.addAll('a'..'z'); + charPool.addAll('A'..'Z'); + charPool.addAll('0'..'9'); + + var randomString = (1..STRING_LENGTH).map { i -> kotlin.random.Random.nextInt(0, charPool.size) } + .map(charPool::get) + .joinToString(""); + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))); + assertEquals(STRING_LENGTH, randomString.length); + } + + @Test + fun generateRandomString_useApacheCommon_returnString() { + var randomString = RandomStringUtils.randomAlphanumeric(STRING_LENGTH); + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))); + assertEquals(STRING_LENGTH, randomString.length); } } \ No newline at end of file From 261694815af5e644f8036846330109df126123a3 Mon Sep 17 00:00:00 2001 From: Ekaterina Galkina Date: Tue, 30 Oct 2018 19:22:35 +0500 Subject: [PATCH 258/546] BAEL-2276 --- .../PublishSubscibeChannelExample.java | 72 ++++++++++++++ .../RouteToRecipientsExample.java | 71 +++++++++++++ .../separateflows/SeparateFlowsExample.java | 99 +++++++++++++++++++ .../subflowchannel/FilterExample.java | 75 ++++++++++++++ .../subflowmapping/RouterExample.java | 70 +++++++++++++ 5 files changed, 387 insertions(+) create mode 100644 spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java create mode 100644 spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java create mode 100644 spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java create mode 100644 spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java create mode 100644 spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java diff --git a/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java b/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java new file mode 100644 index 0000000000..ad1535da6f --- /dev/null +++ b/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java @@ -0,0 +1,72 @@ +package com.baeldung.subflows.publishsubscribechannel; + +import java.util.Arrays; +import java.util.Collection; + +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.integration.annotation.Gateway; +import org.springframework.integration.annotation.IntegrationComponentScan; +import org.springframework.integration.annotation.MessagingGateway; +import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.dsl.IntegrationFlow; + +@EnableIntegration +@IntegrationComponentScan +public class PublishSubscibeChannelExample { + + @MessagingGateway + public interface I { + + @Gateway(requestChannel = "flow.input") + void flow(Collection is); + + } + + @Bean + DirectChannel multipleof3Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs1Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs2Channel() { + return new DirectChannel(); + } + + @Bean + public IntegrationFlow flow() { + return flow -> flow.split() + .publishSubscribeChannel(s -> + s.subscribe(f -> f. filter(p -> p % 3 == 0).channel("multipleof3Channel")) + .subscribe(f -> f. filter(p -> p % 3 == 1).channel("remainderIs1Channel")) + .subscribe(f -> f. filter(p -> p % 3 == 2).channel("remainderIs2Channel")) + ); + } + + public static void main(String[] args) { + final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(PublishSubscibeChannelExample.class); + + DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); + multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); + + DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); + remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); + + DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); + remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); + + ctx.getBean(I.class) + .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); + + ctx.close(); + + } + +} diff --git a/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java b/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java new file mode 100644 index 0000000000..c22072b1ff --- /dev/null +++ b/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java @@ -0,0 +1,71 @@ +package com.baeldung.subflows.routeToRecipients; + +import java.util.Arrays; +import java.util.Collection; + +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.integration.annotation.Gateway; +import org.springframework.integration.annotation.IntegrationComponentScan; +import org.springframework.integration.annotation.MessagingGateway; +import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.dsl.IntegrationFlow; + +@EnableIntegration +@IntegrationComponentScan +public class RouteToRecipientsExample { + + @MessagingGateway + public interface I { + + @Gateway(requestChannel = "flow.input") + void flow(Collection is); + + } + + @Bean + DirectChannel multipleof3Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs1Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs2Channel() { + return new DirectChannel(); + } + + @Bean + public IntegrationFlow flow() { + return flow -> flow.split() + + .routeToRecipients(r -> r. recipient("multipleof3Channel", p -> p % 3 == 0)// filter + . recipient("remainderIs1Channel", p -> p % 3 == 1) + .recipientFlow(sf -> sf. filter(p -> p % 3 == 2) + .channel("remainderIs2Channel"))); + } + + public static void main(String[] args) { + final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(RouteToRecipientsExample.class); + + DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); + multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); + + DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); + remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); + + DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); + remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); + + ctx.getBean(I.class) + .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); + + ctx.close(); + + } +} \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java b/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java new file mode 100644 index 0000000000..ccd49affd0 --- /dev/null +++ b/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java @@ -0,0 +1,99 @@ +package com.baeldung.subflows.separateflows; + +import java.util.Arrays; +import java.util.Collection; + +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.integration.annotation.Gateway; +import org.springframework.integration.annotation.IntegrationComponentScan; +import org.springframework.integration.annotation.MessagingGateway; +import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.dsl.IntegrationFlow; + +@EnableIntegration +@IntegrationComponentScan +public class SeparateFlowsExample { + + @MessagingGateway + public interface I { + + @Gateway(requestChannel = "multipleof3Flow.input") + void multipleof3(Collection is); + + @Gateway(requestChannel = "remainderIs1Flow.input") + void remainderIs1(Collection is); + + @Gateway(requestChannel = "remainderIs2Flow.input") + void remainderIs2(Collection is); + + } + + @Bean + DirectChannel multipleof3Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs1Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs2Channel() { + return new DirectChannel(); + } + + @Bean + public IntegrationFlow multipleof3Flow() { + return f -> f.split() + . filter(p -> p % 3 == 0) + .channel("multipleof3Channel"); + + } + + @Bean + public IntegrationFlow remainderIs1Flow() { + return f -> f.split() + . filter(p -> p % 3 == 1) + .channel("remainderIs1Channel"); + + } + + @Bean + public IntegrationFlow remainderIs2Flow() { + return f -> f.split() + . filter(p -> p % 3 == 2) + .channel("remainderIs2Channel"); + + } + + public static void main(String[] args) { + + final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(SeparateFlowsExample.class); + + DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); + multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); + + DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); + remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); + + DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); + remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); + + ctx.getBean(I.class) + .multipleof3(Arrays.asList(1, 2, 3, 4, 5, 6)); + + ctx.getBean(I.class) + .remainderIs1(Arrays.asList(1, 2, 3, 4, 5, 6)); + + ctx.getBean(I.class) + .remainderIs2(Arrays.asList(1, 2, 3, 4, 5, 6)); + + ctx.close(); + + } + +} diff --git a/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java b/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java new file mode 100644 index 0000000000..f8034ab5bd --- /dev/null +++ b/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java @@ -0,0 +1,75 @@ +package com.baeldung.subflows.subflowchannel; + +import java.util.Arrays; +import java.util.Collection; + +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.integration.annotation.Gateway; +import org.springframework.integration.annotation.IntegrationComponentScan; +import org.springframework.integration.annotation.MessagingGateway; +import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.dsl.IntegrationFlow; + +@EnableIntegration +@IntegrationComponentScan +public class FilterExample { + + @MessagingGateway + public interface I { + + @Gateway(requestChannel = "flow.input") + void flow(Collection is); + + } + + @Bean + DirectChannel multipleof3Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs1Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs2Channel() { + return new DirectChannel(); + } + + @Bean + public IntegrationFlow flow() { + return flow -> flow.split() + + . filter(x -> x % 3 == 0, sf -> sf.discardFlow(subf -> subf + + . filter(x -> x % 3 == 1, ssf -> ssf.discardChannel("remainderIs2Channel")) + .channel("remainderIs1Channel") + + )) + + .channel("multipleof3Channel"); + } + + public static void main(String[] args) { + final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(FilterExample.class); + + DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); + multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); + + DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); + remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); + + DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); + remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); + + ctx.getBean(I.class) + .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); + + ctx.close(); + + } +} \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java b/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java new file mode 100644 index 0000000000..cbef3ca219 --- /dev/null +++ b/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java @@ -0,0 +1,70 @@ +package com.baeldung.subflows.subflowmapping; + +import java.util.Arrays; +import java.util.Collection; + +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.integration.annotation.Gateway; +import org.springframework.integration.annotation.IntegrationComponentScan; +import org.springframework.integration.annotation.MessagingGateway; +import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.dsl.IntegrationFlow; + +@EnableIntegration +@IntegrationComponentScan +public class RouterExample { + @MessagingGateway + public interface I { + + @Gateway(requestChannel = "flow.input") + void flow(Collection is); + + } + + @Bean + DirectChannel multipleof3Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs1Channel() { + return new DirectChannel(); + } + + @Bean + DirectChannel remainderIs2Channel() { + return new DirectChannel(); + } + + @Bean + public IntegrationFlow flow() { + return f -> f.split() + . route(p -> p % 3, m -> m.channelMapping(0, "multipleof3Channel") + .subFlowMapping(1, sf -> sf .channel("remainderIs1Channel")) + .subFlowMapping(2, sf -> sf. handle((p,h)->p))) + .channel("remainderIs2Channel"); + } + + public static void main(String[] args) { + final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(RouterExample.class); + + DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); + multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); + + DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); + remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); + + DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); + remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); + + ctx.getBean(I.class) + .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); + + ctx.close(); + + } + +} From afc62ca73b2022414d68be5b9add9f9428721b8d Mon Sep 17 00:00:00 2001 From: Jonathan Cook Date: Tue, 30 Oct 2018 15:23:43 +0100 Subject: [PATCH 259/546] BAEL-2193 - Merge 2 java.util.Properties objects (#5571) * BAEL-2268 - Guide to JerseyTest - second attempt without formatting changes * BAEL-2268 - Guide to JerseyTest - Add line break to end of file * BAEL-2193 - Merge 2 java.util.Properties objects * BAEL-2193 - Merge 2 java.util.Properties object --- .../properties/MergePropertiesUnitTest.java | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 core-java/src/test/java/com/baeldung/properties/MergePropertiesUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/properties/MergePropertiesUnitTest.java b/core-java/src/test/java/com/baeldung/properties/MergePropertiesUnitTest.java new file mode 100644 index 0000000000..8720aff36b --- /dev/null +++ b/core-java/src/test/java/com/baeldung/properties/MergePropertiesUnitTest.java @@ -0,0 +1,84 @@ +package com.baeldung.properties; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.stream.Stream; + +import org.junit.Test; + +public class MergePropertiesUnitTest { + + @Test + public void givenTwoProperties_whenMergedUsingIteration_thenAllPropertiesInResult() { + Properties globalProperties = mergePropertiesByIteratingKeySet(propertiesA(), propertiesB()); + + testMergedProperties(globalProperties); + } + + @Test + public void givenTwoProperties_whenMergedUsingPutAll_thenAllPropertiesInResult() { + Properties globalProperties = mergePropertiesByUsingPutAll(propertiesA(), propertiesB()); + + testMergedProperties(globalProperties); + } + + @Test + public void givenTwoProperties_whenMergedUsingStreamAPI_thenAllPropertiesInResult() { + Properties globalProperties = mergePropertiesByUsingStreamApi(propertiesB(), propertiesA()); + + testMergedProperties(globalProperties); + } + + private Properties mergePropertiesByIteratingKeySet(Properties... properties) { + Properties mergedProperties = new Properties(); + for (Properties property : properties) { + Set propertyNames = property.stringPropertyNames(); + for (String name : propertyNames) { + String propertyValue = property.getProperty(name); + mergedProperties.setProperty(name, propertyValue); + } + } + return mergedProperties; + } + + private Properties mergePropertiesByUsingPutAll(Properties... properties) { + Properties mergedProperties = new Properties(); + for (Properties property : properties) { + mergedProperties.putAll(property); + } + return mergedProperties; + } + + private Properties mergePropertiesByUsingStreamApi(Properties... properties) { + return Stream.of(properties) + .collect(Properties::new, Map::putAll, Map::putAll); + } + + private Properties propertiesA() { + Properties properties = new Properties(); + properties.setProperty("application.name", "my-app"); + properties.setProperty("application.version", "1.0"); + return properties; + } + + private Properties propertiesB() { + Properties properties = new Properties(); + properties.setProperty("property-1", "sample property"); + properties.setProperty("property-2", "another sample property"); + return properties; + } + + private void testMergedProperties(Properties globalProperties) { + assertThat("There should be 4 properties", globalProperties.size(), equalTo(4)); + assertEquals("Property should be", globalProperties.getProperty("application.name"), "my-app"); + assertEquals("Property should be", globalProperties.getProperty("application.version"), "1.0"); + assertEquals("Property should be", globalProperties.getProperty("property-1"), "sample property"); + assertEquals("Property should be", globalProperties.getProperty("property-2"), "another sample property"); + } + +} From 4f84edd07a7aa7334cb712a9825adc65a7ff9818 Mon Sep 17 00:00:00 2001 From: Paul van Gool Date: Tue, 30 Oct 2018 09:36:09 -0700 Subject: [PATCH 260/546] BAEL-2074: Lombok builder with custom setter --- lombok/README.md | 1 + .../lombok/builder/customsetter/Message.java | 39 +++++++++++++++++++ .../BuilderWithCustomSetterUnitTest.java | 37 ++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java create mode 100644 lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java diff --git a/lombok/README.md b/lombok/README.md index a297aeb31e..34ec569e89 100644 --- a/lombok/README.md +++ b/lombok/README.md @@ -4,3 +4,4 @@ - [Using Lombok’s @Getter for Boolean Fields](https://www.baeldung.com/lombok-getter-boolean) - [Lombok @Builder with Inheritance](https://www.baeldung.com/lombok-builder-inheritance) - [Lombok Builder with Default Value](https://www.baeldung.com/lombok-builder-default-value) +- [Lombok Builder with Custom Setter](https://www.baeldung.com/lombok-builder-with-custom-setter) diff --git a/lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java b/lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java new file mode 100644 index 0000000000..95a314480f --- /dev/null +++ b/lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java @@ -0,0 +1,39 @@ +package com.baeldung.lombok.builder.customsetter; + +import java.io.File; +import java.util.List; + +import lombok.Builder; +import lombok.Data; + +@Builder +@Data +public class Message { + private String sender; + private String recipient; + private String text; + private File file; + + public static class MessageBuilder { + private String text; + private File file; + + public MessageBuilder text(String text) { + this.text = text; + verifyTextOrFile(); + return this; + } + + public MessageBuilder file(File file) { + this.file = file; + verifyTextOrFile(); + return this; + } + + private void verifyTextOrFile() { + if (text != null && file != null) { + throw new IllegalArgumentException("Cannot send 'text' and 'file'."); + } + } + } +} diff --git a/lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java b/lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java new file mode 100644 index 0000000000..3f7f276edf --- /dev/null +++ b/lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java @@ -0,0 +1,37 @@ +package com.baeldung.lombok.builder.customsetter; + +import java.io.File; + +import org.junit.Test; + +public class BuilderWithCustomSetterUnitTest { + + @Test + public void givenBuilderWithCustomSetter_TestTextOnly() { + Message message = Message.builder() + .sender("user@somedomain.com") + .recipient("someuser@otherdomain.com") + .text("How are you today?") + .build(); + } + + @Test + public void givenBuilderWithCustomSetter_TestFileOnly() { + Message message = Message.builder() + .sender("user@somedomain.com") + .recipient("someuser@otherdomain.com") + .file(new File("/path/to/file")) + .build(); + } + + @Test(expected = IllegalArgumentException.class) + public void givenBuilderWithCustomSetter_TestTextAndFile() { + Message message = Message.builder() + .sender("user@somedomain.com") + .recipient("someuser@otherdomain.com") + .text("How are you today?") + .file(new File("/path/to/file")) + .build(); + } + +} From b918a383be38003b0ecc4d1f3ef10b0b073df7bd Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Tue, 30 Oct 2018 20:00:56 +0200 Subject: [PATCH 261/546] Create README.md --- helidon/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 helidon/README.md diff --git a/helidon/README.md b/helidon/README.md new file mode 100644 index 0000000000..a092faf9f2 --- /dev/null +++ b/helidon/README.md @@ -0,0 +1,3 @@ +### Relevant articles + +- [Microservices with Oracle Helidon](https://www.baeldung.com/microservices-oracle-helidon) From b09fd15345935d320a58975108eb3481bca21269 Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Tue, 30 Oct 2018 17:41:55 -0300 Subject: [PATCH 262/546] Initial Commit (#5581) --- spring-boot-crud/pom.xml | 65 +++++++++++++++ .../java/com/baeldung/crud/Application.java | 24 ++++++ .../crud/controllers/UserController.java | 66 +++++++++++++++ .../java/com/baeldung/crud/entities/User.java | 56 +++++++++++++ .../crud/repositories/UserRepository.java | 13 +++ .../src/main/resources/css/shards.min.css | 2 + .../main/resources/templates/add-user.html | 40 +++++++++ .../src/main/resources/templates/index.html | 43 ++++++++++ .../main/resources/templates/update-user.html | 40 +++++++++ .../baeldung/crud/UserControllerUnitTest.java | 81 +++++++++++++++++++ .../java/com/baeldung/crud/UserUnitTest.java | 46 +++++++++++ 11 files changed, 476 insertions(+) create mode 100644 spring-boot-crud/pom.xml create mode 100644 spring-boot-crud/src/main/java/com/baeldung/crud/Application.java create mode 100644 spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java create mode 100644 spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java create mode 100644 spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java create mode 100644 spring-boot-crud/src/main/resources/css/shards.min.css create mode 100644 spring-boot-crud/src/main/resources/templates/add-user.html create mode 100644 spring-boot-crud/src/main/resources/templates/index.html create mode 100644 spring-boot-crud/src/main/resources/templates/update-user.html create mode 100644 spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java create mode 100644 spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java diff --git a/spring-boot-crud/pom.xml b/spring-boot-crud/pom.xml new file mode 100644 index 0000000000..f803a7e70b --- /dev/null +++ b/spring-boot-crud/pom.xml @@ -0,0 +1,65 @@ + + + 4.0.0 + + com.baeldung.spring-boot-crud + spring-boot-crud + 0.1.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.0.6.RELEASE + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-test + + + org.mockito + mockito-core + test + + + com.h2database + h2 + runtime + + + + UTF-8 + 1.8 + + + + spring-boot-crud + + + src/main/resources + true + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java new file mode 100644 index 0000000000..436cccb964 --- /dev/null +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java @@ -0,0 +1,24 @@ +package com.baeldung.crud; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +@EnableAutoConfiguration +@ComponentScan(basePackages={"com.baeldung.crud"}) +@EnableJpaRepositories(basePackages="com.baeldung.crud.repositories") +@EnableTransactionManagement +@EntityScan(basePackages="com.baeldung.crud.entities") + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java new file mode 100644 index 0000000000..1b7185c2fd --- /dev/null +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java @@ -0,0 +1,66 @@ +package com.baeldung.crud.controllers; + +import com.baeldung.crud.UserRepository; +import com.baeldung.crud.entities.User; +import javax.validation.Valid; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +@Controller +public class UserController { + + private final UserRepository userRepository; + + @Autowired + public UserController(UserRepository userRepository) { + this.userRepository = userRepository; + } + + @GetMapping("/signup") + public String showSignUpForm(User user) { + return "add-user"; + } + + @PostMapping("/adduser") + public String addUser(@Valid User user, BindingResult result, Model model) { + if (result.hasErrors()) { + return "add-user"; + } + + userRepository.save(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } + + @GetMapping("/edit/{id}") + public String showUpdateForm(@PathVariable("id") long id, Model model) { + User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + model.addAttribute("user", user); + return "update-user"; + } + + @PostMapping("/update/{id}") + public String updateUser(@PathVariable("id") long id, @Valid User user, BindingResult result, Model model) { + if (result.hasErrors()) { + user.setId(id); + return "update-user"; + } + + userRepository.save(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } + + @GetMapping("/delete/{id}") + public String deleteUser(@PathVariable("id") long id, Model model) { + User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + userRepository.delete(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } +} diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java b/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java new file mode 100644 index 0000000000..2074268179 --- /dev/null +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java @@ -0,0 +1,56 @@ +package com.baeldung.crud.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotBlank; + +@Entity +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + @NotBlank(message = "Name is mandatory") + private String name; + + @NotBlank(message = "Email is mandatory") + private String email; + + public User() {} + + public User(String name, String email) { + this.name = name; + this.email = email; + } + + public void setId(long id) { + this.id = id; + } + + public long getId() { + return id; + } + + public void setName(String name) { + this.name = name; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public String getEmail() { + return email; + } + + @Override + public String toString() { + return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; + } +} diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java b/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java new file mode 100644 index 0000000000..72348463f2 --- /dev/null +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java @@ -0,0 +1,13 @@ +package com.baeldung.crud.repositories; + +import com.baeldung.crud.entities.User; +import java.util.List; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserRepository extends CrudRepository { + + List findByName(String name); + +} diff --git a/spring-boot-crud/src/main/resources/css/shards.min.css b/spring-boot-crud/src/main/resources/css/shards.min.css new file mode 100644 index 0000000000..02260d25fa --- /dev/null +++ b/spring-boot-crud/src/main/resources/css/shards.min.css @@ -0,0 +1,2 @@ +@import url(https://fonts.googleapis.com/css?family=Poppins:300,400,500,600|Roboto+Mono);:root{--blue:#007bff;--indigo:#674eec;--purple:#8445f7;--pink:#ff4169;--red:#c4183c;--orange:#fb7906;--yellow:#ffb400;--green:#17c671;--teal:#1adba2;--cyan:#00b8d8;--white:#fff;--gray:#868e96;--gray-dark:#343a40;--primary:#007bff;--secondary:#5A6169;--success:#17c671;--info:#00b8d8;--warning:#ffb400;--danger:#c4183c;--light:#e9ecef;--dark:#212529;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;--font-family-monospace:"Roboto Mono",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}@media (max-width:575.98px){html{font-size:15px}}body{font-size:1rem;font-weight:300;color:#5a6169;background-color:#fff}a{color:#007bff;text-decoration:none}a:hover{color:#0056b3;text-decoration:underline}b,strong{font-weight:500}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}.h1,.h2,.h3,.h4,.h5,.h6{display:block}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.75rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:400;color:#212529}.h1,h1{font-size:3.052rem;letter-spacing:-.0625rem;line-height:3rem}.h2,h2{font-size:2.441rem;letter-spacing:-.0625rem;line-height:2.25rem}.h3,h3{font-size:1.953rem;line-height:2.25rem}.h4,h4{font-size:1.563rem;line-height:2rem}.h5,h5{font-size:1.25rem;line-height:1.5rem}.h6,h6{font-size:1rem;line-height:1.5rem}.lead{line-height:1.875rem}.display-1,.display-2,.display-3,.display-4{margin-bottom:.75rem}.display-1{font-size:7.451rem;line-height:1}.display-2{font-size:5.96rem;line-height:1}.display-3{font-size:4.768rem;line-height:1}.display-4{font-size:3.815rem;line-height:1}p{margin-bottom:1.75rem}hr{margin-top:1.125rem;margin-bottom:1.125rem;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:300}.mark,mark{padding:.2em;background-color:#fff09e}.blockquote{margin-bottom:.75rem;font-size:1.5rem}.blockquote-footer{font-size:1.125rem}.img-thumbnail{padding:0;border:none;background-color:#fff;border-radius:.375rem;box-shadow:none}.figure-img{margin-bottom:.75rem}.figure-caption{font-size:1rem;color:#868e96}code,kbd,pre,samp{font-family:"Roboto Mono",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}code{font-size:.75rem;padding:.1875rem .8125rem}kbd{padding:.1875rem .8125rem;font-size:.75rem;color:#fff;background-color:#212529;border-radius:.625rem;box-shadow:none}kbd kbd{font-weight:500}pre{margin-bottom:.75rem;font-size:.75rem;color:#212529;line-height:1.375rem}.pre-scrollable{max-height:340px}.table{background-color:transparent}.table td,.table th{padding:.75rem}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d1d3d5}.table-hover .table-secondary:hover{background-color:#c4c6c9}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c4c6c9}.table-success,.table-success>td,.table-success>th{background-color:#beefd7}.table-hover .table-success:hover{background-color:#aaeaca}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#aaeaca}.table-info,.table-info>td,.table-info>th{background-color:#b8ebf4}.table-hover .table-info:hover{background-color:#a2e5f1}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#a2e5f1}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeab8}.table-hover .table-warning:hover{background-color:#ffe29f}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe29f}.table-danger,.table-danger>td,.table-danger>th{background-color:#eebec8}.table-hover .table-danger:hover{background-color:#e9aab7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#e9aab7}.table-light,.table-light>td,.table-light>th{background-color:#f9fafb}.table-hover .table-light:hover{background-color:#eaedf1}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#eaedf1}.table-dark,.table-dark>td,.table-dark>th{background-color:#c1c2c3}.table-hover .table-dark:hover{background-color:#b4b5b6}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b4b5b6}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{background-color:rgba(255,255,255,.075)}.form-control{height:auto;padding:.5rem 1rem;font-size:.95rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #becad6;font-weight:300;will-change:border-color,box-shadow;border-radius:.375rem;box-shadow:none;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06)}.form-control:hover{border-color:#8fa4b8}.form-control:focus{color:#495057;background-color:#fff;border-color:#007bff;box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.form-control:focus:hover{border-color:#007bff}.form-control::-webkit-input-placeholder{color:#868e96}.form-control:-ms-input-placeholder{color:#868e96}.form-control::-ms-input-placeholder{color:#868e96}.form-control::placeholder{color:#868e96}.form-control:disabled,.form-control[readonly]{background-color:#f5f6f7}.form-control:disabled:hover,.form-control[readonly]:hover{border-color:#becad6;cursor:not-allowed}.form-control[readonly]:not(:disabled):focus{box-shadow:none;border-color:#becad6}select.form-control:not([size]):not([multiple]){height:calc(2.425rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}select.form-control:hover{cursor:pointer}form label:hover{cursor:pointer}.col-form-label{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);line-height:1.5}.col-form-label-lg{padding-top:calc(.75rem + 1px);padding-bottom:calc(.75rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.35rem + 1px);padding-bottom:calc(.35rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{padding-top:.5rem;padding-bottom:.5rem;line-height:1.5;font-weight:300}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-middle>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.35rem .75rem;font-size:.875rem;line-height:1.5;border-radius:.35rem}.input-group-sm>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-middle>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(2.0125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-middle>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.75rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.5rem}.input-group-lg>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-middle>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(3.375rem + 2px)}.form-group{margin-bottom:1rem}.form-text{margin-top:.25rem}.form-check{padding-left:1.25rem}.form-check-input{margin-top:.313rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#868e96}.form-check-inline{margin-right:.75rem}.form-check-inline .form-check-input{margin-right:.3125rem}.valid-feedback{margin-top:.25rem;font-size:80%;color:#17c671}.valid-tooltip{background-color:rgba(23,198,113,.8)}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#17c671;box-shadow:0 5px 11.5px rgba(23,198,113,.1)}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{box-shadow:0 5px 11.5px rgba(23,198,113,.1),0 1px 1px .1rem rgba(23,198,113,.2)}.custom-select.is-valid:hover,.form-control.is-valid:hover,.was-validated .custom-select:valid:hover,.was-validated .form-control:valid:hover{border-color:#17c671}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#17c671}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#17c671}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{background-color:#57eca4;border-color:#2ae68b}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{background-color:#2ae68b}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(23,198,113,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{color:#17c671;border-color:#17c671}.custom-file-input.is-valid~.custom-file-label::after,.was-validated .custom-file-input:valid~.custom-file-label::after{background-color:#b3f6d5;border-color:#2ae68b;color:#17c671}.custom-file-input:focus.is-valid~.custom-file-label,.was-validated .custom-file-input:focus:valid~.custom-file-label{border-color:#17c671;box-shadow:0 5px 11.5px rgba(23,198,113,.1),0 1px 1px .1rem rgba(23,198,113,.2)}.custom-file-input:hover.is-valid~.custom-file-label,.was-validated .custom-file-input:hover:valid~.custom-file-label{border-color:#17c671}.custom-toggle .custom-control-input:not(:checked).is-valid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:not(:checked):valid~.custom-control-label::before{background-color:#fff}.custom-toggle .custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:valid~.custom-control-label::before{background-color:#17c671}.custom-toggle .custom-control-input.is-invalid~.custom-control-label::after,.was-validated .custom-toggle .custom-control-input:invalid~.custom-control-label::after{background-color:#eb8c95}.custom-toggle .custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(23,198,113,.1),0 .156rem .125rem rgba(0,0,0,.06)}.invalid-feedback{margin-top:.25rem;font-size:80%;color:#c4183c}.invalid-tooltip{background-color:rgba(196,24,60,.8)}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#c4183c;box-shadow:0 5px 11.5px rgba(196,24,60,.1)}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{box-shadow:0 5px 11.5px rgba(196,24,60,.1),0 1px 1px .1rem rgba(196,24,60,.2)}.custom-select.is-invalid:hover,.form-control.is-invalid:hover,.was-validated .custom-select:invalid:hover,.was-validated .form-control:invalid:hover{border-color:#c4183c}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#c4183c}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#c4183c}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{background-color:#ea5876;border-color:#e52a51}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{background-color:#e52a51}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(196,24,60,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{color:#c4183c;border-color:#c4183c}.custom-file-input.is-invalid~.custom-file-label::after,.was-validated .custom-file-input:invalid~.custom-file-label::after{background-color:#f6b2c0;border-color:#e52a51;color:#c4183c}.custom-file-input:focus.is-invalid~.custom-file-label,.was-validated .custom-file-input:focus:invalid~.custom-file-label{border-color:#c4183c;box-shadow:0 5px 11.5px rgba(196,24,60,.1),0 1px 1px .1rem rgba(196,24,60,.2)}.custom-file-input:hover.is-invalid~.custom-file-label,.was-validated .custom-file-input:hover:invalid~.custom-file-label{border-color:#c4183c}.custom-toggle .custom-control-input:not(:checked).is-invalid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:not(:checked):invalid~.custom-control-label::before{background-color:#fff}.custom-toggle .custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:valid~.custom-control-label::before{background-color:#17c671}.custom-toggle .custom-control-input.is-invalid~.custom-control-label::after,.was-validated .custom-toggle .custom-control-input:invalid~.custom-control-label::after{background-color:#eb8c95}.custom-toggle .custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-toggle .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(196,24,60,.1),0 .156rem .125rem rgba(0,0,0,.06)}@media (min-width:576px){.form-inline .form-check-input{margin-right:.313rem}}.btn{font-weight:300;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;border:1px solid transparent;padding:.75rem 1.25rem;font-size:.875rem;line-height:1.125;border-radius:.375rem;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.btn.hover,.btn:hover{cursor:pointer}.btn.focus,.btn:focus{box-shadow:none}.btn:not([disabled]):not(.disabled).active,.btn:not([disabled]):not(.disabled):active{background-image:none;box-shadow:none}.btn.btn-squared{border-radius:0}.btn.btn-pill{border-radius:50px}.btn-primary{color:#fff;border-color:#007bff;background-color:#007bff;box-shadow:none}.btn-primary:hover{color:#fff;background-color:#006fe6;border-color:#006fe6;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,123,255,.25)}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 3px rgba(0,123,255,.15),0 3px 15px rgba(0,123,255,.2),0 2px 5px rgba(0,0,0,.1)}.btn-primary.disabled,.btn-primary:disabled{background-color:#007bff;border-color:#007bff;box-shadow:none;cursor:not-allowed}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#006fe6;border-color:#0062cc;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-secondary{color:#fff;border-color:#5a6169;background-color:#5a6169;box-shadow:none}.btn-secondary:hover{color:#fff;background-color:#4e545b;border-color:#4e545b;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(90,97,105,.25)}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 3px rgba(90,97,105,.15),0 3px 15px rgba(90,97,105,.2),0 2px 5px rgba(0,0,0,.1)}.btn-secondary.disabled,.btn-secondary:disabled{background-color:#5a6169;border-color:#5a6169;box-shadow:none;cursor:not-allowed}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#4e545b;border-color:#42484e;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-success{color:#fff;border-color:#17c671;background-color:#17c671;box-shadow:none}.btn-success:hover{color:#fff;background-color:#14af64;border-color:#14af64;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(23,198,113,.25)}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 3px rgba(23,198,113,.15),0 3px 15px rgba(23,198,113,.2),0 2px 5px rgba(0,0,0,.1)}.btn-success.disabled,.btn-success:disabled{background-color:#17c671;border-color:#17c671;box-shadow:none;cursor:not-allowed}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#14af64;border-color:#129857;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-info{color:#fff;border-color:#00b8d8;background-color:#00b8d8;box-shadow:none}.btn-info:hover{color:#fff;background-color:#00a2bf;border-color:#00a2bf;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,184,216,.25)}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 3px rgba(0,184,216,.15),0 3px 15px rgba(0,184,216,.2),0 2px 5px rgba(0,0,0,.1)}.btn-info.disabled,.btn-info:disabled{background-color:#00b8d8;border-color:#00b8d8;box-shadow:none;cursor:not-allowed}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#00a2bf;border-color:#008da5;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-warning{color:#212529;border-color:#ffb400;background-color:#ffb400;box-shadow:none}.btn-warning:hover{color:#212529;background-color:#e6a200;border-color:#e6a200;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,180,0,.25)}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 3px rgba(255,180,0,.15),0 3px 15px rgba(255,180,0,.2),0 2px 5px rgba(0,0,0,.1)}.btn-warning.disabled,.btn-warning:disabled{background-color:#ffb400;border-color:#ffb400;box-shadow:none;cursor:not-allowed}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#e6a200;border-color:#cc9000;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-danger{color:#fff;border-color:#c4183c;background-color:#c4183c;box-shadow:none}.btn-danger:hover{color:#fff;background-color:#ad1535;border-color:#ad1535;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(196,24,60,.25)}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 3px rgba(196,24,60,.15),0 3px 15px rgba(196,24,60,.2),0 2px 5px rgba(0,0,0,.1)}.btn-danger.disabled,.btn-danger:disabled{background-color:#c4183c;border-color:#c4183c;box-shadow:none;cursor:not-allowed}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#ad1535;border-color:#97122e;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-light{color:#212529;border-color:#e9ecef;background-color:#e9ecef;box-shadow:none}.btn-light:hover{color:#212529;background-color:#dadfe4;border-color:#dadfe4;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(233,236,239,.25)}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 3px rgba(233,236,239,.15),0 3px 15px rgba(233,236,239,.2),0 2px 5px rgba(0,0,0,.1)}.btn-light.disabled,.btn-light:disabled{background-color:#e9ecef;border-color:#e9ecef;box-shadow:none;cursor:not-allowed}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dadfe4;border-color:#cbd3da;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-dark{color:#fff;border-color:#212529;background-color:#212529;box-shadow:none}.btn-dark:hover{color:#fff;background-color:#16181b;border-color:#16181b;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(33,37,41,.25)}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 3px rgba(33,37,41,.15),0 3px 15px rgba(33,37,41,.2),0 2px 5px rgba(0,0,0,.1)}.btn-dark.disabled,.btn-dark:disabled{background-color:#212529;border-color:#212529;box-shadow:none;cursor:not-allowed}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#16181b;border-color:#0a0c0d;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-white{color:#212529;border-color:#fff;background-color:#fff;box-shadow:none}.btn-white:hover{color:#212529;background-color:#f2f2f2;border-color:#f2f2f2;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,255,255,.25)}.btn-white.focus,.btn-white:focus{box-shadow:0 0 0 3px rgba(255,255,255,.15),0 3px 15px rgba(255,255,255,.2),0 2px 5px rgba(0,0,0,.1)}.btn-white.disabled,.btn-white:disabled{background-color:#fff;border-color:#fff;box-shadow:none;cursor:not-allowed}.btn-white:not(:disabled):not(.disabled).active,.btn-white:not(:disabled):not(.disabled):active,.show>.btn-white.dropdown-toggle{color:#212529;background-color:#f2f2f2;border-color:#e6e6e6;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-black{color:#fff;border-color:#000;background-color:#000;box-shadow:none}.btn-black:hover{color:#fff;background-color:#000;border-color:#000;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,0,0,.25)}.btn-black.focus,.btn-black:focus{box-shadow:0 0 0 3px rgba(0,0,0,.15),0 3px 15px rgba(0,0,0,.2),0 2px 5px rgba(0,0,0,.1)}.btn-black.disabled,.btn-black:disabled{background-color:#000;border-color:#000;box-shadow:none;cursor:not-allowed}.btn-black:not(:disabled):not(.disabled).active,.btn-black:not(:disabled):not(.disabled):active,.show>.btn-black.dropdown-toggle{color:#fff;background-color:#000;border-color:#000;background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-primary{background-color:transparent;background-image:none;border-color:#007bff;color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,123,255,.25)}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 3px rgba(0,123,255,.15),0 3px 15px rgba(0,123,255,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent;box-shadow:none}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-secondary{background-color:transparent;background-image:none;border-color:#5a6169;color:#5a6169}.btn-outline-secondary:hover{color:#fff;background-color:#5a6169;border-color:#5a6169;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(90,97,105,.25)}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 3px rgba(90,97,105,.15),0 3px 15px rgba(90,97,105,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#5a6169;background-color:transparent;box-shadow:none}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#5a6169;border-color:#5a6169}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-success{background-color:transparent;background-image:none;border-color:#17c671;color:#17c671}.btn-outline-success:hover{color:#fff;background-color:#17c671;border-color:#17c671;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(23,198,113,.25)}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 3px rgba(23,198,113,.15),0 3px 15px rgba(23,198,113,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#17c671;background-color:transparent;box-shadow:none}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#17c671;border-color:#17c671}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-info{background-color:transparent;background-image:none;border-color:#00b8d8;color:#00b8d8}.btn-outline-info:hover{color:#fff;background-color:#00b8d8;border-color:#00b8d8;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,184,216,.25)}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 3px rgba(0,184,216,.15),0 3px 15px rgba(0,184,216,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#00b8d8;background-color:transparent;box-shadow:none}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#00b8d8;border-color:#00b8d8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-warning{background-color:transparent;background-image:none;border-color:#ffb400;color:#ffb400}.btn-outline-warning:hover{color:#212529;background-color:#ffb400;border-color:#ffb400;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,180,0,.25)}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 3px rgba(255,180,0,.15),0 3px 15px rgba(255,180,0,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffb400;background-color:transparent;box-shadow:none}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffb400;border-color:#ffb400}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-danger{background-color:transparent;background-image:none;border-color:#c4183c;color:#c4183c}.btn-outline-danger:hover{color:#fff;background-color:#c4183c;border-color:#c4183c;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(196,24,60,.25)}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 3px rgba(196,24,60,.15),0 3px 15px rgba(196,24,60,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#c4183c;background-color:transparent;box-shadow:none}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#c4183c;border-color:#c4183c}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-light{background-color:transparent;background-image:none;border-color:#e9ecef;color:#212529}.btn-outline-light:hover{color:#212529;background-color:#e9ecef;border-color:#e9ecef;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(233,236,239,.25)}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 3px rgba(233,236,239,.15),0 3px 15px rgba(233,236,239,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#e9ecef;background-color:transparent;box-shadow:none}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#e9ecef;border-color:#e9ecef}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-dark{background-color:transparent;background-image:none;border-color:#212529;color:#212529}.btn-outline-dark:hover{color:#fff;background-color:#212529;border-color:#212529;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(33,37,41,.25)}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 3px rgba(33,37,41,.15),0 3px 15px rgba(33,37,41,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#212529;background-color:transparent;box-shadow:none}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#212529;border-color:#212529}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-white{background-color:transparent;background-image:none;border-color:#fff;color:#212529;color:#fff}.btn-outline-white:hover{color:#212529;background-color:#fff;border-color:#fff;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(255,255,255,.25)}.btn-outline-white.focus,.btn-outline-white:focus{box-shadow:0 0 0 3px rgba(255,255,255,.15),0 3px 15px rgba(255,255,255,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-white.disabled,.btn-outline-white:disabled{color:#fff;background-color:transparent;box-shadow:none}.btn-outline-white:not(:disabled):not(.disabled).active,.btn-outline-white:not(:disabled):not(.disabled):active,.show>.btn-outline-white.dropdown-toggle{color:#212529;background-color:#fff;border-color:#fff}.btn-outline-white:not(:disabled):not(.disabled).active:focus,.btn-outline-white:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-white.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-white:not(:disabled):not(.disabled).active,.btn-outline-white:not(:disabled):not(.disabled):active{color:#000}.btn-outline-black{background-color:transparent;background-image:none;border-color:#000;color:#000;color:#000}.btn-outline-black:hover{color:#fff;background-color:#000;border-color:#000;box-shadow:0 5px 15px rgba(0,0,0,.05),0 4px 10px rgba(0,0,0,.25)}.btn-outline-black.focus,.btn-outline-black:focus{box-shadow:0 0 0 3px rgba(0,0,0,.15),0 3px 15px rgba(0,0,0,.2),0 2px 5px rgba(0,0,0,.1)!important}.btn-outline-black.disabled,.btn-outline-black:disabled{color:#000;background-color:transparent;box-shadow:none}.btn-outline-black:not(:disabled):not(.disabled).active,.btn-outline-black:not(:disabled):not(.disabled):active,.show>.btn-outline-black.dropdown-toggle{color:#fff;background-color:#000;border-color:#000}.btn-outline-black:not(:disabled):not(.disabled).active:focus,.btn-outline-black:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-black.dropdown-toggle:focus{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)!important}.btn-outline-black:not(:disabled):not(.disabled).active,.btn-outline-black:not(:disabled):not(.disabled):active{color:#fff}.btn-link{font-weight:300;color:#007bff}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link:disabled{color:#868e96}.btn-group-lg>.btn,.btn-lg{padding:.75rem 1.75rem;font-size:1.125rem;line-height:1.5;border-radius:.5rem}.btn-group-sm>.btn,.btn-sm{padding:.35rem 1rem;font-size:.75rem;line-height:1.5;border-radius:.35rem}.btn-block+.btn-block{margin-top:.5rem}.fade{transition:opacity .2s ease-in-out}.collapsing{transition:height 350ms ease-in-out}i.material-icons{font-size:inherit;position:relative;top:2px}.dropdown-menu{z-index:1000;min-width:10rem;padding:.5rem 0;margin:0 0 0;font-size:1rem;color:#5a6169;background-color:#fff;border:1px solid rgba(0,0,0,.05);border-radius:.375rem;box-shadow:0 .5rem 4rem rgba(0,0,0,.11),0 10px 20px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.06)}.dropdown-menu-small{box-shadow:0 .5rem 2rem rgba(0,0,0,.11),0 3px 10px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.06);padding:.25rem 0;font-size:.813rem}.dropdown-menu-small .dropdown-item{padding:.375rem .875rem;font-size:.813rem}.dropdown-menu-small .dropdown-divider{margin:.25rem 0}.dropup .dropdown-menu{margin-bottom:0}.dropright .dropdown-menu{margin-left:0}.dropleft .dropdown-menu{margin-right:0}.dropdown-divider{height:0;margin:.75rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{padding:.5rem 1.25rem;font-weight:300;color:#212529;font-size:.9375rem;transition:background-color 250ms cubic-bezier(.27,.01,.38,1.06),color 250ms cubic-bezier(.27,.01,.38,1.06)}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;background-color:#eceeef}.dropdown-item.active,.dropdown-item:active{color:#fff;background-color:#c3c7cc}.dropdown-item.disabled,.dropdown-item:disabled{color:#868e96}.dropdown-item.disabled:hover,.dropdown-item:disabled:hover{background:0 0;cursor:not-allowed}.dropdown-header{padding:.5rem 1.25rem;font-size:.875rem;color:#868e96}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.9375rem;padding-left:.9375rem}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:1.3125rem;padding-left:1.3125rem}.btn-group.show .dropdown-toggle{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.show .dropdown-toggle.btn-link{box-shadow:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control{margin-left:-1px}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-file:not(:first-child) .custom-file-label::after{border-top-left-radius:0;border-bottom-left-radius:0}.input-group.input-group-seamless>.form-control{border-radius:.375rem}.input-group.input-group-seamless>.input-group-append,.input-group.input-group-seamless>.input-group-prepend{position:absolute;top:0;bottom:0;z-index:4}.input-group.input-group-seamless>.input-group-append .input-group-text,.input-group.input-group-seamless>.input-group-prepend .input-group-text{padding:12px 14px;background:0 0;border:none}.input-group.input-group-seamless>.input-group-append{right:0}.input-group.input-group-seamless>.input-group-middle{right:0;left:0}.input-group.input-group-seamless>.input-group-prepend{left:0}.input-group.input-group-seamless>.custom-select:not(:last-child),.input-group.input-group-seamless>.form-control:not(:last-child){padding-right:40px}.input-group.input-group-seamless>.custom-select:not(:first-child),.input-group.input-group-seamless>.form-control:not(:first-child){padding-left:40px}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{font-size:1rem;font-weight:300;line-height:1.5;color:#abb6bf;background-color:#f9fafb;border:1px solid #becad6;border-radius:.375rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.input-group-middle>.btn,.input-group>.input-group-middle>.input-group-text{border-left:0;border-right:0;border-radius:0}.input-group-middle{display:-ms-flexbox;display:flex}.custom-control{min-height:1.5rem;padding-left:1.688rem}.custom-control:hover{cursor:pointer}.custom-control .custom-control-label:before{pointer-events:all}.custom-control-inline{margin-right:1rem}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:transparent;background-color:#007bff;box-shadow:none}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-control-input:active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;box-shadow:none}.custom-control-input:disabled~.custom-control-label{color:#868e96}.custom-control-input:disabled~.custom-control-label:hover{cursor:not-allowed}.custom-control-input:disabled~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:static}.custom-control-label:hover{cursor:pointer}.custom-control-label::before{top:.1875rem;left:0;width:1.125rem;height:1.125rem;background-color:#fff;border:1px solid #becad6;transition:all 250ms cubic-bezier(.27,.01,.38,1.06);box-shadow:none}.custom-control-label::after{top:.1875rem;width:1.125rem;height:1.125rem;background-size:50% 50%}.custom-checkbox .custom-control-label::before{border-radius:2px}.custom-checkbox .custom-control-label::after{content:'';position:absolute;top:5px;left:7px;width:5px;height:11px;opacity:0;-webkit-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);border-right:2px solid #fff;border-bottom:2px solid #fff;transition:border 250ms cubic-bezier(.27,.01,.38,1.06),-webkit-transform 250ms cubic-bezier(.27,.01,.38,1.06);transition:transform 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06);transition:transform 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06),-webkit-transform 250ms cubic-bezier(.27,.01,.38,1.06);transition-delay:.1s}.custom-checkbox .custom-control-input:checked~.custom-control-label::before{background-image:none}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{opacity:1;-webkit-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1);background-image:none}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border:none;background-color:#007bff;box-shadow:none}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{content:'';position:absolute;-webkit-transform:scale(1);transform:scale(1);background-image:none;background-color:#fff;border:none;width:10px;height:2px;top:11px;left:4px;opacity:1;transition:none}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background:#e9ecef;border-color:#becad6}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::after{border-color:#becad6}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-label::after{content:'';border-radius:50%;-webkit-transform:scale(0);transform:scale(0);background-image:none!important;position:absolute;background:#fff;width:8px;height:8px;top:8px;left:5px;transition:all 250ms cubic-bezier(.27,.01,.38,1.06);transition-delay:.1s;opacity:0;transform:scale(0)}.custom-radio .custom-control-input:checked~.custom-control-label::before{background-color:#007bff}.custom-radio .custom-control-input:checked~.custom-control-label::after{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:#a8aeb4}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background:#e9ecef;border-color:#becad6}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::after{background:#becad6}.custom-select{height:calc(2.425rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.2;color:#495057;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid #becad6;font-weight:300;font-size:.95rem;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06);border-radius:.375rem}.custom-select:focus{border-color:#007bff;box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select:hover:not(:focus):not(:disabled){cursor:pointer;border-color:#8fa4b8}.custom-select[multiple],.custom-select[size]:not([size="1"]){padding-right:.75rem}.custom-select:disabled{color:#868e96;background-color:#e9ecef}.custom-select-sm{height:calc(2.0125rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:.75rem}.custom-select-lg{height:calc(3.375rem + 2px);font-size:1.25rem;padding-top:.375rem;padding-bottom:.375rem}.custom-file{height:calc(2.428rem + 2px);font-size:.95rem;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border 250ms cubic-bezier(.27,.01,.38,1.06)}.custom-file-input{min-width:14rem;height:calc(2.428rem + 2px)}.custom-file-input:focus~.custom-file-label{border-color:#007bff;color:#495057;box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-file-input:focus~.custom-file-label::after{border-color:#007bff;color:#007bff;background:#e6f2ff}.custom-file-input:focus~.custom-file-label:hover{border-color:#007bff}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input:not(:disabled):hover{cursor:pointer}.custom-file-input:not(:disabled):hover~.custom-file-label,.custom-file-input:not(:disabled):hover~.custom-file-label:before{border-color:#8fa4b8}.custom-file-input:disabled+.custom-file-label{color:#868e96;background-color:#f8f9fa}.custom-file-label{height:calc(2.428rem + 2px);padding:.5rem 1rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #becad6;font-weight:300;box-shadow:none;transition:box-shadow 250ms cubic-bezier(.27,.01,.38,1.06),border-color 250ms cubic-bezier(.27,.01,.38,1.06);border-radius:.375rem}.custom-file-label::after{padding:.5rem 1rem;height:calc(calc(2.428rem + 2px) - 1px * 2);line-height:1.5;color:#495057;border-left:1px solid #becad6;background-color:#e9ecef;border-radius:0 .375rem .375rem 0}.custom-toggle{position:relative;padding-left:3.75rem}.custom-toggle .custom-control-label::before{position:absolute;top:0;left:0;display:block;width:3.125rem;height:1.75rem;background:#fff;border-radius:100px;border:.0625rem solid #becad6}.custom-toggle .custom-control-label::after{content:'';position:absolute;top:.25rem;left:.25rem;width:1.25rem;height:1.25rem;background:#becad6;border-radius:6.25rem;transition:350ms}.custom-toggle .custom-control-input:checked~.custom-control-label::before{background:#17c671;border-color:#17c671}.custom-toggle .custom-control-input:checked~.custom-control-label::after{left:2.875rem;-webkit-transform:translateX(-100%);transform:translateX(-100%);background:#fff}.custom-toggle .custom-control-input:checked:disabled~.custom-control-label::before{background:#e9ecef;border-color:#becad6}.custom-toggle .custom-control-input:checked:disabled~.custom-control-label::after{background:#becad6}.custom-toggle .custom-control-input:active:not(:disabled)~.custom-control-label::after{width:1.625rem}.custom-toggle .custom-control-input:active:not(:checked)~.custom-control-label::before{background-color:#fff}.custom-toggle .custom-control-input:disabled:active~.custom-control-label::before{background-color:#e9ecef}.custom-toggle .custom-control-input:focus~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(23,198,113,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-toggle .custom-control-input:focus:not(:checked)~.custom-control-label::before{box-shadow:0 .313rem .719rem rgba(0,123,255,.1),0 .156rem .125rem rgba(0,0,0,.06)}.custom-toggle.custom-toggle-sm{padding-left:2.625rem}.custom-toggle.custom-toggle-sm .custom-control-label::before{top:.1875rem;position:absolute;display:block;width:2.1875rem;height:1.125rem;background:#fff;border-radius:100px;border:.0625rem solid #becad6}.custom-toggle.custom-toggle-sm .custom-control-label::after{content:'';position:absolute;top:.375rem;left:.1875rem;width:.75rem;height:.75rem}.custom-toggle.custom-toggle-sm .custom-control-input:checked~.custom-control-label::after{left:1.9375rem}.custom-toggle.custom-toggle-sm .custom-control-input:active:not(:disabled)~.custom-control-label::after{width:1rem}.nav{font-size:.875rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}.nav-link{padding:.625rem 1.125rem;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.nav-link.disabled{color:#868e96}.nav-tabs{border-bottom:1px solid #d1d4d8}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.375rem;border-top-right-radius:.375rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef}.nav-tabs .nav-link.disabled{color:#868e96}.nav-tabs .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-tabs .nav-link:hover{border-color:#e7e9ea}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#ddd}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.375rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-pills:hover{background-color:#fdfdfd}.nav-outlined-pills .nav-link{border-radius:.375rem;border:1px solid transparent}.nav-outlined-pills .nav-link.active,.show>.nav-outlined-pills .nav-link{background:0 0;color:#007bff;border-color:#007bff}.nav-outlined-pills .nav-link:hover{border-color:#e7e9ea}.nav-blue .nav-link.active{background-color:#007bff;border-color:#0074f0;color:#fff}.nav-blue .nav-link.disabled{color:#868e96}.nav-blue .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-blue .nav-link{color:#007bff}.nav-blue.nav-outlined-pills .nav-link.active{background:0 0;border-color:#3395ff;color:#007bff}.nav-blue.nav-outlined-pills .nav-link.active:hover{border-color:#3395ff}.nav-blue.nav-outlined-pills .nav-link{color:#007bff}.nav-indigo .nav-link.active{background-color:#674eec;border-color:#5b40eb;color:#fff}.nav-indigo .nav-link.disabled{color:#868e96}.nav-indigo .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-indigo .nav-link{color:#674eec}.nav-indigo.nav-outlined-pills .nav-link.active{background:0 0;border-color:#8f7cf1;color:#674eec}.nav-indigo.nav-outlined-pills .nav-link.active:hover{border-color:#8f7cf1}.nav-indigo.nav-outlined-pills .nav-link{color:#674eec}.nav-purple .nav-link.active{background-color:#8445f7;border-color:#7a36f6;color:#fff}.nav-purple .nav-link.disabled{color:#868e96}.nav-purple .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-purple .nav-link{color:#8445f7}.nav-purple.nav-outlined-pills .nav-link.active{background:0 0;border-color:#a476f9;color:#8445f7}.nav-purple.nav-outlined-pills .nav-link.active:hover{border-color:#a476f9}.nav-purple.nav-outlined-pills .nav-link{color:#8445f7}.nav-pink .nav-link.active{background-color:#ff4169;border-color:#ff325d;color:#fff}.nav-pink .nav-link.disabled{color:#868e96}.nav-pink .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-pink .nav-link{color:#ff4169}.nav-pink.nav-outlined-pills .nav-link.active{background:0 0;border-color:#ff7491;color:#ff4169}.nav-pink.nav-outlined-pills .nav-link.active:hover{border-color:#ff7491}.nav-pink.nav-outlined-pills .nav-link{color:#ff4169}.nav-red .nav-link.active{background-color:#c4183c;border-color:#b61638;color:#fff}.nav-red .nav-link.disabled{color:#868e96}.nav-red .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-red .nav-link{color:#c4183c}.nav-red.nav-outlined-pills .nav-link.active{background:0 0;border-color:#e52a51;color:#c4183c}.nav-red.nav-outlined-pills .nav-link.active:hover{border-color:#e52a51}.nav-red.nav-outlined-pills .nav-link{color:#c4183c}.nav-orange .nav-link.active{background-color:#fb7906;border-color:#ee7204;color:#fff}.nav-orange .nav-link.disabled{color:#868e96}.nav-orange .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-orange .nav-link{color:#fb7906}.nav-orange.nav-outlined-pills .nav-link.active{background:0 0;border-color:#fc9438;color:#fb7906}.nav-orange.nav-outlined-pills .nav-link.active:hover{border-color:#fc9438}.nav-orange.nav-outlined-pills .nav-link{color:#fb7906}.nav-yellow .nav-link.active{background-color:#ffb400;border-color:#f0a900;color:#212529}.nav-yellow .nav-link.disabled{color:#868e96}.nav-yellow .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-yellow .nav-link{color:#ffb400}.nav-yellow.nav-outlined-pills .nav-link.active{background:0 0;border-color:#ffc333;color:#ffb400}.nav-yellow.nav-outlined-pills .nav-link.active:hover{border-color:#ffc333}.nav-yellow.nav-outlined-pills .nav-link{color:#ffb400}.nav-green .nav-link.active{background-color:#17c671;border-color:#15b869;color:#fff}.nav-green .nav-link.disabled{color:#868e96}.nav-green .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-green .nav-link{color:#17c671}.nav-green.nav-outlined-pills .nav-link.active{background:0 0;border-color:#2ae68b;color:#17c671}.nav-green.nav-outlined-pills .nav-link.active:hover{border-color:#2ae68b}.nav-green.nav-outlined-pills .nav-link{color:#17c671}.nav-teal .nav-link.active{background-color:#1adba2;border-color:#18cd98;color:#212529}.nav-teal .nav-link.disabled{color:#868e96}.nav-teal .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-teal .nav-link{color:#1adba2}.nav-teal.nav-outlined-pills .nav-link.active{background:0 0;border-color:#40e8b7;color:#1adba2}.nav-teal.nav-outlined-pills .nav-link.active:hover{border-color:#40e8b7}.nav-teal.nav-outlined-pills .nav-link{color:#1adba2}.nav-cyan .nav-link.active{background-color:#00b8d8;border-color:#00abc9;color:#fff}.nav-cyan .nav-link.disabled{color:#868e96}.nav-cyan .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-cyan .nav-link{color:#00b8d8}.nav-cyan.nav-outlined-pills .nav-link.active{background:0 0;border-color:#0cdbff;color:#00b8d8}.nav-cyan.nav-outlined-pills .nav-link.active:hover{border-color:#0cdbff}.nav-cyan.nav-outlined-pills .nav-link{color:#00b8d8}.nav-white .nav-link.active{background-color:#fff;border-color:#f7f7f7;color:#212529}.nav-white .nav-link.disabled{color:#868e96}.nav-white .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-white .nav-link{color:#fff}.nav-white.nav-outlined-pills .nav-link.active{background:0 0;border-color:#fff;color:#fff}.nav-white.nav-outlined-pills .nav-link.active:hover{border-color:#fff}.nav-white.nav-outlined-pills .nav-link{color:#fff}.nav-gray .nav-link.active{background-color:#868e96;border-color:#7e868f;color:#fff}.nav-gray .nav-link.disabled{color:#868e96}.nav-gray .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-gray .nav-link{color:#868e96}.nav-gray.nav-outlined-pills .nav-link.active{background:0 0;border-color:#a1a8ae;color:#868e96}.nav-gray.nav-outlined-pills .nav-link.active:hover{border-color:#a1a8ae}.nav-gray.nav-outlined-pills .nav-link{color:#868e96}.nav-gray-dark .nav-link.active{background-color:#343a40;border-color:#2d3238;color:#fff}.nav-gray-dark .nav-link.disabled{color:#868e96}.nav-gray-dark .nav-link.disabled:hover{cursor:not-allowed;border-color:transparent}.nav-gray-dark .nav-link{color:#343a40}.nav-gray-dark.nav-outlined-pills .nav-link.active{background:0 0;border-color:#4b545c;color:#343a40}.nav-gray-dark.nav-outlined-pills .nav-link.active:hover{border-color:#4b545c}.nav-gray-dark.nav-outlined-pills .nav-link{color:#343a40}.navbar{padding:.75rem 1.5rem}.navbar-brand{padding-top:.625rem;padding-bottom:.625rem;margin-right:1.5rem;font-size:1rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:400}.navbar-text{padding-top:.625rem;padding-bottom:.625rem}.navbar-toggler{padding:.5rem .5rem;font-size:1rem;background:#fff;border:1px solid transparent;border-radius:.375rem}@media (min-width:576px){.navbar-expand-sm .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}@media (min-width:768px){.navbar-expand-md .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}@media (min-width:992px){.navbar-expand-lg .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}@media (min-width:1200px){.navbar-expand-xl .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}}.navbar-expand .navbar-nav .nav-link{padding-right:.625rem;padding-left:.625rem}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1);background:0 0}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1);background:0 0}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{background-color:#fff;border:none;border-radius:.625rem;box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.625rem;border-top-right-radius:.625rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.625rem;border-bottom-left-radius:.625rem}.card .list-group-item{padding:.8125rem 1.875rem}.card .card-text{margin-bottom:1.5625rem}.card a:hover{text-decoration:none}.card-small{box-shadow:0 2px 0 rgba(90,97,105,.11),0 4px 8px rgba(90,97,105,.12),0 10px 10px rgba(90,97,105,.06),0 7px 70px rgba(90,97,105,.1)}.card-small .card-body,.card-small .card-footer,.card-small .card-header{padding:1rem 1rem}.card-body{padding:1.875rem}.card-body>p:last-child{margin-bottom:0}.card-title{font-weight:500;margin-bottom:.75rem}.card-subtitle{margin-top:-1.09375rem}.card-link{font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}.card-link+.card-link{margin-left:1.875rem}.card-header{padding:1.09375rem 1.875rem;background-color:rgba(90,97,105,.06);border-bottom:none}.card-header:first-child{border-radius:.625rem .625rem 0 0}.card-footer{padding:1.09375rem 1.875rem;background-color:rgba(90,97,105,.06);border-top:none}.card-footer:last-child{border-radius:0 0 .625rem .625rem}.card-header-tabs{margin-bottom:-1rem;border-bottom:0}.card-header-tabs .nav-link,.card-header-tabs .nav-link:hover{border-bottom:transparent}.card-header-pills{margin-right:-.9375rem;margin-left:-.9375rem}.card-header-pills:hover{background:0 0}.card-img-overlay{padding:1.875rem 2.1875rem;background:rgba(90,97,105,.5);border-radius:.625rem}.card-img-overlay .card-title{color:#fff}.card-img{border-radius:.625rem}.card-img-top{border-top-left-radius:.625rem;border-top-right-radius:.625rem}.card-img-bottom{border-bottom-right-radius:.625rem;border-bottom-left-radius:.625rem}.card-deck .card{margin-bottom:.9375rem}@media (min-width:576px){.card-deck{margin-right:-.9375rem;margin-left:-.9375rem}.card-deck .card{margin-right:.9375rem;margin-left:.9375rem}}.card-group>.card{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.card-group>.card:last-child .card-body,.card-group>.card:last-child .card-footer{border-right:none}.card-group .card-body,.card-group .card-footer{border-right:1px solid #e7e9ea}@media (min-width:576px){.card-group{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1);border-radius:.625rem}.card-group>.card{box-shadow:none}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:.625rem}.card-group>.card:only-child .card-header,.card-group>.card:only-child .card-img-top{border-top-left-radius:.625rem;border-top-right-radius:.625rem}.card-group>.card:only-child .card-footer,.card-group>.card:only-child .card-img-bottom{border-bottom-right-radius:.625rem;border-bottom-left-radius:.625rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child){border-radius:0}.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:2.1875rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem}}.pagination{padding-left:0;list-style:none;border-radius:.375rem;font-family:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:.875rem}.page-link{padding:.5rem .75rem;line-height:1.25;color:#007bff;background-color:#fff;border:none;margin:0;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.page-link:focus,.page-link:hover{color:#0056b3;background-color:#f5f5f6;border-color:#dfe1e3}.page-item{box-shadow:0 .125rem .9375rem rgba(90,97,105,.1),0 .125rem .1875rem rgba(90,97,105,.15)}.page-item:first-child{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;overflow:hidden}.page-item:last-child{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem;overflow:hidden}.page-item:last-child .page-link{border-right:none}.page-item.active .page-link{color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#a8aeb4;background-color:#fff;border-color:#dfe1e3}.pagination-lg .page-link{padding:.9375rem 1.5625rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.pagination-sm .page-link{padding:.25rem .6875rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.35rem;border-bottom-left-radius:.35rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.35rem;border-bottom-right-radius:.35rem}.badge{padding:.375rem .5rem;font-size:75%;font-weight:500;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:#fff;border-radius:.375rem}a.badge{transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.badge-pill{padding-right:.5rem;padding-left:.5rem;border-radius:10rem}.badge-squared{border-radius:0}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-outline-primary{background:0 0;border:1px solid #007bff;color:#007bff}.badge-secondary{color:#fff;background-color:#5a6169}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#42484e}.badge-outline-secondary{background:0 0;border:1px solid #5a6169;color:#5a6169}.badge-success{color:#fff;background-color:#17c671}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#129857}.badge-outline-success{background:0 0;border:1px solid #17c671;color:#17c671}.badge-info{color:#fff;background-color:#00b8d8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#008da5}.badge-outline-info{background:0 0;border:1px solid #00b8d8;color:#00b8d8}.badge-warning{color:#212529;background-color:#ffb400}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#212529;text-decoration:none;background-color:#cc9000}.badge-outline-warning{background:0 0;border:1px solid #ffb400;color:#ffb400}.badge-danger{color:#fff;background-color:#c4183c}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#97122e}.badge-outline-danger{background:0 0;border:1px solid #c4183c;color:#c4183c}.badge-light{color:#212529;background-color:#e9ecef}.badge-light[href]:focus,.badge-light[href]:hover{color:#212529;text-decoration:none;background-color:#cbd3da}.badge-outline-light{background:0 0;border:1px solid #e9ecef;color:#e9ecef;color:#212529}.badge-dark{color:#fff;background-color:#212529}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#0a0c0d}.badge-outline-dark{background:0 0;border:1px solid #212529;color:#212529}.jumbotron{padding:38px 42px;margin-bottom:2rem;background-color:#eceeef;border-radius:.5rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.alert{padding:.75rem 1.25rem;margin-bottom:1rem;border:none;border-radius:0}.alert-link{font-weight:500}.alert-dismissible .close{top:0;right:0;padding:.75rem 1.25rem;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.alert-dismissible .close:hover{cursor:pointer}.alert-primary{color:#f5faff;background-color:#007bff}.alert-primary .alert-link{color:#f5faff}.alert-secondary{color:#d9dcdf;background-color:#5a6169}.alert-secondary .alert-link{color:#d9dcdf}.alert-success{color:#d7fae9;background-color:#17c671}.alert-success .alert-link{color:#d7fae9}.alert-info{color:#cef8ff;background-color:#00b8d8}.alert-info .alert-link{color:#cef8ff}.alert-warning{color:#fffcf5;background-color:#ffb400}.alert-warning .alert-link{color:#fffcf5}.alert-danger{color:#fad7de;background-color:#c4183c}.alert-danger .alert-link{color:#fad7de}.alert-light{color:#fff;background-color:#e9ecef;color:#212529}.alert-light .alert-link{color:#fff}.alert-light .alert-link{color:#212529}.alert-dark{color:#959faa;background-color:#212529}.alert-dark .alert-link{color:#959faa}.progress-wrapper{position:relative;color:#5a6169}.progress-wrapper .progress-label{font-size:.8125rem}.progress-wrapper .progress-value{position:absolute;top:6px;right:0;color:#5a6169}.progress{height:.625rem;font-size:.625rem;line-height:.625rem;background-color:#f5f5f6;margin-top:6px;border-radius:1.25rem;box-shadow:inset 0 .1rem .1rem rgba(90,97,105,.15)}.progress-sm{height:.3125rem}.progress-lg{height:.9375rem}.progress-lg .progress-bar{height:.9375rem}.progress-bar{height:.625rem;line-height:.625rem;color:#fff;background-color:#007bff;transition:width .6s ease}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:.625rem .625rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.list-group-small .list-group-item{padding:.625rem 1rem;font-size:.8125rem}.list-group-item-action{color:#5a6169;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.list-group-item-action:focus,.list-group-item-action:hover{color:#5a6169;background-color:#f7f8f8}.list-group-item-action:active{color:#5a6169;background-color:#eceeef}.list-group-item{padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125);font-weight:300}.list-group-item:first-child{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.list-group-item:last-child{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.list-group-item.disabled,.list-group-item:disabled{color:#868e96;background-color:#fff}.list-group-item.active{color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item-primary{color:#004085;background-color:#b8daff}a.list-group-item-primary,button.list-group-item-primary{color:#004085}a.list-group-item-primary:focus,a.list-group-item-primary:hover,button.list-group-item-primary:focus,button.list-group-item-primary:hover{color:#004085;background-color:#9fcdff}a.list-group-item-primary.active,button.list-group-item-primary.active{background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#2f3237;background-color:#d1d3d5}a.list-group-item-secondary,button.list-group-item-secondary{color:#2f3237}a.list-group-item-secondary:focus,a.list-group-item-secondary:hover,button.list-group-item-secondary:focus,button.list-group-item-secondary:hover{color:#2f3237;background-color:#c4c6c9}a.list-group-item-secondary.active,button.list-group-item-secondary.active{background-color:#2f3237;border-color:#2f3237}.list-group-item-success{color:#0c673b;background-color:#beefd7}a.list-group-item-success,button.list-group-item-success{color:#0c673b}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#0c673b;background-color:#aaeaca}a.list-group-item-success.active,button.list-group-item-success.active{background-color:#0c673b;border-color:#0c673b}.list-group-item-info{color:#006070;background-color:#b8ebf4}a.list-group-item-info,button.list-group-item-info{color:#006070}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#006070;background-color:#a2e5f1}a.list-group-item-info.active,button.list-group-item-info.active{background-color:#006070;border-color:#006070}.list-group-item-warning{color:#855e00;background-color:#ffeab8}a.list-group-item-warning,button.list-group-item-warning{color:#855e00}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#855e00;background-color:#ffe29f}a.list-group-item-warning.active,button.list-group-item-warning.active{background-color:#855e00;border-color:#855e00}.list-group-item-danger{color:#660c1f;background-color:#eebec8}a.list-group-item-danger,button.list-group-item-danger{color:#660c1f}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#660c1f;background-color:#e9aab7}a.list-group-item-danger.active,button.list-group-item-danger.active{background-color:#660c1f;border-color:#660c1f}.list-group-item-light{color:#797b7c;background-color:#f9fafb}a.list-group-item-light,button.list-group-item-light{color:#797b7c}a.list-group-item-light:focus,a.list-group-item-light:hover,button.list-group-item-light:focus,button.list-group-item-light:hover{color:#797b7c;background-color:#eaedf1}a.list-group-item-light.active,button.list-group-item-light.active{background-color:#797b7c;border-color:#797b7c}.list-group-item-dark{color:#111315;background-color:#c1c2c3}a.list-group-item-dark,button.list-group-item-dark{color:#111315}a.list-group-item-dark:focus,a.list-group-item-dark:hover,button.list-group-item-dark:focus,button.list-group-item-dark:hover{color:#111315;background-color:#b4b5b6}a.list-group-item-dark.active,button.list-group-item-dark.active{background-color:#111315;border-color:#111315}.close{font-size:1.5rem;font-weight:500;color:#8c949d;text-shadow:none;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.close:focus,.close:hover{color:#8c949d}.modal{z-index:1050}.modal-dialog{margin:.625rem}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out}.modal-dialog-centered{min-height:calc(100% - (.625rem * 2))}.modal-content{background-color:#fff;border:none;border-radius:.5rem;box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.modal-backdrop{z-index:1040;background-color:#5a6169}.modal-backdrop.show{opacity:.12}.modal-header{padding:.9375rem 2.1875rem;border-bottom:1px solid #dfe1e3}.modal-title{line-height:1.5}.modal-body{padding:1.875rem 2.1875rem}.modal-footer{padding:.9375rem 2.1875rem;border-top:1px solid #dfe1e3}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.875rem auto}.modal-dialog-centered{min-height:calc(100% - (1.875rem * 2))}.modal-content{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{z-index:1070;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:300;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem}.tooltip.show{opacity:1}.tooltip .arrow{width:5px;height:5px}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:5px 0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{border-width:5px 2.5px 0;border-top-color:#fff}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 5px}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{width:5px;height:5px}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{border-width:2.5px 5px 2.5px 0;border-right-color:#fff}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:5px 0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{border-width:0 2.5px 5px;border-bottom-color:#fff}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 5px}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{width:5px;height:5px}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{border-width:2.5px 0 2.5px 5px;border-left-color:#fff}.tooltip-inner{max-width:200px;padding:7px 13px;color:#5a6169;background-color:#fff;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2);border-radius:.375rem}.popover{z-index:1060;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:300;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;background-color:#fff;border:none;padding:0;border-radius:.5rem;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.popover .arrow{width:10px;height:5px;margin:0 .5rem}.popover .arrow::before{border-width:11px}.popover .arrow::after{border-width:11px}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:5px}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((5px + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::after,.bs-popover-top .arrow::before{border-width:5px 5px 0}.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::before{border-top-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-top .arrow::after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:5px}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((5px + 1px) * -1);width:5px;height:10px;margin:.5rem 0}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::after,.bs-popover-right .arrow::before{border-width:5px 5px 5px 0}.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::before{border-right-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-right .arrow::after{left:1px;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:5px}.bs-popover-auto[x-placement^=bottom] .arrow,.bs-popover-bottom .arrow{top:calc((5px + 1px) * -1)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::after,.bs-popover-bottom .arrow::before{border-width:0 5px 5px 5px}.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::before{border-bottom-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-bottom .arrow::after{top:1px;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{width:10px;margin-left:-5px;border-bottom:1px solid #f5f5f6}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:5px}.bs-popover-auto[x-placement^=left] .arrow,.bs-popover-left .arrow{right:calc((5px + 1px) * -1);width:5px;height:10px;margin:.5rem 0}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::after,.bs-popover-left .arrow::before{border-width:5px 0 5px 5px}.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::before{border-left-color:rgba(0,0,0,.05)}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-left .arrow::after{right:1px;border-left-color:#fff}.popover-header{padding:14px 20px;font-size:1rem;color:#212529;line-height:14px;background-color:#f5f5f6;border-bottom:1px solid #e7e9ea;border-top-left-radius:calc(.5rem - 1px);border-top-right-radius:calc(.5rem - 1px)}.popover-body{padding:15px 20px;color:#5a6169}.carousel{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)}.carousel-item{transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease}.carousel-control-next,.carousel-control-prev{width:15%;color:#fff;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff}.carousel-control-next-icon,.carousel-control-prev-icon{width:20px;height:20px}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{margin-right:15%;margin-left:15%}.carousel-indicators li{width:30px;height:3px;margin-right:3px;margin-left:3px;background-color:rgba(255,255,255,.5);border-radius:3px}.carousel-indicators .active{background-color:#fff}.carousel-caption{right:15%;left:15%;color:#fff}.noUi-target,.noUi-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-ms-touch-action:none;touch-action:none;-ms-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box}.noUi-target{position:relative;direction:ltr;background:#eceeef;border-radius:5px;box-shadow:inset 0 1px 2px rgba(90,97,105,.1);margin:35px 0}.noUi-target:focus{outline:0;box-shadow:0 0 8px rgba(0,123,255,.65),0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.noUi-base,.noUi-connects{width:100%;height:100%;position:relative;z-index:1}.noUi-connects{overflow:hidden;z-index:0}.noUi-connect,.noUi-origin{position:absolute;will-change:transform;z-index:1;top:0;left:0;height:100%;width:100%;-webkit-transform-origin:0 0;transform-origin:0 0}.noUi-connect:focus,.noUi-origin:focus{outline:0}.noUi-connect{background:#007bff;border-radius:5px}html:not([dir=rtl]) .noUi-horizontal .noUi-origin{left:auto;right:0}html:not([dir=rtl]) .noUi-horizontal .noUi-handle{right:-17px;left:auto}.noUi-rtl .noUi-value-horizontal{-webkit-transform:translate(50%,50%);transform:translate(50%,50%)}.noUi-rtl .noUi-value-vertical{-webkit-transform:translate(0,50%);transform:translate(0,50%)}.noUi-vertical{width:5px}.noUi-vertical .noUi-origin{width:0}.noUi-vertical .noUi-handle{left:-10px;top:-11.5px}.noUi-vertical .noUi-handle:after,.noUi-vertical .noUi-handle:before{width:14px;height:1px;left:6px;top:14px}.noUi-vertical .noUi-handle:after{top:17px}.noUi-vertical .noUi-tooltip{-webkit-transform:translate(0,-50%);transform:translate(0,-50%);top:50%;right:30px}.noUi-vertical .noUi-draggable{cursor:ns-resize}.noUi-horizontal{height:5px}.noUi-horizontal .noUi-origin{height:0}.noUi-horizontal .noUi-handle{left:-11.5px;top:-10px}.noUi-horizontal .noUi-tooltip{-webkit-transform:translate(-50%,0);transform:translate(-50%,0);left:50%;bottom:30px}.noUi-handle{position:absolute;border:1px solid #e7e9ea;border-radius:50%;width:23px;height:23px;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2);background:#fff;transition:all 250ms cubic-bezier(.27,.01,.38,1.06)}.noUi-handle:hover{cursor:grab;cursor:-webkit-grab;cursor:-moz-grab}.noUi-handle:active{cursor:grabbing;cursor:-webkit-grabbing;cursor:-moz-grabbing}.noUi-handle:focus{outline:0;box-shadow:0 0 8px rgba(0,123,255,.65),0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.noUi-handle:after{left:17px}.noUi-state-tap .noUi-connect,.noUi-state-tap .noUi-origin{transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.noUi-state-drag *{cursor:inherit!important}.noUi-connects{border-radius:5px}.noUi-draggable{cursor:ew-resize}.noUi-active{-webkit-transform:scale(1.1);transform:scale(1.1)}[disabled] .noUi-connect{background:#b8b8b8}[disabled] .noUi-handle,[disabled].noUi-handle,[disabled].noUi-target{cursor:not-allowed}[disabled] .noUi-handle{background:#f2f3f4}[disabled] .noUi-handle:focus{box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2)}.noUi-pips,.noUi-pips *{box-sizing:border-box}.noUi-pips{position:absolute;color:#a8aeb4;font-size:12px}.noUi-value{position:absolute;white-space:nowrap;text-align:center}.noUi-value-sub{color:#a8aeb4;font-size:10px}.noUi-marker{position:absolute;background:#a8aeb4}.noUi-marker-sub{background:#a8aeb4}.noUi-marker-large{background:#a8aeb4}.noUi-pips-horizontal{padding:10px 0;height:auto;top:100%;left:0;width:100%}.noUi-value-horizontal{-webkit-transform:translate3d(-50%,50%,0);transform:translate3d(-50%,50%,0)}.noUi-marker-horizontal.noUi-marker{margin-left:-1px;width:1px;height:4px}.noUi-marker-horizontal.noUi-marker-sub{height:5px}.noUi-marker-horizontal.noUi-marker-large{height:7px}.noUi-pips-vertical{padding:0 10px;height:100%;top:0;left:100%}.noUi-value-vertical{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0);padding-left:15px}.noUi-marker-vertical.noUi-marker{width:4px;height:1px;margin-top:-1px}.noUi-marker-vertical.noUi-marker-sub{width:10px}.noUi-marker-vertical.noUi-marker-large{width:7px}.noUi-tooltip{display:block;position:absolute;text-align:center;white-space:nowrap;border-radius:.375rem;border-radius:.375rem;background:#fff;color:#5a6169;box-shadow:0 3px 15px rgba(90,97,105,.1),0 2px 3px rgba(90,97,105,.2);font-size:.75rem;padding:5px 10px}.slider-primary .noUi-connect{background:#007bff}.slider-secondary .noUi-connect{background:#5a6169}.slider-success .noUi-connect{background:#17c671}.slider-info .noUi-connect{background:#00b8d8}.slider-warning .noUi-connect{background:#ffb400}.slider-danger .noUi-connect{background:#c4183c}.slider-light .noUi-connect{background:#e9ecef}.slider-dark .noUi-connect{background:#212529}.datepicker{border-radius:.625rem;direction:ltr}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl.dropdown-menu{left:auto}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0;padding:20px 22px}.datepicker-dropdown:after,.datepicker-dropdown:before{content:'';display:inline-block;border-top:0;position:absolute}.datepicker-dropdown:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #c3c7cc;border-bottom-color:rgba(0,0,0,.2)}.datepicker-dropdown:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff}.datepicker-dropdown.datepicker-orient-left:before{left:6px}.datepicker-dropdown.datepicker-orient-left:after{left:7px}.datepicker-dropdown.datepicker-orient-right:before{right:6px}.datepicker-dropdown.datepicker-orient-right:after{right:7px}.datepicker-dropdown.datepicker-orient-bottom:before{top:-7px}.datepicker-dropdown.datepicker-orient-bottom:after{top:-6px}.datepicker-dropdown.datepicker-orient-top:before{bottom:-7px;border-bottom:0;border-top:7px solid #c3c7cc}.datepicker-dropdown.datepicker-orient-top:after{bottom:-6px;border-bottom:0;border-top:6px solid #fff}.datepicker table{margin:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker table tr td{border-radius:50%}.datepicker table tr th{border-radius:.375rem;font-weight:500}.datepicker table tr td,.datepicker table tr th{transition:all 250ms cubic-bezier(.27,.01,.38,1.06);width:36px;height:36px;border:none;text-align:center}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.datepicker table tr td.new,.datepicker table tr td.old{color:#c3c7cc}.datepicker table tr td.day:hover,.datepicker table tr td.focused{background:#eceeef;cursor:pointer}.datepicker table tr td.disabled,.datepicker table tr td.disabled:hover{background:0 0;color:#e7e9ea;cursor:default}.datepicker table tr td.highlighted{border-radius:0}.datepicker table tr td.highlighted.focused{background:#007bff}.datepicker table tr td.highlighted.disabled,.datepicker table tr td.highlighted.disabled:active{background:#007bff;color:#5a6169}.datepicker table tr td.today{background:#e6f2ff}.datepicker table tr td.today.focused{background:#f5f5f6}.datepicker table tr td.today.disabled,.datepicker table tr td.today.disabled:active{background:#f5f5f6;color:#868e96}.datepicker table tr td.range{background:#007bff;color:#fff;border-radius:0}.datepicker table tr td.range.focused{background:#0067d6}.datepicker table tr td.range.day.disabled:hover,.datepicker table tr td.range.disabled,.datepicker table tr td.range.disabled:active{background:#0062cc;color:#3395ff}.datepicker table tr td.range.highlighted.focused{background:#cbd3da}.datepicker table tr td.range.highlighted.disabled,.datepicker table tr td.range.highlighted.disabled:active{background:#e9ecef;color:#e7e9ea}.datepicker table tr td.range.today.disabled,.datepicker table tr td.range.today.disabled:active{background:#007bff;color:#fff}.datepicker table tr td.day.range-start{border-top-right-radius:0;border-bottom-right-radius:0}.datepicker table tr td.day.range-end{border-top-left-radius:0;border-bottom-left-radius:0}.datepicker table tr td.day.range-start.range-end{border-radius:50%}.datepicker table tr td.day.range:hover,.datepicker table tr td.selected,.datepicker table tr td.selected.highlighted,.datepicker table tr td.selected.highlighted:hover,.datepicker table tr td.selected:hover{background:#007bff;color:#fff}.datepicker table tr td.active,.datepicker table tr td.active.highlighted,.datepicker table tr td.active.highlighted:hover,.datepicker table tr td.active:hover{background:#007bff;color:#fff}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;border-radius:4px}.datepicker table tr td span.focused,.datepicker table tr td span:hover{background:#e9ecef}.datepicker table tr td span.disabled,.datepicker table tr td span.disabled:hover{background:0 0;color:#e7e9ea;cursor:default}.datepicker table tr td span.active,.datepicker table tr td span.active.disabled,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active:hover{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td span.new,.datepicker table tr td span.old{color:#868e96}.datepicker .datepicker-switch{width:145px}.datepicker .datepicker-switch,.datepicker .next,.datepicker .prev,.datepicker tfoot tr th{cursor:pointer}.datepicker .datepicker-switch:hover,.datepicker .next:hover,.datepicker .prev:hover,.datepicker tfoot tr th:hover{background:#e9ecef}.datepicker .next.disabled,.datepicker .prev.disabled{visibility:hidden}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.input-daterange input{text-align:center}.bg-primary{background-color:#007bff!important}.bg-primary.card .card-body,.bg-primary.card .card-footer,.bg-primary.card .card-header,.bg-primary.card .card-title{background-color:#0062cc!important}.bg-primary.card .card-footer,.bg-primary.card .card-header{background:#0074f0}a.bg-primary:focus,a.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#5a6169!important}.bg-secondary.card .card-body,.bg-secondary.card .card-footer,.bg-secondary.card .card-header,.bg-secondary.card .card-title{background-color:#42484e!important}.bg-secondary.card .card-footer,.bg-secondary.card .card-header{background:#535961}a.bg-secondary:focus,a.bg-secondary:hover{background-color:#42484e!important}.bg-success{background-color:#17c671!important}.bg-success.card .card-body,.bg-success.card .card-footer,.bg-success.card .card-header,.bg-success.card .card-title{background-color:#129857!important}.bg-success.card .card-footer,.bg-success.card .card-header{background:#15b869}a.bg-success:focus,a.bg-success:hover{background-color:#129857!important}.bg-info{background-color:#00b8d8!important}.bg-info.card .card-body,.bg-info.card .card-footer,.bg-info.card .card-header,.bg-info.card .card-title{background-color:#008da5!important}.bg-info.card .card-footer,.bg-info.card .card-header{background:#00abc9}a.bg-info:focus,a.bg-info:hover{background-color:#008da5!important}.bg-warning{background-color:#ffb400!important}.bg-warning.card .card-body,.bg-warning.card .card-footer,.bg-warning.card .card-header,.bg-warning.card .card-title{background-color:#cc9000!important}.bg-warning.card .card-footer,.bg-warning.card .card-header{background:#f0a900}a.bg-warning:focus,a.bg-warning:hover{background-color:#cc9000!important}.bg-danger{background-color:#c4183c!important}.bg-danger.card .card-body,.bg-danger.card .card-footer,.bg-danger.card .card-header,.bg-danger.card .card-title{background-color:#97122e!important}.bg-danger.card .card-footer,.bg-danger.card .card-header{background:#b61638}a.bg-danger:focus,a.bg-danger:hover{background-color:#97122e!important}.bg-light{background-color:#e9ecef!important}.bg-light.card .card-body,.bg-light.card .card-footer,.bg-light.card .card-header,.bg-light.card .card-title{background-color:#cbd3da!important}.bg-light.card .card-footer,.bg-light.card .card-header{background:#e0e4e9}a.bg-light:focus,a.bg-light:hover{background-color:#cbd3da!important}.bg-dark{background-color:#212529!important}.bg-dark.card .card-body,.bg-dark.card .card-footer,.bg-dark.card .card-header,.bg-dark.card .card-title{background-color:#0a0c0d!important}.bg-dark.card .card-footer,.bg-dark.card .card-header{background:#1a1d21}a.bg-dark:focus,a.bg-dark:hover{background-color:#0a0c0d!important}.border{border:1px solid #becad6!important}.border-top{border-top:1px solid #becad6!important}.border-right{border-right:1px solid #becad6!important}.border-bottom{border-bottom:1px solid #becad6!important}.border-left{border-left:1px solid #becad6!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#5a6169!important}.border-success{border-color:#17c671!important}.border-info{border-color:#00b8d8!important}.border-warning{border-color:#ffb400!important}.border-danger{border-color:#c4183c!important}.border-light{border-color:#e9ecef!important}.border-dark{border-color:#212529!important}.rounded{border-radius:.375rem!important}.rounded-top{border-top-left-radius:.375rem!important;border-top-right-radius:.375rem!important}.rounded-right{border-top-right-radius:.375rem!important;border-bottom-right-radius:.375rem!important}.rounded-bottom{border-bottom-right-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.rounded-left{border-top-left-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.text-monospace{font-family:"Roboto Mono",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}.font-weight-normal{font-weight:300}.font-weight-bold{font-weight:500}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#5a6169!important}a.text-secondary:focus,a.text-secondary:hover{color:#42484e!important}.text-success{color:#17c671!important}a.text-success:focus,a.text-success:hover{color:#129857!important}.text-info{color:#00b8d8!important}a.text-info:focus,a.text-info:hover{color:#008da5!important}.text-warning{color:#ffb400!important}a.text-warning:focus,a.text-warning:hover{color:#cc9000!important}.text-danger{color:#c4183c!important}a.text-danger:focus,a.text-danger:hover{color:#97122e!important}.text-light{color:#e9ecef!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#212529!important}a.text-dark:focus,a.text-dark:hover{color:#0a0c0d!important}.text-body{color:#5a6169!important}a.text-white:focus,a.text-white:hover{color:#e6e6e6!important}.text-black{color:#000}a.text-black:focus,a.text-black:hover{color:#000!important}.text-muted{color:#868e96!important}.with-shadows{box-shadow:0 .46875rem 2.1875rem rgba(90,97,105,.1),0 .9375rem 1.40625rem rgba(90,97,105,.1),0 .25rem .53125rem rgba(90,97,105,.12),0 .125rem .1875rem rgba(90,97,105,.1)} +/*# sourceMappingURL=shards.min.css.map */ \ No newline at end of file diff --git a/spring-boot-crud/src/main/resources/templates/add-user.html b/spring-boot-crud/src/main/resources/templates/add-user.html new file mode 100644 index 0000000000..31d38f2cb5 --- /dev/null +++ b/spring-boot-crud/src/main/resources/templates/add-user.html @@ -0,0 +1,40 @@ + + + + + + Add User + + + + + + +
+

New User

+
+
+
+
+
+ + + +
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/spring-boot-crud/src/main/resources/templates/index.html b/spring-boot-crud/src/main/resources/templates/index.html new file mode 100644 index 0000000000..2634e10380 --- /dev/null +++ b/spring-boot-crud/src/main/resources/templates/index.html @@ -0,0 +1,43 @@ + + + + + + Users + + + + + + +
+
+
+

No users yet!

+
+

Users

+ + + + + + + + + + + + + + + + + +
NameEmailEditDelete
+
+

+
+
+
+ + \ No newline at end of file diff --git a/spring-boot-crud/src/main/resources/templates/update-user.html b/spring-boot-crud/src/main/resources/templates/update-user.html new file mode 100644 index 0000000000..f94e8eb987 --- /dev/null +++ b/spring-boot-crud/src/main/resources/templates/update-user.html @@ -0,0 +1,40 @@ + + + + + + Update User + + + + + + +
+

Update User

+
+
+
+
+
+ + + +
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java new file mode 100644 index 0000000000..7773a962fb --- /dev/null +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java @@ -0,0 +1,81 @@ +package com.baeldung.crud; + +import com.baeldung.crud.UserController; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.UserRepository; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; + +public class UserControllerUnitTest { + + private static UserController userController; + private static UserRepository mockedUserRepository; + private static BindingResult mockedBindingResult; + private static Model mockedModel; + + @BeforeClass + public static void setUpUserControllerInstance() { + mockedUserRepository = mock(UserRepository.class); + mockedBindingResult = mock(BindingResult.class); + mockedModel = mock(Model.class); + userController = new UserController(mockedUserRepository); + } + + @Test + public void whenCalledshowSignUpForm_thenCorrect() { + User user = new User("John", "john@domain.com"); + + assertThat(userController.showSignUpForm(user)).isEqualTo("add-user"); + } + + @Test + public void whenCalledaddUserAndValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(false); + + assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("index"); + } + + @Test + public void whenCalledaddUserAndInValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(true); + + assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("add-user"); + } + + @Test(expected = IllegalArgumentException.class) + public void whenCalledshowUpdateForm_thenIllegalArgumentException() { + assertThat(userController.showUpdateForm(0, mockedModel)).isEqualTo("update-user"); + } + + @Test + public void whenCalledupdateUserAndValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(false); + + assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("index"); + } + + @Test + public void whenCalledupdateUserAndInValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(true); + + assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("update-user"); + } + + @Test(expected = IllegalArgumentException.class) + public void whenCalleddeleteUser_thenIllegalArgumentException() { + assertThat(userController.deleteUser(1l, mockedModel)).isEqualTo("index"); + } +} diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java new file mode 100644 index 0000000000..a3c6a922d8 --- /dev/null +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java @@ -0,0 +1,46 @@ +package com.baeldung.crud; + +import com.baeldung.crud.User; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +public class UserUnitTest { + + @Test + public void whenCalledGetName_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + assertThat(user.getName()).isEqualTo("Julie"); + } + + @Test + public void whenCalledGetEmail_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + assertThat(user.getEmail()).isEqualTo("julie@domain.com"); + } + + @Test + public void whenCalledSetName_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + user.setName("John"); + + assertThat(user.getName()).isEqualTo("John"); + } + + @Test + public void whenCalledSetEmail_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + user.setEmail("john@domain.com"); + + assertThat(user.getEmail()).isEqualTo("john@domain.com"); + } + + @Test + public void whenCalledtoString_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + assertThat(user.toString()).isEqualTo("User{id=0, name=Julie, email=julie@domain.com}"); + } +} From c486b975a5ec343f17b4e15ac908a2aaf3632678 Mon Sep 17 00:00:00 2001 From: Paul van Gool Date: Tue, 30 Oct 2018 14:32:09 -0700 Subject: [PATCH 263/546] BAEL-2074: IllegalArgumentException -> IllegalStateException --- .../java/com/baeldung/lombok/builder/customsetter/Message.java | 2 +- .../builder/customsetter/BuilderWithCustomSetterUnitTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java b/lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java index 95a314480f..6c58763143 100644 --- a/lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java +++ b/lombok/src/main/java/com/baeldung/lombok/builder/customsetter/Message.java @@ -32,7 +32,7 @@ public class Message { private void verifyTextOrFile() { if (text != null && file != null) { - throw new IllegalArgumentException("Cannot send 'text' and 'file'."); + throw new IllegalStateException("Cannot send 'text' and 'file'."); } } } diff --git a/lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java b/lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java index 3f7f276edf..3143747f0d 100644 --- a/lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java +++ b/lombok/src/test/java/com/baeldung/lombok/builder/customsetter/BuilderWithCustomSetterUnitTest.java @@ -24,7 +24,7 @@ public class BuilderWithCustomSetterUnitTest { .build(); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalStateException.class) public void givenBuilderWithCustomSetter_TestTextAndFile() { Message message = Message.builder() .sender("user@somedomain.com") From aedf3b5cb570d0aba8cad215f4a40da9ba956623 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 22:47:38 +0000 Subject: [PATCH 264/546] removed race condition between different requests --- .../thymeleaf/controller/BookController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index b8132cddc8..12e8e8bc41 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -2,6 +2,7 @@ package com.baeldung.thymeleaf.controller; import java.util.List; import java.util.Optional; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -21,18 +22,18 @@ import com.baeldung.thymeleaf.service.BookService; @Controller public class BookController { - private static int currentPage = 1; - private static int pageSize = 5; @Autowired private BookService bookService; - + @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - page.ifPresent(p -> currentPage = p); - size.ifPresent(s -> pageSize = s); + AtomicInteger currentPage = new AtomicInteger(1); + AtomicInteger pageSize = new AtomicInteger(5); + page.ifPresent(p -> currentPage.set(p)); + size.ifPresent(s -> pageSize.set(s)); - Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); + Page bookPage = bookService.findPaginated(PageRequest.of(currentPage.get() - 1, pageSize.get())); model.addAttribute("bookPage", bookPage); From e3fc47dd53de5cd1f8c6e5175aaff175daa9e974 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 22:57:04 +0000 Subject: [PATCH 265/546] use of atomics way too verbose --- .../baeldung/thymeleaf/controller/BookController.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index 12e8e8bc41..7ede80b01d 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -2,7 +2,6 @@ package com.baeldung.thymeleaf.controller; import java.util.List; import java.util.Optional; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -22,18 +21,15 @@ import com.baeldung.thymeleaf.service.BookService; @Controller public class BookController { - @Autowired private BookService bookService; @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - AtomicInteger currentPage = new AtomicInteger(1); - AtomicInteger pageSize = new AtomicInteger(5); - page.ifPresent(p -> currentPage.set(p)); - size.ifPresent(s -> pageSize.set(s)); + int currentPage = page.isPresent()?page.get():5; + int pageSize = size.isPresent()?size.get():1; - Page bookPage = bookService.findPaginated(PageRequest.of(currentPage.get() - 1, pageSize.get())); + Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); model.addAttribute("bookPage", bookPage); From 9663cc09a1d32ec338044c3d61ecd3a7289608d1 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 23:03:08 +0000 Subject: [PATCH 266/546] orElse is cleaner --- .../com/baeldung/thymeleaf/controller/BookController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index 7ede80b01d..f30ae6e049 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -26,8 +26,8 @@ public class BookController { @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - int currentPage = page.isPresent()?page.get():5; - int pageSize = size.isPresent()?size.get():1; + int currentPage = page.orElse(1); + int pageSize = size.orElse(5); Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); From 5d4d8ff977bf16874e475f9b7dc537140391a23f Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 23:06:12 +0000 Subject: [PATCH 267/546] may as well use final --- .../com/baeldung/thymeleaf/controller/BookController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index f30ae6e049..d10caee9e7 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -26,8 +26,8 @@ public class BookController { @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - int currentPage = page.orElse(1); - int pageSize = size.orElse(5); + final int currentPage = page.orElse(1); + final int pageSize = size.orElse(5); Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); From 9b743a90340b73ed1c476b224888a5899885eb87 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 31 Oct 2018 09:02:00 +0530 Subject: [PATCH 268/546] BAEL-9041 Let's add some examples to the rest-assured tutorial -Add new POST with body example --- .../java/com/baeldung/restassured/Odd.java | 49 +++++++++++++++++++ .../RestAssured2IntegrationTest.java | 24 +++++++-- 2 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 testing-modules/rest-assured/src/test/java/com/baeldung/restassured/Odd.java diff --git a/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/Odd.java b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/Odd.java new file mode 100644 index 0000000000..f60f1764c6 --- /dev/null +++ b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/Odd.java @@ -0,0 +1,49 @@ +package com.baeldung.restassured; + +public class Odd { + + float price; + int status; + float ck; + String name; + + Odd(float price, int status, float ck, String name) { + this.price = price; + this.status = status; + this.ck = ck; + this.name = name; + } + + public float getPrice() { + return price; + } + + public void setPrice(float price) { + this.price = price; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public float getCk() { + return ck; + } + + public void setCk(float ck) { + this.ck = ck; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java index 1b691414db..fd0ee27062 100644 --- a/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java +++ b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java @@ -5,13 +5,15 @@ import io.restassured.RestAssured; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; - import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.configureFor; +import static com.github.tomakehurst.wiremock.client.WireMock.containing; import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static io.restassured.RestAssured.get; +import static io.restassured.RestAssured.with; import static org.hamcrest.Matchers.hasItems; public class RestAssured2IntegrationTest { @@ -29,20 +31,32 @@ public class RestAssured2IntegrationTest { configureFor("localhost", PORT); RestAssured.port = PORT; stubFor(get(urlEqualTo(EVENTS_PATH)).willReturn( - aResponse().withStatus(200) + aResponse().withStatus(200) .withHeader("Content-Type", APPLICATION_JSON) .withBody(ODDS))); + stubFor(post(urlEqualTo("/odds/new")) + .withRequestBody(containing("{\"price\":5.25,\"status\":1,\"ck\":13.1,\"name\":\"X\"}")) + .willReturn(aResponse().withStatus(201))); } @Test public void givenUrl_whenVerifiesOddPricesAccuratelyByStatus_thenCorrect() { - get("/odds").then().body("odds.findAll { it.status > 0 }.price", - hasItems(5.25f, 1.2f)); + get("/odds").then().body("odds.findAll { it.status > 0 }.price", + hasItems(5.25f, 1.2f)); + } + + @Test + public void whenRequestedPost_thenCreated() { + with().body(new Odd(5.25f, 1, 13.1f, "X")) + .when() + .request("POST", "/odds/new") + .then() + .statusCode(201); } private static String getJson() { return Util.inputStreamToString(RestAssured2IntegrationTest.class - .getResourceAsStream("/odds.json")); + .getResourceAsStream("/odds.json")); } @AfterClass From e37dd4adc46456b6310255888beb45fb06f75178 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 31 Oct 2018 09:06:48 +0530 Subject: [PATCH 269/546] BAEL-9041 fixed formatting --- .../baeldung/restassured/RestAssured2IntegrationTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java index fd0ee27062..a7f57d617d 100644 --- a/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java +++ b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java @@ -31,7 +31,7 @@ public class RestAssured2IntegrationTest { configureFor("localhost", PORT); RestAssured.port = PORT; stubFor(get(urlEqualTo(EVENTS_PATH)).willReturn( - aResponse().withStatus(200) + aResponse().withStatus(200) .withHeader("Content-Type", APPLICATION_JSON) .withBody(ODDS))); stubFor(post(urlEqualTo("/odds/new")) @@ -42,7 +42,7 @@ public class RestAssured2IntegrationTest { @Test public void givenUrl_whenVerifiesOddPricesAccuratelyByStatus_thenCorrect() { get("/odds").then().body("odds.findAll { it.status > 0 }.price", - hasItems(5.25f, 1.2f)); + hasItems(5.25f, 1.2f)); } @Test @@ -56,7 +56,7 @@ public class RestAssured2IntegrationTest { private static String getJson() { return Util.inputStreamToString(RestAssured2IntegrationTest.class - .getResourceAsStream("/odds.json")); + .getResourceAsStream("/odds.json")); } @AfterClass From d4def2ab435d45ea90f2749bf1814ce9dcceac49 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 31 Oct 2018 09:07:59 +0530 Subject: [PATCH 270/546] BAEL-9041 fixed formatting --- .../com/baeldung/restassured/RestAssured2IntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java index a7f57d617d..805d67271d 100644 --- a/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java +++ b/testing-modules/rest-assured/src/test/java/com/baeldung/restassured/RestAssured2IntegrationTest.java @@ -41,7 +41,7 @@ public class RestAssured2IntegrationTest { @Test public void givenUrl_whenVerifiesOddPricesAccuratelyByStatus_thenCorrect() { - get("/odds").then().body("odds.findAll { it.status > 0 }.price", + get("/odds").then().body("odds.findAll { it.status > 0 }.price", hasItems(5.25f, 1.2f)); } From 03fd0d8f5385b42cbb41114048f9cd56c7956d1b Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Wed, 31 Oct 2018 12:53:14 +0200 Subject: [PATCH 271/546] [Mercator] Code review changes --- .../mercator/EllipticalMercator.java | 28 +++++++------------ .../mercator/EllipticalMercatorUnitTest.java | 5 +--- .../mercator/SphericalMercatorUnitTest.java | 6 +--- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java index 8c3e4c554f..8f007dc00e 100644 --- a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java @@ -1,25 +1,17 @@ -package com.baeldung.algorithms.mercator; +package com.mercator; class EllipticalMercator extends Mercator { @Override double yAxisProjection(double input) { - if (input > 89.5) { - input = 89.5; - } - if (input < -89.5) { - input = -89.5; - } - double temp = RADIUS_MINOR / RADIUS_MAJOR; - double es = 1.0 - (temp * temp); - double eccent = Math.sqrt(es); - double phi = Math.toRadians(input); - double sinphi = Math.sin(phi); - double con = eccent * sinphi; - double com = 0.5 * eccent; - con = Math.pow(((1.0 - con)/(1.0+con)), com); - double ts = Math.tan(0.5 * ((Math.PI*0.5) - phi))/con; - double y = 0 - RADIUS_MAJOR * Math.log(ts); - return y; + + input = Math.min(Math.max(input, -89.5), 89.5); + double earthDimensionalRateNormalized = 1.0 - Math.pow(RADIUS_MINOR / RADIUS_MAJOR, 2); + + double inputOnEarthProj = Math.sqrt(earthDimensionalRateNormalized) * Math.sin( Math.toRadians(input)); + + inputOnEarthProj = Math.pow(((1.0 - inputOnEarthProj)/(1.0+inputOnEarthProj)), 0.5 * Math.sqrt(earthDimensionalRateNormalized)); + double inputOnEarthProjNormalized = Math.tan(0.5 * ((Math.PI*0.5) - Math.toRadians(input)))/inputOnEarthProj; + return (-1) * RADIUS_MAJOR * Math.log(inputOnEarthProjNormalized); } @Override diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java index 13618e80a7..535a6c2c99 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java @@ -1,12 +1,9 @@ -package com.baeldung.algorithms.mercator; +package com.mercator; import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; import static junit.framework.TestCase.assertEquals; -@RunWith(MockitoJUnitRunner.class) public class EllipticalMercatorUnitTest { @Test diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java index f1152441b8..3fe765f218 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java @@ -1,12 +1,8 @@ -package com.baeldung.algorithms.mercator; +package com.mercator; import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; - import static junit.framework.TestCase.assertEquals; -@RunWith(MockitoJUnitRunner.class) public class SphericalMercatorUnitTest { @Test From a32911077f95f62a6b042d25201df1d7fe44f84c Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Wed, 31 Oct 2018 13:07:14 +0200 Subject: [PATCH 272/546] [Mercator] Code review changes --- .../com/baeldung/algorithms/mercator/EllipticalMercator.java | 1 + 1 file changed, 1 insertion(+) diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java index 8f007dc00e..24b341aea1 100644 --- a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java @@ -1,6 +1,7 @@ package com.mercator; class EllipticalMercator extends Mercator { + @Override double yAxisProjection(double input) { From eefac3911dc37a72304eb47798f122831fd7a66d Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Wed, 31 Oct 2018 12:16:55 +0200 Subject: [PATCH 273/546] Minor fix --- .../com/baeldung/algorithms/mercator/EllipticalMercator.java | 4 ++-- .../algorithms/mercator/EllipticalMercatorUnitTest.java | 2 +- .../algorithms/mercator/SphericalMercatorUnitTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java index 24b341aea1..e1c41f9518 100644 --- a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/mercator/EllipticalMercator.java @@ -1,7 +1,7 @@ -package com.mercator; +package com.baeldung.algorithms.mercator; class EllipticalMercator extends Mercator { - + @Override double yAxisProjection(double input) { diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java index 535a6c2c99..f24d1328f0 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java @@ -1,4 +1,4 @@ -package com.mercator; +package com.baeldung.algorithms.mercator; import org.junit.Test; diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java index 3fe765f218..196abe63cf 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java @@ -1,4 +1,4 @@ -package com.mercator; +package com.baeldung.algorithms.mercator; import org.junit.Test; import static junit.framework.TestCase.assertEquals; From 586e911a026956a2910def60dadd8b4ee2d44537 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Wed, 31 Oct 2018 18:47:17 +0530 Subject: [PATCH 274/546] BAEL-2176 (#5441) * Evaluation Article - Spring web-flux * Evaluation Article - Spring web-flux * Evaluation Article - Spring web-flux * Evaluation Article - Spring web-flux * core-scala: initial commit * adding core-scala to pom * Revert "core-scala: initial commit" This reverts commit d46873405a67addfaa69aa7855b37af9c4a3df14. * BAEL-2176 * inserting new lines between given, when and then parts * Formatted using formatter * indentation changed further * Suggested changes in coding * Adding Date Deserializer * BAEL-2176: Switching to functional paradigm * BAEL-2176 * BAEL-2176: changing HashMap to Map * BAEL-2176: changed exception type * BAEL-2176 --- ...Deserializer.java => MapDeserializer.java} | 26 +++++----- .../StringDateMapDeserializer.java | 44 ++++++++++++++++ ...t.java => MapDeserializationUnitTest.java} | 50 ++++++++++++++----- 3 files changed, 94 insertions(+), 26 deletions(-) rename gson/src/main/java/org/baeldung/gson/serialization/{HashMapDeserializer.java => MapDeserializer.java} (62%) create mode 100644 gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java rename gson/src/test/java/org/baeldung/gson/deserialization/{HashMapDeserializationUnitTest.java => MapDeserializationUnitTest.java} (58%) diff --git a/gson/src/main/java/org/baeldung/gson/serialization/HashMapDeserializer.java b/gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java similarity index 62% rename from gson/src/main/java/org/baeldung/gson/serialization/HashMapDeserializer.java rename to gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java index bb73e32559..cdeb2e23c8 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/HashMapDeserializer.java +++ b/gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java @@ -4,28 +4,26 @@ import java.lang.reflect.Type; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; import org.baeldung.gson.entities.Employee; import com.google.gson.*; -public class HashMapDeserializer implements JsonDeserializer> { +public class MapDeserializer implements JsonDeserializer> { @Override - public HashMap deserialize(JsonElement elem, Type type, JsonDeserializationContext context) throws JsonParseException { - HashMap map = new HashMap<>(); - for (Map.Entry entry : elem.getAsJsonObject().entrySet()) { - JsonElement jsonValue = entry.getValue(); - Object value = null; - if (jsonValue.isJsonPrimitive()) { - value = toPrimitive(jsonValue.getAsJsonPrimitive(), context); - } else { - value = context.deserialize(jsonValue, Employee.class); - } - map.put(entry.getKey(), value); - } - return map; + public Map deserialize(JsonElement elem, Type type, JsonDeserializationContext context) throws JsonParseException { + return elem.getAsJsonObject() + .entrySet() + .stream() + .collect(Collectors.toMap( + Map.Entry::getKey, + e -> e.getValue().isJsonPrimitive() ? + toPrimitive(e.getValue().getAsJsonPrimitive(), context) + : context.deserialize(e.getValue(), Employee.class) + )); } private Object toPrimitive(JsonPrimitive jsonValue, JsonDeserializationContext context) { diff --git a/gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java b/gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java new file mode 100644 index 0000000000..f18bdbc84f --- /dev/null +++ b/gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java @@ -0,0 +1,44 @@ +package org.baeldung.gson.serialization; + +import java.lang.reflect.Type; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Map; +import java.util.stream.Collectors; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; + +public class StringDateMapDeserializer implements JsonDeserializer> { + + private static final Logger logger = LoggerFactory.getLogger(StringDateMapDeserializer.class); + + private SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd"); + + @Override + public Map deserialize(JsonElement elem, Type type, JsonDeserializationContext jsonDeserializationContext) { + System.out.println("Deserializer called"); + logger.info("Deserializer called"); + return elem.getAsJsonObject() + .entrySet() + .stream() + .filter(e -> e.getValue().isJsonPrimitive()) + .filter(e -> e.getValue().getAsJsonPrimitive().isString()) + .collect(Collectors.toMap(Map.Entry::getKey, e -> formatDate(e.getValue()))); + } + + private Date formatDate(JsonElement value) { + try { + return format.parse(value.getAsString()); + } catch (ParseException ex) { + throw new JsonParseException(ex); + } + } + +} diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/HashMapDeserializationUnitTest.java b/gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java similarity index 58% rename from gson/src/test/java/org/baeldung/gson/deserialization/HashMapDeserializationUnitTest.java rename to gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java index 6905ade0da..a5ae4194e8 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/HashMapDeserializationUnitTest.java +++ b/gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java @@ -1,10 +1,14 @@ package org.baeldung.gson.deserialization; import java.lang.reflect.Type; -import java.util.HashMap; +import java.text.ParseException; +import java.util.Date; +import java.util.Map; +import org.apache.commons.lang3.time.DateUtils; import org.baeldung.gson.entities.Employee; -import org.baeldung.gson.serialization.HashMapDeserializer; +import org.baeldung.gson.serialization.MapDeserializer; +import org.baeldung.gson.serialization.StringDateMapDeserializer; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; @@ -16,18 +20,18 @@ import com.google.gson.JsonSyntaxException; import com.google.gson.internal.LinkedTreeMap; import com.google.gson.reflect.TypeToken; -public class HashMapDeserializationUnitTest { +public class MapDeserializationUnitTest { - private static final Logger logger = LoggerFactory.getLogger(HashMapDeserializationUnitTest.class); + private static final Logger logger = LoggerFactory.getLogger(MapDeserializationUnitTest.class); @Test - public void whenUsingHashMapClass_thenShouldReturnMapWithDefaultClasses() { + public void whenUsingMapClass_thenShouldReturnMapWithDefaultClasses() { String jsonString = "{'employee.name':'Bob','employee.salary':10000, 'employee.active':true, " + "'employee':{'id':10, 'name': 'Bob Willis', 'address':'London'}}"; Gson gson = new Gson(); - HashMap map = gson.fromJson(jsonString, HashMap.class); + Map map = gson.fromJson(jsonString, Map.class); logger.info("The converted map: {}", map); Assert.assertEquals(4, map.size()); @@ -43,7 +47,7 @@ public class HashMapDeserializationUnitTest { + "'employee.active':true, " + "'employee':{'id':10, 'name': 'Bob Willis', 'address':'London'}}"; Gson gson = new Gson(); - HashMap map = gson.fromJson(jsonString, HashMap.class); + Map map = gson.fromJson(jsonString, Map.class); logger.info("The converted map: {}", map); } @@ -56,8 +60,8 @@ public class HashMapDeserializationUnitTest { + "'Steve':{'id':10, 'name': 'Steven Waugh', 'address':'Australia'}}"; Gson gson = new Gson(); - Type empMapType = new TypeToken>(){}.getType(); - HashMap nameEmployeeMap = gson.fromJson(jsonString, empMapType); + Type empMapType = new TypeToken>(){}.getType(); + Map nameEmployeeMap = gson.fromJson(jsonString, empMapType); logger.info("The converted map: {}", nameEmployeeMap); Assert.assertEquals(3, nameEmployeeMap.size()); @@ -70,11 +74,11 @@ public class HashMapDeserializationUnitTest { String jsonString = "{'employee.name':'Bob','employee.salary':10000, 'employee.active':true, " + "'employee':{'id':10, 'name': 'Bob Willis', 'address':'London'}}"; - Type type = new TypeToken>(){}.getType(); + Type type = new TypeToken>(){}.getType(); Gson gson = new GsonBuilder() - .registerTypeAdapter(type, new HashMapDeserializer()) + .registerTypeAdapter(type, new MapDeserializer()) .create(); - HashMap blendedMap = gson.fromJson(jsonString, type); + Map blendedMap = gson.fromJson(jsonString, type); logger.info("The converted map: {}", blendedMap); Assert.assertEquals(4, blendedMap.size()); @@ -83,4 +87,26 @@ public class HashMapDeserializationUnitTest { } + @Test + public void whenUsingCustomDateDeserializer_thenShouldReturnMapWithDate() { + String jsonString = "{'Bob': '2017/06/01', 'Jennie':'2015/01/03'}"; + Type type = new TypeToken>(){}.getType(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(type, new StringDateMapDeserializer()) + .create(); + Map empJoiningDateMap = gson.fromJson(jsonString, type); + + logger.info("The converted map: {}", empJoiningDateMap); + logger.info("The map class {}", empJoiningDateMap.getClass()); + Assert.assertEquals(2, empJoiningDateMap.size()); + Assert.assertEquals(Date.class, empJoiningDateMap.get("Bob").getClass()); + Date dt = null; + try { + dt = DateUtils.parseDate("2017-06-01", "yyyy-MM-dd"); + Assert.assertEquals(dt, empJoiningDateMap.get("Bob")); + } catch (ParseException e) { + logger.error("Could not parse date", e); + } + } + } From 1889fa7d372977987e922157d81e633f4ad54693 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Wed, 31 Oct 2018 10:39:20 -0500 Subject: [PATCH 275/546] BAEL-2176 README update (#5588) * BAEL-1766: Update README * BAEL-1853: add link to article * BAEL-1801: add link to article * Added links back to articles * Add links back to articles * BAEL-1795: Update README * BAEL-1901 and BAEL-1555 add links back to article * BAEL-2026 add link back to article * BAEL-2029: add link back to article * BAEL-1898: Add link back to article * BAEL-2102 and BAEL-2131 Add links back to articles * BAEL-2132 Add link back to article * BAEL-1980: add link back to article * BAEL-2200: Display auto-configuration report in Spring Boot * BAEL-2253: Add link back to article * BAEL-2200 BAEL-2287 Add links back to articles * BAEL-2176: add link back to article --- gson/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/gson/README.md b/gson/README.md index 4122b21431..e1eb155f43 100644 --- a/gson/README.md +++ b/gson/README.md @@ -8,3 +8,4 @@ - [Jackson vs Gson](http://www.baeldung.com/jackson-vs-gson) - [Exclude Fields from Serialization in Gson](http://www.baeldung.com/gson-exclude-fields-serialization) - [Save Data to a JSON File with Gson](https://www.baeldung.com/gson-save-file) +- [Convert JSON to a Map Using Gson](https://www.baeldung.com/gson-json-to-map) From a4c624349bfef5e18be75ed9f52e3ab32e4f963d Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Wed, 31 Oct 2018 10:47:32 -0700 Subject: [PATCH 276/546] Update README.md (#5591) --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index 59aab91aa9..627535d1e5 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -158,3 +158,4 @@ - [Java Switch Statement](https://www.baeldung.com/java-switch) - [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) - [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) +- [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) From 42e4bf2ca5e6a994d72963461ebd777d053ebef7 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 31 Oct 2018 23:44:33 +0530 Subject: [PATCH 277/546] BAEL-10179 Fix start of Boot project with parent-boot-1 parent -Added start-class placeholder in parent-boot-1 -Minor cleanup of few parent-boot-1 projects --- parent-boot-1/pom.xml | 4 + .../spring-data-dynamodb/pom.xml | 5 +- spring-aop/pom.xml | 2 - spring-cloud/spring-cloud-aws/pom.xml | 110 +++++++++--------- 4 files changed, 60 insertions(+), 61 deletions(-) diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index c61b791ef3..171806390d 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -43,6 +43,10 @@ org.springframework.boot spring-boot-maven-plugin ${spring-boot.version} + + ${start-class} + + diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index 4cb805131a..fffdd3567d 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -1,9 +1,7 @@ 4.0.0 - com.baeldung spring-data-dynamodb - 0.0.1-SNAPSHOT jar spring-data-dynamodb This is simple boot application for Spring boot dynamodb test @@ -85,8 +83,7 @@ org.apache.httpcomponents httpclient - ${httpclient.version} - +
diff --git a/spring-aop/pom.xml b/spring-aop/pom.xml index b9b97eb076..368f3ada14 100644 --- a/spring-aop/pom.xml +++ b/spring-aop/pom.xml @@ -1,9 +1,7 @@ 4.0.0 - com.baeldung spring-aop - 0.0.1-SNAPSHOT war spring-aop diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index 6933845173..6f672555d1 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -1,64 +1,64 @@ - 4.0.0 - com.baeldung.spring.cloud - spring-cloud-aws - jar - Spring Cloud AWS - Spring Cloud AWS Examples + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.spring.cloud + spring-cloud-aws + jar + Spring Cloud AWS + Spring Cloud AWS Examples - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - + + parent-boot-1 + com.baeldung + 0.0.1-SNAPSHOT + ../../parent-boot-1 + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-aws - - - org.springframework.cloud - spring-cloud-starter-aws-jdbc - - - org.springframework.cloud - spring-cloud-starter-aws-messaging - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-aws + + + org.springframework.cloud + spring-cloud-starter-aws-jdbc + + + org.springframework.cloud + spring-cloud-starter-aws-messaging + - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-test + test + - - org.postgresql - postgresql - - + + org.postgresql + postgresql + + - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-aws + 2.0.1.RELEASE + pom + import + + + - - com.baeldung.spring.cloud.aws.SpringCloudAwsApplication - Dalston.SR4 - + + com.baeldung.spring.cloud.aws.SpringCloudAwsApplication + Dalston.SR4 + From 6bdc71388be84aa894378d23a388207de5ef5296 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Wed, 31 Oct 2018 23:49:03 +0530 Subject: [PATCH 278/546] BAEL-10179 Fixed formatting --- .../spring-data-dynamodb/pom.xml | 2 +- spring-cloud/spring-cloud-aws/pom.xml | 110 +++++++++--------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index fffdd3567d..e8bf9b8c1e 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -83,7 +83,7 @@ org.apache.httpcomponents httpclient - + diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index 6f672555d1..09518483a4 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -1,64 +1,64 @@ - 4.0.0 - com.baeldung.spring.cloud - spring-cloud-aws - jar - Spring Cloud AWS - Spring Cloud AWS Examples + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.spring.cloud + spring-cloud-aws + jar + Spring Cloud AWS + Spring Cloud AWS Examples - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - + + parent-boot-1 + com.baeldung + 0.0.1-SNAPSHOT + ../../parent-boot-1 + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-aws - - - org.springframework.cloud - spring-cloud-starter-aws-jdbc - - - org.springframework.cloud - spring-cloud-starter-aws-messaging - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-aws + + + org.springframework.cloud + spring-cloud-starter-aws-jdbc + + + org.springframework.cloud + spring-cloud-starter-aws-messaging + - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-test + test + - - org.postgresql - postgresql - - + + org.postgresql + postgresql + + - - - - org.springframework.cloud - spring-cloud-aws - 2.0.1.RELEASE - pom - import - - - + + + + org.springframework.cloud + spring-cloud-aws + 2.0.1.RELEASE + pom + import + + + - - com.baeldung.spring.cloud.aws.SpringCloudAwsApplication - Dalston.SR4 - + + com.baeldung.spring.cloud.aws.SpringCloudAwsApplication + Dalston.SR4 + From db5af0a8c31c0933dbb5012f6e3b1b769d0081aa Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Wed, 31 Oct 2018 11:42:35 -0700 Subject: [PATCH 279/546] Create README.md --- spring-boot-crud/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 spring-boot-crud/README.md diff --git a/spring-boot-crud/README.md b/spring-boot-crud/README.md new file mode 100644 index 0000000000..566cb327a8 --- /dev/null +++ b/spring-boot-crud/README.md @@ -0,0 +1,2 @@ +### Relevant Articles: +- [Spring Boot CRUD Application with Thymeleaf](https://www.baeldung.com/spring-boot-crud-thymeleaf) From 6f87196dc9fc31e5ddf83763a71da4350ac2d2e4 Mon Sep 17 00:00:00 2001 From: Ganesh Pagade Date: Thu, 1 Nov 2018 14:08:32 +0530 Subject: [PATCH 280/546] minor fixes --- .../ZuulRatelimitDemoApplication.java | 47 ++----------------- .../controller/GreetingController.java | 13 ++--- .../controller/GreetingControllerTest.java | 1 - 3 files changed, 8 insertions(+), 53 deletions(-) diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java b/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java index cc13b7a046..9b53099768 100644 --- a/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java +++ b/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java @@ -1,53 +1,14 @@ package com.baeldung.spring.cloud.zuulratelimitdemo; -import javax.servlet.http.HttpServletRequest; - import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.zuul.filters.Route; -import org.springframework.context.annotation.Bean; +import org.springframework.cloud.client.SpringCloudApplication; +import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.RateLimitKeyGenerator; -import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.RateLimitUtils; -import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.properties.RateLimitProperties; -import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.repository.RateLimiterErrorHandler; -import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.repository.DefaultRateLimiterErrorHandler; -import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.DefaultRateLimitKeyGenerator; - -@SpringBootApplication +@EnableZuulProxy +@SpringCloudApplication public class ZuulRatelimitDemoApplication { public static void main(String[] args) { SpringApplication.run(ZuulRatelimitDemoApplication.class, args); } - - @Bean - public RateLimitKeyGenerator ratelimitKeyGenerator(RateLimitProperties properties, RateLimitUtils rateLimitUtils) { - return new DefaultRateLimitKeyGenerator(properties, rateLimitUtils) { - @Override - public String key(HttpServletRequest request, Route route, RateLimitProperties.Policy policy) { - return super.key(request, route, policy) + ":" + request.getMethod(); - } - }; - } - - @Bean - public RateLimiterErrorHandler rateLimitErrorHandler() { - return new DefaultRateLimiterErrorHandler() { - @Override - public void handleSaveError(String key, Exception e) { - // custom code - } - - @Override - public void handleFetchError(String key, Exception e) { - // custom code - } - - @Override - public void handleError(String msg, Exception e) { - // custom code - } - }; - } } diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java b/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java index f0facc621a..3f2ec4822f 100644 --- a/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java +++ b/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java @@ -1,26 +1,21 @@ package com.baeldung.spring.cloud.zuulratelimitdemo.controller; -import org.springframework.cloud.client.SpringCloudApplication; -import org.springframework.cloud.netflix.zuul.EnableZuulProxy; import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; -@EnableZuulProxy -@SpringCloudApplication +@Controller @RequestMapping("/greeting") public class GreetingController { - public static final String SIMPLE_RESPONSE = "Hi!"; - public static final String ADVANCED_RESPONSE = "Hello, how you doing?"; - @GetMapping("/simple") public ResponseEntity getSimple() { - return ResponseEntity.ok(SIMPLE_RESPONSE); + return ResponseEntity.ok("Hi!"); } @GetMapping("/advanced") public ResponseEntity getAdvanced() { - return ResponseEntity.ok(ADVANCED_RESPONSE); + return ResponseEntity.ok("Hello, how you doing?"); } } diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java b/spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java index fe81838d5d..d51f881112 100644 --- a/spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java +++ b/spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java @@ -73,7 +73,6 @@ public class GreetingControllerTest { assertNotEquals(reset, "2000"); assertEquals(TOO_MANY_REQUESTS, response.getStatusCode()); - assertNotEquals(GreetingController.ADVANCED_RESPONSE, response.getBody()); TimeUnit.SECONDS.sleep(2); From e90545f3b74c433ef9bf2801d6c00d7bfafa1c89 Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Thu, 1 Nov 2018 13:51:27 +0200 Subject: [PATCH 281/546] [Mercator]Unit test fox --- .../algorithms/mercator/EllipticalMercatorUnitTest.java | 5 ++--- .../algorithms/mercator/SphericalMercatorUnitTest.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java index f24d1328f0..4889c7640f 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java @@ -2,7 +2,6 @@ package com.baeldung.algorithms.mercator; import org.junit.Test; -import static junit.framework.TestCase.assertEquals; public class EllipticalMercatorUnitTest { @@ -10,13 +9,13 @@ public class EllipticalMercatorUnitTest { public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.xAxisProjection(22); - assertEquals(result, 2449028.7974520186); + assert result == 2449028.7974520186; } @Test public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.yAxisProjection(44); - assertEquals(result, 5435749.887511954); + assert result == 5435749.887511954; } } diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java index 196abe63cf..80e09b4c79 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java @@ -9,13 +9,13 @@ public class SphericalMercatorUnitTest { public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.xAxisProjection(22); - assertEquals(result, 2449028.7974520186); + assert result == 2449028.7974520186; } @Test public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.yAxisProjection(44); - assertEquals(result, 5465442.183322753); + assert result == 5465442.183322753; } } From d66c39b20744583039cc9104dd2dc5b2c7cc20e3 Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Thu, 1 Nov 2018 14:00:37 +0200 Subject: [PATCH 282/546] [Mercator] Minor fix --- .../algorithms/mercator/EllipticalMercatorUnitTest.java | 4 ++-- .../algorithms/mercator/SphericalMercatorUnitTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java index 4889c7640f..ce2f171051 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java @@ -6,14 +6,14 @@ import org.junit.Test; public class EllipticalMercatorUnitTest { @Test - public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.xAxisProjection(22); assert result == 2449028.7974520186; } @Test - public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.yAxisProjection(44); assert result == 5435749.887511954; diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java index 80e09b4c79..bbb34302ed 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java @@ -6,14 +6,14 @@ import static junit.framework.TestCase.assertEquals; public class SphericalMercatorUnitTest { @Test - public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.xAxisProjection(22); assert result == 2449028.7974520186; } @Test - public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.yAxisProjection(44); assert result == 5465442.183322753; From 18d7252bdf3d07521deef3d53bc2e630cf57642a Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Thu, 1 Nov 2018 07:12:53 -0500 Subject: [PATCH 283/546] BAEL-2142 README update (#5595) * BAEL-1766: Update README * BAEL-1853: add link to article * BAEL-1801: add link to article * Added links back to articles * Add links back to articles * BAEL-1795: Update README * BAEL-1901 and BAEL-1555 add links back to article * BAEL-2026 add link back to article * BAEL-2029: add link back to article * BAEL-1898: Add link back to article * BAEL-2102 and BAEL-2131 Add links back to articles * BAEL-2132 Add link back to article * BAEL-1980: add link back to article * BAEL-2200: Display auto-configuration report in Spring Boot * BAEL-2253: Add link back to article * BAEL-2200 BAEL-2287 Add links back to articles * BAEL-2176: add link back to article * BAEL-2142: add link to article --- java-strings/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java-strings/README.md b/java-strings/README.md index 603f70d2f1..a653087401 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -34,3 +34,4 @@ - [Remove Emojis from a Java String](https://www.baeldung.com/java-string-remove-emojis) - [String Not Empty Test Assertions in Java](https://www.baeldung.com/java-assert-string-not-empty) - [String Performance Hints](https://www.baeldung.com/java-string-performance) +- [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) From 5d87e46328fe28ea6255728b3d3b867a93154c73 Mon Sep 17 00:00:00 2001 From: Swapan Pramanick Date: Fri, 2 Nov 2018 03:27:05 +0530 Subject: [PATCH 284/546] BAEL-2221: using MockitoJunitRunner --- .../org/baeldung/web/service/EmployeeServiceUnitTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java index ee30c22e9f..23cd9a8fd2 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java @@ -4,16 +4,19 @@ import org.baeldung.web.model.Employee; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; +import org.mockito.runners.MockitoJUnitRunner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; +@RunWith(MockitoJUnitRunner.class) public class EmployeeServiceUnitTest { private static final Logger logger = LoggerFactory.getLogger(EmployeeServiceUnitTest.class); @@ -24,11 +27,6 @@ public class EmployeeServiceUnitTest { @InjectMocks private EmployeeService empService = new EmployeeService(); - @Before - public void setup() { - MockitoAnnotations.initMocks(this); - } - @Test public void givenMockingIsDoneByMockito_whenGetIsCalled_shouldReturnMockedObject() throws Exception { Employee emp = new Employee("E001", "Eric Simmons"); From 085825e149305b38f9f397f85f8f69cad7060692 Mon Sep 17 00:00:00 2001 From: Varun Upadhyay Date: Thu, 1 Nov 2018 18:18:10 -0700 Subject: [PATCH 285/546] Fixed a bug in findWord method --- .../com/baeldung/string/searching/WordIndexer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java b/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java index 5314efb0b4..1bcad6dd32 100644 --- a/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java +++ b/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java @@ -11,11 +11,14 @@ public class WordIndexer { String lowerCaseTextString = textString.toLowerCase(); String lowerCaseWord = word.toLowerCase(); - while(index != -1){ - index = lowerCaseTextString.indexOf(lowerCaseWord, index + 1); - if (index != -1) { - indexes.add(index); + while(index != -1) { + index = lowerCaseTextString.indexOf(lowerCaseWord, index); + if (index == -1) { + break; } + + indexes.add(index); + index++; } return indexes; } From b49dd4f1ac66b46697fcd367bd572d48eca51fe3 Mon Sep 17 00:00:00 2001 From: Vaibhav Sahay Date: Fri, 2 Nov 2018 09:37:00 +0530 Subject: [PATCH 286/546] print odd and even using Semaphore --- .../concurrent/evenandodd/SemaphoreDemo.java | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/SemaphoreDemo.java diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/SemaphoreDemo.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/SemaphoreDemo.java new file mode 100644 index 0000000000..c3afba1f68 --- /dev/null +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/SemaphoreDemo.java @@ -0,0 +1,83 @@ +package com.baeldung.concurrent.evenandodd; + +import java.util.concurrent.Semaphore; + +public class SemaphoreDemo { + + public static void main(String[] args) { + + SharedPrinter sp = new SharedPrinter(); + Thread odd = new Thread(new Odd(sp, 10)); + odd.setName("Odd"); + Thread even = new Thread(new Even(sp, 10)); + even.setName("Even"); + + odd.start(); + even.start(); + + } + +} + +class SharedPrinter { + + Semaphore semEven = new Semaphore(0); + Semaphore semOdd = new Semaphore(1); + + public void printEvenNum(int num) { + try { + semEven.acquire(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println(Thread.currentThread() + .getName() + ":"+num); + semOdd.release(); + } + + public void printOddNum(int num) { + try { + semOdd.acquire(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println(Thread.currentThread() + .getName() + ":"+ num); + semEven.release(); + + } +} + +class Even implements Runnable { + SharedPrinter sp; + int max; + + Even(SharedPrinter sp, int max) { + this.sp = sp; + this.max = max; + } + + @Override + public void run() { + for (int i = 2; i <= max; i = i + 2) { + sp.printEvenNum(i); + } + } +} + +class Odd implements Runnable { + SharedPrinter sp; + int max; + + Odd(SharedPrinter sp, int max) { + this.sp = sp; + this.max = max; + } + + @Override + public void run() { + for (int i = 1; i <= max; i = i + 2) { + sp.printOddNum(i); + } + } +} From adacecbd758459b2d890009ca31d7342683bf260 Mon Sep 17 00:00:00 2001 From: Shreyas Mahajan Date: Fri, 2 Nov 2018 11:54:23 +0530 Subject: [PATCH 287/546] BAEL-2201-shreyas-Replacing customer written MockitoExtension class with mockito's own --- testing-modules/junit-5/pom.xml | 13 +++- .../junit5/mockito/MockitoExtension.java | 75 ------------------- .../junit5/mockito/UserServiceUnitTest.java | 19 ++--- 3 files changed, 18 insertions(+), 89 deletions(-) delete mode 100644 testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/MockitoExtension.java diff --git a/testing-modules/junit-5/pom.xml b/testing-modules/junit-5/pom.xml index 93365264ac..b7600267d9 100644 --- a/testing-modules/junit-5/pom.xml +++ b/testing-modules/junit-5/pom.xml @@ -72,6 +72,13 @@ + + org.mockito + mockito-junit-jupiter + ${mockito.junit.jupiter.version} + test + + org.powermock powermock-api-mockito2 @@ -118,13 +125,13 @@ - 5.2.0 + 5.3.1 + 2.23.0 1.2.0 5.2.0 2.8.2 1.4.196 - 2.8.9 - 1.7.4 + 2.0.0-RC.1 2.21.0 1.6.0 5.0.1.RELEASE diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/MockitoExtension.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/MockitoExtension.java deleted file mode 100644 index 5836ef46e6..0000000000 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/MockitoExtension.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2015-2016 the original author or authors. - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution and is available at - * - * http://www.eclipse.org/legal/epl-v10.html - */ - -package com.baeldung.junit5.mockito; - -import static org.mockito.Mockito.mock; - -import java.lang.reflect.Parameter; - -import org.junit.jupiter.api.extension.ExtensionContext; -import org.junit.jupiter.api.extension.ExtensionContext.Namespace; -import org.junit.jupiter.api.extension.ExtensionContext.Store; -import org.junit.jupiter.api.extension.ParameterContext; -import org.junit.jupiter.api.extension.ParameterResolver; -import org.junit.jupiter.api.extension.TestInstancePostProcessor; -import org.mockito.MockitoAnnotations; -import org.mockito.Mock; - -/** - * {@code MockitoExtension} showcases the {@link TestInstancePostProcessor} - * and {@link ParameterResolver} extension APIs of JUnit 5 by providing - * dependency injection support at the field level and at the method parameter - * level via Mockito 2.x's {@link Mock @Mock} annotation. - * - * @since 5.0 - */ -public class MockitoExtension implements TestInstancePostProcessor, ParameterResolver { - - @Override - public void postProcessTestInstance(Object testInstance, ExtensionContext context) { - MockitoAnnotations.initMocks(testInstance); - } - - @Override - public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) { - return parameterContext.getParameter().isAnnotationPresent(Mock.class); - } - - @Override - public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) { - return getMock(parameterContext.getParameter(), extensionContext); - } - - private Object getMock(Parameter parameter, ExtensionContext extensionContext) { - Class mockType = parameter.getType(); - Store mocks = extensionContext.getStore(Namespace.create(MockitoExtension.class, mockType)); - String mockName = getMockName(parameter); - - if (mockName != null) { - return mocks.getOrComputeIfAbsent(mockName, key -> mock(mockType, mockName)); - } - else { - return mocks.getOrComputeIfAbsent(mockType.getCanonicalName(), key -> mock(mockType)); - } - } - - private String getMockName(Parameter parameter) { - String explicitMockName = parameter.getAnnotation(Mock.class).name().trim(); - if (!explicitMockName.isEmpty()) { - return explicitMockName; - } - else if (parameter.isNamePresent()) { - return parameter.getName(); - } - return null; - } - -} \ No newline at end of file diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java index 1ddab0531a..2e94072e79 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java @@ -3,19 +3,16 @@ package com.baeldung.junit5.mockito; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.platform.runner.JUnitPlatform; -import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; +import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.stubbing.Answer; import com.baeldung.junit5.mockito.repository.MailClient; @@ -25,25 +22,25 @@ import com.baeldung.junit5.mockito.service.DefaultUserService; import com.baeldung.junit5.mockito.service.Errors; import com.baeldung.junit5.mockito.service.UserService; -@RunWith(JUnitPlatform.class) @ExtendWith(MockitoExtension.class) public class UserServiceUnitTest { UserService userService; @Mock UserRepository userRepository; - + @Mock MailClient mailClient; + User user; @BeforeEach - void init(@Mock SettingRepository settingRepository, @Mock MailClient mailClient) { + void init(@Mock SettingRepository settingRepository) { userService = new DefaultUserService(userRepository, settingRepository, mailClient); - when(settingRepository.getUserMinAge()).thenReturn(10); + lenient().when(settingRepository.getUserMinAge()).thenReturn(10); when(settingRepository.getUserNameMinLength()).thenReturn(4); - when(userRepository.isUsernameAlreadyExists(any(String.class))).thenReturn(false); + lenient().when(userRepository.isUsernameAlreadyExists(any(String.class))).thenReturn(false); } @Test - void givenValidUser_whenSaveUser_thenSucceed(@Mock MailClient mailClient) { + void givenValidUser_whenSaveUser_thenSucceed() { // Given user = new User("Jerry", 12); when(userRepository.insert(any(User.class))).then(new Answer() { From 9604defd6c20b103cecc1fa333e770ab39adcf54 Mon Sep 17 00:00:00 2001 From: Shreyas Mahajan Date: Fri, 2 Nov 2018 14:55:16 +0530 Subject: [PATCH 288/546] BAEL-2201-shreyas-Minor changes to reflect the code used in article. --- .../baeldung/junit5/mockito/UserServiceUnitTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java index 2e94072e79..d4195e3b12 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/mockito/UserServiceUnitTest.java @@ -9,6 +9,8 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; @@ -23,9 +25,11 @@ import com.baeldung.junit5.mockito.service.Errors; import com.baeldung.junit5.mockito.service.UserService; @ExtendWith(MockitoExtension.class) +@RunWith(JUnitPlatform.class) public class UserServiceUnitTest { UserService userService; + SettingRepository settingRepository; @Mock UserRepository userRepository; @Mock MailClient mailClient; @@ -37,10 +41,11 @@ public class UserServiceUnitTest { lenient().when(settingRepository.getUserMinAge()).thenReturn(10); when(settingRepository.getUserNameMinLength()).thenReturn(4); lenient().when(userRepository.isUsernameAlreadyExists(any(String.class))).thenReturn(false); + this.settingRepository = settingRepository; } @Test - void givenValidUser_whenSaveUser_thenSucceed() { + void givenValidUser_whenSaveUser_thenSucceed(@Mock MailClient mailClient) { // Given user = new User("Jerry", 12); when(userRepository.insert(any(User.class))).then(new Answer() { @@ -53,7 +58,9 @@ public class UserServiceUnitTest { return user; } }); - + + userService = new DefaultUserService(userRepository, settingRepository, mailClient); + // When User insertedUser = userService.register(user); From 184d60ca6e8f489603c33ac38930f748522a99da Mon Sep 17 00:00:00 2001 From: Juan Moreno Date: Fri, 2 Nov 2018 10:36:21 -0300 Subject: [PATCH 289/546] Hibernate Field Naming with Spring Boot Issue: BAEL-2098 --- .../com/baeldung/naming/HibernateConfig.java | 19 ++++++ .../naming/MetadataExtractorIntegrator.java | 41 +++++++++++++ .../com/baeldung/naming/entity/Account.java | 19 ++++++ .../baeldung/naming/entity/Preference.java | 16 +++++ .../LegacyJpaImplNamingIntegrationTest.java | 58 +++++++++++++++++++ .../com/baeldung/naming/NamingConfig.java | 15 +++++ ...pringBootDefaultNamingIntegrationTest.java | 54 +++++++++++++++++ .../StrategyLegacyHbmImplIntegrationTest.java | 58 +++++++++++++++++++ 8 files changed, 280 insertions(+) create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/HibernateConfig.java create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/MetadataExtractorIntegrator.java create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Account.java create mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Preference.java create mode 100644 persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/LegacyJpaImplNamingIntegrationTest.java create mode 100644 persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/NamingConfig.java create mode 100644 persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/SpringBootDefaultNamingIntegrationTest.java create mode 100644 persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/StrategyLegacyHbmImplIntegrationTest.java diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/HibernateConfig.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/HibernateConfig.java new file mode 100644 index 0000000000..897e34d406 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/HibernateConfig.java @@ -0,0 +1,19 @@ +package com.baeldung.naming; + +import org.hibernate.jpa.boot.spi.IntegratorProvider; +import org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer; + +import java.util.Collections; +import java.util.Map; + +/** + * Custom implementation of the {@link HibernatePropertiesCustomizer HibernatePropertiesCustomizer}. + * We can use it to set custom hibernate properties. + */ +public class HibernateConfig implements HibernatePropertiesCustomizer { + + @Override + public void customize(Map hibernateProperties) { + hibernateProperties.put("hibernate.integrator_provider", (IntegratorProvider) () -> Collections.singletonList(MetadataExtractorIntegrator.INSTANCE)); + } +} diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/MetadataExtractorIntegrator.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/MetadataExtractorIntegrator.java new file mode 100644 index 0000000000..24b5cdea64 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/MetadataExtractorIntegrator.java @@ -0,0 +1,41 @@ +package com.baeldung.naming; + +import org.hibernate.boot.Metadata; +import org.hibernate.boot.model.relational.Database; +import org.hibernate.engine.spi.SessionFactoryImplementor; +import org.hibernate.integrator.spi.Integrator; +import org.hibernate.service.spi.SessionFactoryServiceRegistry; + +/** + * Custom implementation of the {@link Integrator Integrator} interface. + * We can use it to getting access to the binding metadata between entity mappings and database tables. + */ +public class MetadataExtractorIntegrator implements Integrator { + + public static final MetadataExtractorIntegrator INSTANCE = new MetadataExtractorIntegrator(); + + private Database database; + + private Metadata metadata; + + public Database getDatabase() { + return database; + } + + public Metadata getMetadata() { + return metadata; + } + + @Override + public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) { + + this.database = metadata.getDatabase(); + this.metadata = metadata; + + } + + @Override + public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) { + + } +} diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Account.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Account.java new file mode 100644 index 0000000000..6145818c5b --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Account.java @@ -0,0 +1,19 @@ +package com.baeldung.naming.entity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import java.util.List; + +@Entity +public class Account { + + @Id private Long id; + + private String defaultEmail; + + @OneToMany List preferences; + + @Column(name = "\"Secondary_Email\"") private String secondaryEmail; +} diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Preference.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Preference.java new file mode 100644 index 0000000000..928884a2c5 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/naming/entity/Preference.java @@ -0,0 +1,16 @@ +package com.baeldung.naming.entity; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.ManyToOne; + +@Entity +public class Preference { + + @Id private Long id; + + private String name; + + @ManyToOne private Account account; + +} diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/LegacyJpaImplNamingIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/LegacyJpaImplNamingIntegrationTest.java new file mode 100644 index 0000000000..e68be3bed8 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/LegacyJpaImplNamingIntegrationTest.java @@ -0,0 +1,58 @@ +package com.baeldung.naming; + +import com.baeldung.naming.entity.Account; +import org.assertj.core.api.SoftAssertions; +import org.hibernate.boot.Metadata; +import org.hibernate.mapping.PersistentClass; +import org.hibernate.mapping.Table; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@DataJpaTest +@TestPropertySource(properties = { + "spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl", + "spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl" +}) +public class LegacyJpaImplNamingIntegrationTest extends NamingConfig { + + @Test + public void givenLegacyJpaImplNamingStrategy_whenCreateDatabase_thenGetStrategyNames() { + Metadata metadata = MetadataExtractorIntegrator.INSTANCE.getMetadata(); + String entity = Account.class.getCanonicalName(); + PersistentClass persistentClass = metadata.getEntityBinding(entity); + Table table = persistentClass.getTable(); + String physicalNameExpected = "Secondary_Email"; + String implicitNameExpected = "defaultEmail"; + String tableNameExpected = "Account"; + + String tableNameCreated = table.getName(); + boolean columnNameIsQuoted = table + .getColumn(3) + .isQuoted(); + String physicalNameCreated = table + .getColumn(3) + .getName(); + String implicitNameCreated = table + .getColumn(2) + .getName(); + + SoftAssertions.assertSoftly(softly -> { + softly + .assertThat(columnNameIsQuoted) + .isTrue(); + softly + .assertThat(tableNameCreated) + .isEqualTo(tableNameExpected); + softly + .assertThat(physicalNameCreated) + .isEqualTo(physicalNameExpected); + softly + .assertThat(implicitNameCreated) + .isEqualTo(implicitNameExpected); + }); + } +} diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/NamingConfig.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/NamingConfig.java new file mode 100644 index 0000000000..c3ef37aeb4 --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/NamingConfig.java @@ -0,0 +1,15 @@ +package com.baeldung.naming; + +import org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; + +public class NamingConfig { + @TestConfiguration + static class Config { + @Bean + public HibernatePropertiesCustomizer customizer() { + return new HibernateConfig(); + } + } +} diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/SpringBootDefaultNamingIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/SpringBootDefaultNamingIntegrationTest.java new file mode 100644 index 0000000000..089430aabb --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/SpringBootDefaultNamingIntegrationTest.java @@ -0,0 +1,54 @@ +package com.baeldung.naming; + +import com.baeldung.naming.entity.Account; +import org.assertj.core.api.SoftAssertions; +import org.hibernate.boot.Metadata; +import org.hibernate.mapping.PersistentClass; +import org.hibernate.mapping.Table; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(SpringRunner.class) +@DataJpaTest +@TestPropertySource(properties = { + "spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy", + "spring.jpa.hibernate.naming.implicit-strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy" +}) +public class SpringBootDefaultNamingIntegrationTest extends NamingConfig { + + @Test + public void givenDefaultBootNamingStrategy_whenCreateDatabase_thenGetStrategyNames() { + Metadata metadata = MetadataExtractorIntegrator.INSTANCE.getMetadata(); + String entity = Account.class.getCanonicalName(); + PersistentClass persistentClass = metadata.getEntityBinding(entity); + Table table = persistentClass.getTable(); + String physicalNameExpected = "secondary_email"; + String implicitNameExpected = "default_email"; + String tableNameExpected = "account"; + + String tableNameCreated = table.getName(); + String physicalNameCreated = table + .getColumn(3) + .getName(); + String implicitNameCreated = table + .getColumn(2) + .getName(); + + SoftAssertions softly = new SoftAssertions(); + softly + .assertThat(tableNameCreated) + .isEqualTo(tableNameExpected); + softly + .assertThat(physicalNameCreated) + .isEqualTo(physicalNameExpected); + softly + .assertThat(implicitNameCreated) + .isEqualTo(implicitNameExpected); + softly.assertAll(); + } +} diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/StrategyLegacyHbmImplIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/StrategyLegacyHbmImplIntegrationTest.java new file mode 100644 index 0000000000..046755d9bc --- /dev/null +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/naming/StrategyLegacyHbmImplIntegrationTest.java @@ -0,0 +1,58 @@ +package com.baeldung.naming; + +import com.baeldung.naming.entity.Preference; +import org.assertj.core.api.SoftAssertions; +import org.hibernate.boot.Metadata; +import org.hibernate.mapping.PersistentClass; +import org.hibernate.mapping.Table; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.Collection; + +@RunWith(SpringRunner.class) +@DataJpaTest +@TestPropertySource(properties = { + "spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl", + "spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl", +}) +public class StrategyLegacyHbmImplIntegrationTest extends NamingConfig { + + @Test + public void givenLegacyHbmImplNamingNamingStrategy_whenCreateDatabase_thenGetStrategyNames() { + Metadata metadata = MetadataExtractorIntegrator.INSTANCE.getMetadata(); + String entity = Preference.class.getCanonicalName(); + PersistentClass persistentClass = metadata.getEntityBinding(entity); + Collection tables = metadata + .getDatabase() + .getDefaultNamespace() + .getTables(); + Table preferenceTable = persistentClass.getTable(); + String tableNameExpected = "Account_preferences"; + Table accountPreferencesTable = tables + .stream() + .filter(table -> table + .getName() + .equals(tableNameExpected)) + .findFirst() + .get(); + String implicitNameExpected = "account"; + + String implicitNameCreated = preferenceTable + .getColumn(3) + .getName(); + String tableNameCreated = accountPreferencesTable.getName(); + + SoftAssertions.assertSoftly(softly -> { + softly + .assertThat(implicitNameCreated) + .isEqualTo(implicitNameExpected); + softly + .assertThat(tableNameCreated) + .isEqualTo(tableNameExpected); + }); + } +} From e1b47c72a06d38d8007428589b40abb0fb8b655e Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Fri, 2 Nov 2018 20:41:50 +0530 Subject: [PATCH 290/546] BAEL-2303 Added sample code to demo how to replace multiple if statements in java. --- .../baeldung/reducingIfElse/AddCommand.java | 19 +++++ .../com/baeldung/reducingIfElse/AddRule.java | 21 +++++ .../com/baeldung/reducingIfElse/Addition.java | 8 ++ .../baeldung/reducingIfElse/Calculator.java | 84 +++++++++++++++++++ .../com/baeldung/reducingIfElse/Command.java | 7 ++ .../com/baeldung/reducingIfElse/Division.java | 7 ++ .../baeldung/reducingIfElse/Expression.java | 26 ++++++ .../com/baeldung/reducingIfElse/Modulo.java | 7 ++ .../reducingIfElse/Multiplication.java | 7 ++ .../baeldung/reducingIfElse/Operation.java | 5 ++ .../com/baeldung/reducingIfElse/Operator.java | 41 +++++++++ .../reducingIfElse/OperatorFactory.java | 21 +++++ .../com/baeldung/reducingIfElse/Rule.java | 8 ++ .../baeldung/reducingIfElse/RuleEngine.java | 20 +++++ .../baeldung/reducingIfElse/Subtraction.java | 7 ++ .../reduceIfelse/RuleEngineUnitTest.java | 27 ++++++ 16 files changed, 315 insertions(+) create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java create mode 100644 core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java new file mode 100644 index 0000000000..5aa0de7adc --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java @@ -0,0 +1,19 @@ +package com.baeldung.reducingIfElse; + +public class AddCommand implements Command { + + private int a; + private int b; + + @Override + public Integer execute() { + return a + b; + } + + @Override + public Command takeInput(Integer a, Integer b) { + this.a = a; + this.b = b; + return this; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java new file mode 100644 index 0000000000..871ff1f2d1 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java @@ -0,0 +1,21 @@ +package com.baeldung.reducingIfElse; + +public class AddRule implements Rule { + + private int result; + + @Override + public boolean evaluate(Expression expression) { + boolean evalResult = false; + if (expression.getOperator() == Operator.ADD) { + this.result = expression.getX() + expression.getY(); + evalResult = true; + } + return evalResult; + } + + @Override + public int getResult() { + return result; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java new file mode 100644 index 0000000000..3174ea558c --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Addition.java @@ -0,0 +1,8 @@ +package com.baeldung.reducingIfElse; + +public class Addition implements Operation { + @Override + public int apply(int a, int b) { + return a + b; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java new file mode 100644 index 0000000000..9b8cce130f --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java @@ -0,0 +1,84 @@ +package com.baeldung.reducingIfElse; + +public class Calculator { + + public int calculate(int a, int b, String operator) { + int result = Integer.MIN_VALUE; + + if ("add".equals(operator)) { + result = a + b; + } else if ("multiply".equals(operator)) { + result = a * b; + } else if ("divide".equals(operator)) { + result = a / b; + } else if ("subtract".equals(operator)) { + result = a - b; + } else if ("modulo".equals(operator)) { + result = a % b; + } + return result; + } + + public int calculateUsingSwitch(int a, int b, String operator) { + int result = 0; + switch (operator) { + case "add": + result = a + b; + break; + case "multiply": + result = a * b; + break; + case "divide": + result = a / b; + break; + case "subtract": + result = a - b; + break; + case "modulo": + result = a % b; + break; + default: + result = Integer.MIN_VALUE; + } + return result; + } + + public int calculateUsingSwitch(int a, int b, Operator operator) { + int result = 0; + switch (operator) { + case ADD: + result = a + b; + break; + case MULTIPLY: + result = a * b; + break; + case DIVIDE: + result = a / b; + break; + case SUBTRACT: + result = a - b; + break; + case MODULO: + result = a % b; + break; + default: + result = Integer.MIN_VALUE; + } + return result; + } + + public int calculate(int a, int b, Operator operator) { + return operator.apply(a, b); + } + + public int calculateUsingFactory(int a, int b, String operation) { + Operation targetOperation = OperatorFactory.getOperation(operation) + .orElseThrow(() -> new IllegalArgumentException("Invalid Operator")); + return targetOperation.apply(a, b); + } + + public int calculate(int a, int b, Command command) { + return command.takeInput(a, b) + .execute(); + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java new file mode 100644 index 0000000000..d9f00e31b4 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java @@ -0,0 +1,7 @@ +package com.baeldung.reducingIfElse; + +public interface Command { + R execute(); + + Command takeInput(A a, B b); +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java new file mode 100644 index 0000000000..75b1297655 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Division.java @@ -0,0 +1,7 @@ +package com.baeldung.reducingIfElse; + +public class Division implements Operation { + @Override public int apply(int a, int b) { + return a / b; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java new file mode 100644 index 0000000000..4d3fe1b824 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Expression.java @@ -0,0 +1,26 @@ +package com.baeldung.reducingIfElse; + +public class Expression { + + private Integer x; + private Integer y; + private Operator operator; + + public Expression(Integer x, Integer y, Operator operator) { + this.x = x; + this.y = y; + this.operator = operator; + } + + public Integer getX() { + return x; + } + + public Integer getY() { + return y; + } + + public Operator getOperator() { + return operator; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java new file mode 100644 index 0000000000..a7a081704c --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Modulo.java @@ -0,0 +1,7 @@ +package com.baeldung.reducingIfElse; + +public class Modulo implements Operation { + @Override public int apply(int a, int b) { + return a % b; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java new file mode 100644 index 0000000000..e1a39b33c4 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Multiplication.java @@ -0,0 +1,7 @@ +package com.baeldung.reducingIfElse; + +public class Multiplication implements Operation { + @Override public int apply(int a, int b) { + return 0; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java new file mode 100644 index 0000000000..41241fa810 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operation.java @@ -0,0 +1,5 @@ +package com.baeldung.reducingIfElse; + +public interface Operation { + int apply(int a, int b); +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java new file mode 100644 index 0000000000..831b8fa146 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Operator.java @@ -0,0 +1,41 @@ +package com.baeldung.reducingIfElse; + +public enum Operator { + + ADD { + @Override + public int apply(int a, int b) { + return a + b; + } + }, + + MULTIPLY { + @Override + public int apply(int a, int b) { + return a * b; + } + }, + + SUBTRACT { + @Override + public int apply(int a, int b) { + return a - b; + } + }, + + DIVIDE { + @Override + public int apply(int a, int b) { + return a / b; + } + }, + + MODULO { + @Override + public int apply(int a, int b) { + return a % b; + } + }; + + public abstract int apply(int a, int b); +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java new file mode 100644 index 0000000000..18ed63adbd --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/OperatorFactory.java @@ -0,0 +1,21 @@ +package com.baeldung.reducingIfElse; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class OperatorFactory { + + static Map operationMap = new HashMap<>(); + static { + operationMap.put("add", new Addition()); + operationMap.put("divide", new Division()); + operationMap.put("multiply", new Multiplication()); + operationMap.put("subtract", new Subtraction()); + operationMap.put("modulo", new Modulo()); + } + + public static Optional getOperation(String operation) { + return Optional.ofNullable(operationMap.get(operation)); + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java new file mode 100644 index 0000000000..202072dd66 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java @@ -0,0 +1,8 @@ +package com.baeldung.reducingIfElse; + +public interface Rule { + + boolean evaluate(Expression expression); + + int getResult(); +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java new file mode 100644 index 0000000000..3af67aff11 --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java @@ -0,0 +1,20 @@ +package com.baeldung.reducingIfElse; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +public class RuleEngine { + + private static List rules = new ArrayList<>(); + + static { + rules.add(new AddRule()); + } + + public List process(Expression expression) { + return rules.stream() + .filter(r -> r.evaluate(expression)) + .collect(Collectors.toList()); + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java new file mode 100644 index 0000000000..948998810e --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Subtraction.java @@ -0,0 +1,7 @@ +package com.baeldung.reducingIfElse; + +public class Subtraction implements Operation { + @Override public int apply(int a, int b) { + return a - b; + } +} diff --git a/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java b/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java new file mode 100644 index 0000000000..227dd12f0d --- /dev/null +++ b/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.reduceIfelse; + +import com.baeldung.reducingIfElse.Expression; +import com.baeldung.reducingIfElse.Operator; +import com.baeldung.reducingIfElse.Rule; +import com.baeldung.reducingIfElse.RuleEngine; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class RuleEngineUnitTest { + + @Test + public void whenNumbersGivenToRuleEngine_thenReturnCorrectResult() { + Expression expression = new Expression(5, 5, Operator.ADD); + RuleEngine engine = new RuleEngine(); + List rules = engine.process(expression); + + assertNotNull(rules); + assertEquals(1, rules.size()); + assertEquals(10, rules.get(0) + .getResult()); + } +} From 947e8a3edc680f70358fad8aec1b9f7dde127a22 Mon Sep 17 00:00:00 2001 From: bungrudi <30967151+bungrudi@users.noreply.github.com> Date: Fri, 2 Nov 2018 22:14:27 +0700 Subject: [PATCH 291/546] Guide to EnumMap Issue: BAEL-2260 --- core-java-collections/pom.xml | 2 +- .../java/com/baeldung/enummap/DummyEnum.java | 13 ++ .../enummap/EnumMapBenchmarkLiveTest.java | 119 +++++++++++++++ .../com/baeldung/enummap/EnumMapUnitTest.java | 144 ++++++++++++++++++ 4 files changed, 277 insertions(+), 1 deletion(-) create mode 100644 core-java-collections/src/test/java/com/baeldung/enummap/DummyEnum.java create mode 100644 core-java-collections/src/test/java/com/baeldung/enummap/EnumMapBenchmarkLiveTest.java create mode 100644 core-java-collections/src/test/java/com/baeldung/enummap/EnumMapUnitTest.java diff --git a/core-java-collections/pom.xml b/core-java-collections/pom.xml index 39ddc17684..d3ef953e01 100644 --- a/core-java-collections/pom.xml +++ b/core-java-collections/pom.xml @@ -65,7 +65,7 @@ 4.1 4.01 1.7.0 - 3.6.1 + 3.11.1 7.1.0 diff --git a/core-java-collections/src/test/java/com/baeldung/enummap/DummyEnum.java b/core-java-collections/src/test/java/com/baeldung/enummap/DummyEnum.java new file mode 100644 index 0000000000..906c820fa3 --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/enummap/DummyEnum.java @@ -0,0 +1,13 @@ +package com.baeldung.enummap; + +/** + * This enum is used for benchmarking, therefore has many values. + */ +public enum DummyEnum { + CCC_000, + CCC_001,CCC_002,CCC_003,CCC_004,CCC_005,CCC_006,CCC_007,CCC_008,CCC_009,CCC_010, + CCC_011,CCC_012,CCC_013,CCC_014,CCC_015,CCC_016,CCC_017,CCC_018,CCC_019,CCC_020, + CCC_021,CCC_022,CCC_023,CCC_024,CCC_025,CCC_026,CCC_027,CCC_028,CCC_029,CCC_030, + CCC_031,CCC_032,CCC_033,CCC_034,CCC_035,CCC_036,CCC_037,CCC_038,CCC_039,CCC_040, + CCC_041,CCC_042,CCC_043,CCC_044,CCC_045,CCC_046,CCC_047,CCC_048,CCC_049, +} diff --git a/core-java-collections/src/test/java/com/baeldung/enummap/EnumMapBenchmarkLiveTest.java b/core-java-collections/src/test/java/com/baeldung/enummap/EnumMapBenchmarkLiveTest.java new file mode 100644 index 0000000000..997a8ba65b --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/enummap/EnumMapBenchmarkLiveTest.java @@ -0,0 +1,119 @@ +package com.baeldung.enummap; + +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +import java.util.*; +import java.util.concurrent.TimeUnit; + +@BenchmarkMode({ Mode.AverageTime }) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Warmup(iterations = 5) +@Measurement(iterations = 5) +public class EnumMapBenchmarkLiveTest { + + @State(Scope.Thread) + public static class BenchmarkState { + EnumMap enumMap = new EnumMap<>(DummyEnum.class); + HashMap hashMap = new HashMap<>(); + TreeMap treeMap = new TreeMap<>(); + int len = DummyEnum.values().length; + Random random = new Random(); + int randomIndex; + + @Setup(Level.Trial) + public void setUp() { + DummyEnum[] values = DummyEnum.values(); + for (int i = 0; i < len; i++) { + enumMap.put(values[i], values[i].toString()); + hashMap.put(values[i], values[i].toString()); + treeMap.put(values[i], values[i].toString()); + } + } + + @Setup(Level.Invocation) + public void additionalSetup() { + randomIndex = random.nextInt(len); + } + + } + + @Benchmark + public int benchmark01_EnumMapPut(BenchmarkState s) { + s.enumMap.put(DummyEnum.values()[s.randomIndex], DummyEnum.values()[s.randomIndex].toString()); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark01_HashMapPut(BenchmarkState s) { + s.hashMap.put(DummyEnum.values()[s.randomIndex], DummyEnum.values()[s.randomIndex].toString()); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark01_TreeMapPut(BenchmarkState s) { + s.treeMap.put(DummyEnum.values()[s.randomIndex], DummyEnum.values()[s.randomIndex].toString()); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark02_EnumMapGet(BenchmarkState s) { + s.enumMap.get(DummyEnum.values()[s.randomIndex]); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark02_HashMapGet(BenchmarkState s) { + s.hashMap.get(DummyEnum.values()[s.randomIndex]); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark02_TreeMapGet(BenchmarkState s) { + s.treeMap.get(DummyEnum.values()[s.randomIndex]); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark03_EnumMapContainsKey(BenchmarkState s) { + s.enumMap.containsKey(DummyEnum.values()[s.randomIndex]); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark03_HashMapContainsKey(BenchmarkState s) { + s.hashMap.containsKey(DummyEnum.values()[s.randomIndex]); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark03_TreeMapContainsKey(BenchmarkState s) { + s.treeMap.containsKey(DummyEnum.values()[s.randomIndex]); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark04_EnumMapContainsValue(BenchmarkState s) { + s.enumMap.containsValue(DummyEnum.values()[s.randomIndex].toString()); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark04_HashMapContainsValue(BenchmarkState s) { + s.hashMap.containsValue(DummyEnum.values()[s.randomIndex].toString()); + return ++s.randomIndex; + } + + @Benchmark + public int benchmark04_TreeMapContainsValue(BenchmarkState s) { + s.treeMap.containsValue(DummyEnum.values()[s.randomIndex].toString()); + return ++s.randomIndex; + } + + public static void main(String[] args) throws Exception { + Options options = new OptionsBuilder().include(EnumMapBenchmarkLiveTest.class.getSimpleName()).threads(1).forks(0).shouldFailOnError(true).shouldDoGC(false).jvmArgs("-server").build(); + new Runner(options).run(); + } +} diff --git a/core-java-collections/src/test/java/com/baeldung/enummap/EnumMapUnitTest.java b/core-java-collections/src/test/java/com/baeldung/enummap/EnumMapUnitTest.java new file mode 100644 index 0000000000..d9d6cf2c39 --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/enummap/EnumMapUnitTest.java @@ -0,0 +1,144 @@ +package com.baeldung.enummap; + +import org.junit.Test; + +import java.util.*; +import java.util.concurrent.TimeUnit; + +import static java.util.AbstractMap.SimpleEntry; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; + +public class EnumMapUnitTest { + public enum DayOfWeek { + MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY + } + + @Test + public void whenContructedWithEnumType_ThenOnlyAcceptThatAsKey() { + Map dayMap = new EnumMap<>(DayOfWeek.class); + assertThatCode( + () -> dayMap.put(TimeUnit.NANOSECONDS, "NANOSECONDS")) + .isInstanceOf(ClassCastException.class); + } + + @Test + public void whenConstructedWithEnumMap_ThenSameKeyTypeAndInitialMappings() { + EnumMap activityMap = new EnumMap<>(DayOfWeek.class); + activityMap.put(DayOfWeek.MONDAY, "Soccer"); + activityMap.put(DayOfWeek.TUESDAY, "Basketball"); + + EnumMap activityMapCopy = new EnumMap<>(activityMap); + assertThat(activityMapCopy.size()).isEqualTo(2); + assertThat(activityMapCopy.get(DayOfWeek.MONDAY)) + .isEqualTo("Soccer"); + assertThat(activityMapCopy.get(DayOfWeek.TUESDAY)) + .isEqualTo("Basketball"); + } + + @Test + public void givenEmptyMap_whenConstructedWithMap_ThenException() { + HashMap ordinaryMap = new HashMap(); + assertThatCode(() -> new EnumMap(ordinaryMap)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("Specified map is empty"); + } + + @Test + public void givenMapWithEntries_whenConstructedWithMap_ThenSucceed() { + HashMap ordinaryMap = new HashMap<>(); + ordinaryMap.put(DayOfWeek.MONDAY, "Soccer"); + ordinaryMap.put(DayOfWeek.TUESDAY, "Basketball"); + EnumMap enumMap = new EnumMap<>(ordinaryMap); + assertThat(enumMap.size()).isEqualTo(2); + assertThat(enumMap.get(DayOfWeek.MONDAY)).isEqualTo("Soccer"); + assertThat(enumMap.get(DayOfWeek.TUESDAY)).isEqualTo("Basketball"); + } + + @Test + public void givenMapWithMultiTypeEntries_whenConstructedWithMap_ThenException() { + HashMap ordinaryMap = new HashMap<>(); + ordinaryMap.put(DayOfWeek.MONDAY, "Soccer"); + ordinaryMap.put(TimeUnit.MILLISECONDS, "Other enum type"); + assertThatCode(() -> new EnumMap(ordinaryMap)) + .isInstanceOf(ClassCastException.class); + } + + @Test + public void whenPut_thenGet() { + Map activityMap = new EnumMap(DayOfWeek.class); + activityMap.put(DayOfWeek.WEDNESDAY, "Hiking"); + activityMap.put(DayOfWeek.THURSDAY, null); + assertThat(activityMap.get(DayOfWeek.WEDNESDAY)).isEqualTo("Hiking"); + assertThat(activityMap.get(DayOfWeek.THURSDAY)).isNull(); + } + + @Test + public void givenMapping_whenContains_thenTrue() { + EnumMap activityMap = new EnumMap(DayOfWeek.class); + assertThat(activityMap.containsKey(DayOfWeek.WEDNESDAY)).isFalse(); + assertThat(activityMap.containsValue("Hiking")).isFalse(); + activityMap.put(DayOfWeek.WEDNESDAY, "Hiking"); + assertThat(activityMap.containsKey(DayOfWeek.WEDNESDAY)).isTrue(); + assertThat(activityMap.containsValue("Hiking")).isTrue(); + + assertThat(activityMap.containsKey(DayOfWeek.SATURDAY)).isFalse(); + assertThat(activityMap.containsValue(null)).isFalse(); + activityMap.put(DayOfWeek.SATURDAY, null); + assertThat(activityMap.containsKey(DayOfWeek.SATURDAY)).isTrue(); + assertThat(activityMap.containsValue(null)).isTrue(); + } + + @Test + public void whenRemove_thenRemoved() { + EnumMap activityMap = new EnumMap(DayOfWeek.class); + + activityMap.put(DayOfWeek.MONDAY, "Soccer"); + assertThat(activityMap.remove(DayOfWeek.MONDAY)).isEqualTo("Soccer"); + assertThat(activityMap.containsKey(DayOfWeek.MONDAY)).isFalse(); + + activityMap.put(DayOfWeek.MONDAY, "Soccer"); + assertThat(activityMap.remove(DayOfWeek.MONDAY, "Hiking")).isEqualTo(false); + assertThat(activityMap.remove(DayOfWeek.MONDAY, "Soccer")).isEqualTo(true); + } + + @Test + public void whenSubView_thenSubViewOrdered() { + EnumMap activityMap = new EnumMap(DayOfWeek.class); + activityMap.put(DayOfWeek.THURSDAY, "Karate"); + activityMap.put(DayOfWeek.WEDNESDAY, "Hiking"); + activityMap.put(DayOfWeek.MONDAY, "Soccer"); + + Collection values = activityMap.values(); + assertThat(values).containsExactly("Soccer", "Hiking", "Karate"); + + Set keys = activityMap.keySet(); + assertThat(keys) + .containsExactly(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY,DayOfWeek.THURSDAY); + + assertThat(activityMap.entrySet()) + .containsExactly( + new SimpleEntry(DayOfWeek.MONDAY, "Soccer"), + new SimpleEntry(DayOfWeek.WEDNESDAY, "Hiking"), + new SimpleEntry(DayOfWeek.THURSDAY, "Karate")); + } + + @Test + public void givenSubView_whenChange_thenReflected() { + EnumMap activityMap = new EnumMap(DayOfWeek.class); + activityMap.put(DayOfWeek.THURSDAY, "Karate"); + activityMap.put(DayOfWeek.WEDNESDAY, "Hiking"); + activityMap.put(DayOfWeek.MONDAY, "Soccer"); + + Collection values = activityMap.values(); + assertThat(values).containsExactly("Soccer", "Hiking", "Karate"); + + activityMap.put(DayOfWeek.TUESDAY, "Basketball"); + assertThat(values) + .containsExactly("Soccer", "Basketball", "Hiking", "Karate"); + + values.remove("Hiking"); + assertThat(activityMap.containsKey(DayOfWeek.WEDNESDAY)).isFalse(); + assertThat(activityMap.size()).isEqualTo(3); + } +} From 2a9ea052e28c5de3964db3d04601ffb041f71980 Mon Sep 17 00:00:00 2001 From: DOHA Date: Fri, 2 Nov 2018 18:06:35 +0200 Subject: [PATCH 292/546] webflux oauth --- spring-5-reactive-oauth/pom.xml | 59 +++++++++++++++++++ .../reactive/oauth/SecurityConfig.java | 19 ++++++ .../Spring5ReactiveOauthApplication.java | 25 ++++++++ .../reactive/oauth/web/MainController.java | 46 +++++++++++++++ .../baeldung/reactive/oauth/web/dto/Foo.java | 35 +++++++++++ .../src/main/resources/application.yml | 20 +++++++ .../Spring5ReactiveOauthIntegrationTest.java | 16 +++++ 7 files changed, 220 insertions(+) create mode 100644 spring-5-reactive-oauth/pom.xml create mode 100644 spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/SecurityConfig.java create mode 100644 spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthApplication.java create mode 100644 spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/MainController.java create mode 100644 spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/dto/Foo.java create mode 100644 spring-5-reactive-oauth/src/main/resources/application.yml create mode 100644 spring-5-reactive-oauth/src/test/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthIntegrationTest.java diff --git a/spring-5-reactive-oauth/pom.xml b/spring-5-reactive-oauth/pom.xml new file mode 100644 index 0000000000..72e0659bf0 --- /dev/null +++ b/spring-5-reactive-oauth/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + com.baeldung.reactive.oauth + spring-5-reactive-oauth + 1.0.0-SNAPSHOT + jar + + spring-5-reactive-oauth + WebFluc and Spring Security OAuth + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-webflux + + + + org.springframework.security + spring-security-oauth2-client + + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + org.springframework.security + spring-security-test + test + + + + diff --git a/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/SecurityConfig.java b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/SecurityConfig.java new file mode 100644 index 0000000000..2fa1dd9380 --- /dev/null +++ b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/SecurityConfig.java @@ -0,0 +1,19 @@ +package com.baeldung.reactive.oauth; + +import org.springframework.context.annotation.Bean; +import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.web.server.SecurityWebFilterChain; + +@EnableWebFluxSecurity +public class SecurityConfig { + + @Bean + public SecurityWebFilterChain configure(ServerHttpSecurity http) throws Exception { + return http.authorizeExchange() + .pathMatchers("/about").permitAll() + .anyExchange().authenticated() + .and().oauth2Login() + .and().build(); + } +} diff --git a/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthApplication.java b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthApplication.java new file mode 100644 index 0000000000..602ded6b9e --- /dev/null +++ b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthApplication.java @@ -0,0 +1,25 @@ +package com.baeldung.reactive.oauth; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository; +import org.springframework.security.oauth2.client.web.reactive.function.client.ServerOAuth2AuthorizedClientExchangeFilterFunction; +import org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository; +import org.springframework.web.reactive.function.client.WebClient; + +@SpringBootApplication +public class Spring5ReactiveOauthApplication { + + public static void main(String[] args) { + SpringApplication.run(Spring5ReactiveOauthApplication.class, args); + } + + @Bean + public WebClient webClient(ReactiveClientRegistrationRepository clientRegistrationRepo, ServerOAuth2AuthorizedClientRepository authorizedClientRepo) { + ServerOAuth2AuthorizedClientExchangeFilterFunction filter = new ServerOAuth2AuthorizedClientExchangeFilterFunction(clientRegistrationRepo, authorizedClientRepo); + return WebClient.builder() + .filter(filter) + .build(); + } +} diff --git a/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/MainController.java b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/MainController.java new file mode 100644 index 0000000000..b3ce24b0ea --- /dev/null +++ b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/MainController.java @@ -0,0 +1,46 @@ +package com.baeldung.reactive.oauth.web; + +import static org.springframework.security.oauth2.client.web.reactive.function.client.ServerOAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; +import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; +import org.springframework.security.oauth2.core.user.OAuth2User; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.reactive.function.client.WebClient; + +import reactor.core.publisher.Mono; + +import com.baeldung.reactive.oauth.web.dto.Foo; + +@RestController +public class MainController { + + @Autowired + private WebClient webClient; + + @GetMapping("/") + public Mono index(@AuthenticationPrincipal Mono oauth2User) { + return oauth2User + .map(OAuth2User::getName) + .map(name -> String.format("Hi, %s", name)); + } + + @GetMapping("/foos/{id}") + public Mono getFooResource(@RegisteredOAuth2AuthorizedClient("custom") OAuth2AuthorizedClient client, @PathVariable final long id){ + return webClient + .get() + .uri("http://localhost:8088/spring-security-oauth-resource/foos/{id}", id) + .attributes(oauth2AuthorizedClient(client)) + .retrieve() + .bodyToMono(Foo.class); + } + + @GetMapping("/about") + public String getAboutPage() { + return "WebFlux OAuth example"; + } +} diff --git a/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/dto/Foo.java b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/dto/Foo.java new file mode 100644 index 0000000000..15b4addbcd --- /dev/null +++ b/spring-5-reactive-oauth/src/main/java/com/baeldung/reactive/oauth/web/dto/Foo.java @@ -0,0 +1,35 @@ +package com.baeldung.reactive.oauth.web.dto; + +public class Foo { + private long id; + private String name; + + public Foo() { + super(); + } + + public Foo(final long id, final String name) { + super(); + + this.id = id; + this.name = name; + } + + // + + public long getId() { + return id; + } + + public void setId(final long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } +} diff --git a/spring-5-reactive-oauth/src/main/resources/application.yml b/spring-5-reactive-oauth/src/main/resources/application.yml new file mode 100644 index 0000000000..e35e19b344 --- /dev/null +++ b/spring-5-reactive-oauth/src/main/resources/application.yml @@ -0,0 +1,20 @@ +spring: + security: + oauth2: + client: + registration: + google: + client-id: YOUR_APP_CLIENT_ID + client-secret: YOUR_APP_CLIENT_SECRET + custom: + client-id: fooClientIdPassword + client-secret: secret + scopes: read,foo + authorization-grant-type: authorization_code + redirect-uri-template: http://localhost:8080/login/oauth2/code/custom + provider: + custom: + authorization-uri: http://localhost:8081/spring-security-oauth-server/oauth/authorize + token-uri: http://localhost:8081/spring-security-oauth-server/oauth/token + user-info-uri: http://localhost:8088/spring-security-oauth-resource/users/extra + user-name-attribute: user_name \ No newline at end of file diff --git a/spring-5-reactive-oauth/src/test/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthIntegrationTest.java b/spring-5-reactive-oauth/src/test/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthIntegrationTest.java new file mode 100644 index 0000000000..db545d63de --- /dev/null +++ b/spring-5-reactive-oauth/src/test/java/com/baeldung/reactive/oauth/Spring5ReactiveOauthIntegrationTest.java @@ -0,0 +1,16 @@ +package com.baeldung.reactive.oauth; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class Spring5ReactiveOauthIntegrationTest { + + @Test + public void contextLoads() { + } + +} From df8158ad81a97b5af0f566c16ec047b46800ecd5 Mon Sep 17 00:00:00 2001 From: psevestre Date: Sat, 3 Nov 2018 13:00:06 -0300 Subject: [PATCH 293/546] BAEL-1996 (#5507) * [BAEL-1996] WIP - Initial import * [BAEL-1996] Apply formatting rules * [BAEL-1996] Import UAA modules * [BAEL-1996] New directory structure --- jhipster/jhipster-uaa/gateway/.editorconfig | 24 + jhipster/jhipster-uaa/gateway/.gitattributes | 149 + jhipster/jhipster-uaa/gateway/.gitignore | 145 + jhipster/jhipster-uaa/gateway/.huskyrc | 5 + .../jhipster-uaa/gateway/.jhipster/Quote.json | 38 + .../.mvn/wrapper/MavenWrapperDownloader.java | 110 + .../gateway/.mvn/wrapper/maven-wrapper.jar | Bin 0 -> 48337 bytes .../.mvn/wrapper/maven-wrapper.properties | 1 + jhipster/jhipster-uaa/gateway/.prettierignore | 2 + jhipster/jhipster-uaa/gateway/.prettierrc | 12 + jhipster/jhipster-uaa/gateway/.yo-rc.json | 39 + jhipster/jhipster-uaa/gateway/README.md | 186 + jhipster/jhipster-uaa/gateway/angular.json | 39 + jhipster/jhipster-uaa/gateway/mvnw | 286 + jhipster/jhipster-uaa/gateway/mvnw.cmd | 161 + .../jhipster-uaa/gateway/package-lock.json | 20609 ++++++++++++++++ jhipster/jhipster-uaa/gateway/package.json | 131 + jhipster/jhipster-uaa/gateway/pom.xml | 1095 + .../jhipster-uaa/gateway/postcss.config.js | 3 + jhipster/jhipster-uaa/gateway/proxy.conf.json | 7 + .../gateway/src/main/docker/.dockerignore | 14 + .../gateway/src/main/docker/Dockerfile | 20 + .../gateway/src/main/docker/app.yml | 24 + .../docker/central-server-config/README.md | 7 + .../docker-config/application.yml | 15 + .../localhost-config/application.yml | 15 + .../gateway/src/main/docker/entrypoint.sh | 4 + .../docker/hazelcast-management-center.yml | 6 + .../src/main/docker/jhipster-registry.yml | 22 + .../gateway/src/main/docker/mysql.yml | 13 + .../gateway/src/main/docker/sonar.yml | 7 + .../jhipster/gateway/ApplicationWebXml.java | 21 + .../baeldung/jhipster/gateway/GatewayApp.java | 109 + .../gateway/aop/logging/LoggingAspect.java | 98 + .../gateway/config/ApplicationProperties.java | 14 + .../gateway/config/AsyncConfiguration.java | 59 + .../gateway/config/CacheConfiguration.java | 155 + .../config/CloudDatabaseConfiguration.java | 24 + .../jhipster/gateway/config/Constants.java | 17 + .../gateway/config/DatabaseConfiguration.java | 39 + .../config/DateTimeFormatConfiguration.java | 20 + .../gateway/config/DefaultProfileUtil.java | 51 + .../gateway/config/GatewayConfiguration.java | 55 + .../gateway/config/JacksonConfiguration.java | 63 + .../config/LiquibaseConfiguration.java | 53 + .../gateway/config/LocaleConfiguration.java | 27 + .../config/LoggingAspectConfiguration.java | 19 + .../gateway/config/LoggingConfiguration.java | 163 + .../gateway/config/MetricsConfiguration.java | 99 + .../gateway/config/SecurityConfiguration.java | 83 + .../gateway/config/WebConfigurer.java | 210 + .../GatewaySwaggerResourcesProvider.java | 54 + .../config/audit/AuditEventConverter.java | 86 + .../gateway/config/audit/package-info.java | 4 + .../OAuth2AuthenticationConfiguration.java | 80 + .../oauth2/OAuth2JwtAccessTokenConverter.java | 109 + .../config/oauth2/OAuth2Properties.java | 118 + .../jhipster/gateway/config/package-info.java | 4 + .../domain/AbstractAuditingEntity.java | 79 + .../gateway/domain/PersistentAuditEvent.java | 81 + .../jhipster/gateway/domain/package-info.java | 4 + .../accesscontrol/AccessControlFilter.java | 99 + .../ratelimiting/RateLimitingFilter.java | 121 + .../SwaggerBasePathRewritingFilter.java | 99 + .../gateway/repository/package-info.java | 4 + .../security/AuthoritiesConstants.java | 16 + .../gateway/security/SecurityUtils.java | 64 + .../security/SpringSecurityAuditorAware.java | 20 + .../security/oauth2/CookieCollection.java | 139 + .../security/oauth2/CookieTokenExtractor.java | 33 + .../CookiesHttpServletRequestWrapper.java | 31 + .../oauth2/OAuth2AuthenticationService.java | 163 + .../security/oauth2/OAuth2CookieHelper.java | 334 + .../security/oauth2/OAuth2Cookies.java | 35 + .../oauth2/OAuth2SignatureVerifierClient.java | 23 + .../oauth2/OAuth2TokenEndpointClient.java | 32 + .../OAuth2TokenEndpointClientAdapter.java | 120 + .../oauth2/UaaSignatureVerifierClient.java | 63 + .../oauth2/UaaTokenEndpointClient.java | 40 + .../gateway/security/package-info.java | 4 + .../gateway/service/package-info.java | 4 + .../web/filter/RefreshTokenFilter.java | 118 + .../filter/RefreshTokenFilterConfigurer.java | 36 + .../gateway/web/rest/AuthResource.java | 68 + .../gateway/web/rest/GatewayResource.java | 54 + .../gateway/web/rest/LogsResource.java | 39 + .../rest/errors/BadRequestAlertException.java | 42 + .../errors/CustomParameterizedException.java | 54 + .../errors/EmailAlreadyUsedException.java | 10 + .../rest/errors/EmailNotFoundException.java | 13 + .../web/rest/errors/ErrorConstants.java | 21 + .../web/rest/errors/ExceptionTranslator.java | 107 + .../gateway/web/rest/errors/FieldErrorVM.java | 33 + .../errors/InternalServerErrorException.java | 16 + .../rest/errors/InvalidPasswordException.java | 13 + .../errors/LoginAlreadyUsedException.java | 10 + .../gateway/web/rest/errors/package-info.java | 6 + .../gateway/web/rest/package-info.java | 4 + .../gateway/web/rest/util/HeaderUtil.java | 45 + .../gateway/web/rest/util/PaginationUtil.java | 45 + .../gateway/web/rest/vm/LoggerVM.java | 46 + .../jhipster/gateway/web/rest/vm/RouteVM.java | 41 + .../gateway/web/rest/vm/package-info.java | 4 + .../gateway/src/main/jib/entrypoint.sh | 4 + .../src/main/resources/.h2.server.properties | 6 + .../gateway/src/main/resources/banner.txt | 10 + .../main/resources/config/application-dev.yml | 168 + .../resources/config/application-prod.yml | 175 + .../main/resources/config/application-tls.yml | 18 + .../src/main/resources/config/application.yml | 157 + .../main/resources/config/bootstrap-prod.yml | 22 + .../src/main/resources/config/bootstrap.yml | 26 + .../00000000000000_initial_schema.xml | 59 + .../resources/config/liquibase/master.xml | 10 + .../main/resources/config/tls/keystore.p12 | Bin 0 -> 2620 bytes .../main/resources/i18n/messages.properties | 21 + .../resources/i18n/messages_en.properties | 21 + .../resources/i18n/messages_fr.properties | 21 + .../resources/i18n/messages_pt_br.properties | 21 + .../src/main/resources/logback-spring.xml | 70 + .../src/main/resources/templates/error.html | 163 + .../gateway/src/main/webapp/404.html | 61 + .../main/webapp/app/account/account.module.ts | 30 + .../main/webapp/app/account/account.route.ts | 12 + .../account/activate/activate.component.html | 17 + .../account/activate/activate.component.ts | 37 + .../app/account/activate/activate.route.ts | 14 + .../app/account/activate/activate.service.ts | 16 + .../src/main/webapp/app/account/index.ts | 19 + .../password-reset-finish.component.html | 77 + .../finish/password-reset-finish.component.ts | 65 + .../finish/password-reset-finish.route.ts | 12 + .../finish/password-reset-finish.service.ts | 14 + .../init/password-reset-init.component.html | 46 + .../init/password-reset-init.component.ts | 43 + .../init/password-reset-init.route.ts | 12 + .../init/password-reset-init.service.ts | 14 + .../password-strength-bar.component.ts | 84 + .../password/password-strength-bar.scss | 23 + .../account/password/password.component.html | 77 + .../account/password/password.component.ts | 46 + .../app/account/password/password.route.ts | 14 + .../app/account/password/password.service.ts | 14 + .../account/register/register.component.html | 124 + .../account/register/register.component.ts | 75 + .../app/account/register/register.route.ts | 12 + .../app/account/register/register.service.ts | 14 + .../account/settings/settings.component.html | 86 + .../account/settings/settings.component.ts | 64 + .../app/account/settings/settings.route.ts | 14 + .../src/main/webapp/app/admin/admin.module.ts | 57 + .../src/main/webapp/app/admin/admin.route.ts | 18 + .../app/admin/audits/audit-data.model.ts | 3 + .../webapp/app/admin/audits/audit.model.ts | 5 + .../app/admin/audits/audits.component.html | 52 + .../app/admin/audits/audits.component.ts | 128 + .../webapp/app/admin/audits/audits.route.ts | 17 + .../webapp/app/admin/audits/audits.service.ts | 25 + .../configuration.component.html | 46 + .../configuration/configuration.component.ts | 43 + .../configuration/configuration.route.ts | 11 + .../configuration/configuration.service.ts | 67 + .../webapp/app/admin/docs/docs.component.html | 2 + .../webapp/app/admin/docs/docs.component.ts | 9 + .../main/webapp/app/admin/docs/docs.route.ts | 11 + .../app/admin/gateway/gateway-route.model.ts | 3 + .../admin/gateway/gateway-routes.service.ts | 15 + .../app/admin/gateway/gateway.component.html | 50 + .../app/admin/gateway/gateway.component.ts | 28 + .../webapp/app/admin/gateway/gateway.route.ts | 11 + .../admin/health/health-modal.component.html | 36 + .../admin/health/health-modal.component.ts | 41 + .../app/admin/health/health.component.html | 34 + .../app/admin/health/health.component.ts | 66 + .../webapp/app/admin/health/health.route.ts | 11 + .../webapp/app/admin/health/health.service.ts | 133 + .../src/main/webapp/app/admin/index.ts | 32 + .../main/webapp/app/admin/logs/log.model.ts | 3 + .../webapp/app/admin/logs/logs.component.html | 28 + .../webapp/app/admin/logs/logs.component.ts | 32 + .../main/webapp/app/admin/logs/logs.route.ts | 11 + .../webapp/app/admin/logs/logs.service.ts | 19 + .../metrics/metrics-modal.component.html | 56 + .../admin/metrics/metrics-modal.component.ts | 46 + .../app/admin/metrics/metrics.component.html | 216 + .../app/admin/metrics/metrics.component.ts | 77 + .../webapp/app/admin/metrics/metrics.route.ts | 11 + .../app/admin/metrics/metrics.service.ts | 18 + ...er-management-delete-dialog.component.html | 19 + ...user-management-delete-dialog.component.ts | 29 + .../user-management-detail.component.html | 49 + .../user-management-detail.component.ts | 20 + .../user-management-update.component.html | 124 + .../user-management-update.component.ts | 58 + .../user-management.component.html | 79 + .../user-management.component.ts | 146 + .../user-management/user-management.route.ts | 68 + .../src/main/webapp/app/app-routing.module.ts | 23 + .../src/main/webapp/app/app.constants.ts | 8 + .../gateway/src/main/webapp/app/app.main.ts | 14 + .../gateway/src/main/webapp/app/app.module.ts | 62 + .../webapp/app/blocks/config/prod.config.ts | 9 + .../blocks/config/uib-pagination.config.ts | 14 + .../interceptor/auth-expired.interceptor.ts | 39 + .../interceptor/errorhandler.interceptor.ts | 25 + .../interceptor/notification.interceptor.ts | 43 + .../webapp/app/core/auth/account.service.ts | 18 + .../webapp/app/core/auth/auth-jwt.service.ts | 39 + .../main/webapp/app/core/auth/csrf.service.ts | 12 + .../webapp/app/core/auth/principal.service.ts | 102 + .../app/core/auth/state-storage.service.ts | 46 + .../core/auth/user-route-access-service.ts | 56 + .../src/main/webapp/app/core/core.module.ts | 24 + .../gateway/src/main/webapp/app/core/index.ts | 14 + .../app/core/language/language.constants.ts | 10 + .../app/core/language/language.helper.ts | 66 + .../app/core/login/login-modal.service.ts | 27 + .../webapp/app/core/login/login.service.ts | 47 + .../webapp/app/core/user/account.model.ts | 12 + .../main/webapp/app/core/user/user.model.ts | 47 + .../main/webapp/app/core/user/user.service.ts | 39 + .../main/webapp/app/entities/entity.module.ts | 17 + .../webapp/app/entities/quotes/quote/index.ts | 6 + .../quote/quote-delete-dialog.component.html | 19 + .../quote/quote-delete-dialog.component.ts | 65 + .../quotes/quote/quote-detail.component.html | 35 + .../quotes/quote/quote-detail.component.ts | 24 + .../quotes/quote/quote-update.component.html | 67 + .../quotes/quote/quote-update.component.ts | 56 + .../quotes/quote/quote.component.html | 66 + .../entities/quotes/quote/quote.component.ts | 132 + .../app/entities/quotes/quote/quote.module.ts | 23 + .../app/entities/quotes/quote/quote.route.ts | 95 + .../entities/quotes/quote/quote.service.ts | 70 + .../main/webapp/app/home/home.component.html | 41 + .../main/webapp/app/home/home.component.ts | 40 + .../src/main/webapp/app/home/home.module.ts | 12 + .../src/main/webapp/app/home/home.route.ts | 12 + .../src/main/webapp/app/home/home.scss | 23 + .../gateway/src/main/webapp/app/home/index.ts | 3 + .../app/layouts/error/error.component.html | 17 + .../app/layouts/error/error.component.ts | 24 + .../webapp/app/layouts/error/error.route.ts | 23 + .../app/layouts/footer/footer.component.html | 3 + .../app/layouts/footer/footer.component.ts | 7 + .../src/main/webapp/app/layouts/index.ts | 10 + .../app/layouts/main/main.component.html | 11 + .../webapp/app/layouts/main/main.component.ts | 28 + .../layouts/navbar/active-menu.directive.ts | 26 + .../app/layouts/navbar/navbar.component.html | 166 + .../app/layouts/navbar/navbar.component.ts | 76 + .../webapp/app/layouts/navbar/navbar.route.ts | 9 + .../webapp/app/layouts/navbar/navbar.scss | 78 + .../layouts/profiles/page-ribbon.component.ts | 22 + .../app/layouts/profiles/page-ribbon.scss | 31 + .../layouts/profiles/profile-info.model.ts | 6 + .../app/layouts/profiles/profile.service.ts | 40 + .../gateway/src/main/webapp/app/polyfills.ts | 70 + .../app/shared/alert/alert-error.component.ts | 115 + .../app/shared/alert/alert.component.ts | 34 + .../auth/has-any-authority.directive.ts | 39 + .../app/shared/constants/error.constants.ts | 4 + .../app/shared/constants/input.constants.ts | 2 + .../shared/constants/pagination.constants.ts | 1 + .../src/main/webapp/app/shared/index.ts | 13 + .../language/find-language-from-key.pipe.ts | 14 + .../app/shared/login/login.component.html | 43 + .../app/shared/login/login.component.ts | 87 + .../app/shared/model/quotes/quote.model.ts | 12 + .../webapp/app/shared/shared-common.module.ts | 10 + .../webapp/app/shared/shared-libs.module.ts | 26 + .../main/webapp/app/shared/shared.module.ts | 15 + .../app/shared/util/datepicker-adapter.ts | 21 + .../webapp/app/shared/util/request-util.ts | 18 + .../gateway/src/main/webapp/app/vendor.ts | 81 + .../main/webapp/content/images/hipster.png | Bin 0 -> 9499 bytes .../main/webapp/content/images/hipster192.png | Bin 0 -> 27702 bytes .../main/webapp/content/images/hipster256.png | Bin 0 -> 40780 bytes .../main/webapp/content/images/hipster2x.png | Bin 0 -> 18872 bytes .../main/webapp/content/images/hipster384.png | Bin 0 -> 58618 bytes .../main/webapp/content/images/hipster512.png | Bin 0 -> 80621 bytes .../webapp/content/images/logo-jhipster.png | Bin 0 -> 4459 bytes .../content/scss/_bootstrap-variables.scss | 42 + .../src/main/webapp/content/scss/global.scss | 226 + .../src/main/webapp/content/scss/vendor.scss | 12 + .../gateway/src/main/webapp/favicon.ico | Bin 0 -> 5430 bytes .../src/main/webapp/i18n/en/activate.json | 9 + .../src/main/webapp/i18n/en/audits.json | 27 + .../main/webapp/i18n/en/configuration.json | 10 + .../src/main/webapp/i18n/en/error.json | 13 + .../src/main/webapp/i18n/en/gateway.json | 15 + .../src/main/webapp/i18n/en/global.json | 138 + .../src/main/webapp/i18n/en/health.json | 32 + .../gateway/src/main/webapp/i18n/en/home.json | 19 + .../src/main/webapp/i18n/en/login.json | 19 + .../gateway/src/main/webapp/i18n/en/logs.json | 11 + .../src/main/webapp/i18n/en/metrics.json | 101 + .../src/main/webapp/i18n/en/password.json | 12 + .../src/main/webapp/i18n/en/quotesQuote.json | 28 + .../src/main/webapp/i18n/en/register.json | 24 + .../src/main/webapp/i18n/en/reset.json | 27 + .../src/main/webapp/i18n/en/sessions.json | 15 + .../src/main/webapp/i18n/en/settings.json | 32 + .../main/webapp/i18n/en/user-management.json | 30 + .../src/main/webapp/i18n/fr/activate.json | 9 + .../src/main/webapp/i18n/fr/audits.json | 27 + .../main/webapp/i18n/fr/configuration.json | 10 + .../src/main/webapp/i18n/fr/error.json | 13 + .../src/main/webapp/i18n/fr/gateway.json | 15 + .../src/main/webapp/i18n/fr/global.json | 137 + .../src/main/webapp/i18n/fr/health.json | 32 + .../gateway/src/main/webapp/i18n/fr/home.json | 19 + .../src/main/webapp/i18n/fr/login.json | 19 + .../gateway/src/main/webapp/i18n/fr/logs.json | 11 + .../src/main/webapp/i18n/fr/metrics.json | 101 + .../src/main/webapp/i18n/fr/password.json | 12 + .../src/main/webapp/i18n/fr/quotesQuote.json | 28 + .../src/main/webapp/i18n/fr/register.json | 24 + .../src/main/webapp/i18n/fr/reset.json | 27 + .../src/main/webapp/i18n/fr/sessions.json | 15 + .../src/main/webapp/i18n/fr/settings.json | 32 + .../main/webapp/i18n/fr/user-management.json | 30 + .../src/main/webapp/i18n/pt-br/activate.json | 9 + .../src/main/webapp/i18n/pt-br/audits.json | 27 + .../main/webapp/i18n/pt-br/configuration.json | 10 + .../src/main/webapp/i18n/pt-br/error.json | 13 + .../src/main/webapp/i18n/pt-br/gateway.json | 15 + .../src/main/webapp/i18n/pt-br/global.json | 137 + .../src/main/webapp/i18n/pt-br/health.json | 32 + .../src/main/webapp/i18n/pt-br/home.json | 19 + .../src/main/webapp/i18n/pt-br/login.json | 19 + .../src/main/webapp/i18n/pt-br/logs.json | 11 + .../src/main/webapp/i18n/pt-br/metrics.json | 93 + .../src/main/webapp/i18n/pt-br/password.json | 12 + .../main/webapp/i18n/pt-br/quotesQuote.json | 28 + .../src/main/webapp/i18n/pt-br/register.json | 24 + .../src/main/webapp/i18n/pt-br/reset.json | 30 + .../src/main/webapp/i18n/pt-br/sessions.json | 15 + .../src/main/webapp/i18n/pt-br/settings.json | 32 + .../webapp/i18n/pt-br/user-management.json | 30 + .../gateway/src/main/webapp/index.html | 46 + .../gateway/src/main/webapp/manifest.webapp | 31 + .../gateway/src/main/webapp/robots.txt | 11 + .../src/main/webapp/swagger-ui/index.html | 175 + .../SecurityBeanOverrideConfiguration.java | 35 + .../gateway/config/WebConfigurerTest.java | 204 + .../config/WebConfigurerTestController.java | 16 + .../SwaggerBasePathRewritingFilterTest.java | 95 + .../gateway/security/OAuth2TokenMockUtil.java | 83 + .../security/oauth2/CookieCollectionTest.java | 191 + .../oauth2/CookieTokenExtractorTest.java | 45 + .../OAuth2AuthenticationServiceTest.java | 252 + .../oauth2/OAuth2CookieHelperTest.java | 98 + .../gateway/web/rest/LogsResourceIntTest.java | 67 + .../jhipster/gateway/web/rest/TestUtil.java | 135 + .../errors/ExceptionTranslatorIntTest.java | 151 + .../ExceptionTranslatorTestController.java | 86 + .../web/rest/util/PaginationUtilUnitTest.java | 44 + .../src/test/javascript/jest-global-mocks.ts | 15 + .../gateway/src/test/javascript/jest.conf.js | 23 + .../gateway/src/test/javascript/jest.ts | 2 + .../activate/activate.component.spec.ts | 83 + .../password-reset-finish.component.spec.ts | 128 + .../password-reset-init.component.spec.ts | 119 + .../password-strength-bar.component.spec.ts | 50 + .../password/password.component.spec.ts | 91 + .../register/register.component.spec.ts | 135 + .../settings/settings.component.spec.ts | 85 + .../app/admin/audits/audits.component.spec.ts | 135 + .../app/admin/audits/audits.service.spec.ts | 59 + .../configuration.component.spec.ts | 73 + .../configuration.service.spec.ts | 64 + .../app/admin/health/health.component.spec.ts | 323 + .../app/admin/logs/logs.component.spec.ts | 79 + .../spec/app/admin/logs/logs.service.spec.ts | 58 + .../metrics/metrics-modal.component.spec.ts | 90 + .../admin/metrics/metrics.component.spec.ts | 66 + .../app/admin/metrics/metrics.service.spec.ts | 57 + ...management-delete-dialog.component.spec.ts | 59 + .../user-management-detail.component.spec.ts | 67 + .../user-management-update.component.spec.ts | 113 + .../user-management.component.spec.ts | 93 + .../spec/app/core/user/user.service.spec.ts | 66 + .../quote-delete-dialog.component.spec.ts | 55 + .../quote/quote-detail.component.spec.ts | 40 + .../quote/quote-update.component.spec.ts | 66 + .../quotes/quote/quote.component.spec.ts | 138 + .../quotes/quote/quote.service.spec.ts | 130 + .../alert/alert-error.component.spec.ts | 137 + .../app/shared/login/login.component.spec.ts | 165 + .../spec/helpers/mock-account.service.ts | 25 + .../spec/helpers/mock-active-modal.service.ts | 12 + .../spec/helpers/mock-alert.service.ts | 11 + .../helpers/mock-event-manager.service.ts | 12 + .../spec/helpers/mock-language.service.ts | 36 + .../spec/helpers/mock-login.service.ts | 29 + .../spec/helpers/mock-principal.service.ts | 20 + .../spec/helpers/mock-route.service.ts | 29 + .../helpers/mock-state-storage.service.ts | 22 + .../test/javascript/spec/helpers/spyobject.ts | 69 + .../src/test/javascript/spec/test.module.ts | 77 + .../src/test/resources/config/application.yml | 114 + .../src/test/resources/config/bootstrap.yml | 4 + .../gateway/src/test/resources/logback.xml | 46 + .../jhipster-uaa/gateway/tsconfig-aot.json | 30 + jhipster/jhipster-uaa/gateway/tsconfig.json | 32 + jhipster/jhipster-uaa/gateway/tslint.json | 122 + .../gateway/webpack/logo-jhipster.png | Bin 0 -> 4459 bytes .../jhipster-uaa/gateway/webpack/utils.js | 44 + .../gateway/webpack/webpack.common.js | 97 + .../gateway/webpack/webpack.dev.js | 150 + .../gateway/webpack/webpack.prod.js | 147 + jhipster/jhipster-uaa/quotes/.editorconfig | 24 + jhipster/jhipster-uaa/quotes/.gitattributes | 149 + jhipster/jhipster-uaa/quotes/.gitignore | 144 + .../jhipster-uaa/quotes/.jhipster/Quote.json | 37 + .../.mvn/wrapper/MavenWrapperDownloader.java | 110 + .../quotes/.mvn/wrapper/maven-wrapper.jar | Bin 0 -> 48337 bytes .../.mvn/wrapper/maven-wrapper.properties | 1 + jhipster/jhipster-uaa/quotes/.yo-rc.json | 38 + jhipster/jhipster-uaa/quotes/README.md | 94 + jhipster/jhipster-uaa/quotes/mvnw | 286 + jhipster/jhipster-uaa/quotes/mvnw.cmd | 161 + .../jhipster-uaa/quotes/package-lock.json | 4409 ++++ jhipster/jhipster-uaa/quotes/package.json | 16 + jhipster/jhipster-uaa/quotes/pom.xml | 915 + jhipster/jhipster-uaa/quotes/quotes.jh | 13 + .../quotes/src/main/docker/.dockerignore | 14 + .../quotes/src/main/docker/Dockerfile | 20 + .../quotes/src/main/docker/app.yml | 22 + .../docker/central-server-config/README.md | 7 + .../docker-config/application.yml | 15 + .../localhost-config/application.yml | 15 + .../quotes/src/main/docker/entrypoint.sh | 4 + .../docker/hazelcast-management-center.yml | 6 + .../src/main/docker/jhipster-registry.yml | 22 + .../quotes/src/main/docker/mysql.yml | 13 + .../quotes/src/main/docker/sonar.yml | 7 + .../jhipster/quotes/ApplicationWebXml.java | 21 + .../baeldung/jhipster/quotes/QuotesApp.java | 113 + .../quotes/aop/logging/LoggingAspect.java | 98 + .../quotes/client/AuthorizedFeignClient.java | 51 + .../client/AuthorizedUserFeignClient.java | 49 + .../OAuth2InterceptedFeignConfiguration.java | 24 + .../OAuth2UserClientFeignConfiguration.java | 15 + .../client/UserFeignClientInterceptor.java | 29 + .../quotes/config/ApplicationProperties.java | 14 + .../quotes/config/AsyncConfiguration.java | 59 + .../quotes/config/CacheConfiguration.java | 155 + .../config/CloudDatabaseConfiguration.java | 24 + .../jhipster/quotes/config/Constants.java | 17 + .../quotes/config/DatabaseConfiguration.java | 39 + .../config/DateTimeFormatConfiguration.java | 20 + .../quotes/config/DefaultProfileUtil.java | 51 + .../quotes/config/FeignConfiguration.java | 18 + .../quotes/config/JacksonConfiguration.java | 63 + .../quotes/config/LiquibaseConfiguration.java | 53 + .../quotes/config/LocaleConfiguration.java | 27 + .../config/LoggingAspectConfiguration.java | 19 + .../quotes/config/LoggingConfiguration.java | 163 + .../quotes/config/MetricsConfiguration.java | 99 + .../quotes/config/SecurityConfiguration.java | 75 + .../jhipster/quotes/config/WebConfigurer.java | 148 + .../config/audit/AuditEventConverter.java | 86 + .../quotes/config/audit/package-info.java | 4 + .../oauth2/OAuth2JwtAccessTokenConverter.java | 109 + .../config/oauth2/OAuth2Properties.java | 118 + .../jhipster/quotes/config/package-info.java | 4 + .../quotes/domain/AbstractAuditingEntity.java | 79 + .../quotes/domain/PersistentAuditEvent.java | 81 + .../jhipster/quotes/domain/Quote.java | 118 + .../jhipster/quotes/domain/package-info.java | 4 + .../quotes/repository/QuoteRepository.java | 15 + .../quotes/repository/package-info.java | 4 + .../quotes/security/AuthoritiesConstants.java | 16 + .../quotes/security/SecurityUtils.java | 64 + .../security/SpringSecurityAuditorAware.java | 20 + .../oauth2/OAuth2SignatureVerifierClient.java | 23 + .../oauth2/UaaSignatureVerifierClient.java | 63 + .../quotes/security/package-info.java | 4 + .../quotes/service/QuoteQueryService.java | 104 + .../jhipster/quotes/service/QuoteService.java | 46 + .../quotes/service/dto/QuoteCriteria.java | 107 + .../jhipster/quotes/service/dto/QuoteDTO.java | 87 + .../quotes/service/impl/QuoteServiceImpl.java | 90 + .../quotes/service/mapper/EntityMapper.java | 21 + .../quotes/service/mapper/QuoteMapper.java | 24 + .../jhipster/quotes/service/package-info.java | 4 + .../quotes/web/rest/LogsResource.java | 39 + .../quotes/web/rest/QuoteResource.java | 146 + .../rest/errors/BadRequestAlertException.java | 42 + .../errors/CustomParameterizedException.java | 54 + .../errors/EmailAlreadyUsedException.java | 10 + .../rest/errors/EmailNotFoundException.java | 13 + .../web/rest/errors/ErrorConstants.java | 21 + .../web/rest/errors/ExceptionTranslator.java | 107 + .../quotes/web/rest/errors/FieldErrorVM.java | 33 + .../errors/InternalServerErrorException.java | 16 + .../rest/errors/InvalidPasswordException.java | 13 + .../errors/LoginAlreadyUsedException.java | 10 + .../quotes/web/rest/errors/package-info.java | 6 + .../quotes/web/rest/package-info.java | 4 + .../quotes/web/rest/util/HeaderUtil.java | 45 + .../quotes/web/rest/util/PaginationUtil.java | 45 + .../jhipster/quotes/web/rest/vm/LoggerVM.java | 46 + .../quotes/web/rest/vm/package-info.java | 4 + .../quotes/src/main/jib/entrypoint.sh | 4 + .../src/main/resources/.h2.server.properties | 5 + .../quotes/src/main/resources/banner.txt | 10 + .../main/resources/config/application-dev.yml | 159 + .../resources/config/application-prod.yml | 167 + .../main/resources/config/application-tls.yml | 18 + .../src/main/resources/config/application.yml | 160 + .../main/resources/config/bootstrap-prod.yml | 22 + .../src/main/resources/config/bootstrap.yml | 26 + .../00000000000000_initial_schema.xml | 59 + .../20181019033648_added_entity_Quote.xml | 43 + .../resources/config/liquibase/master.xml | 11 + .../main/resources/config/tls/keystore.p12 | Bin 0 -> 2620 bytes .../main/resources/i18n/messages.properties | 21 + .../resources/i18n/messages_en.properties | 21 + .../src/main/resources/logback-spring.xml | 70 + .../src/main/resources/static/index.html | 103 + .../src/main/resources/templates/error.html | 163 + .../SecurityBeanOverrideConfiguration.java | 35 + .../quotes/config/WebConfigurerTest.java | 197 + .../config/WebConfigurerTestController.java | 16 + .../quotes/security/OAuth2TokenMockUtil.java | 83 + .../quotes/web/rest/LogsResourceIntTest.java | 67 + .../quotes/web/rest/QuoteResourceIntTest.java | 546 + .../jhipster/quotes/web/rest/TestUtil.java | 135 + .../errors/ExceptionTranslatorIntTest.java | 151 + .../ExceptionTranslatorTestController.java | 86 + .../web/rest/util/PaginationUtilUnitTest.java | 44 + .../src/test/resources/config/application.yml | 119 + .../src/test/resources/config/bootstrap.yml | 4 + .../quotes/src/test/resources/logback.xml | 46 + jhipster/jhipster-uaa/uaa/.editorconfig | 24 + jhipster/jhipster-uaa/uaa/.gitattributes | 149 + jhipster/jhipster-uaa/uaa/.gitignore | 144 + .../.mvn/wrapper/MavenWrapperDownloader.java | 110 + .../uaa/.mvn/wrapper/maven-wrapper.jar | Bin 0 -> 48337 bytes .../uaa/.mvn/wrapper/maven-wrapper.properties | 1 + jhipster/jhipster-uaa/uaa/.yo-rc.json | 36 + jhipster/jhipster-uaa/uaa/README.md | 95 + jhipster/jhipster-uaa/uaa/mvnw | 286 + jhipster/jhipster-uaa/uaa/mvnw.cmd | 161 + jhipster/jhipster-uaa/uaa/package-lock.json | 4409 ++++ jhipster/jhipster-uaa/uaa/package.json | 16 + jhipster/jhipster-uaa/uaa/pom.xml | 915 + .../uaa/src/main/docker/.dockerignore | 14 + .../uaa/src/main/docker/Dockerfile | 20 + .../jhipster-uaa/uaa/src/main/docker/app.yml | 22 + .../docker/central-server-config/README.md | 7 + .../docker-config/application.yml | 15 + .../localhost-config/application.yml | 15 + .../uaa/src/main/docker/entrypoint.sh | 4 + .../docker/hazelcast-management-center.yml | 6 + .../uaa/src/main/docker/jhipster-registry.yml | 22 + .../uaa/src/main/docker/mysql.yml | 13 + .../uaa/src/main/docker/sonar.yml | 7 + .../jhipster/uaa/ApplicationWebXml.java | 21 + .../com/baeldung/jhipster/uaa/UaaApp.java | 107 + .../uaa/aop/logging/LoggingAspect.java | 98 + .../uaa/config/ApplicationProperties.java | 14 + .../uaa/config/AsyncConfiguration.java | 59 + .../uaa/config/CacheConfiguration.java | 155 + .../config/CloudDatabaseConfiguration.java | 24 + .../jhipster/uaa/config/Constants.java | 17 + .../uaa/config/DatabaseConfiguration.java | 39 + .../config/DateTimeFormatConfiguration.java | 20 + .../uaa/config/DefaultProfileUtil.java | 51 + .../uaa/config/JacksonConfiguration.java | 63 + .../uaa/config/LiquibaseConfiguration.java | 53 + .../uaa/config/LocaleConfiguration.java | 27 + .../config/LoggingAspectConfiguration.java | 19 + .../uaa/config/LoggingConfiguration.java | 163 + .../uaa/config/MetricsConfiguration.java | 99 + .../jhipster/uaa/config/UaaConfiguration.java | 193 + .../jhipster/uaa/config/UaaProperties.java | 100 + .../config/UaaWebSecurityConfiguration.java | 72 + .../jhipster/uaa/config/WebConfigurer.java | 148 + .../uaa/config/audit/AuditEventConverter.java | 86 + .../uaa/config/audit/package-info.java | 4 + .../jhipster/uaa/config/package-info.java | 4 + .../uaa/domain/AbstractAuditingEntity.java | 79 + .../jhipster/uaa/domain/Authority.java | 62 + .../uaa/domain/PersistentAuditEvent.java | 81 + .../baeldung/jhipster/uaa/domain/User.java | 233 + .../jhipster/uaa/domain/package-info.java | 4 + .../uaa/repository/AuthorityRepository.java | 11 + .../CustomAuditEventRepository.java | 89 + .../PersistenceAuditEventRepository.java | 25 + .../uaa/repository/UserRepository.java | 47 + .../jhipster/uaa/repository/package-info.java | 4 + .../uaa/security/AuthoritiesConstants.java | 16 + .../security/DomainUserDetailsService.java | 62 + .../uaa/security/IatTokenEnhancer.java | 36 + .../jhipster/uaa/security/SecurityUtils.java | 64 + .../security/SpringSecurityAuditorAware.java | 20 + .../security/UserNotActivatedException.java | 19 + .../jhipster/uaa/security/package-info.java | 4 + .../uaa/service/AuditEventService.java | 51 + .../jhipster/uaa/service/MailService.java | 105 + .../jhipster/uaa/service/UserService.java | 293 + .../uaa/service/dto/PasswordChangeDTO.java | 35 + .../jhipster/uaa/service/dto/UserDTO.java | 199 + .../uaa/service/dto/package-info.java | 4 + .../uaa/service/mapper/UserMapper.java | 76 + .../uaa/service/mapper/package-info.java | 4 + .../jhipster/uaa/service/package-info.java | 4 + .../jhipster/uaa/service/util/RandomUtil.java | 41 + .../uaa/web/rest/AccountResource.java | 189 + .../jhipster/uaa/web/rest/AuditResource.java | 77 + .../jhipster/uaa/web/rest/LogsResource.java | 39 + .../jhipster/uaa/web/rest/UserResource.java | 190 + .../rest/errors/BadRequestAlertException.java | 42 + .../errors/CustomParameterizedException.java | 54 + .../errors/EmailAlreadyUsedException.java | 10 + .../rest/errors/EmailNotFoundException.java | 13 + .../uaa/web/rest/errors/ErrorConstants.java | 21 + .../web/rest/errors/ExceptionTranslator.java | 107 + .../uaa/web/rest/errors/FieldErrorVM.java | 33 + .../errors/InternalServerErrorException.java | 16 + .../rest/errors/InvalidPasswordException.java | 13 + .../errors/LoginAlreadyUsedException.java | 10 + .../uaa/web/rest/errors/package-info.java | 6 + .../jhipster/uaa/web/rest/package-info.java | 4 + .../uaa/web/rest/util/HeaderUtil.java | 45 + .../uaa/web/rest/util/PaginationUtil.java | 45 + .../uaa/web/rest/vm/KeyAndPasswordVM.java | 27 + .../jhipster/uaa/web/rest/vm/LoggerVM.java | 46 + .../uaa/web/rest/vm/ManagedUserVM.java | 35 + .../uaa/web/rest/vm/package-info.java | 4 + .../uaa/src/main/jib/entrypoint.sh | 4 + .../src/main/resources/.h2.server.properties | 5 + .../uaa/src/main/resources/banner.txt | 10 + .../main/resources/config/application-dev.yml | 157 + .../resources/config/application-prod.yml | 175 + .../main/resources/config/application-tls.yml | 18 + .../src/main/resources/config/application.yml | 139 + .../main/resources/config/bootstrap-prod.yml | 22 + .../src/main/resources/config/bootstrap.yml | 26 + .../config/liquibase/authorities.csv | 3 + .../00000000000000_initial_schema.xml | 141 + .../resources/config/liquibase/master.xml | 10 + .../main/resources/config/liquibase/users.csv | 5 + .../config/liquibase/users_authorities.csv | 6 + .../main/resources/config/tls/keystore.p12 | Bin 0 -> 2612 bytes .../main/resources/i18n/messages.properties | 21 + .../resources/i18n/messages_en.properties | 21 + .../uaa/src/main/resources/logback-spring.xml | 70 + .../src/main/resources/templates/error.html | 163 + .../templates/mail/activationEmail.html | 25 + .../templates/mail/creationEmail.html | 27 + .../templates/mail/passwordResetEmail.html | 25 + .../SecurityBeanOverrideConfiguration.java | 35 + .../uaa/config/WebConfigurerTest.java | 197 + .../config/WebConfigurerTestController.java | 16 + .../CustomAuditEventRepositoryIntTest.java | 165 + .../DomainUserDetailsServiceIntTest.java | 127 + .../uaa/security/OAuth2TokenMockUtil.java | 83 + .../uaa/security/SecurityUtilsUnitTest.java | 64 + .../uaa/service/MailServiceIntTest.java | 187 + .../uaa/service/UserServiceIntTest.java | 194 + .../uaa/web/rest/AccountResourceIntTest.java | 811 + .../uaa/web/rest/AuditResourceIntTest.java | 146 + .../uaa/web/rest/LogsResourceIntTest.java | 67 + .../jhipster/uaa/web/rest/TestUtil.java | 135 + .../uaa/web/rest/UserResourceIntTest.java | 614 + .../errors/ExceptionTranslatorIntTest.java | 151 + .../ExceptionTranslatorTestController.java | 86 + .../web/rest/util/PaginationUtilUnitTest.java | 44 + .../src/test/resources/config/application.yml | 120 + .../src/test/resources/config/bootstrap.yml | 4 + .../resources/i18n/messages_en.properties | 1 + .../uaa/src/test/resources/logback.xml | 43 + .../resources/templates/mail/testEmail.html | 1 + 678 files changed, 69838 insertions(+) create mode 100644 jhipster/jhipster-uaa/gateway/.editorconfig create mode 100644 jhipster/jhipster-uaa/gateway/.gitattributes create mode 100644 jhipster/jhipster-uaa/gateway/.gitignore create mode 100644 jhipster/jhipster-uaa/gateway/.huskyrc create mode 100644 jhipster/jhipster-uaa/gateway/.jhipster/Quote.json create mode 100644 jhipster/jhipster-uaa/gateway/.mvn/wrapper/MavenWrapperDownloader.java create mode 100644 jhipster/jhipster-uaa/gateway/.mvn/wrapper/maven-wrapper.jar create mode 100644 jhipster/jhipster-uaa/gateway/.mvn/wrapper/maven-wrapper.properties create mode 100644 jhipster/jhipster-uaa/gateway/.prettierignore create mode 100644 jhipster/jhipster-uaa/gateway/.prettierrc create mode 100644 jhipster/jhipster-uaa/gateway/.yo-rc.json create mode 100644 jhipster/jhipster-uaa/gateway/README.md create mode 100644 jhipster/jhipster-uaa/gateway/angular.json create mode 100644 jhipster/jhipster-uaa/gateway/mvnw create mode 100644 jhipster/jhipster-uaa/gateway/mvnw.cmd create mode 100644 jhipster/jhipster-uaa/gateway/package-lock.json create mode 100644 jhipster/jhipster-uaa/gateway/package.json create mode 100644 jhipster/jhipster-uaa/gateway/pom.xml create mode 100644 jhipster/jhipster-uaa/gateway/postcss.config.js create mode 100644 jhipster/jhipster-uaa/gateway/proxy.conf.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/.dockerignore create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/Dockerfile create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/app.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/README.md create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/docker-config/application.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/localhost-config/application.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/entrypoint.sh create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/hazelcast-management-center.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/jhipster-registry.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/mysql.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/docker/sonar.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/ApplicationWebXml.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/GatewayApp.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/aop/logging/LoggingAspect.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/ApplicationProperties.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/AsyncConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CacheConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CloudDatabaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/Constants.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DatabaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DateTimeFormatConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DefaultProfileUtil.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/GatewayConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/JacksonConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LiquibaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LocaleConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingAspectConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/MetricsConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/SecurityConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/WebConfigurer.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/apidoc/GatewaySwaggerResourcesProvider.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/AuditEventConverter.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2AuthenticationConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2JwtAccessTokenConverter.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2Properties.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/AbstractAuditingEntity.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/PersistentAuditEvent.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/accesscontrol/AccessControlFilter.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/ratelimiting/RateLimitingFilter.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilter.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/repository/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/AuthoritiesConstants.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SecurityUtils.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SpringSecurityAuditorAware.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollection.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractor.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookiesHttpServletRequestWrapper.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationService.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelper.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2Cookies.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2SignatureVerifierClient.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClient.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClientAdapter.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaSignatureVerifierClient.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaTokenEndpointClient.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/service/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilter.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilterConfigurer.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/AuthResource.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/GatewayResource.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/LogsResource.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/BadRequestAlertException.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/CustomParameterizedException.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailAlreadyUsedException.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailNotFoundException.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ErrorConstants.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslator.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/FieldErrorVM.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InternalServerErrorException.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InvalidPasswordException.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/LoginAlreadyUsedException.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/HeaderUtil.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtil.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/LoggerVM.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/RouteVM.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/package-info.java create mode 100644 jhipster/jhipster-uaa/gateway/src/main/jib/entrypoint.sh create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/.h2.server.properties create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/banner.txt create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/application-dev.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/application-prod.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/application-tls.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/application.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap-prod.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/master.xml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/config/tls/keystore.p12 create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages.properties create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_en.properties create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_fr.properties create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_pt_br.properties create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/logback-spring.xml create mode 100644 jhipster/jhipster-uaa/gateway/src/main/resources/templates/error.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/404.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/index.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.scss create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit-data.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-route.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-routes.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/index.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/log.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/app-routing.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.constants.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.main.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/prod.config.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/uib-pagination.config.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/auth-expired.interceptor.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/errorhandler.interceptor.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/notification.interceptor.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/account.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/auth-jwt.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/csrf.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/principal.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/state-storage.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/user-route-access-service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/core.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/index.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.constants.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.helper.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login-modal.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/account.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/entity.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/index.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.scss create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/index.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/index.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/active-menu.directive.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.route.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.scss create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.scss create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile-info.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/polyfills.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert-error.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/auth/has-any-authority.directive.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/error.constants.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/input.constants.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/pagination.constants.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/index.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/model/quotes/quote.model.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-common.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-libs.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/datepicker-adapter.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/request-util.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/app/vendor.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster.png create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster192.png create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster256.png create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster2x.png create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster384.png create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster512.png create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/logo-jhipster.png create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/_bootstrap-variables.scss create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/global.scss create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/vendor.scss create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/favicon.ico create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/activate.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/audits.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/configuration.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/error.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/gateway.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/global.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/health.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/home.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/login.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/logs.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/metrics.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/password.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/quotesQuote.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/register.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/reset.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/sessions.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/settings.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/user-management.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/activate.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/audits.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/configuration.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/error.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/gateway.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/global.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/health.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/home.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/login.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/logs.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/metrics.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/password.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/quotesQuote.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/register.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/reset.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/sessions.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/settings.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/user-management.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/activate.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/audits.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/configuration.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/error.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/gateway.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/global.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/health.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/home.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/login.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/logs.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/metrics.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/password.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/quotesQuote.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/register.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/reset.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/sessions.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/settings.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/user-management.json create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/index.html create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/manifest.webapp create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/robots.txt create mode 100644 jhipster/jhipster-uaa/gateway/src/main/webapp/swagger-ui/index.html create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/SecurityBeanOverrideConfiguration.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTestController.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/OAuth2TokenMockUtil.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollectionTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractorTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationServiceTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelperTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/LogsResourceIntTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/TestUtil.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorIntTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorTestController.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtilUnitTest.java create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/jest-global-mocks.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/jest.conf.js create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/jest.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/activate/activate.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/finish/password-reset-finish.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/init/password-reset-init.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password-strength-bar.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/register/register.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/settings/settings.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.service.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.service.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/health/health.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.service.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics-modal.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.service.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-delete-dialog.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-detail.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/core/user/user.service.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-delete-dialog.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-detail.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-update.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.service.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/alert/alert-error.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/login/login.component.spec.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-account.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-active-modal.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-alert.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-event-manager.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-language.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-login.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-principal.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-route.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-state-storage.service.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/spyobject.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/javascript/spec/test.module.ts create mode 100644 jhipster/jhipster-uaa/gateway/src/test/resources/config/application.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/test/resources/config/bootstrap.yml create mode 100644 jhipster/jhipster-uaa/gateway/src/test/resources/logback.xml create mode 100644 jhipster/jhipster-uaa/gateway/tsconfig-aot.json create mode 100644 jhipster/jhipster-uaa/gateway/tsconfig.json create mode 100644 jhipster/jhipster-uaa/gateway/tslint.json create mode 100644 jhipster/jhipster-uaa/gateway/webpack/logo-jhipster.png create mode 100644 jhipster/jhipster-uaa/gateway/webpack/utils.js create mode 100644 jhipster/jhipster-uaa/gateway/webpack/webpack.common.js create mode 100644 jhipster/jhipster-uaa/gateway/webpack/webpack.dev.js create mode 100644 jhipster/jhipster-uaa/gateway/webpack/webpack.prod.js create mode 100644 jhipster/jhipster-uaa/quotes/.editorconfig create mode 100644 jhipster/jhipster-uaa/quotes/.gitattributes create mode 100644 jhipster/jhipster-uaa/quotes/.gitignore create mode 100644 jhipster/jhipster-uaa/quotes/.jhipster/Quote.json create mode 100644 jhipster/jhipster-uaa/quotes/.mvn/wrapper/MavenWrapperDownloader.java create mode 100644 jhipster/jhipster-uaa/quotes/.mvn/wrapper/maven-wrapper.jar create mode 100644 jhipster/jhipster-uaa/quotes/.mvn/wrapper/maven-wrapper.properties create mode 100644 jhipster/jhipster-uaa/quotes/.yo-rc.json create mode 100644 jhipster/jhipster-uaa/quotes/README.md create mode 100644 jhipster/jhipster-uaa/quotes/mvnw create mode 100644 jhipster/jhipster-uaa/quotes/mvnw.cmd create mode 100644 jhipster/jhipster-uaa/quotes/package-lock.json create mode 100644 jhipster/jhipster-uaa/quotes/package.json create mode 100644 jhipster/jhipster-uaa/quotes/pom.xml create mode 100644 jhipster/jhipster-uaa/quotes/quotes.jh create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/.dockerignore create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/Dockerfile create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/app.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/README.md create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/docker-config/application.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/localhost-config/application.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/entrypoint.sh create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/hazelcast-management-center.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/jhipster-registry.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/mysql.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/docker/sonar.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/ApplicationWebXml.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/QuotesApp.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/aop/logging/LoggingAspect.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedFeignClient.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedUserFeignClient.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2InterceptedFeignConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2UserClientFeignConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/UserFeignClientInterceptor.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/ApplicationProperties.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/AsyncConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CacheConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CloudDatabaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/Constants.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DatabaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DateTimeFormatConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DefaultProfileUtil.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/FeignConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/JacksonConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LiquibaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LocaleConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingAspectConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/MetricsConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/SecurityConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/WebConfigurer.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/AuditEventConverter.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2JwtAccessTokenConverter.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2Properties.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/AbstractAuditingEntity.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/PersistentAuditEvent.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/Quote.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/QuoteRepository.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/AuthoritiesConstants.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SecurityUtils.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SpringSecurityAuditorAware.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/OAuth2SignatureVerifierClient.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/UaaSignatureVerifierClient.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteQueryService.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteService.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteCriteria.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteDTO.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/impl/QuoteServiceImpl.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/EntityMapper.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/QuoteMapper.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/LogsResource.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/QuoteResource.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/BadRequestAlertException.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/CustomParameterizedException.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailAlreadyUsedException.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailNotFoundException.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ErrorConstants.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslator.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/FieldErrorVM.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InternalServerErrorException.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InvalidPasswordException.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/LoginAlreadyUsedException.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/HeaderUtil.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtil.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/LoggerVM.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/package-info.java create mode 100644 jhipster/jhipster-uaa/quotes/src/main/jib/entrypoint.sh create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/.h2.server.properties create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/banner.txt create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/application-dev.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/application-prod.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/application-tls.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/application.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap-prod.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/20181019033648_added_entity_Quote.xml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/master.xml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/config/tls/keystore.p12 create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages.properties create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages_en.properties create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/logback-spring.xml create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/static/index.html create mode 100644 jhipster/jhipster-uaa/quotes/src/main/resources/templates/error.html create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/SecurityBeanOverrideConfiguration.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTest.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTestController.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/security/OAuth2TokenMockUtil.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/LogsResourceIntTest.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/QuoteResourceIntTest.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/TestUtil.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorIntTest.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorTestController.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtilUnitTest.java create mode 100644 jhipster/jhipster-uaa/quotes/src/test/resources/config/application.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/test/resources/config/bootstrap.yml create mode 100644 jhipster/jhipster-uaa/quotes/src/test/resources/logback.xml create mode 100644 jhipster/jhipster-uaa/uaa/.editorconfig create mode 100644 jhipster/jhipster-uaa/uaa/.gitattributes create mode 100644 jhipster/jhipster-uaa/uaa/.gitignore create mode 100644 jhipster/jhipster-uaa/uaa/.mvn/wrapper/MavenWrapperDownloader.java create mode 100644 jhipster/jhipster-uaa/uaa/.mvn/wrapper/maven-wrapper.jar create mode 100644 jhipster/jhipster-uaa/uaa/.mvn/wrapper/maven-wrapper.properties create mode 100644 jhipster/jhipster-uaa/uaa/.yo-rc.json create mode 100644 jhipster/jhipster-uaa/uaa/README.md create mode 100644 jhipster/jhipster-uaa/uaa/mvnw create mode 100644 jhipster/jhipster-uaa/uaa/mvnw.cmd create mode 100644 jhipster/jhipster-uaa/uaa/package-lock.json create mode 100644 jhipster/jhipster-uaa/uaa/package.json create mode 100644 jhipster/jhipster-uaa/uaa/pom.xml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/.dockerignore create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/Dockerfile create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/app.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/README.md create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/docker-config/application.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/localhost-config/application.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/entrypoint.sh create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/hazelcast-management-center.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/jhipster-registry.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/mysql.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/docker/sonar.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/ApplicationWebXml.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/UaaApp.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/aop/logging/LoggingAspect.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/ApplicationProperties.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/AsyncConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CacheConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CloudDatabaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/Constants.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DatabaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DateTimeFormatConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DefaultProfileUtil.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/JacksonConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LiquibaseConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LocaleConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingAspectConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/MetricsConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaProperties.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaWebSecurityConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/WebConfigurer.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/AuditEventConverter.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/AbstractAuditingEntity.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/Authority.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/PersistentAuditEvent.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/User.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/AuthorityRepository.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepository.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/PersistenceAuditEventRepository.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/UserRepository.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/AuthoritiesConstants.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsService.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/IatTokenEnhancer.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SecurityUtils.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SpringSecurityAuditorAware.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/UserNotActivatedException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/AuditEventService.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/MailService.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/UserService.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/PasswordChangeDTO.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/UserDTO.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/UserMapper.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/util/RandomUtil.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AccountResource.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AuditResource.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/LogsResource.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/UserResource.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/BadRequestAlertException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/CustomParameterizedException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailAlreadyUsedException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailNotFoundException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ErrorConstants.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslator.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/FieldErrorVM.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InternalServerErrorException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InvalidPasswordException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/LoginAlreadyUsedException.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/HeaderUtil.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtil.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/KeyAndPasswordVM.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/LoggerVM.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/ManagedUserVM.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/package-info.java create mode 100644 jhipster/jhipster-uaa/uaa/src/main/jib/entrypoint.sh create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/.h2.server.properties create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/banner.txt create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/application-dev.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/application-prod.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/application-tls.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/application.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap-prod.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/authorities.csv create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/master.xml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users.csv create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users_authorities.csv create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/config/tls/keystore.p12 create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages.properties create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages_en.properties create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/logback-spring.xml create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/templates/error.html create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/activationEmail.html create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/creationEmail.html create mode 100644 jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/passwordResetEmail.html create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/SecurityBeanOverrideConfiguration.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTestController.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepositoryIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsServiceIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/OAuth2TokenMockUtil.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/SecurityUtilsUnitTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/MailServiceIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/UserServiceIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AccountResourceIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AuditResourceIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/LogsResourceIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/TestUtil.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/UserResourceIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorIntTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorTestController.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtilUnitTest.java create mode 100644 jhipster/jhipster-uaa/uaa/src/test/resources/config/application.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/test/resources/config/bootstrap.yml create mode 100644 jhipster/jhipster-uaa/uaa/src/test/resources/i18n/messages_en.properties create mode 100644 jhipster/jhipster-uaa/uaa/src/test/resources/logback.xml create mode 100644 jhipster/jhipster-uaa/uaa/src/test/resources/templates/mail/testEmail.html diff --git a/jhipster/jhipster-uaa/gateway/.editorconfig b/jhipster/jhipster-uaa/gateway/.editorconfig new file mode 100644 index 0000000000..a03599dd04 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/.editorconfig @@ -0,0 +1,24 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 4 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[{package,bower}.json] +indent_style = space +indent_size = 2 diff --git a/jhipster/jhipster-uaa/gateway/.gitattributes b/jhipster/jhipster-uaa/gateway/.gitattributes new file mode 100644 index 0000000000..8ab72fe637 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/.gitattributes @@ -0,0 +1,149 @@ +# This file is inspired by https://github.com/alexkaratarakis/gitattributes +# +# Auto detect text files and perform LF normalization +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +# The above will handle all files NOT found below +# These files are text and should be normalized (Convert crlf => lf) + +*.bat text eol=crlf +*.coffee text +*.css text +*.cql text +*.df text +*.ejs text +*.html text +*.java text +*.js text +*.json text +*.less text +*.properties text +*.sass text +*.scss text +*.sh text eol=lf +*.sql text +*.txt text +*.ts text +*.xml text +*.yaml text +*.yml text + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.markdown text +*.md text +*.adoc text +*.textile text +*.mustache text +*.csv text +*.tab text +*.tsv text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +*COPYRIGHT* text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. If you want to treat it as text, +# comment-out the following line and uncomment the line after. +*.svg binary +#*.svg text +*.eps binary + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.class binary +*.jar binary +*.war binary + +## LINTERS +.csslintrc text +.eslintrc text +.jscsrc text +.jshintrc text +.jshintignore text +.stylelintrc text + +## CONFIGS +*.bowerrc text +*.conf text +*.config text +.editorconfig text +.gitattributes text +.gitconfig text +.gitignore text +.htaccess text +*.npmignore text + +## HEROKU +Procfile text +.slugignore text + +## AUDIO +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +## VIDEO +*.3gpp binary +*.3gp binary +*.as binary +*.asf binary +*.asx binary +*.fla binary +*.flv binary +*.m4v binary +*.mng binary +*.mov binary +*.mp4 binary +*.mpeg binary +*.mpg binary +*.swc binary +*.swf binary +*.webm binary + +## ARCHIVES +*.7z binary +*.gz binary +*.rar binary +*.tar binary +*.zip binary + +## FONTS +*.ttf binary +*.eot binary +*.otf binary +*.woff binary +*.woff2 binary diff --git a/jhipster/jhipster-uaa/gateway/.gitignore b/jhipster/jhipster-uaa/gateway/.gitignore new file mode 100644 index 0000000000..f1f6845d33 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/.gitignore @@ -0,0 +1,145 @@ +###################### +# Project Specific +###################### +/src/main/webapp/content/css/main.css +/target/www/** +/src/test/javascript/coverage/ + +###################### +# Node +###################### +/node/ +node_tmp/ +node_modules/ +npm-debug.log.* +/.awcache/* +/.cache-loader/* + +###################### +# SASS +###################### +.sass-cache/ + +###################### +# Eclipse +###################### +*.pydevproject +.project +.metadata +tmp/ +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath +.factorypath +/src/main/resources/rebel.xml + +# External tool builders +.externalToolBuilders/** + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + +###################### +# Intellij +###################### +.idea/ +*.iml +*.iws +*.ipr +*.ids +*.orig +classes/ +out/ + +###################### +# Visual Studio Code +###################### +.vscode/ + +###################### +# Maven +###################### +/log/ +/target/ + +###################### +# Gradle +###################### +.gradle/ +/build/ + +###################### +# Package Files +###################### +*.jar +*.war +*.ear +*.db + +###################### +# Windows +###################### +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + +###################### +# Mac OSX +###################### +.DS_Store +.svn + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +###################### +# Directories +###################### +/bin/ +/deploy/ + +###################### +# Logs +###################### +*.log* + +###################### +# Others +###################### +*.class +*.*~ +*~ +.merge_file* + +###################### +# Gradle Wrapper +###################### +!gradle/wrapper/gradle-wrapper.jar + +###################### +# Maven Wrapper +###################### +!.mvn/wrapper/maven-wrapper.jar + +###################### +# ESLint +###################### +.eslintcache diff --git a/jhipster/jhipster-uaa/gateway/.huskyrc b/jhipster/jhipster-uaa/gateway/.huskyrc new file mode 100644 index 0000000000..9e18d87674 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/.huskyrc @@ -0,0 +1,5 @@ +{ + "hooks": { + "pre-commit": "lint-staged" + } +} diff --git a/jhipster/jhipster-uaa/gateway/.jhipster/Quote.json b/jhipster/jhipster-uaa/gateway/.jhipster/Quote.json new file mode 100644 index 0000000000..af06567fff --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/.jhipster/Quote.json @@ -0,0 +1,38 @@ +{ + "name": "Quote", + "fields": [ + { + "fieldName": "symbol", + "fieldType": "String", + "fieldValidateRules": [ + "required", + "unique" + ] + }, + { + "fieldName": "price", + "fieldType": "BigDecimal", + "fieldValidateRules": [ + "required" + ] + }, + { + "fieldName": "lastTrade", + "fieldType": "ZonedDateTime", + "fieldValidateRules": [ + "required" + ] + } + ], + "relationships": [], + "changelogDate": "20181020145525", + "entityTableName": "quote", + "dto": "mapstruct", + "pagination": "pagination", + "service": "serviceImpl", + "jpaMetamodelFiltering": true, + "fluentMethods": true, + "clientRootFolder": "quotes", + "applications": "*", + "microserviceName": "quotes" +} \ No newline at end of file diff --git a/jhipster/jhipster-uaa/gateway/.mvn/wrapper/MavenWrapperDownloader.java b/jhipster/jhipster-uaa/gateway/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..fa4f7b499f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,110 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = + "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: : " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/jhipster/jhipster-uaa/gateway/.mvn/wrapper/maven-wrapper.jar b/jhipster/jhipster-uaa/gateway/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..01e67997377a393fd672c7dcde9dccbedf0cb1e9 GIT binary patch literal 48337 zcmbTe1CV9Qwl>;j+wQV$+qSXFw%KK)%eHN!%U!l@+x~l>b1vR}@9y}|TM-#CBjy|< zb7YRpp)Z$$Gzci_H%LgxZ{NNV{%Qa9gZlF*E2<($D=8;N5Asbx8se{Sz5)O13x)rc z5cR(k$_mO!iis+#(8-D=#R@|AF(8UQ`L7dVNSKQ%v^P|1A%aF~Lye$@HcO@sMYOb3 zl`5!ThJ1xSJwsg7hVYFtE5vS^5UE0$iDGCS{}RO;R#3y#{w-1hVSg*f1)7^vfkxrm!!N|oTR0Hj?N~IbVk+yC#NK} z5myv()UMzV^!zkX@O=Yf!(Z_bF7}W>k*U4@--&RH0tHiHY0IpeezqrF#@8{E$9d=- z7^kT=1Bl;(Q0k{*_vzz1Et{+*lbz%mkIOw(UA8)EE-Pkp{JtJhe@VXQ8sPNTn$Vkj zicVp)sV%0omhsj;NCmI0l8zzAipDV#tp(Jr7p_BlL$}Pys_SoljztS%G-Wg+t z&Q#=<03Hoga0R1&L!B);r{Cf~b$G5p#@?R-NNXMS8@cTWE^7V!?ixz(Ag>lld;>COenWc$RZ61W+pOW0wh>sN{~j; zCBj!2nn|4~COwSgXHFH?BDr8pK323zvmDK-84ESq25b;Tg%9(%NneBcs3;r znZpzntG%E^XsSh|md^r-k0Oen5qE@awGLfpg;8P@a-s<{Fwf?w3WapWe|b-CQkqlo z46GmTdPtkGYdI$e(d9Zl=?TU&uv94VR`g|=7xB2Ur%=6id&R2 z4e@fP7`y58O2sl;YBCQFu7>0(lVt-r$9|06Q5V>4=>ycnT}Fyz#9p;3?86`ZD23@7 z7n&`!LXzjxyg*P4Tz`>WVvpU9-<5MDSDcb1 zZaUyN@7mKLEPGS$^odZcW=GLe?3E$JsMR0kcL4#Z=b4P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Zk<6N3V-Vs#GB%vXZat+(EFWbkbky#{yGY`rOvN)?{5qUuFv=r=dyYZrULf%MppWuNRUWc z8|YaIn}P0DGkwSZ(njAO$Zhr3Yw`3O1A+&F*2UjO{0`P%kK(qL;kEkfjRC=lxPRjL z{{4PO3-*5RZ_B3LUB&?ZpJ4nk1E4L&eT~HX0Jo(|uGQCW3utB@p)rF@W*n$==TlS zKiTfzhrLbAeRqru%D;fUwXOUcHud{pw@Ib1xxQ}<2)?KC&%y5PVef<7rcu2l!8dsy z?lvdaHJ#s$0m18y{x#fB$o=l)-sV?Qya5GWf#8Vd{~Grn@qgX#!EI`Y>++l%1A;eL z{_7t6jMeEr@a+oxyCL^+_}9Qc;i0&Xd%LXp?to*R|26LKHG(m0)*QF4*h;5%YG5<9)c> z1vq!7bIJSv1^27i-mcH!zX>ep3Iw0^{nx<1jOy)N_UoFD8v}x~2mEWapI3m~kMQkR z#&@4FuEGBn`mgtSx6jeY7vUQNf=^}sTZErIEpH!cy|@7Z zU4h_Oxxd2s=f{}$XXy4}%JqTSjRC + if ('serviceWorker' in navigator) { + navigator.serviceWorker + .register('./service-worker.js') + .then(function() { console.log('Service Worker Registered'); }); + } + +``` + +Note: workbox creates the respective service worker and dynamically generate the `service-worker.js` + +### Managing dependencies + +For example, to add [Leaflet][] library as a runtime dependency of your application, you would run following command: + + npm install --save --save-exact leaflet + +To benefit from TypeScript type definitions from [DefinitelyTyped][] repository in development, you would run following command: + + npm install --save-dev --save-exact @types/leaflet + +Then you would import the JS and CSS files specified in library's installation instructions so that [Webpack][] knows about them: +Edit [src/main/webapp/app/vendor.ts](src/main/webapp/app/vendor.ts) file: +~~~ +import 'leaflet/dist/leaflet.js'; +~~~ + +Edit [src/main/webapp/content/css/vendor.css](src/main/webapp/content/css/vendor.css) file: +~~~ +@import '~leaflet/dist/leaflet.css'; +~~~ +Note: there are still few other things remaining to do for Leaflet that we won't detail here. + +For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][]. + +### Using angular-cli + +You can also use [Angular CLI][] to generate some custom client code. + +For example, the following command: + + ng generate component my-component + +will generate few files: + + create src/main/webapp/app/my-component/my-component.component.html + create src/main/webapp/app/my-component/my-component.component.ts + update src/main/webapp/app/app.module.ts + + +## Building for production + +To optimize the gateway application for production, run: + + ./mvnw -Pprod clean package + +This will concatenate and minify the client CSS and JavaScript files. It will also modify `index.html` so it references these new files. +To ensure everything worked, run: + + java -jar target/*.war + +Then navigate to [http://localhost:8080](http://localhost:8080) in your browser. + +Refer to [Using JHipster in production][] for more details. + +## Testing + +To launch your application's tests, run: + + ./mvnw clean test + +### Client tests + +Unit tests are run by [Jest][] and written with [Jasmine][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with: + + npm test + + + +For more information, refer to the [Running tests page][]. + +### Code quality + +Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with: + +``` +docker-compose -f src/main/docker/sonar.yml up -d +``` + +Then, run a Sonar analysis: + +``` +./mvnw -Pprod clean test sonar:sonar +``` + +For more information, refer to the [Code quality page][]. + +## Using Docker to simplify development (optional) + +You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services. + +For example, to start a mysql database in a docker container, run: + + docker-compose -f src/main/docker/mysql.yml up -d + +To stop it and remove the container, run: + + docker-compose -f src/main/docker/mysql.yml down + +You can also fully dockerize your application and all the services that it depends on. +To achieve this, first build a docker image of your app by running: + + ./mvnw package -Pprod jib:dockerBuild + +Then run: + + docker-compose -f src/main/docker/app.yml up -d + +For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`jhipster docker-compose`), which is able to generate docker configurations for one or several JHipster applications. + +## Continuous Integration (optional) + +To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information. + +[JHipster Homepage and latest documentation]: https://www.jhipster.tech +[JHipster 5.4.2 archive]: https://www.jhipster.tech/documentation-archive/v5.4.2 +[Doing microservices with JHipster]: https://www.jhipster.tech/documentation-archive/v5.4.2/microservices-architecture/ +[Using JHipster in development]: https://www.jhipster.tech/documentation-archive/v5.4.2/development/ +[Service Discovery and Configuration with the JHipster-Registry]: https://www.jhipster.tech/documentation-archive/v5.4.2/microservices-architecture/#jhipster-registry +[Using Docker and Docker-Compose]: https://www.jhipster.tech/documentation-archive/v5.4.2/docker-compose +[Using JHipster in production]: https://www.jhipster.tech/documentation-archive/v5.4.2/production/ +[Running tests page]: https://www.jhipster.tech/documentation-archive/v5.4.2/running-tests/ +[Code quality page]: https://www.jhipster.tech/documentation-archive/v5.4.2/code-quality/ +[Setting up Continuous Integration]: https://www.jhipster.tech/documentation-archive/v5.4.2/setting-up-ci/ + + +[Node.js]: https://nodejs.org/ +[Yarn]: https://yarnpkg.org/ +[Webpack]: https://webpack.github.io/ +[Angular CLI]: https://cli.angular.io/ +[BrowserSync]: http://www.browsersync.io/ +[Jest]: https://facebook.github.io/jest/ +[Jasmine]: http://jasmine.github.io/2.0/introduction.html +[Protractor]: https://angular.github.io/protractor/ +[Leaflet]: http://leafletjs.com/ +[DefinitelyTyped]: http://definitelytyped.org/ diff --git a/jhipster/jhipster-uaa/gateway/angular.json b/jhipster/jhipster-uaa/gateway/angular.json new file mode 100644 index 0000000000..b7f32a8949 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/angular.json @@ -0,0 +1,39 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "gateway": { + "root": "", + "sourceRoot": "src/main/webapp", + "projectType": "application", + "architect": {} + } + }, + "defaultProject": "gateway", + "cli": { + "packageManager": "yarn" + }, + "schematics": { + "@schematics/angular:component": { + "inlineStyle": true, + "inlineTemplate": false, + "spec": false, + "prefix": "jhi", + "styleExt": "scss" + }, + "@schematics/angular:directive": { + "spec": false, + "prefix": "jhi" + }, + "@schematics/angular:guard": { + "spec": false + }, + "@schematics/angular:pipe": { + "spec": false + }, + "@schematics/angular:service": { + "spec": false + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/mvnw b/jhipster/jhipster-uaa/gateway/mvnw new file mode 100644 index 0000000000..5551fde8e7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/mvnw @@ -0,0 +1,286 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + 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 + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/jhipster/jhipster-uaa/gateway/mvnw.cmd b/jhipster/jhipster-uaa/gateway/mvnw.cmd new file mode 100644 index 0000000000..e5cfb0ae9e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/mvnw.cmd @@ -0,0 +1,161 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/jhipster/jhipster-uaa/gateway/package-lock.json b/jhipster/jhipster-uaa/gateway/package-lock.json new file mode 100644 index 0000000000..9c5b3935f4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/package-lock.json @@ -0,0 +1,20609 @@ +{ + "name": "gateway", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@angular-devkit/architect": { + "version": "0.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular-devkit/architect/-/architect-0.7.2.tgz", + "integrity": "sha512-p7e4wE+a1AxlfCJQL1IIBltblV9VqFSMlUuPW3PUp0fguo0yaTv9paY5WlFwrj0YhypBj3zHcjSdIruHrgbErg==", + "dev": true, + "requires": { + "@angular-devkit/core": "0.7.2", + "rxjs": "^6.0.0" + } + }, + "@angular-devkit/core": { + "version": "0.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular-devkit/core/-/core-0.7.2.tgz", + "integrity": "sha512-1Es9oNpabOukutBe+0txXUHyhI6ypuc7WrxTutZH7Lr3n3+CTG6oEv42rOcot1aXi1n97wNqcdY3lrENFu9vhQ==", + "dev": true, + "requires": { + "ajv": "~6.4.0", + "chokidar": "^2.0.3", + "rxjs": "^6.0.0", + "source-map": "^0.5.6" + } + }, + "@angular-devkit/schematics": { + "version": "0.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular-devkit/schematics/-/schematics-0.7.2.tgz", + "integrity": "sha512-4mhLhXc4Tyu07sGXWOHV9zXZ8uthbUo5zr63lj0Z9gv5f/vrJj5fyEoTnHONBFzVPdElMYS2vhiEtwnN0hKQDA==", + "dev": true, + "requires": { + "@angular-devkit/core": "0.7.2", + "rxjs": "^6.0.0" + } + }, + "@angular/cli": { + "version": "6.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/cli/-/cli-6.1.2.tgz", + "integrity": "sha512-uY1/rFWqmi7MibUz4bwhkiM95PmDZn0OCaMxGafZlriZgu+81on7/7biWNHgIRAd+QV1qBJlstWT2J0K8r1vLA==", + "dev": true, + "requires": { + "@angular-devkit/architect": "0.7.2", + "@angular-devkit/core": "0.7.2", + "@angular-devkit/schematics": "0.7.2", + "@schematics/angular": "0.7.2", + "@schematics/update": "0.7.2", + "opn": "^5.3.0", + "rxjs": "^6.0.0", + "semver": "^5.1.0", + "symbol-observable": "^1.2.0", + "yargs-parser": "^10.0.0" + } + }, + "@angular/common": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/common/-/common-6.1.0.tgz", + "integrity": "sha512-uxdjxbuTYiCsOcrfO9EumGrfXo+7nB7HlS9F4wraKcnR22oJYNUh36meFKZwpoj5pDIBLnZQu75boI16o3W+SQ==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@angular/compiler": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/compiler/-/compiler-6.1.0.tgz", + "integrity": "sha512-5c8ZYCFv0xccy0F12zBRIJX0pJd9BgCThJuhVJAuaRFFOqPZl8FKEO3SFqKJNywT0UktZD9JpYFKxhUVxuSHDg==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@angular/compiler-cli": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/compiler-cli/-/compiler-cli-6.1.0.tgz", + "integrity": "sha512-g4fXQwAYnxtr08BK3CiodJsUXz3fIBCVfZaWIcLMdOlyarFDEvB3TA9qfPkQtlndm87WpXjZ6Xd9OAkmG8t8dw==", + "dev": true, + "requires": { + "chokidar": "^1.4.2", + "minimist": "^1.2.0", + "reflect-metadata": "^0.1.2", + "tsickle": "^0.30.0" + }, + "dependencies": { + "anymatch": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, + "@angular/core": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/core/-/core-6.1.0.tgz", + "integrity": "sha512-gWu9Q7q2+fhFC5dl/BvGW7Ha7NUJtK9wQLYQlfIMim4lKTOiM1/S0MYBVMrEq58ldMr9DnA35f5jGno3x6/v+g==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@angular/forms": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/forms/-/forms-6.1.0.tgz", + "integrity": "sha512-6InfsKWEL9w2RvTXjy5R3F8GRjENT9d444o95aSvf+ZK7KsYOeIwcYgN2pw+LjfNu2O3EbAqps8APQ6oD/Fn3A==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@angular/platform-browser": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/platform-browser/-/platform-browser-6.1.0.tgz", + "integrity": "sha512-LcpcHLpy+fjN+gKcnTkWuTTuF+uYT350mje1kNr4Advoco76tXYBjAda/EehG+vmQmDTd5E+uxJhKJr/1POVEw==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@angular/platform-browser-dynamic": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.1.0.tgz", + "integrity": "sha512-gjOJ38ciuIgdAuG8bEs/sdJmkfm/oICLrCcQexz+EUCZAiqbKDb0HvFTDaKaLtR7iDbTXVMQhoYMOyTY40FwLQ==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@angular/router": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular/router/-/router-6.1.0.tgz", + "integrity": "sha512-tIcHLuat19cnoQBbOfe/8zAHVqf/9S17YgwSO6VUPTuXLRe9ZBgYT50BzqRhcm8ODOqVmLBQYlzP7zRcNRkHDA==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@babel/code-frame": { + "version": "7.0.0-beta.46", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@babel/code-frame/-/code-frame-7.0.0-beta.46.tgz", + "integrity": "sha512-7BKRkmYaPZm3Yff5HGZJKCz7RqZ5jUjknsXT6Gz5YKG23J3uq9hAj0epncCB0rlqmnZ8Q+UUpQB2tCR5mT37vw==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.46" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.46", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@babel/highlight/-/highlight-7.0.0-beta.46.tgz", + "integrity": "sha512-r4snW6Q8ICL3Y8hGzYJRvyG/+sc+kvkewXNedG9tQjoHmUFMwMSv/o45GWQUQswevGnWghiGkpRPivFfOuMsOA==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@fortawesome/angular-fontawesome": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@fortawesome/angular-fontawesome/-/angular-fontawesome-0.2.0.tgz", + "integrity": "sha512-iBaH3ulJh+WjaNHqDxoKR6D4udgY+C7FChVSFOv0u7rjdT8wd0ap5YS1QHA82K0dfkUAvlEA4l5wtDtUpG679A==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@fortawesome/fontawesome-common-types": { + "version": "0.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.4.tgz", + "integrity": "sha512-0qbIVm+MzkxMwKDx8V0C7w/6Nk+ZfBseOn2R1YK0f2DQP5pBcOQbu9NmaVaLzbJK6VJb1TuyTf0ZF97rc6iWJQ==" + }, + "@fortawesome/fontawesome-svg-core": { + "version": "1.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.4.tgz", + "integrity": "sha512-oGtnwcdhJomoDxbJcy6S0JxK6ItDhJLNOujm+qILPqajJ2a0P/YRomzBbixFjAPquCoyPUlA9g9ejA22P7TKNA==", + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.4" + } + }, + "@fortawesome/free-solid-svg-icons": { + "version": "5.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.3.1.tgz", + "integrity": "sha512-NkiLBFoiHtJ89cPJdM+W6cLvTVKkLh3j9t3MxkXyip0ncdD3lhCunSuzvFcrTHWeETEyoClGd8ZIWrr3HFZ3BA==", + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.4" + } + }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@ng-bootstrap/ng-bootstrap": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-3.0.0.tgz", + "integrity": "sha512-yYfqUORHc363ElX6C38hR4g9lFSOCXBVv3LTDNCyEz5go5kqSW8Tl5LDUlCxpswj02Wn14O1MunrnznZoSfYZA==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@ngtools/webpack": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@ngtools/webpack/-/webpack-6.0.0.tgz", + "integrity": "sha512-ULZnn1sFmVZ4o8LRWRk8BVnJzSpfjvpjTC2lsC/5DavPwpYLbMEdecwE5OIZhkXUr6QLZebPHEjlazesWHwqrA==", + "dev": true, + "requires": { + "@angular-devkit/core": "0.6.0", + "tree-kill": "^1.0.0", + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "@angular-devkit/core": { + "version": "0.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@angular-devkit/core/-/core-0.6.0.tgz", + "integrity": "sha512-hM1AOSF/+XZpv350pODPgoO/2QL61tfRlCXf3u4zHxkXdcboFKGCIi7VEu7TYMWSQzujcTFJciVBrgf/IfQ3cA==", + "dev": true, + "requires": { + "ajv": "~6.4.0", + "chokidar": "^2.0.3", + "rxjs": "^6.0.0", + "source-map": "^0.5.6" + } + } + } + }, + "@ngx-translate/core": { + "version": "10.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@ngx-translate/core/-/core-10.0.2.tgz", + "integrity": "sha512-7nM3DrJaqKswwtJlbu2kuKNl+hE8Isr18sKsKvGGpSxQk+G0gO0reDlx2PhUNus7TJTkA1C59vU/JoN8hIvZ4g==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@ngx-translate/http-loader": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@ngx-translate/http-loader/-/http-loader-3.0.1.tgz", + "integrity": "sha1-ILD5i8bCUyESnT4zAqs8xInApCo=", + "requires": { + "tslib": "^1.9.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz", + "integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==", + "dev": true + }, + "@samverschueren/stream-to-observable": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", + "integrity": "sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg==", + "dev": true, + "requires": { + "any-observable": "^0.3.0" + } + }, + "@schematics/angular": { + "version": "0.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@schematics/angular/-/angular-0.7.2.tgz", + "integrity": "sha512-u92urZDC9qk/4gQliajrzxgrEz3ucvOtQ0eCzbRKU86AGWrz215hQJRmLRSDAdVy0frfc8Gg8IhdHSA2nZLgVw==", + "dev": true, + "requires": { + "@angular-devkit/core": "0.7.2", + "@angular-devkit/schematics": "0.7.2", + "typescript": ">=2.6.2 <2.8" + } + }, + "@schematics/update": { + "version": "0.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@schematics/update/-/update-0.7.2.tgz", + "integrity": "sha512-YOnQhhYAAGjhWGCs7RUPKQD2G9Qg5gby4Dxa43vGP31xUcYFeYZCbU9MchnaxLPFi1NH4UEztkRFT4T3bn2d1A==", + "dev": true, + "requires": { + "@angular-devkit/core": "0.7.2", + "@angular-devkit/schematics": "0.7.2", + "npm-registry-client": "^8.5.1", + "rxjs": "^6.0.0", + "semver": "^5.3.0", + "semver-intersect": "^1.1.2" + } + }, + "@sindresorhus/is": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", + "dev": true + }, + "@types/jest": { + "version": "22.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@types/jest/-/jest-22.2.3.tgz", + "integrity": "sha512-e74sM9W/4qqWB6D4TWV9FQk0WoHtX1X4FJpbjxucMSVJHtFjbQOH3H6yp+xno4br0AKG0wz/kPtaN599GUOvAg==", + "dev": true + }, + "@types/node": { + "version": "9.4.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@types/node/-/node-9.4.7.tgz", + "integrity": "sha512-4Ba90mWNx8ddbafuyGGwjkZMigi+AWfYLSDCpovwsE63ia8w93r3oJ8PIAQc3y8U+XHcnMOHPIzNe3o438Ywcw==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/ast/-/ast-1.3.0.tgz", + "integrity": "sha512-IXMtAT2u6SEAHe8iZW+CdtC7K3xkBhvMp6RY3GQILXeXq9pLsgCwnVLEAO/pMkDCsoX/y83K12quA/CxGbuHew==", + "dev": true, + "requires": { + "@webassemblyjs/helper-wasm-bytecode": "1.3.0", + "@webassemblyjs/wast-parser": "1.3.0", + "webassemblyjs": "1.3.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.3.0.tgz", + "integrity": "sha512-Y746aq0AmT5cU8/tGEYAioVn7h8GGgVuQYRsXCB38u/rnE/TZhG38z+oXp+HaakubmXyXQ5IU+suZ7qnqANQgQ==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/helper-buffer/-/helper-buffer-1.3.0.tgz", + "integrity": "sha512-3o+srBMOSS3VHQlxGONEBnw10rWPo7Mcbc4waq8bPZRy26JBw0fFHlBICIySWcvvO0K9rvGD6d2rJV6VzDp/Gg==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.3.0.tgz", + "integrity": "sha512-Sn5EhpGFtavLOgvOGQn9HMRiLxkgPHksTGbNcGuZbHvyx20DNO1VHGZYnvupavBqJPtjceS2YjQT2vN3piZwng==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.3.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/helper-fsm/-/helper-fsm-1.3.0.tgz", + "integrity": "sha512-Q5uchhiRmlZUFKOBcI+8+ri0eyAWyFPTwcVu9bDep3FsxkgugI5i+V52r1rZrgNjB3QFcYgAwLEeJQgBciW9dA==", + "dev": true + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.3.0.tgz", + "integrity": "sha512-DYJPE3OeHXi72Bc5eXqGhOPIo0usevsZltSsrrhlejw8F6c86tOeMJjBiVR4stiP4M3utnaXuTj+JuaXgeQo8g==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.3.0.tgz", + "integrity": "sha512-1Vt839EyU7YLy40EXF19b9vaYdSeNDFWQHsY2BEOVePatbRaz2ytbVFP3lSjZDTBmOml3nbEdUzHC+XtObBKXg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/helper-buffer": "1.3.0", + "@webassemblyjs/helper-wasm-bytecode": "1.3.0", + "@webassemblyjs/wasm-gen": "1.3.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/leb128/-/leb128-1.3.0.tgz", + "integrity": "sha512-oR6WdUiw4Kpjt12swFy5A7Hy5PF33ojdsZbgScRuXSZEfgXVSIhFj5ZKD0UY4v22SJN/Q1ESpAuHnlGzQcljTg==", + "dev": true, + "requires": { + "leb": "^0.3.0" + } + }, + "@webassemblyjs/validation": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/validation/-/validation-1.3.0.tgz", + "integrity": "sha512-CuBmcwCL6Th8oJBnfQfSvLWyIFcSYc2qyj68SeBtU1Zikg5rbuobLEqIRALfzLjJSJUO3SQtJ5GsjidRM0ezWQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0" + } + }, + "@webassemblyjs/wasm-edit": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/wasm-edit/-/wasm-edit-1.3.0.tgz", + "integrity": "sha512-xfrnmh7WTxbc55FJmpJCqOvdctG1xZeetdasYLEbPfUP8AgoDovjkhpMRBJcQk6z6AOuldt93rkxbjt9fA+bjw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/helper-buffer": "1.3.0", + "@webassemblyjs/helper-wasm-bytecode": "1.3.0", + "@webassemblyjs/helper-wasm-section": "1.3.0", + "@webassemblyjs/wasm-gen": "1.3.0", + "@webassemblyjs/wasm-opt": "1.3.0", + "@webassemblyjs/wasm-parser": "1.3.0", + "@webassemblyjs/wast-printer": "1.3.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/wasm-gen/-/wasm-gen-1.3.0.tgz", + "integrity": "sha512-vvyJdznx82hqdjGVvQjQ1JMtD8Aokiu9OqaQRt62ywNyeBXNZH+Di3axq8725RFOtEYWuiMun6knfTVitVuTzg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/helper-wasm-bytecode": "1.3.0", + "@webassemblyjs/leb128": "1.3.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/wasm-opt/-/wasm-opt-1.3.0.tgz", + "integrity": "sha512-uWtbbEDzsrv+jPbk8jzHyrmCcDMT8J3VmifEsLuD5bov6Q40GJwj/GMAtbH2kB28dvqWU0lIA+D5dUlJHMgAzQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/helper-buffer": "1.3.0", + "@webassemblyjs/wasm-gen": "1.3.0", + "@webassemblyjs/wasm-parser": "1.3.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/wasm-parser/-/wasm-parser-1.3.0.tgz", + "integrity": "sha512-eQxCJa2Ks0lZc/JwG0A0uzvOmbjklsVKtKI+M1qp73xbOgpotHFBioeskk9J8AlpNwB5Ofeslw98O5k4Wi8scg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/helper-wasm-bytecode": "1.3.0", + "@webassemblyjs/leb128": "1.3.0", + "@webassemblyjs/wasm-parser": "1.3.0", + "webassemblyjs": "1.3.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/wast-parser/-/wast-parser-1.3.0.tgz", + "integrity": "sha512-NJOsD4PKBCQXzKhX7zqoF6Bgmq4cbODKwusOsFw18dccHggTNEjx71WRKL1fplnECQp9s7ukxn4uadsDtY0q2g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/floating-point-hex-parser": "1.3.0", + "@webassemblyjs/helper-code-frame": "1.3.0", + "@webassemblyjs/helper-fsm": "1.3.0", + "long": "^3.2.0", + "webassemblyjs": "1.3.0" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webassemblyjs/wast-printer/-/wast-printer-1.3.0.tgz", + "integrity": "sha512-K7iOU1PY2fPviDwZU7f0i/75r2baXlJR3VYXEpwQp608tQiYJY6/4Uji9kJ7FKsf+gqZSop2umCK0nhuDrU7/w==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/wast-parser": "1.3.0", + "long": "^3.2.0" + } + }, + "@webpack-contrib/schema-utils": { + "version": "1.0.0-beta.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@webpack-contrib/schema-utils/-/schema-utils-1.0.0-beta.0.tgz", + "integrity": "sha512-LonryJP+FxQQHsjGBi6W786TQB1Oym+agTpY0c+Kj8alnIw+DLUJb6SI8Y1GHGhLCH1yPRrucjObUmxNICQ1pg==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0", + "chalk": "^2.3.2", + "strip-ansi": "^4.0.0", + "text-table": "^0.2.0", + "webpack-log": "^1.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "abab": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/abab/-/abab-1.0.4.tgz", + "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "dev": true + }, + "accepts": { + "version": "1.3.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "dev": true, + "requires": { + "mime-types": "~2.1.18", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "5.7.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "dev": true, + "requires": { + "acorn": "^5.0.0" + } + }, + "acorn-globals": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/acorn-globals/-/acorn-globals-4.1.0.tgz", + "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", + "dev": true, + "requires": { + "acorn": "^5.0.0" + } + }, + "after": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", + "dev": true + }, + "ajv": { + "version": "6.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ajv/-/ajv-6.4.0.tgz", + "integrity": "sha1-06/3jpJ3VJdx2vAWTP9ISCt1T8Y=", + "dev": true, + "requires": { + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0", + "uri-js": "^3.0.2" + } + }, + "ajv-errors": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ajv-errors/-/ajv-errors-1.0.0.tgz", + "integrity": "sha1-7PAh+hCP0X37Xms4Py3SM+Mf/Fk=", + "dev": true + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "dev": true + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "angular-router-loader": { + "version": "0.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/angular-router-loader/-/angular-router-loader-0.8.5.tgz", + "integrity": "sha512-8wggCTKGgzB1o8co3Wvj+p9pKN7T7q3C477lEz3NLjvPVzUti8rv9i45Di+4aO/k+HvzGh3s8QdNlXU2Bl4avQ==", + "dev": true, + "requires": { + "loader-utils": "^1.0.2" + } + }, + "angular2-template-loader": { + "version": "0.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/angular2-template-loader/-/angular2-template-loader-0.6.2.tgz", + "integrity": "sha1-wNROkP/w+sleiyPwQ6zaf9HFHXw=", + "dev": true, + "requires": { + "loader-utils": "^0.2.15" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + } + } + }, + "ansi": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi/-/ansi-0.3.1.tgz", + "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=", + "dev": true + }, + "ansi-cyan": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-html": { + "version": "0.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", + "dev": true + }, + "ansi-red": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "any-observable": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/any-observable/-/any-observable-0.3.0.tgz", + "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==", + "dev": true + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "app-root-path": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/app-root-path/-/app-root-path-2.0.1.tgz", + "integrity": "sha1-zWLc+OT9WkF+/GZNLlsQZTxlG0Y=", + "dev": true + }, + "append-transform": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/append-transform/-/append-transform-1.0.0.tgz", + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "dev": true, + "requires": { + "default-require-extensions": "^2.0.0" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + }, + "dependencies": { + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + } + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-flatten": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-flatten/-/array-flatten-2.1.1.tgz", + "integrity": "sha1-Qmu52oQJDBg42BLIFQryCoMx4pY=", + "dev": true + }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arraybuffer.slice": { + "version": "0.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "ast-types": { + "version": "0.9.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ast-types/-/ast-types-0.9.6.tgz", + "integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "async-each-series": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async-each-series/-/async-each-series-0.1.1.tgz", + "integrity": "sha1-dhfBkXQB/Yykooqtzj266Yr+tDI=", + "dev": true + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "autoprefixer": { + "version": "6.7.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/autoprefixer/-/autoprefixer-6.7.7.tgz", + "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=", + "dev": true, + "requires": { + "browserslist": "^1.7.6", + "caniuse-db": "^1.0.30000634", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^5.2.16", + "postcss-value-parser": "^3.2.3" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "axios": { + "version": "0.17.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/axios/-/axios-0.17.1.tgz", + "integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=", + "dev": true, + "requires": { + "follow-redirects": "^1.2.5", + "is-buffer": "^1.1.5" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babel-extract-comments": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz", + "integrity": "sha512-qWWzi4TlddohA91bFwgt6zO/J0X+io7Qp184Fw0m2JYRSTZnJbFR8+07KmzudHCZgOiKRCrjhylwv9Xd8gfhVQ==", + "dev": true, + "requires": { + "babylon": "^6.18.0" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babel-helper-bindify-decorators": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", + "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-explode-class": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", + "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", + "dev": true, + "requires": { + "babel-helper-bindify-decorators": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-jest": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-jest/-/babel-jest-22.4.3.tgz", + "integrity": "sha512-BgSjmtl3mW3i+VeVHEr9d2zFSAT66G++pJcHQiUjd00pkW+voYXFctIm/indcqOWWXw5a1nUpR1XWszD9fJ1qg==", + "dev": true, + "requires": { + "babel-plugin-istanbul": "^4.1.5", + "babel-preset-jest": "^22.4.3" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-istanbul": { + "version": "4.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", + "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.13.0", + "find-up": "^2.1.0", + "istanbul-lib-instrument": "^1.10.1", + "test-exclude": "^4.2.1" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + } + } + }, + "babel-plugin-jest-hoist": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.3.tgz", + "integrity": "sha512-zhvv4f6OTWy2bYevcJftwGCWXMFe7pqoz41IhMi4xna7xNsX5NygdagsrE0y6kkfuXq8UalwvPwKTyAxME2E/g==", + "dev": true + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-async-generators": { + "version": "6.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", + "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", + "dev": true + }, + "babel-plugin-syntax-class-constructor-call": { + "version": "6.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz", + "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=", + "dev": true + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "dev": true + }, + "babel-plugin-syntax-decorators": { + "version": "6.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", + "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=", + "dev": true + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-export-extensions": { + "version": "6.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz", + "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=", + "dev": true + }, + "babel-plugin-syntax-flow": { + "version": "6.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-generator-functions": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", + "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-generators": "^6.5.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-class-constructor-call": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz", + "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=", + "dev": true, + "requires": { + "babel-plugin-syntax-class-constructor-call": "^6.18.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-decorators": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", + "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", + "dev": true, + "requires": { + "babel-helper-explode-class": "^6.24.1", + "babel-plugin-syntax-decorators": "^6.13.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + }, + "dependencies": { + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + } + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-export-extensions": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz", + "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=", + "dev": true, + "requires": { + "babel-plugin-syntax-export-extensions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-flow-strip-types": { + "version": "6.22.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", + "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", + "dev": true, + "requires": { + "babel-plugin-syntax-flow": "^6.18.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.24.1", + "babel-plugin-transform-es2015-classes": "^6.24.1", + "babel-plugin-transform-es2015-computed-properties": "^6.24.1", + "babel-plugin-transform-es2015-destructuring": "^6.22.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", + "babel-plugin-transform-es2015-for-of": "^6.22.0", + "babel-plugin-transform-es2015-function-name": "^6.24.1", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-transform-es2015-object-super": "^6.24.1", + "babel-plugin-transform-es2015-parameters": "^6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", + "babel-plugin-transform-regenerator": "^6.24.1" + } + }, + "babel-preset-jest": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-preset-jest/-/babel-preset-jest-22.4.3.tgz", + "integrity": "sha512-a+M3LTEXTq3gxv0uBN9Qm6ahUl7a8pj923nFbCUdqFUSsf3YrX8Uc+C3MEwji5Af3LiQjSC7w4ooYewlz8HRTA==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^22.4.3", + "babel-plugin-syntax-object-rest-spread": "^6.13.0" + } + }, + "babel-preset-stage-1": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz", + "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=", + "dev": true, + "requires": { + "babel-plugin-transform-class-constructor-call": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-preset-stage-2": "^6.24.1" + } + }, + "babel-preset-stage-2": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", + "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-preset-stage-3": "^6.24.1" + } + }, + "babel-preset-stage-3": { + "version": "6.24.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", + "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", + "dev": true, + "requires": { + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-generator-functions": "^6.24.1", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-exponentiation-operator": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.22.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "backo2": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base62": { + "version": "1.2.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/base62/-/base62-1.2.8.tgz", + "integrity": "sha512-V6YHUbjLxN1ymqNLb1DPHoU1CpfdL7d2YTIp5W3U4hhoG4hhxNmsFDs66M9EXxBiSEke5Bt5dwdfMwwZF70iLA==", + "dev": true + }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "dev": true + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "base64id": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/base64id/-/base64id-1.0.0.tgz", + "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", + "dev": true + }, + "batch": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "dev": true, + "requires": { + "callsite": "1.0.0" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "binaryextensions": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/binaryextensions/-/binaryextensions-2.1.1.tgz", + "integrity": "sha512-XBaoWE9RW8pPdPQNibZsW2zh8TW6gcarXp1FZPwT8Uop8ScSNldJEWf2k9l3HeTqdrEwsOsFcq74RiJECW34yA==", + "dev": true + }, + "blob": { + "version": "0.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/blob/-/blob-0.0.4.tgz", + "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=", + "dev": true + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "dev": true, + "requires": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.1", + "http-errors": "~1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "~2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "~1.6.15" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + }, + "qs": { + "version": "6.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "dev": true, + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", + "dev": true + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "dev": true, + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": ">= 1.3.1 < 2" + } + } + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", + "dev": true + } + } + }, + "bonjour": { + "version": "3.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bonjour/-/bonjour-3.5.0.tgz", + "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", + "dev": true, + "requires": { + "array-flatten": "^2.1.0", + "deep-equal": "^1.0.1", + "dns-equal": "^1.0.0", + "dns-txt": "^2.0.2", + "multicast-dns": "^6.0.1", + "multicast-dns-service-types": "^1.1.0" + } + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "bootstrap": { + "version": "4.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bootstrap/-/bootstrap-4.1.3.tgz", + "integrity": "sha512-rDFIzgXcof0jDyjNosjv4Sno77X4KuPeFxG2XZZv1/Kc8DRVGVADdoQyyOVDwPqL36DDmtCQbrpMCqvpPLJQ0w==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-process-hrtime": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", + "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", + "dev": true + }, + "browser-resolve": { + "version": "1.11.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browser-sync": { + "version": "2.24.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browser-sync/-/browser-sync-2.24.6.tgz", + "integrity": "sha512-3cVW8Ft3sPQ1t9gqZXBDZhTyRce8NW4wf5KzpCYcg6fWjPbyt+vZLvEo+sTq7c7eNQhi8lInQWbjIFEpoM2f7Q==", + "dev": true, + "requires": { + "browser-sync-ui": "v1.0.1", + "bs-recipes": "1.3.4", + "chokidar": "1.7.0", + "connect": "3.6.6", + "connect-history-api-fallback": "^1.5.0", + "dev-ip": "^1.0.1", + "easy-extender": "2.3.2", + "eazy-logger": "3.0.2", + "etag": "^1.8.1", + "fresh": "^0.5.2", + "fs-extra": "3.0.1", + "http-proxy": "1.15.2", + "immutable": "3.8.2", + "localtunnel": "1.9.0", + "micromatch": "2.3.11", + "opn": "4.0.2", + "portscanner": "2.1.1", + "qs": "6.2.3", + "raw-body": "^2.3.2", + "resp-modifier": "6.0.2", + "rx": "4.1.0", + "serve-index": "1.9.1", + "serve-static": "1.13.2", + "server-destroy": "1.0.1", + "socket.io": "2.1.1", + "ua-parser-js": "0.7.17", + "yargs": "6.4.0" + }, + "dependencies": { + "anymatch": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "opn": { + "version": "4.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/opn/-/opn-4.0.2.tgz", + "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "qs": { + "version": "6.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/qs/-/qs-6.2.3.tgz", + "integrity": "sha1-HPyyXBCpsrSDBT/zn138kjOQjP4=", + "dev": true + } + } + }, + "browser-sync-ui": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browser-sync-ui/-/browser-sync-ui-1.0.1.tgz", + "integrity": "sha512-RIxmwVVcUFhRd1zxp7m2FfLnXHf59x4Gtj8HFwTA//3VgYI3AKkaQAuDL8KDJnE59XqCshxZa13JYuIWtZlKQg==", + "dev": true, + "requires": { + "async-each-series": "0.1.1", + "connect-history-api-fallback": "^1.1.0", + "immutable": "^3.7.6", + "server-destroy": "1.0.1", + "socket.io-client": "2.0.4", + "stream-throttle": "^0.1.3" + } + }, + "browser-sync-webpack-plugin": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browser-sync-webpack-plugin/-/browser-sync-webpack-plugin-2.2.2.tgz", + "integrity": "sha512-x92kl8LdBi4dp6YVXYqrSoDkOCOLCeBOrYSY0h9Sk1VcCDSoZC1Vc62eae6TfC2ljN4/L+aYlkzE46kirHzbgA==", + "dev": true, + "requires": { + "lodash": "^4" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserify-des/-/browserify-des-1.0.1.tgz", + "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "1.7.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "^1.0.30000639", + "electron-to-chromium": "^1.2.7" + } + }, + "bs-recipes": { + "version": "1.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bs-recipes/-/bs-recipes-1.3.4.tgz", + "integrity": "sha1-DS1NSKcYyMBEdp/cT4lZLci2lYU=", + "dev": true + }, + "bser": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-indexof": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-indexof/-/buffer-indexof-1.1.1.tgz", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "builtins": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", + "dev": true + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true + }, + "cacache": { + "version": "10.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "dev": true, + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.1", + "mississippi": "^2.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^5.2.4", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + }, + "dependencies": { + "rimraf": { + "version": "2.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "cache-loader": { + "version": "1.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cache-loader/-/cache-loader-1.2.2.tgz", + "integrity": "sha512-rsGh4SIYyB9glU+d0OcHwiXHXBoUgDhHZaQ1KAbiXqfz1CDPxtTboh1gPbJ0q2qdO8a9lfcjgC5CJ2Ms32y5bw==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "mkdirp": "^0.5.1", + "neo-async": "^2.5.0", + "schema-utils": "^0.4.2" + } + }, + "cacheable-request": { + "version": "2.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", + "dev": true, + "requires": { + "clone-response": "1.0.2", + "get-stream": "3.0.0", + "http-cache-semantics": "3.8.1", + "keyv": "3.0.0", + "lowercase-keys": "1.0.0", + "normalize-url": "2.0.1", + "responselike": "1.0.2" + }, + "dependencies": { + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "dev": true, + "requires": { + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" + } + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + } + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "callsite": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", + "dev": true + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camel-case": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "dev": true, + "requires": { + "no-case": "^2.2.0", + "upper-case": "^1.1.1" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "caniuse-api": { + "version": "1.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/caniuse-api/-/caniuse-api-1.6.1.tgz", + "integrity": "sha1-tTTnxzTE+B7F++isoq0kNUuWLGw=", + "dev": true, + "requires": { + "browserslist": "^1.3.6", + "caniuse-db": "^1.0.30000529", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "caniuse-db": { + "version": "1.0.30000835", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/caniuse-db/-/caniuse-db-1.0.30000835.tgz", + "integrity": "sha1-ZVaTHN8DWQPYZV1jA/lQG1kV++k=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30000885", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/caniuse-lite/-/caniuse-lite-1.0.30000885.tgz", + "integrity": "sha512-cXKbYwpxBLd7qHyej16JazPoUacqoVuDhvR61U7Fr5vSxMUiodzcYa1rQYRYfZ5GexV03vGZHd722vNPLjPJGQ==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chevrotain": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chevrotain/-/chevrotain-4.1.0.tgz", + "integrity": "sha512-iwuK4FOV+vZlvKonoXVw6G+rXJm4jWk17aJFkm6FloVYcVSrAaJLdCdQo+IIyX98jm0WJVcdK9cllRZQpNBnBg==", + "dev": true, + "requires": { + "regexp-to-ast": "0.3.5" + } + }, + "chokidar": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chokidar/-/chokidar-2.0.4.tgz", + "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.0", + "braces": "^2.3.0", + "fsevents": "^1.2.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "lodash.debounce": "^4.0.8", + "normalize-path": "^2.1.1", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0", + "upath": "^1.0.5" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "dev": true + }, + "chrome-trace-event": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chrome-trace-event/-/chrome-trace-event-0.1.3.tgz", + "integrity": "sha512-sjndyZHrrWiu4RY7AkHgjn80GfAM2ZSzUkZLV/Js59Ldmh6JDThf0SUmOHU53rFu2rVxxfCzJ30Ukcfch3Gb/A==", + "dev": true + }, + "ci-info": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "clap": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clap/-/clap-1.2.3.tgz", + "integrity": "sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA==", + "dev": true, + "requires": { + "chalk": "^1.1.3" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-css": { + "version": "4.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clean-css/-/clean-css-4.1.11.tgz", + "integrity": "sha1-Ls3xRaujj1R0DybO/Q/z4D4SXWo=", + "dev": true, + "requires": { + "source-map": "0.5.x" + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-spinners": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-spinners/-/cli-spinners-0.1.2.tgz", + "integrity": "sha1-u3ZNiOGF+54eaiofGXcjGPYF4xw=", + "dev": true + }, + "cli-table": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-table/-/cli-table-0.3.1.tgz", + "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=", + "dev": true, + "requires": { + "colors": "1.0.3" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + } + } + }, + "cli-truncate": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-truncate/-/cli-truncate-0.2.1.tgz", + "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=", + "dev": true, + "requires": { + "slice-ansi": "0.0.4", + "string-width": "^1.0.1" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-deep": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-deep/-/clone-deep-2.0.2.tgz", + "integrity": "sha512-SZegPTKjCgpQH63E+eN6mVEEPdQBOUzjyJm5Pora4lrwWRFS8I0QAxV/KD6vV/i0WuijHZWQC1fMsPEdxfdVCQ==", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.0", + "shallow-clone": "^1.0.0" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + } + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "coa": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/coa/-/coa-1.0.4.tgz", + "integrity": "sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0=", + "dev": true, + "requires": { + "q": "^1.1.2" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "codelyzer": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/codelyzer/-/codelyzer-4.2.1.tgz", + "integrity": "sha512-CKwfgpfkqi9dyzy4s6ELaxJ54QgJ6A8iTSsM4bzHbLuTpbKncvNc3DUlCvpnkHBhK47gEf4qFsWoYqLrJPhy6g==", + "dev": true, + "requires": { + "app-root-path": "^2.0.1", + "css-selector-tokenizer": "^0.7.0", + "cssauron": "^1.4.0", + "semver-dsl": "^1.0.1", + "source-map": "^0.5.6", + "sprintf-js": "^1.0.3" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color": { + "version": "0.11.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color/-/color-0.11.4.tgz", + "integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=", + "dev": true, + "requires": { + "clone": "^1.0.2", + "color-convert": "^1.3.0", + "color-string": "^0.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-string": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-string/-/color-string-0.3.0.tgz", + "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=", + "dev": true, + "requires": { + "color-name": "^1.0.0" + } + }, + "colormin": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colormin/-/colormin-1.1.2.tgz", + "integrity": "sha1-6i90IKcrlogaOKrlnsEkpvcpgTM=", + "dev": true, + "requires": { + "color": "^0.11.0", + "css-color-names": "0.0.4", + "has": "^1.0.1" + } + }, + "colornames": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colornames/-/colornames-1.1.1.tgz", + "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "colorspace": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colorspace/-/colorspace-1.1.1.tgz", + "integrity": "sha512-pI3btWyiuz7Ken0BWh9Elzsmv2bM9AhA7psXib4anUXy/orfZ/E0MbQwhSOG/9L8hLlalqrU0UhOuqxW1YjmVw==", + "dev": true, + "requires": { + "color": "3.0.x", + "text-hex": "1.0.x" + }, + "dependencies": { + "color": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color/-/color-3.0.0.tgz", + "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", + "dev": true, + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, + "color-string": { + "version": "1.5.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "dev": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + } + } + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.19.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "dev": true + }, + "common-tags": { + "version": "1.8.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/common-tags/-/common-tags-1.8.0.tgz", + "integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "commoner": { + "version": "0.10.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commoner/-/commoner-0.10.8.tgz", + "integrity": "sha1-NPw2cs0kOT6LtH5wyqApOBH08sU=", + "dev": true, + "requires": { + "commander": "^2.5.0", + "detective": "^4.3.1", + "glob": "^5.0.15", + "graceful-fs": "^4.1.2", + "iconv-lite": "^0.4.5", + "mkdirp": "^0.5.0", + "private": "^0.1.6", + "q": "^1.1.2", + "recast": "^0.11.17" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "compare-versions": { + "version": "3.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/compare-versions/-/compare-versions-3.3.0.tgz", + "integrity": "sha512-MAAAIOdi2s4Gl6rZ76PNcUa9IOYB+5ICdT41o5uMRf09aEu/F9RK+qhe8RjXNPwcTjGV7KU7h2P/fljThFVqyQ==", + "dev": true + }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", + "dev": true + }, + "compressible": { + "version": "2.0.14", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/compressible/-/compressible-2.0.14.tgz", + "integrity": "sha1-MmxfUH+7BV9UEWeCuWmoG2einac=", + "dev": true, + "requires": { + "mime-db": ">= 1.34.0 < 2" + } + }, + "compression": { + "version": "1.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/compression/-/compression-1.7.2.tgz", + "integrity": "sha1-qv+81qr4VLROuygDU9WtFlH1mmk=", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "bytes": "3.0.0", + "compressible": "~2.0.13", + "debug": "2.6.9", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.1", + "vary": "~1.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "conf": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/conf/-/conf-2.0.0.tgz", + "integrity": "sha512-iCLzBsGFi8S73EANsEJZz0JnJ/e5VZef/kSaxydYZLAvw0rFNAUx5R7K5leC/CXXR2mZfXWhUvcZOO/dM2D5xg==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "env-paths": "^1.0.0", + "make-dir": "^1.0.0", + "pkg-up": "^2.0.0", + "write-file-atomic": "^2.3.0" + } + }, + "connect": { + "version": "3.6.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/connect/-/connect-3.6.6.tgz", + "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.0", + "parseurl": "~1.3.2", + "utils-merge": "1.0.1" + } + }, + "connect-history-api-fallback": { + "version": "1.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz", + "integrity": "sha1-sGhzk0vF40T+9hGhlqb6rgruAVo=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "dev": true + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-webpack-plugin": { + "version": "4.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/copy-webpack-plugin/-/copy-webpack-plugin-4.5.1.tgz", + "integrity": "sha512-OlTo6DYg0XfTKOF8eLf79wcHm4Ut10xU2cRBRPMW/NA5F9VMjZGTfRHWDIYC3s+1kObGYrBLshXWU1K0hILkNQ==", + "dev": true, + "requires": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "globby": "^7.1.1", + "is-glob": "^4.0.0", + "loader-utils": "^1.1.0", + "minimatch": "^3.0.4", + "p-limit": "^1.0.0", + "serialize-javascript": "^1.4.0" + } + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cosmiconfig": { + "version": "5.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cosmiconfig/-/cosmiconfig-5.0.6.tgz", + "integrity": "sha512-6DWfizHriCrFWURP1/qyhsiFvYdlJzbCzmtFWh744+KyWsJo5+kPzUZZaMRSSItoYc0pxFX7gEO7ZC1/gN/7AQ==", + "dev": true, + "requires": { + "is-directory": "^0.3.1", + "js-yaml": "^3.9.0", + "parse-json": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + } + } + }, + "cpx": { + "version": "1.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cpx/-/cpx-1.5.0.tgz", + "integrity": "sha1-GFvgGFEdhycN7czCkxceN2VauI8=", + "dev": true, + "requires": { + "babel-runtime": "^6.9.2", + "chokidar": "^1.6.0", + "duplexer": "^0.1.1", + "glob": "^7.0.5", + "glob2base": "^0.0.12", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.1", + "resolve": "^1.1.7", + "safe-buffer": "^5.0.1", + "shell-quote": "^1.6.1", + "subarg": "^1.0.0" + }, + "dependencies": { + "anymatch": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css-color-names": { + "version": "0.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", + "dev": true + }, + "css-declaration-sorter": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-declaration-sorter/-/css-declaration-sorter-3.0.1.tgz", + "integrity": "sha512-jH4024SHZ3e0M7ann9VxpFpH3moplRXNz9ZBqvFMZqi09Yo5ARbs2wdPH8GqN9iRTlQynrbGbraNbBxBLei85Q==", + "dev": true, + "requires": { + "postcss": "^6.0.0", + "timsort": "^0.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "css-loader": { + "version": "0.28.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-loader/-/css-loader-0.28.10.tgz", + "integrity": "sha512-X1IJteKnW9Llmrd+lJ0f7QZHh9Arf+11S7iRcoT2+riig3BK0QaCaOtubAulMK6Itbo08W6d3l8sW21r+Jhp5Q==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "css-selector-tokenizer": "^0.7.0", + "cssnano": "^3.10.0", + "icss-utils": "^2.1.0", + "loader-utils": "^1.0.2", + "lodash.camelcase": "^4.3.0", + "object-assign": "^4.1.1", + "postcss": "^5.0.6", + "postcss-modules-extract-imports": "^1.2.0", + "postcss-modules-local-by-default": "^1.2.0", + "postcss-modules-scope": "^1.1.0", + "postcss-modules-values": "^1.3.0", + "postcss-value-parser": "^3.3.0", + "source-list-map": "^2.0.0" + } + }, + "css-select": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true, + "requires": { + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" + } + }, + "css-select-base-adapter": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-select-base-adapter/-/css-select-base-adapter-0.1.0.tgz", + "integrity": "sha1-AQKz0UYw34bD65+p9UVicBBs+ZA=", + "dev": true + }, + "css-selector-tokenizer": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz", + "integrity": "sha1-5piEdK6MlTR3v15+/s/OzNnPTIY=", + "dev": true, + "requires": { + "cssesc": "^0.1.0", + "fastparse": "^1.1.1", + "regexpu-core": "^1.0.0" + } + }, + "css-tree": { + "version": "1.0.0-alpha25", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-tree/-/css-tree-1.0.0-alpha25.tgz", + "integrity": "sha512-XC6xLW/JqIGirnZuUWHXCHRaAjje2b3OIB0Vj5RIJo6mIi/AdJo30quQl5LxUl0gkXDIrTrFGbMlcZjyFplz1A==", + "dev": true, + "requires": { + "mdn-data": "^1.0.0", + "source-map": "^0.5.3" + } + }, + "css-unit-converter": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-unit-converter/-/css-unit-converter-1.1.1.tgz", + "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=", + "dev": true + }, + "css-url-regex": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-url-regex/-/css-url-regex-1.1.0.tgz", + "integrity": "sha1-g4NCMMyfdMRX3lnuvRVD/uuDt+w=", + "dev": true + }, + "css-what": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-what/-/css-what-2.1.0.tgz", + "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=", + "dev": true + }, + "cssauron": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssauron/-/cssauron-1.4.0.tgz", + "integrity": "sha1-pmAt/34EqDBtwNuaVR6S6LVmKtg=", + "dev": true, + "requires": { + "through": "X.X.X" + } + }, + "cssesc": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssesc/-/cssesc-0.1.0.tgz", + "integrity": "sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=", + "dev": true + }, + "cssnano": { + "version": "3.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssnano/-/cssnano-3.10.0.tgz", + "integrity": "sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg=", + "dev": true, + "requires": { + "autoprefixer": "^6.3.1", + "decamelize": "^1.1.2", + "defined": "^1.0.0", + "has": "^1.0.1", + "object-assign": "^4.0.1", + "postcss": "^5.0.14", + "postcss-calc": "^5.2.0", + "postcss-colormin": "^2.1.8", + "postcss-convert-values": "^2.3.4", + "postcss-discard-comments": "^2.0.4", + "postcss-discard-duplicates": "^2.0.1", + "postcss-discard-empty": "^2.0.1", + "postcss-discard-overridden": "^0.1.1", + "postcss-discard-unused": "^2.2.1", + "postcss-filter-plugins": "^2.0.0", + "postcss-merge-idents": "^2.1.5", + "postcss-merge-longhand": "^2.0.1", + "postcss-merge-rules": "^2.0.3", + "postcss-minify-font-values": "^1.0.2", + "postcss-minify-gradients": "^1.0.1", + "postcss-minify-params": "^1.0.4", + "postcss-minify-selectors": "^2.0.4", + "postcss-normalize-charset": "^1.1.0", + "postcss-normalize-url": "^3.0.7", + "postcss-ordered-values": "^2.1.0", + "postcss-reduce-idents": "^2.2.2", + "postcss-reduce-initial": "^1.0.0", + "postcss-reduce-transforms": "^1.0.3", + "postcss-svgo": "^2.1.1", + "postcss-unique-selectors": "^2.0.2", + "postcss-value-parser": "^3.2.3", + "postcss-zindex": "^2.0.1" + } + }, + "cssnano-preset-default": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssnano-preset-default/-/cssnano-preset-default-4.0.0.tgz", + "integrity": "sha1-wzQoe099SfstFwqS+SFGVXiOO2s=", + "dev": true, + "requires": { + "css-declaration-sorter": "^3.0.0", + "cssnano-util-raw-cache": "^4.0.0", + "postcss": "^6.0.0", + "postcss-calc": "^6.0.0", + "postcss-colormin": "^4.0.0", + "postcss-convert-values": "^4.0.0", + "postcss-discard-comments": "^4.0.0", + "postcss-discard-duplicates": "^4.0.0", + "postcss-discard-empty": "^4.0.0", + "postcss-discard-overridden": "^4.0.0", + "postcss-merge-longhand": "^4.0.0", + "postcss-merge-rules": "^4.0.0", + "postcss-minify-font-values": "^4.0.0", + "postcss-minify-gradients": "^4.0.0", + "postcss-minify-params": "^4.0.0", + "postcss-minify-selectors": "^4.0.0", + "postcss-normalize-charset": "^4.0.0", + "postcss-normalize-display-values": "^4.0.0", + "postcss-normalize-positions": "^4.0.0", + "postcss-normalize-repeat-style": "^4.0.0", + "postcss-normalize-string": "^4.0.0", + "postcss-normalize-timing-functions": "^4.0.0", + "postcss-normalize-unicode": "^4.0.0", + "postcss-normalize-url": "^4.0.0", + "postcss-normalize-whitespace": "^4.0.0", + "postcss-ordered-values": "^4.0.0", + "postcss-reduce-initial": "^4.0.0", + "postcss-reduce-transforms": "^4.0.0", + "postcss-svgo": "^4.0.0", + "postcss-unique-selectors": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "browserslist": { + "version": "4.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserslist/-/browserslist-4.1.1.tgz", + "integrity": "sha512-VBorw+tgpOtZ1BYhrVSVTzTt/3+vSE3eFUh0N2GCFK1HffceOaf32YS/bs6WiFhjDAblAFrx85jMy3BG9fBK2Q==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000884", + "electron-to-chromium": "^1.3.62", + "node-releases": "^1.0.0-alpha.11" + } + }, + "caniuse-api": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/caniuse-api/-/caniuse-api-3.0.0.tgz", + "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-lite": "^1.0.0", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "coa": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/coa/-/coa-2.0.1.tgz", + "integrity": "sha512-5wfTTO8E2/ja4jFSxePXlG5nRu5bBtL/r1HCIpJW/lzT6yDtKl0u0Z4o/Vpz32IpKmBn7HerheEZQgA9N2DarQ==", + "dev": true, + "requires": { + "q": "^1.1.2" + } + }, + "color": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color/-/color-3.1.0.tgz", + "integrity": "sha512-CwyopLkuRYO5ei2EpzpIh6LqJMt6Mt+jZhO5VI5f/wJLZriXQE32/SSqzmrh+QB+AZT81Cj8yv+7zwToW8ahZg==", + "dev": true, + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, + "color-string": { + "version": "1.5.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "dev": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "css-select": { + "version": "1.3.0-rc0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-select/-/css-select-1.3.0-rc0.tgz", + "integrity": "sha1-b5MZaqrnN2ZuoQNqjLFKj8t6kjE=", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "^1.0.1" + } + }, + "csso": { + "version": "3.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/csso/-/csso-3.5.0.tgz", + "integrity": "sha512-WtJjFP3ZsSdWhiZr4/k1B9uHPgYjFYnDxfbaJxk1hz5PDLIJ5BCRWkJqaztZ0DbP8d2ZIVwUPIJb2YmCwkPaMw==", + "dev": true, + "requires": { + "css-tree": "1.0.0-alpha.27" + }, + "dependencies": { + "css-tree": { + "version": "1.0.0-alpha.27", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/css-tree/-/css-tree-1.0.0-alpha.27.tgz", + "integrity": "sha512-BAYp9FyN4jLXjfvRpTDchBllDptqlK9I7OsagXCG9Am5C+5jc8eRZHgqb9x500W2OKS14MMlpQc/nmh/aA7TEQ==", + "dev": true, + "requires": { + "mdn-data": "^1.0.0", + "source-map": "^0.5.3" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-svg": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-svg/-/is-svg-3.0.0.tgz", + "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", + "dev": true, + "requires": { + "html-comment-regex": "^1.1.0" + } + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "normalize-url": { + "version": "3.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-url/-/normalize-url-3.3.0.tgz", + "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "postcss-calc": { + "version": "6.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-calc/-/postcss-calc-6.0.1.tgz", + "integrity": "sha1-PSQXG79udinUIqQ26/5t2VEfQzA=", + "dev": true, + "requires": { + "css-unit-converter": "^1.1.1", + "postcss": "^6.0.0", + "postcss-selector-parser": "^2.2.2", + "reduce-css-calc": "^2.0.0" + } + }, + "postcss-colormin": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-colormin/-/postcss-colormin-4.0.1.tgz", + "integrity": "sha1-bxwYoBVbxpYT8v8ThD4uSuj/C74=", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "color": "^3.0.0", + "has": "^1.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + } + }, + "postcss-convert-values": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-convert-values/-/postcss-convert-values-4.0.0.tgz", + "integrity": "sha1-d9d9mu0dxOaVbmUcw0nVMwWHb2I=", + "dev": true, + "requires": { + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + } + }, + "postcss-discard-comments": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-comments/-/postcss-discard-comments-4.0.0.tgz", + "integrity": "sha1-loSimedrPpMmPvj9KtvxocCP2I0=", + "dev": true, + "requires": { + "postcss": "^6.0.0" + } + }, + "postcss-discard-duplicates": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.0.tgz", + "integrity": "sha1-QvPCZ/hfqQngQsNXZ+z9Zcsr1yw=", + "dev": true, + "requires": { + "postcss": "^6.0.0" + } + }, + "postcss-discard-empty": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-empty/-/postcss-discard-empty-4.0.0.tgz", + "integrity": "sha1-VeGKWcdBKOOMfSgEvPpAVmEfuX8=", + "dev": true, + "requires": { + "postcss": "^6.0.0" + } + }, + "postcss-discard-overridden": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-overridden/-/postcss-discard-overridden-4.0.0.tgz", + "integrity": "sha1-Sgv4WXh4TPH4HtLBwf2dlkodofo=", + "dev": true, + "requires": { + "postcss": "^6.0.0" + } + }, + "postcss-merge-longhand": { + "version": "4.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-merge-longhand/-/postcss-merge-longhand-4.0.5.tgz", + "integrity": "sha512-tw2obF6I2VhXhPMObQc1QpQO850m3arhqP3PcBAU7Tx70v73QF6brs9uK0XKMNuC7BPo6DW+fh07cGhrLL57HA==", + "dev": true, + "requires": { + "css-color-names": "0.0.4", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0", + "stylehacks": "^4.0.0" + } + }, + "postcss-merge-rules": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-merge-rules/-/postcss-merge-rules-4.0.1.tgz", + "integrity": "sha1-Qw/Vmz8u0uivzQsxJ47aOYVKuxA=", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "cssnano-util-same-parent": "^4.0.0", + "postcss": "^6.0.0", + "postcss-selector-parser": "^3.0.0", + "vendors": "^1.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "^4.1.1", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-minify-font-values": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-font-values/-/postcss-minify-font-values-4.0.0.tgz", + "integrity": "sha1-TMM9KD1qgXWQNudX75gdksvYW+0=", + "dev": true, + "requires": { + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + } + }, + "postcss-minify-gradients": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-gradients/-/postcss-minify-gradients-4.0.0.tgz", + "integrity": "sha1-P8ORZDnSepu4Bm23za2AFlDrCQ4=", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "is-color-stop": "^1.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + } + }, + "postcss-minify-params": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-params/-/postcss-minify-params-4.0.0.tgz", + "integrity": "sha1-BekWbuSMBa9lGYnOhNOcG015BnQ=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0", + "uniqs": "^2.0.0" + } + }, + "postcss-minify-selectors": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-selectors/-/postcss-minify-selectors-4.0.0.tgz", + "integrity": "sha1-sen2xGNBbT/Nyybnt4XZX2FXiq0=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "has": "^1.0.0", + "postcss": "^6.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "^4.1.1", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-normalize-charset": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-charset/-/postcss-normalize-charset-4.0.0.tgz", + "integrity": "sha1-JFJyknAtXoEp6vo9HeSe1RpqtzA=", + "dev": true, + "requires": { + "postcss": "^6.0.0" + } + }, + "postcss-normalize-url": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-url/-/postcss-normalize-url-4.0.0.tgz", + "integrity": "sha1-t6nIrSbPJmlMFG6y1ovQz0mVbw0=", + "dev": true, + "requires": { + "is-absolute-url": "^2.0.0", + "normalize-url": "^3.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + } + }, + "postcss-ordered-values": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-ordered-values/-/postcss-ordered-values-4.1.0.tgz", + "integrity": "sha512-gbqbEiONKKJgoOKhtzBjFqmHSzviPL4rv0ACVcFS7wxWXBY07agFXRQ7Y3eMGV0ZORzQXp2NGnj0c+imJG0NcA==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + } + }, + "postcss-reduce-initial": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-reduce-initial/-/postcss-reduce-initial-4.0.1.tgz", + "integrity": "sha1-8tWPUM6isMXcEnjW6l7Q/1gpwpM=", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "has": "^1.0.0", + "postcss": "^6.0.0" + } + }, + "postcss-reduce-transforms": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.0.tgz", + "integrity": "sha1-9kX8dEDDUnT0DegQThStcWPt8Yg=", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "has": "^1.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + } + }, + "postcss-svgo": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-svgo/-/postcss-svgo-4.0.0.tgz", + "integrity": "sha1-wLutAlIPxjbJ14sOhAPi5RXDIoU=", + "dev": true, + "requires": { + "is-svg": "^3.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0", + "svgo": "^1.0.0" + } + }, + "postcss-unique-selectors": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-unique-selectors/-/postcss-unique-selectors-4.0.0.tgz", + "integrity": "sha1-BMHpdkx1h0JhMDQCxB8Ol2n8VQE=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "postcss": "^6.0.0", + "uniqs": "^2.0.0" + } + }, + "reduce-css-calc": { + "version": "2.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/reduce-css-calc/-/reduce-css-calc-2.1.4.tgz", + "integrity": "sha512-i/vWQbyd3aJRmip9OVSN9V6nIjLf/gg/ctxb0CpvHWtcRysFl/ngDBQD+rqavxdw/doScA3GMBXhzkHQ4GCzFQ==", + "dev": true, + "requires": { + "css-unit-converter": "^1.1.1", + "postcss-value-parser": "^3.3.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "svgo": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/svgo/-/svgo-1.0.5.tgz", + "integrity": "sha512-nYrifviB77aNKDNKKyuay3M9aYiK6Hv5gJVDdjj2ZXTQmI8WZc8+UPLR5IpVlktJfSu3co/4XcWgrgI6seGBPg==", + "dev": true, + "requires": { + "coa": "~2.0.1", + "colors": "~1.1.2", + "css-select": "~1.3.0-rc0", + "css-select-base-adapter": "~0.1.0", + "css-tree": "1.0.0-alpha25", + "css-url-regex": "^1.1.0", + "csso": "^3.5.0", + "js-yaml": "~3.10.0", + "mkdirp": "~0.5.1", + "object.values": "^1.0.4", + "sax": "~1.2.4", + "stable": "~0.1.6", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + } + } + } + }, + "cssnano-util-get-arguments": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", + "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=", + "dev": true + }, + "cssnano-util-get-match": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz", + "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=", + "dev": true + }, + "cssnano-util-raw-cache": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.0.tgz", + "integrity": "sha1-vgooVuJfGF9feivMBiTii38Xmp8=", + "dev": true, + "requires": { + "postcss": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "cssnano-util-same-parent": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.0.tgz", + "integrity": "sha1-0qPeEDmqmLxOwlAB+gUDMMKhbaw=", + "dev": true + }, + "csso": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/csso/-/csso-2.3.2.tgz", + "integrity": "sha1-3dUsWHAz9J6Utx/FVWnyUuj/X4U=", + "dev": true, + "requires": { + "clap": "^1.0.9", + "source-map": "^0.5.3" + } + }, + "cssom": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssom/-/cssom-0.3.2.tgz", + "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", + "dev": true + }, + "cssstyle": { + "version": "0.2.37", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssstyle/-/cssstyle-0.2.37.tgz", + "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true + }, + "d": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "^0.10.9" + } + }, + "d3": { + "version": "3.5.17", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/d3/-/d3-3.5.17.tgz", + "integrity": "sha1-vEZ0gAQ3iyGjYMn8fPUjF5B2L7g=", + "dev": true + }, + "dargs": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dargs/-/dargs-6.0.0.tgz", + "integrity": "sha512-6lJauzNaI7MiM8EHQWmGj+s3rP5/i1nYs8GAvKrLAx/9dpc9xS/4seFb1ioR39A+kcfu4v3jnEa/EE5qWYnitQ==", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/data-urls/-/data-urls-1.0.0.tgz", + "integrity": "sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA==", + "dev": true, + "requires": { + "abab": "^1.0.4", + "whatwg-mimetype": "^2.0.0", + "whatwg-url": "^6.4.0" + } + }, + "date-fns": { + "version": "1.29.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/date-fns/-/date-fns-1.29.0.tgz", + "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==", + "dev": true + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "default-require-extensions": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "dev": true, + "requires": { + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "^2.0.5", + "object-keys": "^1.0.8" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/del/-/del-3.0.0.tgz", + "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", + "dev": true, + "requires": { + "globby": "^6.1.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "p-map": "^1.1.1", + "pify": "^3.0.0", + "rimraf": "^2.2.8" + }, + "dependencies": { + "globby": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-conflict": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/detect-conflict/-/detect-conflict-1.0.1.tgz", + "integrity": "sha1-CIZXpmqWHAUBnbfEIwiDsca0F24=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "detect-node": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/detect-node/-/detect-node-2.0.3.tgz", + "integrity": "sha1-ogM8CcyOFY03dI+951B4Mr1s4Sc=", + "dev": true + }, + "detective": { + "version": "4.7.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/detective/-/detective-4.7.1.tgz", + "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", + "dev": true, + "requires": { + "acorn": "^5.2.1", + "defined": "^1.0.0" + } + }, + "dev-ip": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dev-ip/-/dev-ip-1.0.1.tgz", + "integrity": "sha1-p2o+0YVb56ASu4rBbLgPPADcKPA=", + "dev": true + }, + "diagnostics": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/diagnostics/-/diagnostics-1.1.1.tgz", + "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", + "dev": true, + "requires": { + "colorspace": "1.1.x", + "enabled": "1.0.x", + "kuler": "1.0.x" + } + }, + "didyoumean": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/didyoumean/-/didyoumean-1.2.1.tgz", + "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "dns-equal": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=", + "dev": true + }, + "dns-packet": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dns-packet/-/dns-packet-1.3.1.tgz", + "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "dev": true, + "requires": { + "ip": "^1.1.0", + "safe-buffer": "^5.0.1" + } + }, + "dns-txt": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", + "dev": true, + "requires": { + "buffer-indexof": "^1.0.0" + } + }, + "dom-converter": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dom-converter/-/dom-converter-0.1.4.tgz", + "integrity": "sha1-pF71cnuJDJv/5tfIduexnLDhfzs=", + "dev": true, + "requires": { + "utila": "~0.3" + }, + "dependencies": { + "utila": { + "version": "0.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "~1.1.1", + "entities": "~1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "domhandler": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/domhandler/-/domhandler-2.1.0.tgz", + "integrity": "sha1-0mRvXlf2w7qxHPbLBdPArPdBJZQ=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "drange": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/drange/-/drange-1.1.1.tgz", + "integrity": "sha512-pYxfDYpued//QpnLIm4Avk7rsNtAtQkUES2cwAYSvD/wd2pKD71gN2Ebj3e7klzXwjocvE8c5vx/1fxwpqmSxA==", + "dev": true + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "duplexify": { + "version": "3.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "easy-extender": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/easy-extender/-/easy-extender-2.3.2.tgz", + "integrity": "sha1-PTJI/r4rFZYHMW2PnPSRwWZIIh0=", + "dev": true, + "requires": { + "lodash": "^3.10.1" + } + }, + "eazy-logger": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/eazy-logger/-/eazy-logger-3.0.2.tgz", + "integrity": "sha1-oyWqXlPROiIliJsqxBE7K5Y29Pw=", + "dev": true, + "requires": { + "tfunk": "^3.0.1" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "editions": { + "version": "1.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/editions/-/editions-1.3.4.tgz", + "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", + "dev": true + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "ejs": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ejs/-/ejs-2.6.1.tgz", + "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.70", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/electron-to-chromium/-/electron-to-chromium-1.3.70.tgz", + "integrity": "sha512-WYMjqCnPVS5JA+XvwEnpwucJpVi2+q9cdCFpbhxgWGsCtforFBEkuP9+nCyy/wnU/0SyLcLRIeZct9ayMGcXoQ==", + "dev": true + }, + "elegant-spinner": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/elegant-spinner/-/elegant-spinner-1.0.1.tgz", + "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=", + "dev": true + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "enabled": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/enabled/-/enabled-1.0.2.tgz", + "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", + "dev": true, + "requires": { + "env-variable": "0.0.x" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "engine.io": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/engine.io/-/engine.io-3.2.0.tgz", + "integrity": "sha512-mRbgmAtQ4GAlKwuPnnAvXXwdPhEx+jkc0OBCLrXuD/CRvwNK3AxRSnqK4FSqmAMRRHryVJP8TopOvmEaA64fKw==", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "base64id": "1.0.0", + "cookie": "0.3.1", + "debug": "~3.1.0", + "engine.io-parser": "~2.1.0", + "ws": "~3.3.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "engine.io-client": { + "version": "3.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/engine.io-client/-/engine.io-client-3.1.6.tgz", + "integrity": "sha512-hnuHsFluXnsKOndS4Hv6SvUrgdYx1pk2NqfaDMW+GWdgfU3+/V25Cj7I8a0x92idSpa5PIhJRKxPvp9mnoLsfg==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "~3.1.0", + "engine.io-parser": "~2.1.1", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~3.3.1", + "xmlhttprequest-ssl": "~1.5.4", + "yeast": "0.1.2" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "engine.io-parser": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/engine.io-parser/-/engine.io-parser-2.1.2.tgz", + "integrity": "sha512-dInLFzr80RijZ1rGpx1+56/uFoH7/7InhH3kZt+Ms6hT8tNx3NGW/WNSA/f8As1WkOfkuyb3tnRyuXGxusclMw==", + "dev": true, + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "~0.0.7", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary2": "~1.0.2" + } + }, + "enhanced-resolve": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz", + "integrity": "sha512-jox/62b2GofV1qTUQTMPEJSDIGycS43evqYzD/KVtEb9OCoki9cnacUPxCrZa7JfPzZSYOCZhu9O9luaMxAX8g==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" + } + }, + "entities": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "env-paths": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/env-paths/-/env-paths-1.0.0.tgz", + "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=", + "dev": true + }, + "env-variable": { + "version": "0.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/env-variable/-/env-variable-0.0.5.tgz", + "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==", + "dev": true + }, + "envify": { + "version": "3.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/envify/-/envify-3.4.1.tgz", + "integrity": "sha1-1xIjKejfFoi6dxsSUBkXyc5cvOg=", + "dev": true, + "requires": { + "jstransform": "^11.0.3", + "through": "~2.3.4" + } + }, + "envinfo": { + "version": "4.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/envinfo/-/envinfo-4.4.2.tgz", + "integrity": "sha512-5rfRs+m+6pwoKRCFqpsA5+qsLngFms1aWPrxfKbrObCzQaPc3M3yPloZx+BL9UE3dK58cxw36XVQbFRSCCfGSQ==", + "dev": true + }, + "errno": { + "version": "0.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error": { + "version": "7.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/error/-/error-7.0.2.tgz", + "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", + "dev": true, + "requires": { + "string-template": "~0.2.1", + "xtend": "~4.0.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "error-stack-parser": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/error-stack-parser/-/error-stack-parser-2.0.2.tgz", + "integrity": "sha512-E1fPutRDdIj/hohG0UpT5mayXNCxXP9d+snxFsPU9X0XgccOumKraa3juDMwTUyi7+Bu5+mCGagjg4IYeNbOdw==", + "dev": true, + "requires": { + "stackframe": "^1.0.4" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" + } + }, + "es5-ext": { + "version": "0.10.45", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/es5-ext/-/es5-ext-0.10.45.tgz", + "integrity": "sha512-FkfM6Vxxfmztilbxxz5UKSD4ICMf5tSpRFtDNtkAhOxZ0EKtX6qwmXNyH/sFyIbX2P/nU5AMiA9jilWsUGJzCQ==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-promise": { + "version": "4.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/es6-promise/-/es6-promise-4.0.5.tgz", + "integrity": "sha1-eILzCt3lskDM+n99eMVIMwlRrkI=", + "dev": true + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "es6-templates": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/es6-templates/-/es6-templates-0.2.3.tgz", + "integrity": "sha1-XLmsn7He1usSOTQrgdeSu7QHjuQ=", + "dev": true, + "requires": { + "recast": "~0.11.12", + "through": "~2.3.6" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/escodegen/-/escodegen-1.10.0.tgz", + "integrity": "sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "eventemitter3": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/eventemitter3/-/eventemitter3-1.2.0.tgz", + "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "eventsource": { + "version": "0.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/eventsource/-/eventsource-0.1.6.tgz", + "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=", + "dev": true, + "requires": { + "original": ">=0.0.5" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "exec-sh": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/exec-sh/-/exec-sh-0.2.1.tgz", + "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", + "dev": true, + "requires": { + "merge": "^1.1.3" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "expect": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expect/-/expect-22.4.3.tgz", + "integrity": "sha512-XcNXEPehqn8b/jm8FYotdX0YrXn36qp4HWlrVT4ktwQas1l1LPxiVWncYnnL2eyMtKAmVIaG0XAp0QlrqJaxaA==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "jest-diff": "^22.4.3", + "jest-get-type": "^22.4.3", + "jest-matcher-utils": "^22.4.3", + "jest-message-util": "^22.4.3", + "jest-regex-util": "^22.4.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + } + } + }, + "exports-loader": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/exports-loader/-/exports-loader-0.7.0.tgz", + "integrity": "sha512-RKwCrO4A6IiKm0pG3c9V46JxIHcDplwwGJn6+JJ1RcVnh/WSGJa0xkmk5cRVtgOPzCAtTMGj2F7nluh9L0vpSA==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "source-map": "0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.5.0.tgz", + "integrity": "sha1-D+llA6yGpa213mP05BKuSHLNvoY=", + "dev": true + } + } + }, + "express": { + "version": "4.16.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "dev": true, + "requires": { + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.3", + "qs": "6.5.1", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "array-flatten": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-glob": { + "version": "2.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-glob/-/fast-glob-2.2.3.tgz", + "integrity": "sha512-NiX+JXjnx43RzvVFwRWfPKo4U+1BrK5pJPsHQdKMlLoFHrrGktXglQhHliSihWAq+m1z6fHk3uwGHrtRbS9vLA==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.0.1", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.1", + "micromatch": "^3.1.10" + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-safe-stringify": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", + "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==", + "dev": true + }, + "fastparse": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fastparse/-/fastparse-1.1.1.tgz", + "integrity": "sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg=", + "dev": true + }, + "faye-websocket": { + "version": "0.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/faye-websocket/-/faye-websocket-0.10.0.tgz", + "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "dev": true, + "requires": { + "websocket-driver": ">=0.5.1" + } + }, + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", + "dev": true, + "requires": { + "bser": "^2.0.0" + } + }, + "fbjs": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fbjs/-/fbjs-0.6.1.tgz", + "integrity": "sha1-lja3cF9bqWhNRLcveDISVK/IYPc=", + "dev": true, + "requires": { + "core-js": "^1.0.0", + "loose-envify": "^1.0.0", + "promise": "^7.0.3", + "ua-parser-js": "^0.7.9", + "whatwg-fetch": "^0.9.0" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true + } + } + }, + "fecha": { + "version": "2.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fecha/-/fecha-2.3.3.tgz", + "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==", + "dev": true + }, + "figgy-pudding": { + "version": "3.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figgy-pudding/-/figgy-pudding-3.5.1.tgz", + "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-loader": { + "version": "1.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/file-loader/-/file-loader-1.1.11.tgz", + "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", + "dev": true, + "requires": { + "loader-utils": "^1.0.2", + "schema-utils": "^0.4.5" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fileset": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fileset/-/fileset-2.0.3.tgz", + "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", + "dev": true, + "requires": { + "glob": "^7.0.3", + "minimatch": "^3.0.3" + } + }, + "filesize": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/filesize/-/filesize-3.6.1.tgz", + "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", + "dev": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-index": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-index/-/find-index-0.1.1.tgz", + "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", + "dev": true + }, + "find-parent-dir": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-parent-dir/-/find-parent-dir-0.3.0.tgz", + "integrity": "sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "first-chunk-stream": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", + "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "flatten": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/flatten/-/flatten-1.0.2.tgz", + "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", + "dev": true + }, + "flow-parser": { + "version": "0.71.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/flow-parser/-/flow-parser-0.71.0.tgz", + "integrity": "sha512-rXSvqSBLf8aRI6T3P99jMcUYvZoO1KZcKDkzGJmXvYdNAgRKu7sfGNtxEsn3cX4TgungBuJpX+K8aHRC9/B5MA==", + "dev": true + }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "follow-redirects": { + "version": "1.5.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/follow-redirects/-/follow-redirects-1.5.9.tgz", + "integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==", + "dev": true, + "requires": { + "debug": "=3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "fork-ts-checker-webpack-plugin": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-0.4.1.tgz", + "integrity": "sha512-UckdUYL51F5t9t/2Uqk0xatxz8Cf75a1THNIrDYajjcAcg2Q64SXNP7BTQPxXm0bU1chzjR3brXIaianbFqI3Q==", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "chalk": "^1.1.3", + "chokidar": "^1.7.0", + "lodash.endswith": "^4.2.1", + "lodash.isfunction": "^3.0.8", + "lodash.isstring": "^4.0.1", + "lodash.startswith": "^4.2.1", + "minimatch": "^3.0.4", + "resolve": "^1.5.0", + "tapable": "^1.0.0", + "vue-parser": "^1.1.5" + }, + "dependencies": { + "anymatch": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + } + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "friendly-errors-webpack-plugin": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.0.tgz", + "integrity": "sha512-K27M3VK30wVoOarP651zDmb93R9zF28usW4ocaK3mfQeIEI5BPht/EzZs5E8QLLwbLRJQMwscAjDxYPb1FuNiw==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "error-stack-parser": "^2.0.0", + "string-width": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-extra": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs-extra/-/fs-extra-3.0.1.tgz", + "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^3.0.0", + "universalify": "^0.1.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "generator-jhipster": { + "version": "5.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/generator-jhipster/-/generator-jhipster-5.4.2.tgz", + "integrity": "sha512-iuTZGPonlMFWrabTC7x27UnCa8sckWFKD7HiwMp2JOYLlLU+BPt0WJWlQ9hJv5JHHx+pe0pUxwEHbi0fSu0Ljw==", + "dev": true, + "requires": { + "axios": "0.18.0", + "chalk": "2.4.1", + "commander": "2.16.0", + "conf": "2.0.0", + "didyoumean": "1.2.1", + "ejs": "2.6.1", + "glob": "7.1.2", + "gulp-filter": "5.1.0", + "insight": "0.10.1", + "jhipster-core": "3.4.0", + "js-object-pretty-print": "0.3.0", + "js-yaml": "3.12.0", + "lodash": "4.17.10", + "meow": "5.0.0", + "mkdirp": "0.5.1", + "os-locale": "2.1.0", + "parse-gitignore": "1.0.1", + "pluralize": "7.0.0", + "prettier": "1.13.7", + "randexp": "0.4.9", + "semver": "5.5.0", + "shelljs": "0.8.2", + "tabtab": "2.2.2", + "through2": "2.0.3", + "uuid": "3.3.2", + "yeoman-environment": "2.3.0", + "yeoman-generator": "3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "axios": { + "version": "0.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "dev": true, + "requires": { + "follow-redirects": "^1.3.0", + "is-buffer": "^1.1.5" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "commander": { + "version": "2.16.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.16.0.tgz", + "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "prettier": { + "version": "1.13.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prettier/-/prettier-1.13.7.tgz", + "integrity": "sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-own-enumerable-property-symbols": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz", + "integrity": "sha512-TtY/sbOemiMKPRUDDanGCSgBYe7Mf0vbRsWnBZ+9yghpZ1MvcpSpuZFjHdEeY/LZjZy0vdLjS77L6HosisFiug==", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "gh-got": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gh-got/-/gh-got-6.0.0.tgz", + "integrity": "sha512-F/mS+fsWQMo1zfgG9MD8KWvTWPPzzhuVwY++fhQ5Ggd+0P+CAMHtzMZhNxG+TqGfHDChJKsbh6otfMGqO2AKBw==", + "dev": true, + "requires": { + "got": "^7.0.0", + "is-plain-obj": "^1.1.0" + } + }, + "github-username": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/github-username/-/github-username-4.1.0.tgz", + "integrity": "sha1-y+KABBiDIG2kISrp5LXxacML9Bc=", + "dev": true, + "requires": { + "gh-got": "^6.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-all": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-all/-/glob-all-3.1.0.tgz", + "integrity": "sha1-iRPd+17hrHgSZWJBsD1SF8ZLAqs=", + "dev": true, + "requires": { + "glob": "^7.0.5", + "yargs": "~1.2.6" + }, + "dependencies": { + "minimist": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-0.1.0.tgz", + "integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4=", + "dev": true + }, + "yargs": { + "version": "1.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-1.2.6.tgz", + "integrity": "sha1-nHtKgv1dWVsr8Xq23MQxNUMv40s=", + "dev": true, + "requires": { + "minimist": "^0.1.0" + } + } + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "glob2base": { + "version": "0.0.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob2base/-/glob2base-0.0.12.tgz", + "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "dev": true, + "requires": { + "find-index": "^0.1.1" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "7.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/globby/-/globby-7.1.1.tgz", + "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "grouped-queue": { + "version": "0.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/grouped-queue/-/grouped-queue-0.3.3.tgz", + "integrity": "sha1-wWfSpTGcWg4JZO9qJbfC34mWyFw=", + "dev": true, + "requires": { + "lodash": "^4.17.2" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "growly": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "gulp-filter": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gulp-filter/-/gulp-filter-5.1.0.tgz", + "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM=", + "dev": true, + "requires": { + "multimatch": "^2.0.0", + "plugin-error": "^0.1.2", + "streamfilter": "^1.0.5" + } + }, + "handle-thing": { + "version": "1.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/handle-thing/-/handle-thing-1.2.5.tgz", + "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-binary2": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-binary2/-/has-binary2-1.0.2.tgz", + "integrity": "sha1-6D26SfC5vk0CbSc2U1DZ8D9Uvpg=", + "dev": true, + "requires": { + "isarray": "2.0.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + } + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", + "dev": true + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", + "dev": true + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hash.js/-/hash.js-1.1.4.tgz", + "integrity": "sha512-A6RlQvvZEtFS5fLU43IDu0QUmBy+fDO9VMdTXvufKwIkt/rFfvICAViCax5fbDO4zdNzaC3/27ZhKUok5bAJyw==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hex-color-regex": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hex-color-regex/-/hex-color-regex-1.1.0.tgz", + "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hoek": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + } + }, + "hsl-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hsl-regex/-/hsl-regex-1.0.0.tgz", + "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=", + "dev": true + }, + "hsla-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hsla-regex/-/hsla-regex-1.0.0.tgz", + "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=", + "dev": true + }, + "html-comment-regex": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/html-comment-regex/-/html-comment-regex-1.1.1.tgz", + "integrity": "sha1-ZouTd26q5V696POtRkswekljYl4=", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "html-entities": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/html-entities/-/html-entities-1.2.1.tgz", + "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=", + "dev": true + }, + "html-loader": { + "version": "0.5.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/html-loader/-/html-loader-0.5.5.tgz", + "integrity": "sha512-7hIW7YinOYUpo//kSYcPB6dCKoceKLmOwjEMmhIobHuWGDVl0Nwe4l68mdG/Ru0wcUxQjVMEoZpkalZ/SE7zog==", + "dev": true, + "requires": { + "es6-templates": "^0.2.3", + "fastparse": "^1.1.1", + "html-minifier": "^3.5.8", + "loader-utils": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "html-minifier": { + "version": "3.5.16", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/html-minifier/-/html-minifier-3.5.16.tgz", + "integrity": "sha512-zP5EfLSpiLRp0aAgud4CQXPQZm9kXwWjR/cF0PfdOj+jjWnOaCgeZcll4kYXSvIBPeUMmyaSc7mM4IDtA+kboA==", + "dev": true, + "requires": { + "camel-case": "3.0.x", + "clean-css": "4.1.x", + "commander": "2.15.x", + "he": "1.1.x", + "param-case": "2.1.x", + "relateurl": "0.2.x", + "uglify-js": "3.3.x" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + } + } + }, + "html-webpack-plugin": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", + "integrity": "sha1-sBq71yOsqqeze2r0SS69oD2d03s=", + "dev": true, + "requires": { + "html-minifier": "^3.2.3", + "loader-utils": "^0.2.16", + "lodash": "^4.17.3", + "pretty-error": "^2.0.2", + "tapable": "^1.0.0", + "toposort": "^1.0.0", + "util.promisify": "1.0.0" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "htmlparser2": { + "version": "3.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/htmlparser2/-/htmlparser2-3.3.0.tgz", + "integrity": "sha1-zHDQWln2VC5D8OaFyYLhTJJKnv4=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.1", + "domutils": "1.1", + "readable-stream": "1.0" + }, + "dependencies": { + "domutils": { + "version": "1.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/domutils/-/domutils-1.1.6.tgz", + "integrity": "sha1-vdw94Jm5ou+sxRxiPyj0FuzFdIU=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "dev": true + }, + "http-deceiver": { + "version": "1.2.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", + "dev": true + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "dependencies": { + "statuses": { + "version": "1.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + } + } + }, + "http-parser-js": { + "version": "0.4.13", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-parser-js/-/http-parser-js-0.4.13.tgz", + "integrity": "sha1-O9bW/ebjFyyTNMOzO2wZPYD+ETc=", + "dev": true + }, + "http-proxy": { + "version": "1.15.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-proxy/-/http-proxy-1.15.2.tgz", + "integrity": "sha1-ZC/cr/5S00SNK9o7AHnpQJBk2jE=", + "dev": true, + "requires": { + "eventemitter3": "1.x.x", + "requires-port": "1.x.x" + } + }, + "http-proxy-middleware": { + "version": "0.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz", + "integrity": "sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==", + "dev": true, + "requires": { + "http-proxy": "^1.16.2", + "is-glob": "^4.0.0", + "lodash": "^4.17.5", + "micromatch": "^3.1.9" + }, + "dependencies": { + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", + "dev": true + }, + "http-proxy": { + "version": "1.17.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-proxy/-/http-proxy-1.17.0.tgz", + "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "dev": true, + "requires": { + "eventemitter3": "^3.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "husky": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/husky/-/husky-1.1.0.tgz", + "integrity": "sha512-jnUD0PK3xGLB5Jc3f3UEwl8qOZeLd0WiWABhVyHPS5R298HOccGZJMOMBSk3gFksAa1BeK9FQYYEfPNlqkfBxg==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.6", + "execa": "^0.9.0", + "find-up": "^3.0.0", + "get-stdin": "^6.0.0", + "is-ci": "^1.2.1", + "pkg-dir": "^3.0.0", + "please-upgrade-node": "^3.1.1", + "read-pkg": "^4.0.1", + "run-node": "^1.0.0", + "slash": "^2.0.0" + }, + "dependencies": { + "execa": { + "version": "0.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/execa/-/execa-0.9.0.tgz", + "integrity": "sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA==", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "read-pkg": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg/-/read-pkg-4.0.1.tgz", + "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", + "dev": true, + "requires": { + "normalize-package-data": "^2.3.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + } + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", + "dev": true + }, + "icss-utils": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/icss-utils/-/icss-utils-2.1.0.tgz", + "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", + "dev": true, + "requires": { + "postcss": "^6.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "ieee754": { + "version": "1.1.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "immutable": { + "version": "3.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/immutable/-/immutable-3.8.2.tgz", + "integrity": "sha1-wkOZUUVbs5kT2vKBN28VMOEErfM=", + "dev": true + }, + "import-local": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "dev": true, + "requires": { + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "inquirer": { + "version": "5.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inquirer/-/inquirer-5.2.0.tgz", + "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.1.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^5.5.2", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "rxjs": { + "version": "5.5.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rxjs/-/rxjs-5.5.12.tgz", + "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "dev": true, + "requires": { + "symbol-observable": "1.0.1" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", + "dev": true + } + } + }, + "insight": { + "version": "0.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/insight/-/insight-0.10.1.tgz", + "integrity": "sha512-kLGeYQkh18f8KuC68QKdi0iwUcIaayJVB/STpX7x452/7pAUm1yfG4giJwcxbrTh0zNYtc8kBR+6maLMOzglOQ==", + "dev": true, + "requires": { + "async": "^2.1.4", + "chalk": "^2.3.0", + "conf": "^1.3.1", + "inquirer": "^5.0.0", + "lodash.debounce": "^4.0.8", + "os-name": "^2.0.1", + "request": "^2.74.0", + "tough-cookie": "^2.0.0", + "uuid": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "conf": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/conf/-/conf-1.4.0.tgz", + "integrity": "sha512-bzlVWS2THbMetHqXKB8ypsXN4DQ/1qopGwNJi1eYbpwesJcd86FBjFciCQX/YwAhp9bM7NVnPFqZ5LpV7gP0Dg==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "env-paths": "^1.0.0", + "make-dir": "^1.0.0", + "pkg-up": "^2.0.0", + "write-file-atomic": "^2.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "internal-ip": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/internal-ip/-/internal-ip-1.2.0.tgz", + "integrity": "sha1-rp+/k7mEh4eF1QqN4bNWlWBYz1w=", + "dev": true, + "requires": { + "meow": "^3.3.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + } + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "into-stream": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "dev": true, + "requires": { + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "ip": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "ipaddr.js": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ipaddr.js/-/ipaddr.js-1.6.0.tgz", + "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=", + "dev": true + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-absolute-url/-/is-absolute-url-2.1.0.tgz", + "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-ci": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "dev": true, + "requires": { + "ci-info": "^1.5.0" + } + }, + "is-color-stop": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-color-stop/-/is-color-stop-1.1.0.tgz", + "integrity": "sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=", + "dev": true, + "requires": { + "css-color-names": "^0.0.4", + "hex-color-regex": "^1.1.0", + "hsl-regex": "^1.0.0", + "hsla-regex": "^1.0.0", + "rgb-regex": "^1.0.1", + "rgba-regex": "^1.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-generator-fn": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-generator-fn/-/is-generator-fn-1.0.0.tgz", + "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", + "dev": true + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-number-like": { + "version": "1.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-number-like/-/is-number-like-1.0.8.tgz", + "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", + "dev": true, + "requires": { + "lodash.isfinite": "^3.3.2" + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-observable": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-observable/-/is-observable-1.1.0.tgz", + "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", + "dev": true, + "requires": { + "symbol-observable": "^1.1.0" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true + }, + "is-scoped": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-scoped/-/is-scoped-1.0.0.tgz", + "integrity": "sha1-RJypgpnnEwOCViieyytUDcQ3yzA=", + "dev": true, + "requires": { + "scoped-regex": "^1.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-svg": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-svg/-/is-svg-2.1.0.tgz", + "integrity": "sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=", + "dev": true, + "requires": { + "html-comment-regex": "^1.1.0" + } + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isbinaryfile": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isbinaryfile/-/isbinaryfile-3.0.3.tgz", + "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", + "dev": true, + "requires": { + "buffer-alloc": "^1.2.0" + } + }, + "isemail": { + "version": "3.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isemail/-/isemail-3.1.2.tgz", + "integrity": "sha512-zfRhJn9rFSGhzU5tGZqepRSAj3+g6oTOHxMGGriWNJZzyLPUK8H7VHpqKntegnW8KLyGA9zwuNaCoopl40LTpg==", + "dev": true, + "requires": { + "punycode": "2.x.x" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-api": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-api/-/istanbul-api-1.3.1.tgz", + "integrity": "sha512-duj6AlLcsWNwUpfyfHt0nWIeRiZpuShnP40YTxOGQgtaN8fd6JYSxsvxUphTDy8V5MfDXo4s/xVCIIvVCO808g==", + "dev": true, + "requires": { + "async": "^2.1.4", + "compare-versions": "^3.1.0", + "fileset": "^2.0.2", + "istanbul-lib-coverage": "^1.2.0", + "istanbul-lib-hook": "^1.2.0", + "istanbul-lib-instrument": "^1.10.1", + "istanbul-lib-report": "^1.1.4", + "istanbul-lib-source-maps": "^1.2.4", + "istanbul-reports": "^1.3.0", + "js-yaml": "^3.7.0", + "mkdirp": "^0.5.1", + "once": "^1.4.0" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz", + "integrity": "sha512-8O2T/3VhrQHn0XcJbP1/GN7kXMiRAlPi+fj3uEHrjBD8Oz7Py0prSC25C09NuAZS6bgW1NNKAvCSHZXB0irSGA==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "istanbul-lib-coverage": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz", + "integrity": "sha512-eLAMkPG9FU0v5L02lIkcj/2/Zlz9OuluaXikdr5iStk8FDbSwAixTK9TkYxbF0eNnzAJTwM2fkV2A1tpsIp4Jg==", + "dev": true, + "requires": { + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", + "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", + "dev": true, + "requires": { + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.2.0", + "semver": "^5.3.0" + } + }, + "istanbul-lib-report": { + "version": "1.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz", + "integrity": "sha512-Azqvq5tT0U09nrncK3q82e/Zjkxa4tkFZv7E6VcqP0QCPn6oNljDPfrZEC/umNXds2t7b8sRJfs6Kmpzt8m2kA==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" + }, + "dependencies": { + "supports-color": { + "version": "3.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz", + "integrity": "sha512-fDa0hwU/5sDXwAklXgAoCJCOsFsBplVQ6WBldz5UwaqOzmDhUK4nfuR7/G//G2lERlblUNJB8P6e8cXq3a7MlA==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.1.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istanbul-reports/-/istanbul-reports-1.3.0.tgz", + "integrity": "sha512-y2Z2IMqE1gefWUaVjrBm0mSKvUkaBy9Vqz8iwr/r40Y9hBbIteH5wqHG/9DLTfJ9xUnUT2j7A3+VVJ6EaYBllA==", + "dev": true, + "requires": { + "handlebars": "^4.0.3" + } + }, + "istextorbinary": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istextorbinary/-/istextorbinary-2.2.1.tgz", + "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", + "dev": true, + "requires": { + "binaryextensions": "2", + "editions": "^1.3.3", + "textextensions": "2" + } + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "jasmine-diff": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jasmine-diff/-/jasmine-diff-0.1.3.tgz", + "integrity": "sha1-k8zC3MQQKMXd1GBlWAdIOfLe6qg=", + "dev": true, + "requires": { + "diff": "^3.2.0" + } + }, + "jest": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest/-/jest-22.4.3.tgz", + "integrity": "sha512-FFCdU/pXOEASfHxFDOWUysI/+FFoqiXJADEIXgDKuZyqSmBD3tZ4BEGH7+M79v7czj7bbkhwtd2LaEDcJiM/GQ==", + "dev": true, + "requires": { + "import-local": "^1.0.0", + "jest-cli": "^22.4.3" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "jest-cli": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-cli/-/jest-cli-22.4.3.tgz", + "integrity": "sha512-IiHybF0DJNqZPsbjn4Cy4vcqcmImpoFwNFnkehzVw8lTUSl4axZh5DHewu5bdpZF2Y5gUqFKYzH0FH4Qx2k+UA==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "import-local": "^1.0.0", + "is-ci": "^1.0.10", + "istanbul-api": "^1.1.14", + "istanbul-lib-coverage": "^1.1.1", + "istanbul-lib-instrument": "^1.8.0", + "istanbul-lib-source-maps": "^1.2.1", + "jest-changed-files": "^22.4.3", + "jest-config": "^22.4.3", + "jest-environment-jsdom": "^22.4.3", + "jest-get-type": "^22.4.3", + "jest-haste-map": "^22.4.3", + "jest-message-util": "^22.4.3", + "jest-regex-util": "^22.4.3", + "jest-resolve-dependencies": "^22.4.3", + "jest-runner": "^22.4.3", + "jest-runtime": "^22.4.3", + "jest-snapshot": "^22.4.3", + "jest-util": "^22.4.3", + "jest-validate": "^22.4.3", + "jest-worker": "^22.4.3", + "micromatch": "^2.3.11", + "node-notifier": "^5.2.1", + "realpath-native": "^1.0.0", + "rimraf": "^2.5.4", + "slash": "^1.0.0", + "string-length": "^2.0.0", + "strip-ansi": "^4.0.0", + "which": "^1.2.12", + "yargs": "^10.0.3" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "10.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-10.1.2.tgz", + "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^8.1.0" + } + }, + "yargs-parser": { + "version": "8.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-8.1.0.tgz", + "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "jest-changed-files": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-changed-files/-/jest-changed-files-22.4.3.tgz", + "integrity": "sha512-83Dh0w1aSkUNFhy5d2dvqWxi/y6weDwVVLU6vmK0cV9VpRxPzhTeGimbsbRDSnEoszhF937M4sDLLeS7Cu/Tmw==", + "dev": true, + "requires": { + "throat": "^4.0.0" + } + }, + "jest-config": { + "version": "22.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-config/-/jest-config-22.4.4.tgz", + "integrity": "sha512-9CKfo1GC4zrXSoMLcNeDvQBfgtqGTB1uP8iDIZ97oB26RCUb886KkKWhVcpyxVDOUxbhN+uzcBCeFe7w+Iem4A==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^22.4.1", + "jest-environment-node": "^22.4.1", + "jest-get-type": "^22.1.0", + "jest-jasmine2": "^22.4.4", + "jest-regex-util": "^22.1.0", + "jest-resolve": "^22.4.2", + "jest-util": "^22.4.1", + "jest-validate": "^22.4.4", + "pretty-format": "^22.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-diff": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-diff/-/jest-diff-22.4.3.tgz", + "integrity": "sha512-/QqGvCDP5oZOF6PebDuLwrB2BMD8ffJv6TAGAdEVuDx1+uEgrHpSFrfrOiMRx2eJ1hgNjlQrOQEHetVwij90KA==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "diff": "^3.2.0", + "jest-get-type": "^22.4.3", + "pretty-format": "^22.4.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-docblock": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-docblock/-/jest-docblock-22.4.3.tgz", + "integrity": "sha512-uPKBEAw7YrEMcXueMKZXn/rbMxBiSv48fSqy3uEnmgOlQhSX+lthBqHb1fKWNVmFqAp9E/RsSdBfiV31LbzaOg==", + "dev": true, + "requires": { + "detect-newline": "^2.1.0" + } + }, + "jest-environment-jsdom": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-environment-jsdom/-/jest-environment-jsdom-22.4.3.tgz", + "integrity": "sha512-FviwfR+VyT3Datf13+ULjIMO5CSeajlayhhYQwpzgunswoaLIPutdbrnfUHEMyJCwvqQFaVtTmn9+Y8WCt6n1w==", + "dev": true, + "requires": { + "jest-mock": "^22.4.3", + "jest-util": "^22.4.3", + "jsdom": "^11.5.1" + } + }, + "jest-environment-node": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-environment-node/-/jest-environment-node-22.4.3.tgz", + "integrity": "sha512-reZl8XF6t/lMEuPWwo9OLfttyC26A5AMgDyEQ6DBgZuyfyeNUzYT8BFo6uxCCP/Av/b7eb9fTi3sIHFPBzmlRA==", + "dev": true, + "requires": { + "jest-mock": "^22.4.3", + "jest-util": "^22.4.3" + } + }, + "jest-get-type": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-get-type/-/jest-get-type-22.4.3.tgz", + "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", + "dev": true + }, + "jest-haste-map": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-haste-map/-/jest-haste-map-22.4.3.tgz", + "integrity": "sha512-4Q9fjzuPVwnaqGKDpIsCSoTSnG3cteyk2oNVjBX12HHOaF1oxql+uUiqZb5Ndu7g/vTZfdNwwy4WwYogLh29DQ==", + "dev": true, + "requires": { + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.1.11", + "jest-docblock": "^22.4.3", + "jest-serializer": "^22.4.3", + "jest-worker": "^22.4.3", + "micromatch": "^2.3.11", + "sane": "^2.0.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, + "jest-jasmine2": { + "version": "22.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-jasmine2/-/jest-jasmine2-22.4.4.tgz", + "integrity": "sha512-nK3vdUl50MuH7vj/8at7EQVjPGWCi3d5+6aCi7Gxy/XMWdOdbH1qtO/LjKbqD8+8dUAEH+BVVh7HkjpCWC1CSw==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^22.4.0", + "graceful-fs": "^4.1.11", + "is-generator-fn": "^1.0.0", + "jest-diff": "^22.4.0", + "jest-matcher-utils": "^22.4.0", + "jest-message-util": "^22.4.0", + "jest-snapshot": "^22.4.0", + "jest-util": "^22.4.1", + "source-map-support": "^0.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-junit": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-junit/-/jest-junit-5.1.0.tgz", + "integrity": "sha512-3EVf1puv2ox5wybQDfLX3AEn3IKOgDV4E76y4pO2hBu46DEtAFZZAm//X1pzPQpqKji0zqgMIzqzF/K+uGAX9A==", + "dev": true, + "requires": { + "jest-validate": "^23.0.1", + "mkdirp": "^0.5.1", + "strip-ansi": "^4.0.0", + "xml": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "jest-validate": { + "version": "23.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-validate/-/jest-validate-23.6.0.tgz", + "integrity": "sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-get-type": "^22.1.0", + "leven": "^2.1.0", + "pretty-format": "^23.6.0" + } + }, + "pretty-format": { + "version": "23.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-format/-/pretty-format-23.6.0.tgz", + "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-leak-detector": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-leak-detector/-/jest-leak-detector-22.4.3.tgz", + "integrity": "sha512-NZpR/Ls7+ndO57LuXROdgCGz2RmUdC541tTImL9bdUtU3WadgFGm0yV+Ok4Fuia/1rLAn5KaJ+i76L6e3zGJYQ==", + "dev": true, + "requires": { + "pretty-format": "^22.4.3" + } + }, + "jest-matcher-utils": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-matcher-utils/-/jest-matcher-utils-22.4.3.tgz", + "integrity": "sha512-lsEHVaTnKzdAPR5t4B6OcxXo9Vy4K+kRRbG5gtddY8lBEC+Mlpvm1CJcsMESRjzUhzkz568exMV1hTB76nAKbA==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-get-type": "^22.4.3", + "pretty-format": "^22.4.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-message-util": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-message-util/-/jest-message-util-22.4.3.tgz", + "integrity": "sha512-iAMeKxhB3Se5xkSjU0NndLLCHtP4n+GtCqV0bISKA5dmOXQfEbdEmYiu2qpnWBDCQdEafNDDU6Q+l6oBMd/+BA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0-beta.35", + "chalk": "^2.0.1", + "micromatch": "^2.3.11", + "slash": "^1.0.0", + "stack-utils": "^1.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-mock": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-mock/-/jest-mock-22.4.3.tgz", + "integrity": "sha512-+4R6mH5M1G4NK16CKg9N1DtCaFmuxhcIqF4lQK/Q1CIotqMs/XBemfpDPeVZBFow6iyUNu6EBT9ugdNOTT5o5Q==", + "dev": true + }, + "jest-preset-angular": { + "version": "5.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-preset-angular/-/jest-preset-angular-5.2.2.tgz", + "integrity": "sha1-zeqSwaABBsRGCB1lQrbFoPjcn+w=", + "dev": true, + "requires": { + "@types/jest": "^22.1.3", + "jest-zone-patch": "^0.0.8", + "ts-jest": "^22.4.1" + } + }, + "jest-regex-util": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-regex-util/-/jest-regex-util-22.4.3.tgz", + "integrity": "sha512-LFg1gWr3QinIjb8j833bq7jtQopiwdAs67OGfkPrvy7uNUbVMfTXXcOKXJaeY5GgjobELkKvKENqq1xrUectWg==", + "dev": true + }, + "jest-resolve": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-resolve/-/jest-resolve-22.4.3.tgz", + "integrity": "sha512-u3BkD/MQBmwrOJDzDIaxpyqTxYH+XqAXzVJP51gt29H8jpj3QgKof5GGO2uPGKGeA1yTMlpbMs1gIQ6U4vcRhw==", + "dev": true, + "requires": { + "browser-resolve": "^1.11.2", + "chalk": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-resolve-dependencies": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-resolve-dependencies/-/jest-resolve-dependencies-22.4.3.tgz", + "integrity": "sha512-06czCMVToSN8F2U4EvgSB1Bv/56gc7MpCftZ9z9fBgUQM7dzHGCMBsyfVA6dZTx8v0FDcnALf7hupeQxaBCvpA==", + "dev": true, + "requires": { + "jest-regex-util": "^22.4.3" + } + }, + "jest-runner": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-runner/-/jest-runner-22.4.3.tgz", + "integrity": "sha512-U7PLlQPRlWNbvOHWOrrVay9sqhBJmiKeAdKIkvX4n1G2tsvzLlf77nBD28GL1N6tGv4RmuTfI8R8JrkvCa+IBg==", + "dev": true, + "requires": { + "exit": "^0.1.2", + "jest-config": "^22.4.3", + "jest-docblock": "^22.4.3", + "jest-haste-map": "^22.4.3", + "jest-jasmine2": "^22.4.3", + "jest-leak-detector": "^22.4.3", + "jest-message-util": "^22.4.3", + "jest-runtime": "^22.4.3", + "jest-util": "^22.4.3", + "jest-worker": "^22.4.3", + "throat": "^4.0.0" + } + }, + "jest-runtime": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-runtime/-/jest-runtime-22.4.3.tgz", + "integrity": "sha512-Eat/esQjevhx9BgJEC8udye+FfoJ2qvxAZfOAWshYGS22HydHn5BgsvPdTtt9cp0fSl5LxYOFA1Pja9Iz2Zt8g==", + "dev": true, + "requires": { + "babel-core": "^6.0.0", + "babel-jest": "^22.4.3", + "babel-plugin-istanbul": "^4.1.5", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "exit": "^0.1.2", + "graceful-fs": "^4.1.11", + "jest-config": "^22.4.3", + "jest-haste-map": "^22.4.3", + "jest-regex-util": "^22.4.3", + "jest-resolve": "^22.4.3", + "jest-util": "^22.4.3", + "jest-validate": "^22.4.3", + "json-stable-stringify": "^1.0.1", + "micromatch": "^2.3.11", + "realpath-native": "^1.0.0", + "slash": "^1.0.0", + "strip-bom": "3.0.0", + "write-file-atomic": "^2.1.0", + "yargs": "^10.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "10.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-10.1.2.tgz", + "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^8.1.0" + } + }, + "yargs-parser": { + "version": "8.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-8.1.0.tgz", + "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "jest-serializer": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-serializer/-/jest-serializer-22.4.3.tgz", + "integrity": "sha512-uPaUAppx4VUfJ0QDerpNdF43F68eqKWCzzhUlKNDsUPhjOon7ZehR4C809GCqh765FoMRtTVUVnGvIoskkYHiw==", + "dev": true + }, + "jest-snapshot": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-snapshot/-/jest-snapshot-22.4.3.tgz", + "integrity": "sha512-JXA0gVs5YL0HtLDCGa9YxcmmV2LZbwJ+0MfyXBBc5qpgkEYITQFJP7XNhcHFbUvRiniRpRbGVfJrOoYhhGE0RQ==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-diff": "^22.4.3", + "jest-matcher-utils": "^22.4.3", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^22.4.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-sonar-reporter": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz", + "integrity": "sha512-ZervDCgEX5gdUbdtWsjdipLN3bKJwpxbvhkYNXTAYvAckCihobSLr9OT/IuyNIRT1EZMDDwR6DroWtrq+IL64w==", + "dev": true, + "requires": { + "xml": "^1.0.1" + } + }, + "jest-util": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-util/-/jest-util-22.4.3.tgz", + "integrity": "sha512-rfDfG8wyC5pDPNdcnAlZgwKnzHvZDu8Td2NJI/jAGKEGxJPYiE4F0ss/gSAkG4778Y23Hvbz+0GMrDJTeo7RjQ==", + "dev": true, + "requires": { + "callsites": "^2.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.11", + "is-ci": "^1.0.10", + "jest-message-util": "^22.4.3", + "mkdirp": "^0.5.1", + "source-map": "^0.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-validate": { + "version": "22.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-validate/-/jest-validate-22.4.4.tgz", + "integrity": "sha512-dmlf4CIZRGvkaVg3fa0uetepcua44DHtktHm6rcoNVtYlpwe6fEJRkMFsaUVcFHLzbuBJ2cPw9Gl9TKfnzMVwg==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-config": "^22.4.4", + "jest-get-type": "^22.1.0", + "leven": "^2.1.0", + "pretty-format": "^22.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-worker": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-worker/-/jest-worker-22.4.3.tgz", + "integrity": "sha512-B1ucW4fI8qVAuZmicFxI1R3kr2fNeYJyvIQ1rKcuLYnenFV5K5aMbxFj6J0i00Ju83S8jP2d7Dz14+AvbIHRYQ==", + "dev": true, + "requires": { + "merge-stream": "^1.0.1" + } + }, + "jest-zone-patch": { + "version": "0.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-zone-patch/-/jest-zone-patch-0.0.8.tgz", + "integrity": "sha1-kPo7W2DpWtPmJN0sPrWbsdyr03E=", + "dev": true + }, + "jhipster-core": { + "version": "3.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jhipster-core/-/jhipster-core-3.4.0.tgz", + "integrity": "sha512-iVJ6MF4jlpvtVL5gbn9t4Jw27RodjY04SXYSGfTLAzHyQRMmehHLvNq/3DBjVwHgBrDn1u2k17oLGouJus9MhA==", + "dev": true, + "requires": { + "chevrotain": "4.1.0", + "fs-extra": "7.0.0", + "lodash": "4.17.11", + "winston": "3.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "7.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs-extra/-/fs-extra-7.0.0.tgz", + "integrity": "sha512-EglNDLRpmaTWiD/qraZn6HREAEAHJcJOmxNEYwq6xeMKnVMAy3GUcFB+wXt2C6k4CNvB/mP1y/U3dzvKKj5OtQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "joi": { + "version": "11.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/joi/-/joi-11.4.0.tgz", + "integrity": "sha512-O7Uw+w/zEWgbL6OcHbyACKSj0PkQeUgmehdoXVSxt92QFCq4+1390Rwh5moI2K/OgC7D8RHRZqHZxT2husMJHA==", + "dev": true, + "requires": { + "hoek": "4.x.x", + "isemail": "3.x.x", + "topo": "2.x.x" + } + }, + "js-base64": { + "version": "2.4.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-base64/-/js-base64-2.4.5.tgz", + "integrity": "sha512-aUnNwqMOXw3yvErjMPSQu6qIIzUmT1e5KcU1OZxRDU1g/am6mzBvcrmLAYwzmB59BHPrh5/tKaiF4OPhqRWESQ==", + "dev": true + }, + "js-object-pretty-print": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-object-pretty-print/-/js-object-pretty-print-0.3.0.tgz", + "integrity": "sha1-RnDkUAZu4ezPNRdMfRl/WqOLz3Q=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-yaml/-/js-yaml-3.7.0.tgz", + "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^2.6.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jscodeshift": { + "version": "0.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jscodeshift/-/jscodeshift-0.5.0.tgz", + "integrity": "sha512-JAcQINNMFpdzzpKJN8k5xXjF3XDuckB1/48uScSzcnNyK199iWEc9AxKL9OoX5144M2w5zEx9Qs4/E/eBZZUlw==", + "dev": true, + "requires": { + "babel-plugin-transform-flow-strip-types": "^6.8.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-1": "^6.5.0", + "babel-register": "^6.9.0", + "babylon": "^7.0.0-beta.30", + "colors": "^1.1.2", + "flow-parser": "^0.*", + "lodash": "^4.13.1", + "micromatch": "^2.3.7", + "neo-async": "^2.5.0", + "node-dir": "0.1.8", + "nomnom": "^1.8.1", + "recast": "^0.14.1", + "temp": "^0.8.1", + "write-file-atomic": "^1.2.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "ast-types": { + "version": "0.11.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ast-types/-/ast-types-0.11.3.tgz", + "integrity": "sha512-XA5o5dsNw8MhyW0Q7MWXJWc4oOzZKbdsEJq45h7c8q/d9DwWZ5F2ugUc1PuMLPGsUnphCt/cNDHu8JeBbxf1qA==", + "dev": true + }, + "babylon": { + "version": "7.0.0-beta.47", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/babylon/-/babylon-7.0.0-beta.47.tgz", + "integrity": "sha512-+rq2cr4GDhtToEzKFD6KZZMDBXhjFAr9JjPw9pAppZACeEWqNM294j+NdBzkSHYXwzzBmVjZ3nEVJlOhbR2gOQ==", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "recast": { + "version": "0.14.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/recast/-/recast-0.14.7.tgz", + "integrity": "sha512-/nwm9pkrcWagN40JeJhkPaRxiHXBRkXyRh/hgU088Z/v+qCy+zIHHY6bC6o7NaKAxPqtE6nD8zBH1LfU0/Wx6A==", + "dev": true, + "requires": { + "ast-types": "0.11.3", + "esprima": "~4.0.0", + "private": "~0.1.5", + "source-map": "~0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + } + } + }, + "jsdom": { + "version": "11.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsdom/-/jsdom-11.9.0.tgz", + "integrity": "sha512-sb3omwJTJ+HwAltLZevM/KQBusY+l2Ar5UfnTCWk9oUVBiDnQPBNiG1BaTAKttCnneonYbNo7vi4EFDY2lBfNA==", + "dev": true, + "requires": { + "abab": "^1.0.4", + "acorn": "^5.3.0", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": ">= 0.2.37 < 0.3.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.0", + "escodegen": "^1.9.0", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.2.0", + "nwmatcher": "^1.4.3", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.83.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.3", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.0", + "ws": "^4.0.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "parse5": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "ws": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ws/-/ws-4.1.0.tgz", + "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0" + } + } + } + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-loader": { + "version": "0.5.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-loader/-/json-loader-0.5.4.tgz", + "integrity": "sha1-i6oTZaYy9Yo8RtIBdfxgAsluN94=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsonfile/-/jsonfile-3.0.1.tgz", + "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jstransform": { + "version": "11.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jstransform/-/jstransform-11.0.3.tgz", + "integrity": "sha1-CaeJk+CuTU70SH9hVakfYZDLQiM=", + "dev": true, + "requires": { + "base62": "^1.1.0", + "commoner": "^0.10.1", + "esprima-fb": "^15001.1.0-dev-harmony-fb", + "object-assign": "^2.0.0", + "source-map": "^0.4.2" + }, + "dependencies": { + "esprima-fb": { + "version": "15001.1.0-dev-harmony-fb", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz", + "integrity": "sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE=", + "dev": true + }, + "object-assign": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-assign/-/object-assign-2.1.1.tgz", + "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "keyv": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "killable": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/killable/-/killable-1.0.0.tgz", + "integrity": "sha1-2ouEvUfeU5WHj5XWTQLyRJ/gXms=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "kuler": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kuler/-/kuler-1.0.1.tgz", + "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", + "dev": true, + "requires": { + "colornames": "^1.1.1" + } + }, + "last-call-webpack-plugin": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz", + "integrity": "sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w==", + "dev": true, + "requires": { + "lodash": "^4.17.5", + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "leb": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/leb/-/leb-0.3.0.tgz", + "integrity": "sha1-Mr7p+tFoMo1q6oUi2DP0GA7tHaM=", + "dev": true + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": true + }, + "leven": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "limiter": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/limiter/-/limiter-1.1.3.tgz", + "integrity": "sha512-zrycnIMsLw/3ZxTbW7HCez56rcFGecWTx5OZNplzcXUUmJLmoYArC6qdJzmAN5BWiNXGcpjhF9RQ1HSv5zebEw==", + "dev": true + }, + "lint-staged": { + "version": "7.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lint-staged/-/lint-staged-7.3.0.tgz", + "integrity": "sha512-AXk40M9DAiPi7f4tdJggwuKIViUplYtVj1os1MVEteW7qOkU50EOehayCfO9TsoGK24o/EsWb41yrEgfJDDjCw==", + "dev": true, + "requires": { + "chalk": "^2.3.1", + "commander": "^2.14.1", + "cosmiconfig": "^5.0.2", + "debug": "^3.1.0", + "dedent": "^0.7.0", + "execa": "^0.9.0", + "find-parent-dir": "^0.3.0", + "is-glob": "^4.0.0", + "is-windows": "^1.0.2", + "jest-validate": "^23.5.0", + "listr": "^0.14.1", + "lodash": "^4.17.5", + "log-symbols": "^2.2.0", + "micromatch": "^3.1.8", + "npm-which": "^3.0.1", + "p-map": "^1.1.1", + "path-is-inside": "^1.0.2", + "pify": "^3.0.0", + "please-upgrade-node": "^3.0.2", + "staged-git-files": "1.1.1", + "string-argv": "^0.0.2", + "stringify-object": "^3.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "execa": { + "version": "0.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/execa/-/execa-0.9.0.tgz", + "integrity": "sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA==", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "jest-validate": { + "version": "23.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jest-validate/-/jest-validate-23.6.0.tgz", + "integrity": "sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-get-type": "^22.1.0", + "leven": "^2.1.0", + "pretty-format": "^23.6.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pretty-format": { + "version": "23.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-format/-/pretty-format-23.6.0.tgz", + "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "listr": { + "version": "0.14.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/listr/-/listr-0.14.2.tgz", + "integrity": "sha512-vmaNJ1KlGuGWShHI35X/F8r9xxS0VTHh9GejVXwSN20fG5xpq3Jh4bJbnumoT6q5EDM/8/YP1z3YMtQbFmhuXw==", + "dev": true, + "requires": { + "@samverschueren/stream-to-observable": "^0.3.0", + "is-observable": "^1.1.0", + "is-promise": "^2.1.0", + "is-stream": "^1.1.0", + "listr-silent-renderer": "^1.1.1", + "listr-update-renderer": "^0.4.0", + "listr-verbose-renderer": "^0.4.0", + "p-map": "^1.1.1", + "rxjs": "^6.1.0" + } + }, + "listr-silent-renderer": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", + "integrity": "sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4=", + "dev": true + }, + "listr-update-renderer": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz", + "integrity": "sha1-NE2YDaLKLosUW6MFkI8yrj9MyKc=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "elegant-spinner": "^1.0.1", + "figures": "^1.7.0", + "indent-string": "^3.0.0", + "log-symbols": "^1.0.2", + "log-update": "^1.0.2", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "figures": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "dev": true, + "requires": { + "chalk": "^1.0.0" + } + } + } + }, + "listr-verbose-renderer": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", + "integrity": "sha1-ggb0z21S3cWCfl/RSYng6WWTOjU=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "cli-cursor": "^1.0.2", + "date-fns": "^1.27.2", + "figures": "^1.7.0" + }, + "dependencies": { + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + } + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "loader-runner": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loader-runner/-/loader-runner-2.3.0.tgz", + "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "localtunnel": { + "version": "1.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/localtunnel/-/localtunnel-1.9.0.tgz", + "integrity": "sha512-wCIiIHJ8kKIcWkTQE3m1VRABvsH2ZuOkiOpZUofUCf6Q42v3VIZ+Q0YfX1Z4sYDRj0muiKL1bLvz1FeoxsPO0w==", + "dev": true, + "requires": { + "axios": "0.17.1", + "debug": "2.6.8", + "openurl": "1.1.1", + "yargs": "6.6.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "debug": { + "version": "2.6.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "yargs": { + "version": "6.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-6.6.0.tgz", + "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^4.2.0" + } + }, + "yargs-parser": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-4.2.1.tgz", + "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + } + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true + }, + "lodash.endswith": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.endswith/-/lodash.endswith-4.2.1.tgz", + "integrity": "sha1-/tWawXOO0+I27dcGTsRWRIs3vAk=", + "dev": true + }, + "lodash.isfinite": { + "version": "3.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", + "integrity": "sha1-+4m2WpqAKBgz8LdHizpRBPiY67M=", + "dev": true + }, + "lodash.isfunction": { + "version": "3.0.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", + "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==", + "dev": true + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.pad": { + "version": "4.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.pad/-/lodash.pad-4.5.1.tgz", + "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA=", + "dev": true + }, + "lodash.padend": { + "version": "4.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", + "dev": true + }, + "lodash.padstart": { + "version": "4.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.padstart/-/lodash.padstart-4.6.1.tgz", + "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "lodash.startswith": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.startswith/-/lodash.startswith-4.2.1.tgz", + "integrity": "sha1-xZjErc4YiiflMUVzHNxsDnF3YAw=", + "dev": true + }, + "lodash.tail": { + "version": "4.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.tail/-/lodash.tail-4.1.1.tgz", + "integrity": "sha1-0jM6NtnncXyK0vfKyv7HwytERmQ=", + "dev": true + }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "dev": true, + "requires": { + "lodash._reinterpolate": "~3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "dev": true, + "requires": { + "lodash._reinterpolate": "~3.0.0" + } + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "log-update": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/log-update/-/log-update-1.0.2.tgz", + "integrity": "sha1-GZKfZMQJPS0ucHWh2tivWcKWuNE=", + "dev": true, + "requires": { + "ansi-escapes": "^1.0.0", + "cli-cursor": "^1.0.2" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + } + } + }, + "logform": { + "version": "1.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/logform/-/logform-1.10.0.tgz", + "integrity": "sha512-em5ojIhU18fIMOw/333mD+ZLE2fis0EzXl1ZwHx4iQzmpQi6odNiY/t+ITNr33JZhT9/KEaH+UPIipr6a9EjWg==", + "dev": true, + "requires": { + "colors": "^1.2.1", + "fast-safe-stringify": "^2.0.4", + "fecha": "^2.3.3", + "ms": "^2.1.1", + "triple-beam": "^1.2.0" + }, + "dependencies": { + "colors": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colors/-/colors-1.3.2.tgz", + "integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "loglevel": { + "version": "1.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loglevel/-/loglevel-1.6.1.tgz", + "integrity": "sha1-4PyVEztu8nbNyIh82vJKpvFW+Po=", + "dev": true + }, + "loglevelnext": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loglevelnext/-/loglevelnext-1.0.5.tgz", + "integrity": "sha512-V/73qkPuJmx4BcBF19xPBr+0ZRVBhc4POxvZTZdMeXpJ4NItXSJ/MSwuFT0kQJlCbXvdlZoQQ/418bS1y9Jh6A==", + "dev": true, + "requires": { + "es6-symbol": "^3.1.1", + "object.assign": "^4.1.0" + } + }, + "long": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "^3.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lower-case": { + "version": "1.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", + "dev": true + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "macaddress": { + "version": "0.2.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/macaddress/-/macaddress-0.2.8.tgz", + "integrity": "sha1-WQTcU3w57G2+/q6QIycTX6hRHxI=", + "dev": true + }, + "macos-release": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/macos-release/-/macos-release-1.1.0.tgz", + "integrity": "sha512-mmLbumEYMi5nXReB9js3WGsB8UE6cDBWyIO62Z4DNx6GbRhDxHNjA1MlzSpJ2S2KM1wyiPRA0d19uHWYYvMHjA==", + "dev": true + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.x" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-expression-evaluator": { + "version": "1.2.17", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", + "integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=", + "dev": true + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "mdn-data": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mdn-data/-/mdn-data-1.2.0.tgz", + "integrity": "sha512-esDqNvsJB2q5V28+u7NdtdMg6Rmg4khQmAVSjUiX7BY/7haIv0K2yWM43hYp0or+3nvG7+UaTF1JHz31hgU1TA==", + "dev": true + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "mem": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "mem-fs": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem-fs/-/mem-fs-1.1.3.tgz", + "integrity": "sha1-uK6NLj/Lb10/kWXBLUVRoGXZicw=", + "dev": true, + "requires": { + "through2": "^2.0.0", + "vinyl": "^1.1.0", + "vinyl-file": "^2.0.0" + } + }, + "mem-fs-editor": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem-fs-editor/-/mem-fs-editor-5.1.0.tgz", + "integrity": "sha512-2Yt2GCYEbcotYbIJagmow4gEtHDqzpq5XN94+yAx/NT5+bGqIjkXnm3KCUQfE6kRfScGp9IZknScoGRKu8L78w==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "deep-extend": "^0.6.0", + "ejs": "^2.5.9", + "glob": "^7.0.3", + "globby": "^8.0.1", + "isbinaryfile": "^3.0.2", + "mkdirp": "^0.5.0", + "multimatch": "^2.0.0", + "rimraf": "^2.2.8", + "through2": "^2.0.0", + "vinyl": "^2.0.1" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "globby": { + "version": "8.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "vinyl": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + } + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "meow": { + "version": "5.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "merge": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/merge/-/merge-1.2.0.tgz", + "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "dev": true + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge-jsons-webpack-plugin": { + "version": "1.0.14", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/merge-jsons-webpack-plugin/-/merge-jsons-webpack-plugin-1.0.14.tgz", + "integrity": "sha1-VA56m+2uQbz5MRscg0WgpjD2UYk=", + "dev": true, + "requires": { + "es6-promise": "4.0.5", + "glob": "7.1.1", + "json-loader": "0.5.4" + }, + "dependencies": { + "glob": { + "version": "7.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "merge2": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/merge2/-/merge2-1.2.3.tgz", + "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "dev": true + }, + "mime-db": { + "version": "1.36.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime-db/-/mime-db-1.36.0.tgz", + "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "dev": true + }, + "mime-types": { + "version": "2.1.20", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime-types/-/mime-types-2.1.20.tgz", + "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "dev": true, + "requires": { + "mime-db": "~1.36.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "mini-css-extract-plugin": { + "version": "0.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.2.tgz", + "integrity": "sha512-ots7URQH4wccfJq9Ssrzu2+qupbncAce4TmTzunI9CIwlQMp2XI+WNUw6xWF6MMAGAm1cbUVINrSjATaVMyKXg==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "schema-utils": "^1.0.0", + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^2.0.1", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mixin-object": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mixin-object/-/mixin-object-2.0.1.tgz", + "integrity": "sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4=", + "dev": true, + "requires": { + "for-in": "^0.1.3", + "is-extendable": "^0.1.1" + }, + "dependencies": { + "for-in": { + "version": "0.1.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/for-in/-/for-in-0.1.8.tgz", + "integrity": "sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE=", + "dev": true + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "moment": { + "version": "2.22.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + }, + "moment-locales-webpack-plugin": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/moment-locales-webpack-plugin/-/moment-locales-webpack-plugin-1.0.5.tgz", + "integrity": "sha512-33jWmbPQmIFLzHV+lQ2o5pPSDjc8C7tgRcIhiYPsXwq+X/8W5MEqBIcUQuaS4je0VRZb2tO1gl9C7NBeUKnonQ==", + "dev": true, + "requires": { + "lodash.difference": "^4.5.0" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multicast-dns": { + "version": "6.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/multicast-dns/-/multicast-dns-6.2.3.tgz", + "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", + "dev": true, + "requires": { + "dns-packet": "^1.3.1", + "thunky": "^1.0.2" + } + }, + "multicast-dns-service-types": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", + "dev": true + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, + "neo-async": { + "version": "2.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/neo-async/-/neo-async-2.5.1.tgz", + "integrity": "sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "ng-jhipster": { + "version": "0.5.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ng-jhipster/-/ng-jhipster-0.5.4.tgz", + "integrity": "sha512-1+rWT1p04anBWpN/BkYMnnFI6jXOqZjswYgZw2VjH2I79Giyg4bDLXFvaDbPawEUFc0p3W2r0OqdaLUcudOfrw==", + "requires": { + "@ngx-translate/core": "^10.0.1", + "@ngx-translate/http-loader": "^3.0.1" + } + }, + "ngx-cookie": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ngx-cookie/-/ngx-cookie-2.0.1.tgz", + "integrity": "sha512-3+agXZkoPxRP3IyELf7Eiuhk6TX+EAX974kkCR6Xjm+N7boEA+Fin2Q90AAE4XZzY48skkVzLH96TOikb5yU3g==" + }, + "ngx-infinite-scroll": { + "version": "0.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ngx-infinite-scroll/-/ngx-infinite-scroll-0.5.1.tgz", + "integrity": "sha1-3ZRSxgL/fDIi8MoWhIGqFBQChrc=" + }, + "ngx-webstorage": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ngx-webstorage/-/ngx-webstorage-2.0.1.tgz", + "integrity": "sha512-AhBkl1v5sBLYiGC1DuHxM90B8OewqyhYhm+KGtJIFxMh5dj3tlNgPokmWCtKcUZF26m8MgxDDuP5e6NeDCpYQw==" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "no-case": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "dev": true, + "requires": { + "lower-case": "^1.1.1" + } + }, + "node-dir": { + "version": "0.1.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/node-dir/-/node-dir-0.1.8.tgz", + "integrity": "sha1-VfuN62mQcHB/tn+RpGDwRIKUx30=", + "dev": true + }, + "node-forge": { + "version": "0.7.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/node-forge/-/node-forge-0.7.5.tgz", + "integrity": "sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ==", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-libs-browser": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^1.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.0", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.10.3", + "vm-browserify": "0.0.4" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "node-notifier": { + "version": "5.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/node-notifier/-/node-notifier-5.2.1.tgz", + "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "semver": "^5.4.1", + "shellwords": "^0.1.1", + "which": "^1.3.0" + } + }, + "node-releases": { + "version": "1.0.0-alpha.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/node-releases/-/node-releases-1.0.0-alpha.11.tgz", + "integrity": "sha512-CaViu+2FqTNYOYNihXa5uPS/zry92I3vPU4nCB6JB3OeZ2UGtOpF5gRwuN4+m3hbEcL47bOXyun1jX2iC+3uEQ==", + "dev": true, + "requires": { + "semver": "^5.3.0" + } + }, + "nomnom": { + "version": "1.8.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nomnom/-/nomnom-1.8.1.tgz", + "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", + "dev": true, + "requires": { + "chalk": "~0.4.0", + "underscore": "~1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", + "dev": true + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "dev": true, + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true + }, + "normalize-url": { + "version": "1.9.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-url/-/normalize-url-1.9.1.tgz", + "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "prepend-http": "^1.0.0", + "query-string": "^4.1.0", + "sort-keys": "^1.0.0" + } + }, + "npm-package-arg": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npm-package-arg/-/npm-package-arg-6.1.0.tgz", + "integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.6.0", + "osenv": "^0.1.5", + "semver": "^5.5.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "npm-path": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npm-path/-/npm-path-2.0.4.tgz", + "integrity": "sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw==", + "dev": true, + "requires": { + "which": "^1.2.10" + } + }, + "npm-registry-client": { + "version": "8.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npm-registry-client/-/npm-registry-client-8.5.1.tgz", + "integrity": "sha512-7rjGF2eA7hKDidGyEWmHTiKfXkbrcQAsGL/Rh4Rt3x3YNRNHhwaTzVJfW3aNvvlhg4G62VCluif0sLCb/i51Hg==", + "dev": true, + "requires": { + "concat-stream": "^1.5.2", + "graceful-fs": "^4.1.6", + "normalize-package-data": "~1.0.1 || ^2.0.0", + "npm-package-arg": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", + "npmlog": "2 || ^3.1.0 || ^4.0.0", + "once": "^1.3.3", + "request": "^2.74.0", + "retry": "^0.10.0", + "safe-buffer": "^5.1.1", + "semver": "2 >=2.2.1 || 3.x || 4 || 5", + "slide": "^1.1.3", + "ssri": "^5.2.4" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "npm-which": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npm-which/-/npm-which-3.0.1.tgz", + "integrity": "sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo=", + "dev": true, + "requires": { + "commander": "^2.9.0", + "npm-path": "^2.0.2", + "which": "^1.2.10" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nwmatcher": { + "version": "1.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nwmatcher/-/nwmatcher-1.4.4.tgz", + "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-component": { + "version": "0.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + }, + "object-path": { + "version": "0.9.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-path/-/object-path-0.9.2.tgz", + "integrity": "sha1-D9mnT8X60a45aLWGvaXGMr1sBaU=", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "object.values": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object.values/-/object.values-1.0.4.tgz", + "integrity": "sha1-5STaCbT2b/Bd9FdUbscqyZ8TBpo=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.6.1", + "function-bind": "^1.1.0", + "has": "^1.0.1" + } + }, + "obuf": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "one-time": { + "version": "0.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/one-time/-/one-time-0.0.4.tgz", + "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "openurl": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/openurl/-/openurl-1.1.1.tgz", + "integrity": "sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=", + "dev": true + }, + "opn": { + "version": "5.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/opn/-/opn-5.4.0.tgz", + "integrity": "sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } + } + }, + "optimize-css-assets-webpack-plugin": { + "version": "5.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.1.tgz", + "integrity": "sha512-Rqm6sSjWtx9FchdP0uzTQDc7GXDKnwVEGoSxjezPkzMewx7gEWE9IMUYKmigTRC4U3RaNSwYVnUDLuIdtTpm0A==", + "dev": true, + "requires": { + "cssnano": "^4.1.0", + "last-call-webpack-plugin": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cssnano": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cssnano/-/cssnano-4.1.0.tgz", + "integrity": "sha512-7x24b/ghbrQv2QRgqMR12H3ZZ38xYCKJSXfg21YCtnIE177/NyvMkeiuQdWauIgMjySaTZ+cd5PN2qvfbsGeSw==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.0", + "cssnano-preset-default": "^4.0.0", + "is-resolvable": "^1.0.0", + "postcss": "^6.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "ora": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ora/-/ora-0.2.3.tgz", + "integrity": "sha1-N1J9Igrc1Tw5tzVx11QVbV22V6Q=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "cli-cursor": "^1.0.2", + "cli-spinners": "^0.1.2", + "object-assign": "^4.0.1" + }, + "dependencies": { + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + } + } + }, + "original": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/original/-/original-1.0.1.tgz", + "integrity": "sha512-IEvtB5vM5ULvwnqMxWBLxkS13JIEXbakizMSo3yoPNPCIWzg8TG3Usn/UhXoZFM/m+FuEA20KdzPSFq/0rS+UA==", + "dev": true, + "requires": { + "url-parse": "~1.4.0" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-name": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-name/-/os-name-2.0.1.tgz", + "integrity": "sha1-uaOGNhwXrjohc27wWZQFyajF3F4=", + "dev": true, + "requires": { + "macos-release": "^1.0.0", + "win-release": "^1.0.0" + } + }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true + }, + "p-each-series": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-each-series/-/p-each-series-1.0.0.tgz", + "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true + }, + "p-lazy": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-lazy/-/p-lazy-1.0.0.tgz", + "integrity": "sha1-7FPIAvLuOsKPFmzILQsrAt4nqDU=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-map": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "dev": true + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", + "dev": true + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "dev": true, + "requires": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "param-case": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", + "dev": true, + "requires": { + "no-case": "^2.2.0" + } + }, + "parse-asn1": { + "version": "5.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + } + }, + "parse-gitignore": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-gitignore/-/parse-gitignore-1.0.1.tgz", + "integrity": "sha512-UGyowyjtx26n65kdAMWhm6/3uy5uSrpcuH7tt+QEVudiBoVS+eqHxD5kbi9oWVRwj7sCzXqwuM+rUGw7earl6A==", + "dev": true + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parse5": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse5/-/parse5-3.0.3.tgz", + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "dev": true, + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "dev": true, + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pbkdf2": { + "version": "3.0.16", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pbkdf2/-/pbkdf2-3.0.16.tgz", + "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + } + } + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + } + } + }, + "please-upgrade-node": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz", + "integrity": "sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, + "plugin-error": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", + "dev": true, + "requires": { + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" + }, + "dependencies": { + "arr-diff": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" + } + }, + "arr-union": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", + "dev": true + }, + "extend-shallow": { + "version": "1.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", + "dev": true, + "requires": { + "kind-of": "^1.1.0" + } + }, + "kind-of": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", + "dev": true + } + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "pn": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "portfinder": { + "version": "1.0.13", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/portfinder/-/portfinder-1.0.13.tgz", + "integrity": "sha1-uzLs2HwnEErm7kS1o8y/Drsa7ek=", + "dev": true, + "requires": { + "async": "^1.5.2", + "debug": "^2.2.0", + "mkdirp": "0.5.x" + } + }, + "portscanner": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/portscanner/-/portscanner-2.1.1.tgz", + "integrity": "sha1-6rtAnk3iSVD1oqUW01rnaTQ/u5Y=", + "dev": true, + "requires": { + "async": "1.5.2", + "is-number-like": "^1.0.3" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "postcss": { + "version": "5.2.18", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-5.2.18.tgz", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "js-base64": "^2.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + }, + "dependencies": { + "supports-color": { + "version": "3.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "postcss-calc": { + "version": "5.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-calc/-/postcss-calc-5.3.1.tgz", + "integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=", + "dev": true, + "requires": { + "postcss": "^5.0.2", + "postcss-message-helpers": "^2.0.0", + "reduce-css-calc": "^1.2.6" + } + }, + "postcss-colormin": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-colormin/-/postcss-colormin-2.2.2.tgz", + "integrity": "sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks=", + "dev": true, + "requires": { + "colormin": "^1.0.5", + "postcss": "^5.0.13", + "postcss-value-parser": "^3.2.3" + } + }, + "postcss-convert-values": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz", + "integrity": "sha1-u9hZPFwf0uPRwyK7kl3K6Nrk1i0=", + "dev": true, + "requires": { + "postcss": "^5.0.11", + "postcss-value-parser": "^3.1.2" + } + }, + "postcss-discard-comments": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz", + "integrity": "sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0=", + "dev": true, + "requires": { + "postcss": "^5.0.14" + } + }, + "postcss-discard-duplicates": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-duplicates/-/postcss-discard-duplicates-2.1.0.tgz", + "integrity": "sha1-uavye4isGIFYpesSq8riAmO5GTI=", + "dev": true, + "requires": { + "postcss": "^5.0.4" + } + }, + "postcss-discard-empty": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz", + "integrity": "sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU=", + "dev": true, + "requires": { + "postcss": "^5.0.14" + } + }, + "postcss-discard-overridden": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz", + "integrity": "sha1-ix6vVU9ob7KIzYdMVWZ7CqNmjVg=", + "dev": true, + "requires": { + "postcss": "^5.0.16" + } + }, + "postcss-discard-unused": { + "version": "2.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz", + "integrity": "sha1-vOMLLMWR/8Y0Mitfs0ZLbZNPRDM=", + "dev": true, + "requires": { + "postcss": "^5.0.14", + "uniqs": "^2.0.0" + } + }, + "postcss-filter-plugins": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz", + "integrity": "sha1-bYWGJTTXNaxCDkqFgG4fXUKG2Ew=", + "dev": true, + "requires": { + "postcss": "^5.0.4", + "uniqid": "^4.0.0" + } + }, + "postcss-load-config": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-load-config/-/postcss-load-config-1.2.0.tgz", + "integrity": "sha1-U56a/J3chiASHr+djDZz4M5Q0oo=", + "dev": true, + "requires": { + "cosmiconfig": "^2.1.0", + "object-assign": "^4.1.0", + "postcss-load-options": "^1.2.0", + "postcss-load-plugins": "^2.3.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cosmiconfig/-/cosmiconfig-2.2.2.tgz", + "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==", + "dev": true, + "requires": { + "is-directory": "^0.3.1", + "js-yaml": "^3.4.3", + "minimist": "^1.2.0", + "object-assign": "^4.1.0", + "os-homedir": "^1.0.1", + "parse-json": "^2.2.0", + "require-from-string": "^1.1.0" + } + } + } + }, + "postcss-load-options": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-load-options/-/postcss-load-options-1.2.0.tgz", + "integrity": "sha1-sJixVZ3awt8EvAuzdfmaXP4rbYw=", + "dev": true, + "requires": { + "cosmiconfig": "^2.1.0", + "object-assign": "^4.1.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cosmiconfig/-/cosmiconfig-2.2.2.tgz", + "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==", + "dev": true, + "requires": { + "is-directory": "^0.3.1", + "js-yaml": "^3.4.3", + "minimist": "^1.2.0", + "object-assign": "^4.1.0", + "os-homedir": "^1.0.1", + "parse-json": "^2.2.0", + "require-from-string": "^1.1.0" + } + } + } + }, + "postcss-load-plugins": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-load-plugins/-/postcss-load-plugins-2.3.0.tgz", + "integrity": "sha1-dFdoEWWZrKLwCfrUJrABdQSdjZI=", + "dev": true, + "requires": { + "cosmiconfig": "^2.1.1", + "object-assign": "^4.1.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cosmiconfig/-/cosmiconfig-2.2.2.tgz", + "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==", + "dev": true, + "requires": { + "is-directory": "^0.3.1", + "js-yaml": "^3.4.3", + "minimist": "^1.2.0", + "object-assign": "^4.1.0", + "os-homedir": "^1.0.1", + "parse-json": "^2.2.0", + "require-from-string": "^1.1.0" + } + } + } + }, + "postcss-loader": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-loader/-/postcss-loader-2.1.1.tgz", + "integrity": "sha512-f0J/DWE/hyO9/LH0WHpXkny/ZZ238sSaG3p1SRBtVZnFWUtD7GXIEgHoBg8cnAeRbmEvUxHQptY46zWfwNYj/w==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "postcss": "^6.0.0", + "postcss-load-config": "^1.2.0", + "schema-utils": "^0.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-merge-idents": { + "version": "2.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz", + "integrity": "sha1-TFUwMTwI4dWzu/PSu8dH4njuonA=", + "dev": true, + "requires": { + "has": "^1.0.1", + "postcss": "^5.0.10", + "postcss-value-parser": "^3.1.1" + } + }, + "postcss-merge-longhand": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz", + "integrity": "sha1-I9kM0Sewp3mUkVMyc5A0oaTz1lg=", + "dev": true, + "requires": { + "postcss": "^5.0.4" + } + }, + "postcss-merge-rules": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz", + "integrity": "sha1-0d9d+qexrMO+VT8OnhDofGG19yE=", + "dev": true, + "requires": { + "browserslist": "^1.5.2", + "caniuse-api": "^1.5.2", + "postcss": "^5.0.4", + "postcss-selector-parser": "^2.2.2", + "vendors": "^1.0.0" + } + }, + "postcss-message-helpers": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz", + "integrity": "sha1-pPL0+rbk/gAvCu0ABHjN9S+bpg4=", + "dev": true + }, + "postcss-minify-font-values": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz", + "integrity": "sha1-S1jttWZB66fIR0qzUmyv17vey2k=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "postcss": "^5.0.4", + "postcss-value-parser": "^3.0.2" + } + }, + "postcss-minify-gradients": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz", + "integrity": "sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE=", + "dev": true, + "requires": { + "postcss": "^5.0.12", + "postcss-value-parser": "^3.3.0" + } + }, + "postcss-minify-params": { + "version": "1.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz", + "integrity": "sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.1", + "postcss": "^5.0.2", + "postcss-value-parser": "^3.0.2", + "uniqs": "^2.0.0" + } + }, + "postcss-minify-selectors": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz", + "integrity": "sha1-ssapjAByz5G5MtGkllCBFDEXNb8=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.2", + "has": "^1.0.1", + "postcss": "^5.0.14", + "postcss-selector-parser": "^2.0.0" + } + }, + "postcss-modules-extract-imports": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz", + "integrity": "sha1-ZhQOzs447wa/DT41XWm/WdFB6oU=", + "dev": true, + "requires": { + "postcss": "^6.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-local-by-default": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", + "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", + "dev": true, + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-scope": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", + "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", + "dev": true, + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-values": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz", + "integrity": "sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA=", + "dev": true, + "requires": { + "icss-replace-symbols": "^1.1.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-normalize-charset": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz", + "integrity": "sha1-757nEhLX/nWceO0WL2HtYrXLk/E=", + "dev": true, + "requires": { + "postcss": "^5.0.5" + } + }, + "postcss-normalize-display-values": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.0.tgz", + "integrity": "sha1-lQ4Me+NEV3ChYP/9a2ZEw8DNj4k=", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-normalize-positions": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-positions/-/postcss-normalize-positions-4.0.0.tgz", + "integrity": "sha1-7pNDq5gbgixjq3JhXszNCFZERaM=", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "has": "^1.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-normalize-repeat-style": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.0.tgz", + "integrity": "sha1-txHFks8W+vn/V15C+hALZ5kIPv8=", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "cssnano-util-get-match": "^4.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-normalize-string": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-string/-/postcss-normalize-string-4.0.0.tgz", + "integrity": "sha1-cYy20wpvrGrGqDDjLAbAfbxm/l0=", + "dev": true, + "requires": { + "has": "^1.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-normalize-timing-functions": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.0.tgz", + "integrity": "sha1-A1HymIaqmB1D2RssK9GuptCvbSM=", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-normalize-unicode": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.0.tgz", + "integrity": "sha1-Ws1dR7rqXRdnSyzMSuUWb6iM35c=", + "dev": true, + "requires": { + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-normalize-url": { + "version": "3.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz", + "integrity": "sha1-EI90s/L82viRov+j6kWSJ5/HgiI=", + "dev": true, + "requires": { + "is-absolute-url": "^2.0.0", + "normalize-url": "^1.4.0", + "postcss": "^5.0.14", + "postcss-value-parser": "^3.2.3" + } + }, + "postcss-normalize-whitespace": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.0.tgz", + "integrity": "sha1-HafnaxCuY8EYJ/oE/Du0oe/pnMA=", + "dev": true, + "requires": { + "postcss": "^6.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-ordered-values": { + "version": "2.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz", + "integrity": "sha1-7sbCpntsQSqNsgQud/6NpD+VwR0=", + "dev": true, + "requires": { + "postcss": "^5.0.4", + "postcss-value-parser": "^3.0.1" + } + }, + "postcss-reduce-idents": { + "version": "2.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz", + "integrity": "sha1-wsbSDMlYKE9qv75j92Cb9AkFmtM=", + "dev": true, + "requires": { + "postcss": "^5.0.4", + "postcss-value-parser": "^3.0.2" + } + }, + "postcss-reduce-initial": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz", + "integrity": "sha1-aPgGlfBF0IJjqHmtJA343WT2ROo=", + "dev": true, + "requires": { + "postcss": "^5.0.4" + } + }, + "postcss-reduce-transforms": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz", + "integrity": "sha1-/3b02CEkN7McKYpC0uFEQCV3GuE=", + "dev": true, + "requires": { + "has": "^1.0.1", + "postcss": "^5.0.8", + "postcss-value-parser": "^3.0.1" + } + }, + "postcss-selector-parser": { + "version": "2.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz", + "integrity": "sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A=", + "dev": true, + "requires": { + "flatten": "^1.0.2", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "postcss-svgo": { + "version": "2.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-svgo/-/postcss-svgo-2.1.6.tgz", + "integrity": "sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0=", + "dev": true, + "requires": { + "is-svg": "^2.0.0", + "postcss": "^5.0.14", + "postcss-value-parser": "^3.2.3", + "svgo": "^0.7.0" + } + }, + "postcss-unique-selectors": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz", + "integrity": "sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.1", + "postcss": "^5.0.4", + "uniqs": "^2.0.0" + } + }, + "postcss-value-parser": { + "version": "3.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", + "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", + "dev": true + }, + "postcss-zindex": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-zindex/-/postcss-zindex-2.2.0.tgz", + "integrity": "sha1-0hCd3AVbka9n/EyzsCWUZjnSryI=", + "dev": true, + "requires": { + "has": "^1.0.1", + "postcss": "^5.0.4", + "uniqs": "^2.0.0" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier": { + "version": "1.11.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prettier/-/prettier-1.11.1.tgz", + "integrity": "sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw==", + "dev": true + }, + "pretty-bytes": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-bytes/-/pretty-bytes-5.1.0.tgz", + "integrity": "sha512-wa5+qGVg9Yt7PB6rYm3kXlKzgzgivYTLRandezh43jjRqgyDyP+9YxfJpJiLs9yKD1WeU8/OvtToWpW7255FtA==", + "dev": true + }, + "pretty-error": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-error/-/pretty-error-2.1.1.tgz", + "integrity": "sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=", + "dev": true, + "requires": { + "renderkid": "^2.0.1", + "utila": "~0.4" + } + }, + "pretty-format": { + "version": "22.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-format/-/pretty-format-22.4.3.tgz", + "integrity": "sha512-S4oT9/sT6MN7/3COoOy+ZJeA92VmOnveLHgrwBE3Z1W5N9S2A1QGNYiE1z75DAENbJrXXUb+OWXhpJcg05QKQQ==", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + } + } + }, + "private": { + "version": "0.1.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "promise": { + "version": "7.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "requires": { + "asap": "~2.0.3" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "proxy-addr": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/proxy-addr/-/proxy-addr-2.0.3.tgz", + "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", + "dev": true, + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.6.0" + } + }, + "proxy-middleware": { + "version": "0.15.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/proxy-middleware/-/proxy-middleware-0.15.0.tgz", + "integrity": "sha1-o/3xvvtzD5UZZYcqwvYHTGFHelY=", + "dev": true + }, + "prr": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.1.29", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/public-encrypt/-/public-encrypt-4.0.2.tgz", + "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "query-string": { + "version": "4.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/query-string/-/query-string-4.3.4.tgz", + "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", + "dev": true, + "requires": { + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "querystringify": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/querystringify/-/querystringify-2.0.0.tgz", + "integrity": "sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw==", + "dev": true + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "randexp": { + "version": "0.4.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/randexp/-/randexp-0.4.9.tgz", + "integrity": "sha512-maAX1cnBkzIZ89O4tSQUOF098xjGMC8N+9vuY/WfHwg87THw6odD2Br35donlj5e6KnB1SB0QBHhTQhhDHuTPQ==", + "dev": true, + "requires": { + "drange": "^1.0.0", + "ret": "^0.2.0" + }, + "dependencies": { + "ret": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ret/-/ret-0.2.2.tgz", + "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "dev": true + } + } + }, + "randomatic": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "raw-body": { + "version": "2.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "dev": true, + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" + } + }, + "raw-loader": { + "version": "0.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/raw-loader/-/raw-loader-0.5.1.tgz", + "integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao=", + "dev": true + }, + "react": { + "version": "0.14.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/react/-/react-0.14.9.tgz", + "integrity": "sha1-kRCmSXxJ1EuhwO3TF67CnC4NkdE=", + "dev": true, + "requires": { + "envify": "^3.0.0", + "fbjs": "^0.6.1" + } + }, + "react-dom": { + "version": "0.14.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/react-dom/-/react-dom-0.14.9.tgz", + "integrity": "sha1-BQZKPc8PsYgKOyv8nVjFXY2fYpM=", + "dev": true + }, + "read-chunk": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-chunk/-/read-chunk-2.1.0.tgz", + "integrity": "sha1-agTAkoAF7Z1C4aasVgDhnLx/9lU=", + "dev": true, + "requires": { + "pify": "^3.0.0", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + } + }, + "realpath-native": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/realpath-native/-/realpath-native-1.0.0.tgz", + "integrity": "sha512-XJtlRJ9jf0E1H1SLeJyQ9PGzQD7S65h1pRXEcAeK48doKOnKxcgPeNohJvD5u/2sI9J1oke6E8bZHS/fmW1UiQ==", + "dev": true, + "requires": { + "util.promisify": "^1.0.0" + } + }, + "recast": { + "version": "0.11.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/recast/-/recast-0.11.23.tgz", + "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", + "dev": true, + "requires": { + "ast-types": "0.9.6", + "esprima": "~3.1.0", + "private": "~0.1.5", + "source-map": "~0.5.0" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + } + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "reduce-css-calc": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz", + "integrity": "sha1-dHyRTgSWFKTJz7umKYca0dKSdxY=", + "dev": true, + "requires": { + "balanced-match": "^0.4.2", + "math-expression-evaluator": "^1.2.14", + "reduce-function-call": "^1.0.1" + }, + "dependencies": { + "balanced-match": { + "version": "0.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + } + } + }, + "reduce-function-call": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/reduce-function-call/-/reduce-function-call-1.0.2.tgz", + "integrity": "sha1-WiAL+S4ON3UXUv5FsKszD9S2vpk=", + "dev": true, + "requires": { + "balanced-match": "^0.4.2" + }, + "dependencies": { + "balanced-match": { + "version": "0.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + } + } + }, + "reflect-metadata": { + "version": "0.1.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/reflect-metadata/-/reflect-metadata-0.1.12.tgz", + "integrity": "sha512-n+IyV+nGz3+0q3/Yf1ra12KpCyi001bi4XFxSjbiWWjfqb52iTTtpGXmCCAOWWIAn9KEuFZKGqBERHmrtScZ3A==" + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp-to-ast": { + "version": "0.3.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regexp-to-ast/-/regexp-to-ast-0.3.5.tgz", + "integrity": "sha512-1CJygtdvsfNFwiyjaMLBWtg2tfEqx/jSZ8S6TV+GlNL8kiH8rb4cm5Pb7A/C2BpyM/fA8ZJEudlCwi/jvAY+Ow==", + "dev": true + }, + "regexpu-core": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regexpu-core/-/regexpu-core-1.0.0.tgz", + "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + }, + "relateurl": { + "version": "0.2.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "renderkid": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/renderkid/-/renderkid-2.0.1.tgz", + "integrity": "sha1-iYyr/Ivt5Le5ETWj/9Mj5YwNsxk=", + "dev": true, + "requires": { + "css-select": "^1.1.0", + "dom-converter": "~0.1", + "htmlparser2": "~3.3.0", + "strip-ansi": "^3.0.0", + "utila": "~0.3" + }, + "dependencies": { + "utila": { + "version": "0.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "^4.13.1" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "resp-modifier": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resp-modifier/-/resp-modifier-6.0.2.tgz", + "integrity": "sha1-sSTeXE+6/LpUH0j/pzlw9KpFa08=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "minimatch": "^3.0.2" + } + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "dev": true + }, + "rgb-regex": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rgb-regex/-/rgb-regex-1.0.1.tgz", + "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=", + "dev": true + }, + "rgba-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rgba-regex/-/rgba-regex-1.0.0.tgz", + "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "run-node": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/run-node/-/run-node-1.0.0.tgz", + "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==", + "dev": true + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "rx": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rx/-/rx-4.1.0.tgz", + "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", + "dev": true + }, + "rxjs": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rxjs/-/rxjs-6.1.0.tgz", + "integrity": "sha512-lMZdl6xbHJCSb5lmnb6nOhsoBVCyoDC5LDJQK9WWyq+tsI7KnlDIZ0r0AZAlBpRPLbwQA9kzSBAZwNIZEZ+hcw==", + "requires": { + "tslib": "^1.9.0" + } + }, + "rxjs-compat": { + "version": "6.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rxjs-compat/-/rxjs-compat-6.1.0.tgz", + "integrity": "sha512-x5L1KQy1RqDRpPadN5iDOx71TV9Wqmlmu6OOEn3tFFgaTCB0/N+Lmby/rZHgJ6JEPzzt0nD9Zv+kS53E5JIR5g==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sane": { + "version": "2.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sane/-/sane-2.5.0.tgz", + "integrity": "sha512-glfKd7YH4UCrh/7dD+UESsr8ylKWRE7UQPoXuz28FgmcF0ViJQhCTCCZHICRKxf8G8O1KdLEn20dcICK54c7ew==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "exec-sh": "^0.2.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.1.1", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5", + "watch": "~0.18.0" + } + }, + "sass": { + "version": "1.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sass/-/sass-1.13.0.tgz", + "integrity": "sha512-FmA4D73dULJ2WsnbMar3P9Fj1Kd83T3YA+QTfbb2+T61epdIgAvfCR+m9mK/mQrN45stlipKoVqsdaEdLe+iDQ==", + "dev": true, + "requires": { + "chokidar": "^2.0.0" + } + }, + "sass-loader": { + "version": "7.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sass-loader/-/sass-loader-7.1.0.tgz", + "integrity": "sha512-+G+BKGglmZM2GUSfT9TLuEp6tzehHPjAMoRRItOojWIqIGPloVCMhNIQuG639eJ+y033PaGTSjLaTHts8Kw79w==", + "dev": true, + "requires": { + "clone-deep": "^2.0.1", + "loader-utils": "^1.0.1", + "lodash.tail": "^4.1.1", + "neo-async": "^2.5.0", + "pify": "^3.0.0", + "semver": "^5.5.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "schema-utils": { + "version": "0.4.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + }, + "scoped-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/scoped-regex/-/scoped-regex-1.0.0.tgz", + "integrity": "sha1-o0a7Gs1CB65wvXwMfKnlZra63bg=", + "dev": true + }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", + "dev": true + }, + "selfsigned": { + "version": "1.10.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/selfsigned/-/selfsigned-1.10.3.tgz", + "integrity": "sha512-vmZenZ+8Al3NLHkWnhBQ0x6BkML1eCP2xEi3JE+f3D9wW9fipD9NNJHYtE9XJM4TsPaHGZJIamrSI6MTg1dU2Q==", + "dev": true, + "requires": { + "node-forge": "0.7.5" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-dsl": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/semver-dsl/-/semver-dsl-1.0.1.tgz", + "integrity": "sha1-02eN5VVeimH2Ke7QJTZq5fJzQKA=", + "dev": true, + "requires": { + "semver": "^5.3.0" + } + }, + "semver-intersect": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/semver-intersect/-/semver-intersect-1.3.1.tgz", + "integrity": "sha1-j6hKnhAovSOeRTDRo+GB5pjYhLo=", + "dev": true, + "requires": { + "semver": "^5.0.0" + } + }, + "send": { + "version": "0.16.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true + } + } + }, + "serialize-javascript": { + "version": "1.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/serialize-javascript/-/serialize-javascript-1.5.0.tgz", + "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", + "dev": true + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } + }, + "server-destroy": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0=", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shallow-clone": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shallow-clone/-/shallow-clone-1.0.0.tgz", + "integrity": "sha512-oeXreoKR/SyNJtRJMAKPDSvd28OqEwG4eR/xc856cRGBII7gX9lvAqDxusPm0846z/w/hWYjI1NpKwJ00NHzRA==", + "dev": true, + "requires": { + "is-extendable": "^0.1.1", + "kind-of": "^5.0.0", + "mixin-object": "^2.0.1" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, + "shelljs": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shelljs/-/shelljs-0.8.2.tgz", + "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-progress-webpack-plugin": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/simple-progress-webpack-plugin/-/simple-progress-webpack-plugin-1.1.2.tgz", + "integrity": "sha512-bNQfb3qSqbtsfxg6d0dGechUUJH2lZqKG5+bj2aoJmEA0rSzcm+2JVfC2YgkDABfuGItZ/O5ttt6BssWZW4SNg==", + "dev": true, + "requires": { + "chalk": "2.3.x", + "figures": "2.0.x", + "log-update": "2.3.x" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "log-update": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/log-update/-/log-update-2.3.0.tgz", + "integrity": "sha1-iDKP19HOeTiykoN0bwsbwSayRwg=", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "cli-cursor": "^2.0.0", + "wrap-ansi": "^3.0.1" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wrap-ansi/-/wrap-ansi-3.0.1.tgz", + "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0" + } + } + } + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + } + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "slide": { + "version": "1.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "socket.io": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/socket.io/-/socket.io-2.1.1.tgz", + "integrity": "sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA==", + "dev": true, + "requires": { + "debug": "~3.1.0", + "engine.io": "~3.2.0", + "has-binary2": "~1.0.2", + "socket.io-adapter": "~1.1.0", + "socket.io-client": "2.1.1", + "socket.io-parser": "~3.2.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "engine.io-client": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/engine.io-client/-/engine.io-client-3.2.1.tgz", + "integrity": "sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "~3.1.0", + "engine.io-parser": "~2.1.1", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~3.3.1", + "xmlhttprequest-ssl": "~1.5.4", + "yeast": "0.1.2" + } + }, + "isarray": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + }, + "socket.io-client": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/socket.io-client/-/socket.io-client-2.1.1.tgz", + "integrity": "sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ==", + "dev": true, + "requires": { + "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "~3.1.0", + "engine.io-client": "~3.2.0", + "has-binary2": "~1.0.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "socket.io-parser": "~3.2.0", + "to-array": "0.1.4" + } + }, + "socket.io-parser": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/socket.io-parser/-/socket.io-parser-3.2.0.tgz", + "integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "debug": "~3.1.0", + "isarray": "2.0.1" + } + } + } + }, + "socket.io-adapter": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz", + "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=", + "dev": true + }, + "socket.io-client": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/socket.io-client/-/socket.io-client-2.0.4.tgz", + "integrity": "sha1-CRilUkBtxeVAs4Dc2Xr8SmQzL44=", + "dev": true, + "requires": { + "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "~2.6.4", + "engine.io-client": "~3.1.0", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "socket.io-parser": "~3.1.1", + "to-array": "0.1.4" + } + }, + "socket.io-parser": { + "version": "3.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/socket.io-parser/-/socket.io-parser-3.1.3.tgz", + "integrity": "sha512-g0a2HPqLguqAczs3dMECuA1RgoGFPyvDqcbaDEdCWY9g59kdUAz3YRmaJBNKXflrHNwB7Q12Gkf/0CZXfdHR7g==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "debug": "~3.1.0", + "has-binary2": "~1.0.2", + "isarray": "2.0.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "isarray": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + } + } + }, + "sockjs": { + "version": "0.3.19", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sockjs/-/sockjs-0.3.19.tgz", + "integrity": "sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw==", + "dev": true, + "requires": { + "faye-websocket": "^0.10.0", + "uuid": "^3.0.1" + } + }, + "sockjs-client": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sockjs-client/-/sockjs-client-1.1.5.tgz", + "integrity": "sha1-G7fA9yIsQPQq3xT0RCy9Eml3GoM=", + "dev": true, + "requires": { + "debug": "^2.6.6", + "eventsource": "0.1.6", + "faye-websocket": "~0.11.0", + "inherits": "^2.0.1", + "json3": "^3.3.2", + "url-parse": "^1.1.8" + }, + "dependencies": { + "faye-websocket": { + "version": "0.11.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/faye-websocket/-/faye-websocket-0.11.1.tgz", + "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", + "dev": true, + "requires": { + "websocket-driver": ">=0.5.1" + } + } + } + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "source-list-map": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-list-map/-/source-list-map-2.0.0.tgz", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-support/-/source-map-support-0.5.6.tgz", + "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==", + "dev": true + }, + "spdy": { + "version": "3.4.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdy/-/spdy-3.4.7.tgz", + "integrity": "sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw=", + "dev": true, + "requires": { + "debug": "^2.6.8", + "handle-thing": "^1.2.5", + "http-deceiver": "^1.2.7", + "safe-buffer": "^5.0.1", + "select-hose": "^2.0.0", + "spdy-transport": "^2.0.18" + } + }, + "spdy-transport": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdy-transport/-/spdy-transport-2.1.0.tgz", + "integrity": "sha512-bpUeGpZcmZ692rrTiqf9/2EUakI6/kXX1Rpe0ib/DyOzbiexVfXkw6GnvI9hVGvIwVaUhkaBojjCZwLNRGQg1g==", + "dev": true, + "requires": { + "debug": "^2.6.8", + "detect-node": "^2.0.3", + "hpack.js": "^2.1.6", + "obuf": "^1.1.1", + "readable-stream": "^2.2.9", + "safe-buffer": "^5.0.1", + "wbuf": "^1.7.2" + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sprintf-js/-/sprintf-js-1.1.1.tgz", + "integrity": "sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw=", + "dev": true + }, + "sshpk": { + "version": "1.15.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sshpk/-/sshpk-1.15.1.tgz", + "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "5.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ssri/-/ssri-5.3.0.tgz", + "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "stable": { + "version": "0.1.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "stack-utils": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", + "dev": true + }, + "stackframe": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stackframe/-/stackframe-1.0.4.tgz", + "integrity": "sha512-to7oADIniaYwS3MhtCa/sQhrxidCCQiF/qp4/m5iN3ipf0Y7Xlri0f6eG29r08aL7JYl8n32AF3Q5GYBZ7K8vw==", + "dev": true + }, + "staged-git-files": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/staged-git-files/-/staged-git-files-1.1.1.tgz", + "integrity": "sha512-H89UNKr1rQJvI1c/PIR3kiAMBV23yvR7LItZiV74HWZwzt7f3YHuujJ9nJZlt58WlFox7XQsOahexwk7nTe69A==", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stream-each/-/stream-each-1.2.2.tgz", + "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "stream-throttle": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stream-throttle/-/stream-throttle-0.1.3.tgz", + "integrity": "sha1-rdV8jXzHOoFjDTHNVdOWHPr7qcM=", + "dev": true, + "requires": { + "commander": "^2.2.0", + "limiter": "^1.0.5" + } + }, + "stream-to-observable": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stream-to-observable/-/stream-to-observable-0.2.0.tgz", + "integrity": "sha1-WdbqOT2HwsDdrBCqDVYbxrpvDhA=", + "dev": true, + "requires": { + "any-observable": "^0.2.0" + }, + "dependencies": { + "any-observable": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/any-observable/-/any-observable-0.2.0.tgz", + "integrity": "sha1-xnhwBYADV5AJCD9UrAq6+1wz0kI=", + "dev": true + } + } + }, + "streamfilter": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/streamfilter/-/streamfilter-1.0.7.tgz", + "integrity": "sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ==", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string-argv": { + "version": "0.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-argv/-/string-argv-0.0.2.tgz", + "integrity": "sha1-2sMECGkMIfPDYwo/86BYd73L1zY=", + "dev": true + }, + "string-length": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "dev": true, + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "string-template": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "stringify-object": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stringify-object/-/stringify-object-3.2.2.tgz", + "integrity": "sha512-O696NF21oLiDy8PhpWu8AEqoZHw++QW6mUv0UvKZe8gWSdSvMXkiLufK7OmnP27Dro4GU5kb9U7JIO0mBuCRQg==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^2.0.1", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-bom-stream": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz", + "integrity": "sha1-+H217yYT9paKpUWr/h7HKLaoKco=", + "dev": true, + "requires": { + "first-chunk-stream": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "strip-comments": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-comments/-/strip-comments-1.0.2.tgz", + "integrity": "sha512-kL97alc47hoyIQSV165tTt9rG5dn4w1dNnBhOQ3bOU1Nc1hel09jnXANaHJ7vzHLd4Ju8kseDGzlev96pghLFw==", + "dev": true, + "requires": { + "babel-extract-comments": "^1.0.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "style-loader": { + "version": "0.20.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/style-loader/-/style-loader-0.20.3.tgz", + "integrity": "sha512-2I7AVP73MvK33U7B9TKlYZAqdROyMXDYSMvHLX43qy3GCOaJNiV6i0v/sv9idWIaQ42Yn2dNv79Q5mKXbKhAZg==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "schema-utils": "^0.4.5" + } + }, + "stylehacks": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stylehacks/-/stylehacks-4.0.0.tgz", + "integrity": "sha1-ZLMjlRxKJOX8ey7AbBN78y0VXoo=", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "postcss": "^6.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "browserslist": { + "version": "4.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/browserslist/-/browserslist-4.1.1.tgz", + "integrity": "sha512-VBorw+tgpOtZ1BYhrVSVTzTt/3+vSE3eFUh0N2GCFK1HffceOaf32YS/bs6WiFhjDAblAFrx85jMy3BG9fBK2Q==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000884", + "electron-to-chromium": "^1.3.62", + "node-releases": "^1.0.0-alpha.11" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "^4.1.1", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "svgo": { + "version": "0.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/svgo/-/svgo-0.7.2.tgz", + "integrity": "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U=", + "dev": true, + "requires": { + "coa": "~1.0.1", + "colors": "~1.1.2", + "csso": "~2.3.1", + "js-yaml": "~3.7.0", + "mkdirp": "~0.5.1", + "sax": "~1.2.1", + "whet.extend": "~0.9.9" + } + }, + "swagger-ui": { + "version": "2.2.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/swagger-ui/-/swagger-ui-2.2.10.tgz", + "integrity": "sha1-sl56IWZOXZC/OR2zDbCN5B6FLXs=" + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "dev": true + }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, + "tabtab": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tabtab/-/tabtab-2.2.2.tgz", + "integrity": "sha1-egR/FDsBC0y9MfhX6ClhUSy/ThQ=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "inquirer": "^1.0.2", + "lodash.difference": "^4.5.0", + "lodash.uniq": "^4.5.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "npmlog": "^2.0.3", + "object-assign": "^4.1.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "external-editor": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/external-editor/-/external-editor-1.1.1.tgz", + "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "spawn-sync": "^1.0.15", + "tmp": "^0.0.29" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "gauge": { + "version": "1.2.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gauge/-/gauge-1.2.7.tgz", + "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", + "dev": true, + "requires": { + "ansi": "^0.3.0", + "has-unicode": "^2.0.0", + "lodash.pad": "^4.1.0", + "lodash.padend": "^4.1.0", + "lodash.padstart": "^4.1.0" + } + }, + "inquirer": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inquirer/-/inquirer-1.2.3.tgz", + "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", + "dev": true, + "requires": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "external-editor": "^1.1.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "mute-stream": "0.0.6", + "pinkie-promise": "^2.0.0", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "mute-stream": { + "version": "0.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mute-stream/-/mute-stream-0.0.6.tgz", + "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=", + "dev": true + }, + "npmlog": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npmlog/-/npmlog-2.0.4.tgz", + "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", + "dev": true, + "requires": { + "ansi": "~0.3.1", + "are-we-there-yet": "~1.1.2", + "gauge": "~1.2.5" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "tmp": { + "version": "0.0.29", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, + "tapable": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tapable/-/tapable-1.0.0.tgz", + "integrity": "sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg==", + "dev": true + }, + "temp": { + "version": "0.8.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/temp/-/temp-0.8.3.tgz", + "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", + "dev": true, + "requires": { + "os-tmpdir": "^1.0.0", + "rimraf": "~2.2.6" + }, + "dependencies": { + "rimraf": { + "version": "2.2.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", + "dev": true + } + } + }, + "terser": { + "version": "3.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/terser/-/terser-3.8.2.tgz", + "integrity": "sha512-FGSBXiBJe2TSXy6pWwXpY0YcEWEK35UKL64BBbxX3aHqM4Nj0RMqXvqBuoSGfyd80t8MKQ5JwYm5jRRGTSEFNg==", + "dev": true, + "requires": { + "commander": "~2.17.1", + "source-map": "~0.6.1", + "source-map-support": "~0.5.6" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/terser-webpack-plugin/-/terser-webpack-plugin-1.0.0.tgz", + "integrity": "sha512-J1i69VN1tyhzpzbWrNvNaS1G4G7iNCvTvoT+qGNFxQPqND2Kk49M6yKw5/yA+dcU0D5pH/PuuH2ouDbhqDf0RQ==", + "dev": true, + "requires": { + "@webpack-contrib/schema-utils": "^1.0.0-beta.0", + "cacache": "^11.0.2", + "find-cache-dir": "^2.0.0", + "serialize-javascript": "^1.4.0", + "source-map": "^0.6.1", + "terser": "^3.8.1", + "webpack-sources": "^1.1.0", + "worker-farm": "^1.5.2" + }, + "dependencies": { + "cacache": { + "version": "11.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cacache/-/cacache-11.0.2.tgz", + "integrity": "sha512-hMiz7LN4w8sdfmKsvNs80ao/vf2JCGWWdpu95JyY90AJZRbZJmgE71dCefRiNf8OCqiZQDcUBfYiLlUNu4/j5A==", + "dev": true, + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "figgy-pudding": "^3.1.0", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.2", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^6.0.0", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + } + }, + "find-cache-dir": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-cache-dir/-/find-cache-dir-2.0.0.tgz", + "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "ssri": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ssri/-/ssri-6.0.0.tgz", + "integrity": "sha512-zYOGfVHPhxyzwi8MdtdNyxv3IynWCIM4jYReR48lqu0VngxgH1c+C6CmipRdJ55eVByTJV/gboFEEI7TEQI8DA==", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + } + } + }, + "test-exclude": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/test-exclude/-/test-exclude-4.2.1.tgz", + "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "micromatch": "^3.1.8", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" + } + }, + "text-hex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "textextensions": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/textextensions/-/textextensions-2.2.0.tgz", + "integrity": "sha512-j5EMxnryTvKxwH2Cq+Pb43tsf6sdEgw6Pdwxk83mPaq0ToeFJt6WE4J3s5BqY7vmjlLgkgXvhtXUxo80FyBhCA==", + "dev": true + }, + "tfunk": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tfunk/-/tfunk-3.1.0.tgz", + "integrity": "sha1-OORBT8ZJd9h6/apy+sttKfgve1s=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "object-path": "^0.9.0" + } + }, + "thread-loader": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/thread-loader/-/thread-loader-1.1.5.tgz", + "integrity": "sha512-BklxWyBW9EsRC6neZPuwwV6L1iRkGwe8sFWUcI1g+3DS3JajW/zJKo2t6j2a72bXngv9a4xyDHpn1EpXM9VWDw==", + "dev": true, + "requires": { + "async": "^2.3.0", + "loader-runner": "^2.3.0", + "loader-utils": "^1.1.0" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "throat": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/throat/-/throat-4.1.0.tgz", + "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "thunky": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/thunky/-/thunky-1.0.2.tgz", + "integrity": "sha1-qGLgGOP7HqLsP85dVWBc9X8kc3E=", + "dev": true + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "timers-browserify": { + "version": "2.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/timers-browserify/-/timers-browserify-2.0.10.tgz", + "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "timsort": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-array": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "to-string-loader": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-string-loader/-/to-string-loader-1.1.5.tgz", + "integrity": "sha1-e3qheJG3u0lHp6Eb+wO1/enG5pU=", + "dev": true, + "requires": { + "loader-utils": "^0.2.16" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + } + } + }, + "topo": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/topo/-/topo-2.0.2.tgz", + "integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=", + "dev": true, + "requires": { + "hoek": "4.x.x" + } + }, + "toposort": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/toposort/-/toposort-1.0.7.tgz", + "integrity": "sha1-LmhELZ9k7HILjMieZEOsbKqVACk=", + "dev": true + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "tree-kill": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tree-kill/-/tree-kill-1.2.0.tgz", + "integrity": "sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg==", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "triple-beam": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", + "dev": true + }, + "ts-jest": { + "version": "22.4.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ts-jest/-/ts-jest-22.4.4.tgz", + "integrity": "sha512-v9pO7u4HNMDSBCN9IEvlR6taDAGm2mo7nHEDLWyoFDgYeZ4aHm8JHEPrthd8Pmcl4eCM8J4Ata4ROR/cwFRV2A==", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-plugin-istanbul": "^4.1.4", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", + "babel-preset-jest": "^22.4.0", + "cpx": "^1.5.0", + "fs-extra": "4.0.3", + "jest-config": "^22.4.2", + "pkg-dir": "^2.0.0", + "yargs": "^11.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "11.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-11.0.0.tgz", + "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "ts-loader": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ts-loader/-/ts-loader-4.0.1.tgz", + "integrity": "sha512-dzgQnkAGY4sLqVw6t4LJH8FGR8j0zsPmC1Ff2ChzKhYO+hgWJkSEyrHTlSSZqn5oWr0Po7q/IRoeq8O4SNKQ9A==", + "dev": true, + "requires": { + "chalk": "^2.3.0", + "enhanced-resolve": "^4.0.0", + "loader-utils": "^1.0.2", + "micromatch": "^3.1.4", + "semver": "^5.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "tsickle": { + "version": "0.30.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tsickle/-/tsickle-0.30.0.tgz", + "integrity": "sha512-A4ALnEDQNrECn5xhgHmoXKM5qERCM395pKIfqcV57ex3zEInVogu/A191Btv8OPEINkr3xQ3Q2XRywyqkge3Qg==", + "dev": true, + "requires": { + "jasmine-diff": "^0.1.3", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "source-map": "^0.6.0", + "source-map-support": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, + "tslint": { + "version": "5.9.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tslint/-/tslint-5.9.1.tgz", + "integrity": "sha1-ElX4ej/1frCw4fDmEKi0dIBGya4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.12.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "tslint-config-prettier": { + "version": "1.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tslint-config-prettier/-/tslint-config-prettier-1.9.0.tgz", + "integrity": "sha512-glCHJJrJYXoP/nvhrmb7gt7q2Er0PaXu3zwySpIxRZvCYgBWt8l+Qi4VVTgFt5Moj/1klWg08PxxjE3/7hvp3Q==", + "dev": true + }, + "tslint-loader": { + "version": "3.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tslint-loader/-/tslint-loader-3.6.0.tgz", + "integrity": "sha512-Me9Qf/87BOfCY8uJJw+J7VMF4U8WiMXKLhKKKugMydF0xMhMOt9wo2mjYTNhwbF9H7SHh8PAIwRG8roisTNekQ==", + "dev": true, + "requires": { + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.1", + "rimraf": "^2.4.4", + "semver": "^5.3.0" + } + }, + "tsutils": { + "version": "2.27.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tsutils/-/tsutils-2.27.1.tgz", + "integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.18" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "2.7.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/typescript/-/typescript-2.7.2.tgz", + "integrity": "sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==", + "dev": true + }, + "ua-parser-js": { + "version": "0.7.17", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ua-parser-js/-/ua-parser-js-0.7.17.tgz", + "integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g==", + "dev": true + }, + "uglify-js": { + "version": "3.3.28", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uglify-js/-/uglify-js-3.3.28.tgz", + "integrity": "sha512-68Rc/aA6cswiaQ5SrE979UJcXX+ADA1z33/ZsPd+fbAiVdjZ16OXdbtGO+rJUUBgK6qdf3SOPhQf3K/ybF5Miw==", + "dev": true, + "requires": { + "commander": "~2.15.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uglifyjs-webpack-plugin": { + "version": "1.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.6.tgz", + "integrity": "sha512-NDP94ahjW7ZH+qzdjxjIV04n5YGnrYD2jeHgKgnpUKmdAfcXEO5DbVo21fXAm/KPMyX9k21zWFBMYm9m9R2ptg==", + "dev": true, + "requires": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "schema-utils": "^0.4.5", + "serialize-javascript": "^1.4.0", + "source-map": "^0.6.1", + "uglify-es": "^3.3.4", + "webpack-sources": "^1.1.0", + "worker-farm": "^1.5.2" + }, + "dependencies": { + "commander": { + "version": "2.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "dev": true, + "requires": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + } + } + } + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "dev": true + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "uniqid": { + "version": "4.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uniqid/-/uniqid-4.1.1.tgz", + "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", + "dev": true, + "requires": { + "macaddress": "^0.2.8" + } + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", + "dev": true + }, + "unique-filename": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/unique-filename/-/unique-filename-1.1.0.tgz", + "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/unique-slug/-/unique-slug-2.0.0.tgz", + "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unquote": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "untildify": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true + }, + "upath": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "dev": true + }, + "upper-case": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", + "dev": true + }, + "uri-js": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uri-js/-/uri-js-3.0.2.tgz", + "integrity": "sha1-+QuFhQf4HepNz7s8TD2/orVX+qo=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-join": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-join/-/url-join-4.0.0.tgz", + "integrity": "sha1-TTNA6AfTdzvamZH4MFrNzCpmXSo=", + "dev": true + }, + "url-parse": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-parse/-/url-parse-1.4.1.tgz", + "integrity": "sha512-x95Td74QcvICAA0+qERaVkRpTGKyBHHYdwL2LXZm5t/gBtCB9KQSO/0zQgSTYEV1p0WcvSg79TLNPSvd5IDJMQ==", + "dev": true, + "requires": { + "querystringify": "^2.0.0", + "requires-port": "^1.0.0" + } + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.10.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "utila": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/utila/-/utila-0.4.0.tgz", + "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "v8-compile-cache": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/v8-compile-cache/-/v8-compile-cache-1.1.2.tgz", + "integrity": "sha512-ejdrifsIydN1XDH7EuR2hn8ZrkRKUYF7tUcBjBy/lhrCvs2K+zRlbW9UHc0IQ9RsYFZJFqJrieoIHfkCa0DBRA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", + "dev": true, + "requires": { + "builtins": "^1.0.3" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "vendors": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vendors/-/vendors-1.0.2.tgz", + "integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-file": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl-file/-/vinyl-file-2.0.0.tgz", + "integrity": "sha1-p+v1/779obfRjRQPyweyI++2dRo=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.3.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0", + "strip-bom-stream": "^2.0.0", + "vinyl": "^1.1.0" + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "vue-parser": { + "version": "1.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vue-parser/-/vue-parser-1.1.6.tgz", + "integrity": "sha512-v3/R7PLbaFVF/c8IIzWs1HgRpT2gN0dLRkaLIT5q+zJGVgmhN4VuZJF4Y9N4hFtFjS4B1EHxAOP6/tzqM4Ug2g==", + "dev": true, + "requires": { + "parse5": "^3.0.3" + } + }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "watch": { + "version": "0.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/watch/-/watch-0.18.0.tgz", + "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", + "dev": true, + "requires": { + "exec-sh": "^0.2.0", + "minimist": "^1.2.0" + } + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "dev": true, + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + } + }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, + "webassemblyjs": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webassemblyjs/-/webassemblyjs-1.3.0.tgz", + "integrity": "sha512-q/16d2hYjex5G5wczUqmP0e37KKxUYttvZgt6xgMia7yrSIZ2rX6tq/7HPey8Wi/T6oIWxUwsJ+rDcpKzdPmTw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/validation": "1.3.0", + "@webassemblyjs/wasm-parser": "1.3.0", + "@webassemblyjs/wast-parser": "1.3.0", + "long": "^3.2.0" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "webpack": { + "version": "4.8.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack/-/webpack-4.8.0.tgz", + "integrity": "sha512-tfPUKNWkoD+iHk1X0eyQhLR5X9auy5xguiJyjJy5nMgy5yZpmI+s6Y3husZFHmQOGNCl+xxU/A63jk3IceTZTg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.3.0", + "@webassemblyjs/wasm-edit": "1.3.0", + "@webassemblyjs/wasm-parser": "1.3.0", + "acorn": "^5.0.0", + "acorn-dynamic-import": "^3.0.0", + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0", + "chrome-trace-event": "^0.1.1", + "enhanced-resolve": "^4.0.0", + "eslint-scope": "^3.7.1", + "loader-runner": "^2.3.0", + "loader-utils": "^1.1.0", + "memory-fs": "~0.4.1", + "micromatch": "^3.1.8", + "mkdirp": "~0.5.0", + "neo-async": "^2.5.0", + "node-libs-browser": "^2.0.0", + "schema-utils": "^0.4.4", + "tapable": "^1.0.0", + "uglifyjs-webpack-plugin": "^1.2.4", + "watchpack": "^1.5.0", + "webpack-sources": "^1.0.1" + } + }, + "webpack-addons": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-addons/-/webpack-addons-1.1.5.tgz", + "integrity": "sha512-MGO0nVniCLFAQz1qv22zM02QPjcpAoJdy7ED0i3Zy7SY1IecgXCm460ib7H/Wq7e9oL5VL6S2BxaObxwIcag0g==", + "dev": true, + "requires": { + "jscodeshift": "^0.4.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "ast-types": { + "version": "0.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ast-types/-/ast-types-0.10.1.tgz", + "integrity": "sha512-UY7+9DPzlJ9VM8eY0b2TUZcZvF+1pO0hzMtAyjBYKhOmnvRlqYNYnWdtsMj0V16CGaMlpL0G1jnLbLo4AyotuQ==", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "jscodeshift": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jscodeshift/-/jscodeshift-0.4.1.tgz", + "integrity": "sha512-iOX6If+hsw0q99V3n31t4f5VlD1TQZddH08xbT65ZqA7T4Vkx68emrDZMUOLVvCEAJ6NpAk7DECe3fjC/t52AQ==", + "dev": true, + "requires": { + "async": "^1.5.0", + "babel-plugin-transform-flow-strip-types": "^6.8.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-1": "^6.5.0", + "babel-register": "^6.9.0", + "babylon": "^6.17.3", + "colors": "^1.1.2", + "flow-parser": "^0.*", + "lodash": "^4.13.1", + "micromatch": "^2.3.7", + "node-dir": "0.1.8", + "nomnom": "^1.8.1", + "recast": "^0.12.5", + "temp": "^0.8.1", + "write-file-atomic": "^1.2.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "recast": { + "version": "0.12.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/recast/-/recast-0.12.9.tgz", + "integrity": "sha512-y7ANxCWmMW8xLOaiopiRDlyjQ9ajKRENBH+2wjntIbk3A6ZR1+BLQttkmSHMY7Arl+AAZFwJ10grg2T6f1WI8A==", + "dev": true, + "requires": { + "ast-types": "0.10.1", + "core-js": "^2.4.1", + "esprima": "~4.0.0", + "private": "~0.1.5", + "source-map": "~0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + } + } + }, + "webpack-cli": { + "version": "2.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-cli/-/webpack-cli-2.1.3.tgz", + "integrity": "sha512-5AsKoL/Ccn8iTrwk3uErdyhetGH+c7VRQ7Itim2GL0IhBRq5rtojVDk00buMRmFmBpw1RvHXq97Gup965LbozA==", + "dev": true, + "requires": { + "chalk": "^2.3.2", + "cross-spawn": "^6.0.5", + "diff": "^3.5.0", + "enhanced-resolve": "^4.0.0", + "envinfo": "^4.4.2", + "glob-all": "^3.1.0", + "global-modules": "^1.0.0", + "got": "^8.2.0", + "import-local": "^1.0.0", + "inquirer": "^5.1.0", + "interpret": "^1.0.4", + "jscodeshift": "^0.5.0", + "listr": "^0.13.0", + "loader-utils": "^1.1.0", + "lodash": "^4.17.5", + "log-symbols": "^2.2.0", + "mkdirp": "^0.5.1", + "p-each-series": "^1.0.0", + "p-lazy": "^1.0.0", + "prettier": "^1.5.3", + "supports-color": "^5.3.0", + "v8-compile-cache": "^1.1.2", + "webpack-addons": "^1.1.5", + "yargs": "^11.1.0", + "yeoman-environment": "^2.0.0", + "yeoman-generator": "^2.0.4" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "dargs": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dargs/-/dargs-5.1.0.tgz", + "integrity": "sha1-7H6lDHhWTNNsnV7Bj2Yyn63ieCk=", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "got": { + "version": "8.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-observable": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-observable/-/is-observable-0.2.0.tgz", + "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", + "dev": true, + "requires": { + "symbol-observable": "^0.2.2" + } + }, + "listr": { + "version": "0.13.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/listr/-/listr-0.13.0.tgz", + "integrity": "sha1-ILsLowuuZg7oTMBQPfS+PVYjiH0=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "figures": "^1.7.0", + "indent-string": "^2.1.0", + "is-observable": "^0.2.0", + "is-promise": "^2.1.0", + "is-stream": "^1.1.0", + "listr-silent-renderer": "^1.1.1", + "listr-update-renderer": "^0.4.0", + "listr-verbose-renderer": "^0.4.0", + "log-symbols": "^1.0.2", + "log-update": "^1.0.2", + "ora": "^0.2.3", + "p-map": "^1.1.1", + "rxjs": "^5.4.2", + "stream-to-observable": "^0.2.0", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "dev": true, + "requires": { + "chalk": "^1.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "mem-fs-editor": { + "version": "4.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem-fs-editor/-/mem-fs-editor-4.0.3.tgz", + "integrity": "sha512-tgWmwI/+6vwu6POan82dTjxEpwAoaj0NAFnghtVo/FcLK2/7IhPUtFUUYlwou4MOY6OtjTUJtwpfH1h+eSUziw==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "deep-extend": "^0.6.0", + "ejs": "^2.5.9", + "glob": "^7.0.3", + "globby": "^7.1.1", + "isbinaryfile": "^3.0.2", + "mkdirp": "^0.5.0", + "multimatch": "^2.0.0", + "rimraf": "^2.2.8", + "through2": "^2.0.0", + "vinyl": "^2.0.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-cancelable": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", + "dev": true + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "pretty-bytes": { + "version": "4.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-bytes/-/pretty-bytes-4.0.2.tgz", + "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "rxjs": { + "version": "5.5.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rxjs/-/rxjs-5.5.12.tgz", + "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "dev": true, + "requires": { + "symbol-observable": "1.0.1" + }, + "dependencies": { + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", + "dev": true + } + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-observable": { + "version": "0.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/symbol-observable/-/symbol-observable-0.2.4.tgz", + "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=", + "dev": true + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "vinyl": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "11.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + }, + "yeoman-generator": { + "version": "2.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeoman-generator/-/yeoman-generator-2.0.5.tgz", + "integrity": "sha512-rV6tJ8oYzm4mmdF2T3wjY+Q42jKF2YiiD0VKfJ8/0ZYwmhCKC9Xs2346HVLPj/xE13i68psnFJv7iS6gWRkeAg==", + "dev": true, + "requires": { + "async": "^2.6.0", + "chalk": "^2.3.0", + "cli-table": "^0.3.1", + "cross-spawn": "^6.0.5", + "dargs": "^5.1.0", + "dateformat": "^3.0.3", + "debug": "^3.1.0", + "detect-conflict": "^1.0.0", + "error": "^7.0.2", + "find-up": "^2.1.0", + "github-username": "^4.0.0", + "istextorbinary": "^2.2.1", + "lodash": "^4.17.10", + "make-dir": "^1.1.0", + "mem-fs-editor": "^4.0.0", + "minimist": "^1.2.0", + "pretty-bytes": "^4.0.2", + "read-chunk": "^2.1.0", + "read-pkg-up": "^3.0.0", + "rimraf": "^2.6.2", + "run-async": "^2.0.0", + "shelljs": "^0.8.0", + "text-table": "^0.2.0", + "through2": "^2.0.0", + "yeoman-environment": "^2.0.5" + } + } + } + }, + "webpack-dev-middleware": { + "version": "3.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-dev-middleware/-/webpack-dev-middleware-3.1.3.tgz", + "integrity": "sha512-I6Mmy/QjWU/kXwCSFGaiOoL5YEQIVmbb0o45xMoCyQAg/mClqZVTcsX327sPfekDyJWpCxb+04whNyLOIxpJdQ==", + "dev": true, + "requires": { + "loud-rejection": "^1.6.0", + "memory-fs": "~0.4.1", + "mime": "^2.1.0", + "path-is-absolute": "^1.0.0", + "range-parser": "^1.0.3", + "url-join": "^4.0.0", + "webpack-log": "^1.0.1" + }, + "dependencies": { + "mime": { + "version": "2.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==", + "dev": true + } + } + }, + "webpack-dev-server": { + "version": "3.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-dev-server/-/webpack-dev-server-3.1.5.tgz", + "integrity": "sha512-LVHg+EPwZLHIlfvokSTgtJqO/vI5CQi89fASb5JEDtVMDjY0yuIEqPPdMiKaBJIB/Ab7v/UN/sYZ7WsZvntQKw==", + "dev": true, + "requires": { + "ansi-html": "0.0.7", + "array-includes": "^3.0.3", + "bonjour": "^3.5.0", + "chokidar": "^2.0.0", + "compression": "^1.5.2", + "connect-history-api-fallback": "^1.3.0", + "debug": "^3.1.0", + "del": "^3.0.0", + "express": "^4.16.2", + "html-entities": "^1.2.0", + "http-proxy-middleware": "~0.18.0", + "import-local": "^1.0.0", + "internal-ip": "1.2.0", + "ip": "^1.1.5", + "killable": "^1.0.0", + "loglevel": "^1.4.1", + "opn": "^5.1.0", + "portfinder": "^1.0.9", + "selfsigned": "^1.9.1", + "serve-index": "^1.7.2", + "sockjs": "0.3.19", + "sockjs-client": "1.1.5", + "spdy": "^3.4.1", + "strip-ansi": "^3.0.0", + "supports-color": "^5.1.0", + "webpack-dev-middleware": "3.1.3", + "webpack-log": "^1.1.2", + "yargs": "11.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "11.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-11.0.0.tgz", + "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "webpack-log": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-log/-/webpack-log-1.2.0.tgz", + "integrity": "sha512-U9AnICnu50HXtiqiDxuli5gLB5PGBo7VvcHx36jRZHwK4vzOYLbImqT4lwWwoMHdQWwEKw736fCHEekokTEKHA==", + "dev": true, + "requires": { + "chalk": "^2.1.0", + "log-symbols": "^2.1.0", + "loglevelnext": "^1.0.1", + "uuid": "^3.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "webpack-merge": { + "version": "4.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-merge/-/webpack-merge-4.1.2.tgz", + "integrity": "sha512-/0QYwW/H1N/CdXYA2PNPVbsxO3u2Fpz34vs72xm03SRfg6bMNGfMJIQEpQjKRvkG2JvT6oRJFpDtSrwbX8Jzvw==", + "dev": true, + "requires": { + "lodash": "^4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "webpack-notifier": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-notifier/-/webpack-notifier-1.6.0.tgz", + "integrity": "sha1-/6yOVf+MRpdSuMG7sBGhbxCYbgI=", + "dev": true, + "requires": { + "node-notifier": "^5.1.2", + "object-assign": "^4.1.0", + "strip-ansi": "^3.0.1" + } + }, + "webpack-sources": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "webpack-visualizer-plugin": { + "version": "0.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/webpack-visualizer-plugin/-/webpack-visualizer-plugin-0.1.11.tgz", + "integrity": "sha1-uHcK2GtPZSYSxosbeCJT+vn4o04=", + "dev": true, + "requires": { + "d3": "^3.5.6", + "mkdirp": "^0.5.1", + "react": "^0.14.0", + "react-dom": "^0.14.0" + } + }, + "websocket-driver": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/websocket-driver/-/websocket-driver-0.7.0.tgz", + "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", + "dev": true, + "requires": { + "http-parser-js": ">=0.4.0", + "websocket-extensions": ">=0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/websocket-extensions/-/websocket-extensions-0.1.3.tgz", + "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", + "integrity": "sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.19" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + } + } + }, + "whatwg-fetch": { + "version": "0.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz", + "integrity": "sha1-DjaExsuZlbQ+/J3wPkw2XZX9nMA=", + "dev": true + }, + "whatwg-mimetype": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", + "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==", + "dev": true + }, + "whatwg-url": { + "version": "6.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/whatwg-url/-/whatwg-url-6.4.1.tgz", + "integrity": "sha512-FwygsxsXx27x6XXuExA/ox3Ktwcbf+OAvrKmLulotDAiO1Q6ixchPFaHYsis2zZBZSJTR0+dR+JVtf7MlbqZjw==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "whet.extend": { + "version": "0.9.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/whet.extend/-/whet.extend-0.9.9.tgz", + "integrity": "sha1-+HfVv2SMl+WqVC+twW1qJZucEaE=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "win-release": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha1-X6VeAr58qTTt/BJmVjLoSbcuUgk=", + "dev": true, + "requires": { + "semver": "^5.0.1" + } + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "dev": true + }, + "winston": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/winston/-/winston-3.1.0.tgz", + "integrity": "sha512-FsQfEE+8YIEeuZEYhHDk5cILo1HOcWkGwvoidLrDgPog0r4bser1lEIOco2dN9zpDJ1M88hfDgZvxe5z4xNcwg==", + "dev": true, + "requires": { + "async": "^2.6.0", + "diagnostics": "^1.1.1", + "is-stream": "^1.1.0", + "logform": "^1.9.1", + "one-time": "0.0.4", + "readable-stream": "^2.3.6", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.2.0" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "winston-transport": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/winston-transport/-/winston-transport-4.2.0.tgz", + "integrity": "sha512-0R1bvFqxSlK/ZKTH86nymOuKv/cT1PQBMuDdA7k7f0S9fM44dNH6bXnuxwXPrN8lefJgtZq08BKdyZ0DZIy/rg==", + "dev": true, + "requires": { + "readable-stream": "^2.3.6", + "triple-beam": "^1.2.0" + } + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "workbox-background-sync": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-background-sync/-/workbox-background-sync-3.6.1.tgz", + "integrity": "sha512-lMXwUbZ/FQBWf/jkFwz0ARfMLeIk9q73+fsqGwwUwUcr8NC6GDZlgtH9sPndxU1VbM+bieRM9R9kVStE4s2uVQ==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-broadcast-cache-update": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-broadcast-cache-update/-/workbox-broadcast-cache-update-3.6.1.tgz", + "integrity": "sha512-wC6LQNNPGLfZ1W+kSA2sP5YrbUl5axYgD0iNU37l4ABaCmjpu2XiFwPH+v4NOj/YWJt+z2563YB4SFM+/rC2mg==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-build": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-build/-/workbox-build-3.6.1.tgz", + "integrity": "sha512-1xEaFzVWzcIMwNHIW8WesGL+7MOx7XeHU1et1VWGDbxHV0i2HL8koMxq3g2WpKJy+yEh0hRG+4KuTGMmeuQcMA==", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "common-tags": "^1.4.0", + "fs-extra": "^4.0.2", + "glob": "^7.1.2", + "joi": "^11.1.1", + "lodash.template": "^4.4.0", + "pretty-bytes": "^4.0.2", + "stringify-object": "^3.2.2", + "strip-comments": "^1.0.2", + "workbox-background-sync": "^3.6.1", + "workbox-broadcast-cache-update": "^3.6.1", + "workbox-cache-expiration": "^3.6.1", + "workbox-cacheable-response": "^3.6.1", + "workbox-core": "^3.6.1", + "workbox-google-analytics": "^3.6.1", + "workbox-navigation-preload": "^3.6.1", + "workbox-precaching": "^3.6.1", + "workbox-range-requests": "^3.6.1", + "workbox-routing": "^3.6.1", + "workbox-strategies": "^3.6.1", + "workbox-streams": "^3.6.1", + "workbox-sw": "^3.6.1" + }, + "dependencies": { + "fs-extra": { + "version": "4.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "pretty-bytes": { + "version": "4.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-bytes/-/pretty-bytes-4.0.2.tgz", + "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=", + "dev": true + } + } + }, + "workbox-cache-expiration": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-cache-expiration/-/workbox-cache-expiration-3.6.1.tgz", + "integrity": "sha512-mOV90D8cJ6S2s1GUGbfTvQ+WWKEMAvbHkH+vjIFdl+hXcToC7toctBI3UzI7vmmFv3TRQcP3TAxBmJgEFjgJew==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-cacheable-response": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-cacheable-response/-/workbox-cacheable-response-3.6.1.tgz", + "integrity": "sha512-67tsFrpgX5LI3Nu82eVXlqfdq/PegF+agjcrLRDfSlD6cySCZCb0cyFHwLhegw5A6BayRHzYcBM5/imGeaMwjw==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-core": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-core/-/workbox-core-3.6.1.tgz", + "integrity": "sha512-xrrPQ335Cdekihe1jhscXYm4mmhh7ZXqSlZqJhyVmp9lNp5xzz1t0R22AfoaVNsg0zdu6Ouqnn0RsQ53QkZ8tw==", + "dev": true + }, + "workbox-google-analytics": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-google-analytics/-/workbox-google-analytics-3.6.1.tgz", + "integrity": "sha512-rnAT2RseiQO8DWjjkQkojVHX/6MK/L88+UFKr92xG1fKGD2asOk97AG6i0fAAti6f4KMg2s5UWZthiFR9QH4fQ==", + "dev": true, + "requires": { + "workbox-background-sync": "^3.6.1", + "workbox-core": "^3.6.1", + "workbox-routing": "^3.6.1", + "workbox-strategies": "^3.6.1" + } + }, + "workbox-navigation-preload": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-navigation-preload/-/workbox-navigation-preload-3.6.1.tgz", + "integrity": "sha512-Dzzp0JasGZWHSbZdx+UY0ZFaJu6P1LGIlFw3A+oTHbop9rZY219BNREcpzHT107SP7VFBkz/KIGF7s05FD6tpQ==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-precaching": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-precaching/-/workbox-precaching-3.6.1.tgz", + "integrity": "sha512-qKNelNcGGSnKZveZRO+4sFKxr33iNMcP9Pbm8OkdEdAAZem0Ia4hIL87mHvwCvRnuj/vaV2BwRghZnzmLsK8Ng==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-range-requests": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-range-requests/-/workbox-range-requests-3.6.1.tgz", + "integrity": "sha512-/ZPvMvKUzWBVmmN+fCPslF8RXin0C5WAla9EE0taiAMWdrVfPGghERtZLHumk/yM/M3k+OqWzPxCV0Wg/mjbqg==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-routing": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-routing/-/workbox-routing-3.6.1.tgz", + "integrity": "sha512-9LoBs5ck9Rjutno4yfBzqFyiUqj2UvILgYHGFkjHLp7lA4KK9VIuBJjGCLNaWr2r0pe6DVM5tM2OvlAOa2JO3w==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-strategies": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-strategies/-/workbox-strategies-3.6.1.tgz", + "integrity": "sha512-OEw1psICNGpL1bqFZGyjl9N9hnmnRvsOA2EWAXxKVlwqmVvGzSeb8S46DPnH2JQgy77DRfNzeHVdfN6XirqdJw==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-streams": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-streams/-/workbox-streams-3.6.1.tgz", + "integrity": "sha512-SjO8wyUJ72+EXFVn9i9140hxbiN7d56k8gDHTxVoQT7OrCVYWkGFR0GzfnoRONaaHvO+/CGOyS37/Y+IXr7Vdw==", + "dev": true, + "requires": { + "workbox-core": "^3.6.1" + } + }, + "workbox-sw": { + "version": "3.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-sw/-/workbox-sw-3.6.1.tgz", + "integrity": "sha512-bXKvvjt5Oet87cpuSuVpiFYBohCv9xLmniZwMZPAFQVEtpPCyWv5X+UVZ+BpHVDBcRMYz7lXNIRWa9J54zR2vA==", + "dev": true + }, + "workbox-webpack-plugin": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/workbox-webpack-plugin/-/workbox-webpack-plugin-3.2.0.tgz", + "integrity": "sha512-zl1/2ChVhwcpSumDd3jSUfbDIk5MtTSW5xc/h/WPkBpYi4dwvfwmQ8KAXc1qBIEoDz++R483zwYTyJQJ0g6f3w==", + "dev": true, + "requires": { + "json-stable-stringify": "^1.0.1", + "workbox-build": "^3.2.0" + } + }, + "worker-farm": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/worker-farm/-/worker-farm-1.6.0.tgz", + "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "write-file-webpack-plugin": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/write-file-webpack-plugin/-/write-file-webpack-plugin-4.2.0.tgz", + "integrity": "sha512-sIjfV+M1Ia8p/lVcLjvM2I0Lq/40tCMZe+k0Pxg2TG6TKjUgHGwQeM42QdYLiHAIAITGQK1HEQA3YknFubzfDQ==", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "debug": "^2.6.8", + "filesize": "^3.2.1", + "lodash": "^4.5.1", + "mkdirp": "^0.5.1", + "moment": "^2.11.2" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "ws": { + "version": "3.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + } + }, + "xml": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "dev": true + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", + "dev": true + }, + "xmlhttprequest-ssl": { + "version": "1.5.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", + "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "6.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs/-/yargs-6.4.0.tgz", + "integrity": "sha1-gW4ahm1VmMzzTlWW3c4i2S2kkNQ=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "yargs-parser": { + "version": "4.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-4.2.1.tgz", + "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + } + } + } + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", + "dev": true + }, + "yeoman-environment": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeoman-environment/-/yeoman-environment-2.3.0.tgz", + "integrity": "sha512-PHSAkVOqYdcR+C+Uht1SGC4eVD/9OhygYFkYaI66xF8vKIeS1RNYay+umj2ZrQeJ50tF5Q/RSO6qGDz9y3Ifug==", + "dev": true, + "requires": { + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^3.1.0", + "diff": "^3.3.1", + "escape-string-regexp": "^1.0.2", + "globby": "^8.0.1", + "grouped-queue": "^0.3.3", + "inquirer": "^5.2.0", + "is-scoped": "^1.0.0", + "lodash": "^4.17.10", + "log-symbols": "^2.1.0", + "mem-fs": "^1.1.0", + "strip-ansi": "^4.0.0", + "text-table": "^0.2.0", + "untildify": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "globby": { + "version": "8.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "yeoman-generator": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeoman-generator/-/yeoman-generator-3.0.0.tgz", + "integrity": "sha512-aHsNXzkdgAoakZTZsDX7T56wYWYd1O5E/GBIFAVMJLH7TKRr+1MiEJszZQbbCSA+J+lpT743/8L88j35yNdTLQ==", + "dev": true, + "requires": { + "async": "^2.6.0", + "chalk": "^2.3.0", + "cli-table": "^0.3.1", + "cross-spawn": "^6.0.5", + "dargs": "^6.0.0", + "dateformat": "^3.0.3", + "debug": "^3.1.0", + "detect-conflict": "^1.0.0", + "error": "^7.0.2", + "find-up": "^3.0.0", + "github-username": "^4.0.0", + "istextorbinary": "^2.2.1", + "lodash": "^4.17.10", + "make-dir": "^1.1.0", + "mem-fs-editor": "^5.0.0", + "minimist": "^1.2.0", + "pretty-bytes": "^5.1.0", + "read-chunk": "^2.1.0", + "read-pkg-up": "^4.0.0", + "rimraf": "^2.6.2", + "run-async": "^2.0.0", + "shelljs": "^0.8.0", + "text-table": "^0.2.0", + "through2": "^2.0.0", + "yeoman-environment": "^2.0.5" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "zone.js": { + "version": "0.8.26", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/zone.js/-/zone.js-0.8.26.tgz", + "integrity": "sha512-W9Nj+UmBJG251wkCacIkETgra4QgBo/vgoEkb4a2uoLzpQG7qF9nzwoLXWU5xj3Fg2mxGvEDh47mg24vXccYjA==" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/package.json b/jhipster/jhipster-uaa/gateway/package.json new file mode 100644 index 0000000000..2196622413 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/package.json @@ -0,0 +1,131 @@ +{ + "name": "gateway", + "version": "0.0.0", + "description": "Description for gateway", + "private": true, + "license": "UNLICENSED", + "cacheDirectories": [ + "node_modules" + ], + "dependencies": { + "@angular/common": "6.1.0", + "@angular/compiler": "6.1.0", + "@angular/core": "6.1.0", + "@angular/forms": "6.1.0", + "@angular/platform-browser": "6.1.0", + "@angular/platform-browser-dynamic": "6.1.0", + "@angular/router": "6.1.0", + "@fortawesome/angular-fontawesome": "0.2.0", + "@fortawesome/fontawesome-svg-core": "1.2.4", + "@fortawesome/free-solid-svg-icons": "5.3.1", + "@ng-bootstrap/ng-bootstrap": "3.0.0", + "bootstrap": "4.1.3", + "core-js": "2.5.7", + "moment": "2.22.2", + "ng-jhipster": "0.5.4", + "ngx-cookie": "2.0.1", + "ngx-infinite-scroll": "0.5.1", + "ngx-webstorage": "2.0.1", + "reflect-metadata": "0.1.12", + "rxjs": "6.1.0", + "rxjs-compat": "6.1.0", + "swagger-ui": "2.2.10", + "tslib": "1.9.3", + "zone.js": "0.8.26" + }, + "devDependencies": { + "@angular/cli": "6.1.2", + "@angular/compiler-cli": "6.1.0", + "@ngtools/webpack": "6.0.0", + "@types/jest": "22.2.3", + "@types/node": "9.4.7", + "angular-router-loader": "0.8.5", + "angular2-template-loader": "0.6.2", + "browser-sync": "2.24.6", + "browser-sync-webpack-plugin": "2.2.2", + "cache-loader": "1.2.2", + "codelyzer": "4.2.1", + "copy-webpack-plugin": "4.5.1", + "css-loader": "0.28.10", + "exports-loader": "0.7.0", + "file-loader": "1.1.11", + "fork-ts-checker-webpack-plugin": "0.4.1", + "friendly-errors-webpack-plugin": "1.7.0", + "generator-jhipster": "5.4.2", + "html-loader": "0.5.5", + "html-webpack-plugin": "3.2.0", + "husky": "1.1.0", + "jest": "22.4.3", + "jest-junit": "5.1.0", + "jest-preset-angular": "5.2.2", + "jest-sonar-reporter": "2.0.0", + "lint-staged": "7.3.0", + "merge-jsons-webpack-plugin": "1.0.14", + "mini-css-extract-plugin": "0.4.2", + "moment-locales-webpack-plugin": "1.0.5", + "optimize-css-assets-webpack-plugin": "5.0.1", + "prettier": "1.11.1", + "proxy-middleware": "0.15.0", + "raw-loader": "0.5.1", + "rimraf": "2.6.1", + "simple-progress-webpack-plugin": "1.1.2", + "style-loader": "0.20.3", + "tapable": "1.0.0", + "terser-webpack-plugin": "1.0.0", + "thread-loader": "1.1.5", + "to-string-loader": "1.1.5", + "ts-loader": "4.0.1", + "tslint": "5.9.1", + "tslint-config-prettier": "1.9.0", + "tslint-loader": "3.6.0", + "typescript": "2.7.2", + "sass": "1.13.0", + "sass-loader": "7.1.0", + "postcss-loader": "2.1.1", + "xml2js": "0.4.19", + "webpack": "4.8.0", + "webpack-cli": "2.1.3", + "webpack-dev-server": "3.1.5", + "webpack-merge": "4.1.2", + "webpack-notifier": "1.6.0", + "webpack-visualizer-plugin": "0.1.11", + "workbox-webpack-plugin": "3.2.0", + "write-file-webpack-plugin": "4.2.0" + }, + "engines": { + "node": ">=8.9.0" + }, + "lint-staged": { + "src/**/*.{ts,css,scss}": [ + "prettier --write", + "git add" + ] + }, + "scripts": { + "prettier:format": "prettier --write \"src/**/*.{ts,css,scss}\"", + "lint": "tslint --project tsconfig.json -e 'node_modules/**'", + "lint:fix": "npm run lint -- --fix", + "ngc": "ngc -p tsconfig-aot.json", + "cleanup": "rimraf target/{aot,www}", + "clean-www": "rimraf target//www/app/{src,target/}", + "start": "npm run webpack:dev", + "start-tls": "npm run webpack:dev -- --env.tls", + "serve": "npm run start", + "build": "npm run webpack:prod", + "test": "npm run lint && jest --coverage --logHeapUsage -w=2 --config src/test/javascript/jest.conf.js", + "test:watch": "npm test -- --watch --clearCache", + "webpack:dev": "npm run webpack-dev-server -- --config webpack/webpack.dev.js --inline --hot --port=9060 --watch-content-base --env.stats=minimal", + "webpack:dev-verbose": "npm run webpack-dev-server -- --config webpack/webpack.dev.js --inline --hot --port=9060 --watch-content-base --profile --progress --env.stats=normal", + "webpack:build:main": "npm run webpack -- --config webpack/webpack.dev.js --env.stats=normal", + "webpack:build": "npm run cleanup && npm run webpack:build:main", + "webpack:prod:main": "npm run webpack -- --config webpack/webpack.prod.js --profile", + "webpack:prod": "npm run cleanup && npm run webpack:prod:main && npm run clean-www", + "webpack:test": "npm run test", + "webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js", + "webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js" + }, + "jestSonar": { + "reportPath": "target/test-results/jest", + "reportFile": "TESTS-results-sonar.xml" + } +} diff --git a/jhipster/jhipster-uaa/gateway/pom.xml b/jhipster/jhipster-uaa/gateway/pom.xml new file mode 100644 index 0000000000..52f84e4006 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/pom.xml @@ -0,0 +1,1095 @@ + + + 4.0.0 + + com.baeldung.jhipster.gateway + gateway + 0.0.1-SNAPSHOT + war + Gateway + + + + + + + + + + 3.0.0 + 1.8 + 2.12.6 + v8.12.0 + 6.4.1 + UTF-8 + UTF-8 + ${project.build.directory}/test-results + yyyyMMddHHmmss + ${java.version} + ${java.version} + -Djava.security.egd=file:/dev/./urandom -Xmx256m + jdt_apt + false + + + + + + + 2.0.25 + + 2.0.5.RELEASE + + 5.2.17.Final + + 3.22.0-GA + + 3.5.5 + 3.6 + 2.0.1.Final + 1.2.0.Final + + + 3.1.0 + 3.8.0 + 2.10 + 3.0.0-M2 + 3.1.0 + 2.22.0 + 3.2.2 + 0.9.11 + 1.6 + 0.8.2 + 3.4.2 + 3.5.0.1254 + 2.2.5 + + + http://localhost:9001 + src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/www/**/*.* + S3437,S4684,UndocumentedApi,BoldAndItalicTagsCheck + + src/main/webapp/app/**/*.* + Web:BoldAndItalicTagsCheck + + src/main/java/**/* + squid:S3437 + + src/main/java/**/* + squid:UndocumentedApi + + src/main/java/**/* + squid:S4684 + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + jacoco + ${project.testresult.directory}/jest/TESTS-results-sonar.xml + ${project.testresult.directory}/lcov.info + ${project.basedir}/src/main/ + ${project.testresult.directory}/surefire-reports + ${project.basedir}/src/test/ + + + + + + + + io.github.jhipster + jhipster-dependencies + ${jhipster-dependencies.version} + pom + import + + + + + + + + io.github.jhipster + jhipster-framework + + + + org.springframework.boot + spring-boot-starter-cache + + + io.dropwizard.metrics + metrics-core + + + io.dropwizard.metrics + metrics-annotation + + + io.dropwizard.metrics + metrics-json + + + io.dropwizard.metrics + metrics-jvm + + + io.dropwizard.metrics + metrics-servlet + + + io.dropwizard.metrics + metrics-servlets + + + com.fasterxml.jackson.datatype + jackson-datatype-hibernate5 + + + com.fasterxml.jackson.datatype + jackson-datatype-hppc + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-afterburner + + + com.h2database + h2 + test + + + org.apache.httpcomponents + httpclient + + + com.hazelcast + hazelcast + + + com.hazelcast + hazelcast-hibernate52 + + + com.hazelcast + hazelcast-spring + + + com.jayway.jsonpath + json-path + test + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-bean-validators + + + com.mattbertolini + liquibase-slf4j + + + com.ryantenney.metrics + metrics-spring + + + com.zaxxer + HikariCP + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + javax.cache + cache-api + + + mysql + mysql-connector-java + + + org.assertj + assertj-core + test + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + provided + + + org.hibernate + hibernate-envers + + + org.hibernate.validator + hibernate-validator + + + org.liquibase + liquibase-core + + + net.logstash.logback + logstash-logback-encoder + + + org.mapstruct + mapstruct-jdk8 + ${mapstruct.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + provided + + + org.springframework.boot + spring-boot-configuration-processor + provided + + + org.springframework.boot + spring-boot-loader-tools + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-logging + + + org.springframework.boot + spring-boot-starter-mail + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-test + test + + + org.springframework.security + spring-security-test + test + + + org.zalando + problem-spring-web + 0.24.0-RC.0 + + + org.springframework.security.oauth + spring-security-oauth2 + + + org.springframework.security + spring-security-jwt + + + + org.springframework.cloud + spring-cloud-starter-netflix-zuul + + + com.github.vladimir-bukhtoyarov + bucket4j-core + + + com.github.vladimir-bukhtoyarov + bucket4j-jcache + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.cloud + spring-cloud-starter-netflix-ribbon + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + org.springframework.retry + spring-retry + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.cloud + spring-cloud-security + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + org.springframework.cloud + spring-cloud-spring-service-connector + + + + org.springframework.security + spring-security-data + + + + + + spring-boot:run + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + ${maven-eclipse-plugin.version} + + true + true + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven-enforcer-plugin.version} + + + enforce-versions + + enforce + + + + + + + You are running an older version of Maven. JHipster requires at least Maven ${maven.version} + [${maven.version},) + + + + You are running an incompatible version of Java. JHipster requires JDK ${java.version} + [1.8,1.9) + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${maven-resources-plugin.version} + + + default-resources + validate + + copy-resources + + + target/classes + false + + # + + + + src/main/resources/ + true + + config/*.yml + + + + src/main/resources/ + false + + config/*.yml + + + + + + + docker-resources + verify + + copy-resources + + + target/classes/static/ + + + target/www + false + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + alphabetical + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + pre-unit-tests + + prepare-agent + + + + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + + + + + post-unit-test + test + + report + + + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + ${project.testresult.directory}/coverage/jacoco + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + org.liquibase + liquibase-maven-plugin + ${liquibase.version} + + src/main/resources/config/liquibase/master.xml + src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml + org.h2.Driver + jdbc:h2:file:./target/h2db/db/gateway + + gateway + + hibernate:spring:com.baeldung.jhipster.gateway.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + true + debug + + + + org.javassist + javassist + ${javassist.version} + + + org.liquibase.ext + liquibase-hibernate5 + ${liquibase-hibernate5.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring-boot.version} + + + javax.validation + validation-api + ${validation-api.version} + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + ${start-class} + true + true + + + + + com.google.cloud.tools + jib-maven-plugin + ${jib-maven-plugin.version} + + + openjdk:8-jre-alpine + + + gateway:latest + + + + sh + + chmod +x /entrypoint.sh && sync && /entrypoint.sh + + + 8080 + 5701/udp + + + ALWAYS + 0 + + true + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.jacoco + + jacoco-maven-plugin + + + ${jacoco-maven-plugin.version} + + + prepare-agent + + + + + + + + + com.github.eirslett + frontend-maven-plugin + ${frontend-maven-plugin.version} + + install-node-and-npm + npm + + + + + + + + + + + + + + + + no-liquibase + + ,no-liquibase + + + + swagger + + ,swagger + + + + tls + + ,tls + + + + webpack + + + ${basedir}/target/www/app/main.bundle.js + + + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-devtools + true + + + com.h2database + h2 + + + + + + com.github.eirslett + frontend-maven-plugin + ${frontend-maven-plugin.version} + + + install node and npm + + install-node-and-npm + + + ${node.version} + ${npm.version} + + + + npm install + + npm + + + + webpack build dev + + npm + + generate-resources + + run webpack:build + false + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + target/www/ + + + src/main/webapp + + WEB-INF/** + + + + + + + + + + dev${profile.no-liquibase} + + + + dev + + true + + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-devtools + true + + + com.h2database + h2 + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + target/www/ + + + src/main/webapp + + WEB-INF/** + + + + + + + + + + dev${profile.tls}${profile.no-liquibase} + + + + prod + + + org.springframework.boot + spring-boot-starter-undertow + + + + + + maven-clean-plugin + ${maven-clean-plugin.version} + + + + target/www/ + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + target/www/ + + + src/main/webapp + + WEB-INF/** + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${start-class} + true + + + + + build-info + + + + + + com.github.eirslett + frontend-maven-plugin + ${frontend-maven-plugin.version} + + + install node and npm + + install-node-and-npm + + + ${node.version} + ${npm.version} + + + + npm install + + npm + + + install + + + + webpack build test + + npm + + test + + run webpack:test + false + + + + webpack build prod + + npm + + generate-resources + + run webpack:prod + false + + + + + + pl.project13.maven + git-commit-id-plugin + ${git-commit-id-plugin.version} + + + + revision + + + + + false + true + + ^git.commit.id.abbrev$ + ^git.commit.id.describe$ + ^git.branch$ + + + + + + + + prod${profile.swagger}${profile.no-liquibase} + + + + + cc + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-devtools + true + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + src/main/webapp/ + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${start-class} + true + true + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + default-compile + none + + + default-testCompile + none + + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin.version} + + + compile + compile + + add-source + compile + + + + test-compile + test-compile + + add-source + testCompile + + + + + incremental + true + ${scala.version} + + + + + + + dev,swagger + + + + + zipkin + + + org.springframework.cloud + spring-cloud-starter-zipkin + + + + + + IDE + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + + + + + + diff --git a/jhipster/jhipster-uaa/gateway/postcss.config.js b/jhipster/jhipster-uaa/gateway/postcss.config.js new file mode 100644 index 0000000000..f549c034d5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/postcss.config.js @@ -0,0 +1,3 @@ +module.exports = { + plugins: [] +} diff --git a/jhipster/jhipster-uaa/gateway/proxy.conf.json b/jhipster/jhipster-uaa/gateway/proxy.conf.json new file mode 100644 index 0000000000..8b41fdf7fa --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/proxy.conf.json @@ -0,0 +1,7 @@ +{ + "*": { + "target": "http://localhost:8080", + "secure": false, + "loglevel": "debug" + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/.dockerignore b/jhipster/jhipster-uaa/gateway/src/main/docker/.dockerignore new file mode 100644 index 0000000000..b03bdc71ee --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/.dockerignore @@ -0,0 +1,14 @@ +# https://docs.docker.com/engine/reference/builder/#dockerignore-file +classes/ +generated-sources/ +generated-test-sources/ +h2db/ +maven-archiver/ +maven-status/ +reports/ +surefire-reports/ +test-classes/ +test-results/ +www/ +!*.jar +!*.war diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/Dockerfile b/jhipster/jhipster-uaa/gateway/src/main/docker/Dockerfile new file mode 100644 index 0000000000..6a1c74c0bf --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM openjdk:8-jre-alpine + +ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ + JHIPSTER_SLEEP=0 \ + JAVA_OPTS="" + +# Add a jhipster user to run our application so that it doesn't need to run as root +RUN adduser -D -s /bin/sh jhipster +WORKDIR /home/jhipster + +ADD entrypoint.sh entrypoint.sh +RUN chmod 755 entrypoint.sh && chown jhipster:jhipster entrypoint.sh +USER jhipster + +ENTRYPOINT ["./entrypoint.sh"] + +EXPOSE 8080 5701/udp + +ADD *.war app.war + diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/app.yml b/jhipster/jhipster-uaa/gateway/src/main/docker/app.yml new file mode 100644 index 0000000000..347681e676 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/app.yml @@ -0,0 +1,24 @@ +version: '2' +services: + gateway-app: + image: gateway + environment: + # - _JAVA_OPTIONS=-Xmx512m -Xms256m + - SPRING_PROFILES_ACTIVE=prod,swagger + - EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka + - SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config + - SPRING_DATASOURCE_URL=jdbc:mysql://gateway-mysql:3306/gateway?useUnicode=true&characterEncoding=utf8&useSSL=false + - JHIPSTER_SLEEP=30 # gives time for the JHipster Registry to boot before the application + ports: + - 8080:8080 + gateway-mysql: + extends: + file: mysql.yml + service: gateway-mysql + jhipster-registry: + extends: + file: jhipster-registry.yml + service: jhipster-registry + environment: + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/docker-config/ diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/README.md b/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/README.md new file mode 100644 index 0000000000..6aab9ffdd5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/README.md @@ -0,0 +1,7 @@ +# Central configuration sources details + +The JHipster-Registry will use the following directories as its configuration source : +- localhost-config : when running the registry in docker with the jhipster-registry.yml docker-compose file +- docker-config : when running the registry and the app both in docker with the app.yml docker-compose file + +For more info, refer to https://www.jhipster.tech/microservices-architecture/#registry_app_configuration diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/docker-config/application.yml b/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/docker-config/application.yml new file mode 100644 index 0000000000..8a973c0a35 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/docker-config/application.yml @@ -0,0 +1,15 @@ +# Common configuration shared between all applications +configserver: + name: Docker JHipster Registry + status: Connected to the JHipster Registry running in Docker + +jhipster: + security: + authentication: + jwt: + secret: my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded + +eureka: + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@jhipster-registry:8761/eureka/ diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/localhost-config/application.yml b/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/localhost-config/application.yml new file mode 100644 index 0000000000..db4602e419 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/central-server-config/localhost-config/application.yml @@ -0,0 +1,15 @@ +# Common configuration shared between all applications +configserver: + name: Docker JHipster Registry + status: Connected to the JHipster Registry running in Docker + +jhipster: + security: + authentication: + jwt: + secret: my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded + +eureka: + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/entrypoint.sh b/jhipster/jhipster-uaa/gateway/src/main/docker/entrypoint.sh new file mode 100644 index 0000000000..ccffafb5a4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} +exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar "${HOME}/app.war" "$@" diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/hazelcast-management-center.yml b/jhipster/jhipster-uaa/gateway/src/main/docker/hazelcast-management-center.yml new file mode 100644 index 0000000000..9ad1303458 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/hazelcast-management-center.yml @@ -0,0 +1,6 @@ +version: '2' +services: + gateway-hazelcast-management-center: + image: hazelcast/management-center:3.9.3 + ports: + - 8180:8080 diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/jhipster-registry.yml b/jhipster/jhipster-uaa/gateway/src/main/docker/jhipster-registry.yml new file mode 100644 index 0000000000..512bc54be6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/jhipster-registry.yml @@ -0,0 +1,22 @@ +version: '2' +services: + jhipster-registry: + image: jhipster/jhipster-registry:v4.0.4 + volumes: + - ./central-server-config:/central-config + # When run with the "dev" Spring profile, the JHipster Registry will + # read the config from the local filesystem (central-server-config directory) + # When run with the "prod" Spring profile, it will read the configuration from a Git repository + # See https://www.jhipster.tech/microservices-architecture/#registry_app_configuration + environment: + # - _JAVA_OPTIONS=-Xmx512m -Xms256m + - SPRING_PROFILES_ACTIVE=dev,swagger,uaa + - SPRING_SECURITY_USER_PASSWORD=admin + - JHIPSTER_REGISTRY_PASSWORD=admin + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/localhost-config/ + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=git + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_URI=https://github.com/jhipster/jhipster-registry/ + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_PATHS=central-config + ports: + - 8761:8761 diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/mysql.yml b/jhipster/jhipster-uaa/gateway/src/main/docker/mysql.yml new file mode 100644 index 0000000000..a3cc7bf368 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/mysql.yml @@ -0,0 +1,13 @@ +version: '2' +services: + gateway-mysql: + image: mysql:5.7.20 + # volumes: + # - ~/volumes/jhipster/gateway/mysql/:/var/lib/mysql/ + environment: + - MYSQL_USER=root + - MYSQL_ALLOW_EMPTY_PASSWORD=yes + - MYSQL_DATABASE=gateway + ports: + - 3306:3306 + command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp diff --git a/jhipster/jhipster-uaa/gateway/src/main/docker/sonar.yml b/jhipster/jhipster-uaa/gateway/src/main/docker/sonar.yml new file mode 100644 index 0000000000..64182e81ef --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/docker/sonar.yml @@ -0,0 +1,7 @@ +version: '2' +services: + gateway-sonar: + image: sonarqube:7.1-alpine + ports: + - 9001:9000 + - 9092:9092 diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/ApplicationWebXml.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/ApplicationWebXml.java new file mode 100644 index 0000000000..30ad451b11 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/ApplicationWebXml.java @@ -0,0 +1,21 @@ +package com.baeldung.jhipster.gateway; + +import com.baeldung.jhipster.gateway.config.DefaultProfileUtil; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * This is a helper Java class that provides an alternative to creating a web.xml. + * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc. + */ +public class ApplicationWebXml extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + /** + * set a default to use when no profile is configured. + */ + DefaultProfileUtil.addDefaultProfile(application.application()); + return application.sources(GatewayApp.class); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/GatewayApp.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/GatewayApp.java new file mode 100644 index 0000000000..60d90eae25 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/GatewayApp.java @@ -0,0 +1,109 @@ +package com.baeldung.jhipster.gateway; + +import com.baeldung.jhipster.gateway.config.ApplicationProperties; +import com.baeldung.jhipster.gateway.config.DefaultProfileUtil; + +import io.github.jhipster.config.JHipsterConstants; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.netflix.zuul.EnableZuulProxy; +import org.springframework.core.env.Environment; + +import javax.annotation.PostConstruct; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Arrays; +import java.util.Collection; + +@SpringBootApplication +@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class}) +@EnableDiscoveryClient +@EnableZuulProxy +public class GatewayApp { + + private static final Logger log = LoggerFactory.getLogger(GatewayApp.class); + + private final Environment env; + + public GatewayApp(Environment env) { + this.env = env; + } + + /** + * Initializes gateway. + *

+ * Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile + *

+ * You can find more information on how profiles work with JHipster on https://www.jhipster.tech/profiles/. + */ + @PostConstruct + public void initApplication() { + Collection activeProfiles = Arrays.asList(env.getActiveProfiles()); + if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { + log.error("You have misconfigured your application! It should not run " + + "with both the 'dev' and 'prod' profiles at the same time."); + } + if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)) { + log.error("You have misconfigured your application! It should not " + + "run with both the 'dev' and 'cloud' profiles at the same time."); + } + } + + /** + * Main method, used to run the application. + * + * @param args the command line arguments + */ + public static void main(String[] args) { + SpringApplication app = new SpringApplication(GatewayApp.class); + DefaultProfileUtil.addDefaultProfile(app); + Environment env = app.run(args).getEnvironment(); + logApplicationStartup(env); + } + + private static void logApplicationStartup(Environment env) { + String protocol = "http"; + if (env.getProperty("server.ssl.key-store") != null) { + protocol = "https"; + } + String serverPort = env.getProperty("server.port"); + String contextPath = env.getProperty("server.servlet.context-path"); + if (StringUtils.isBlank(contextPath)) { + contextPath = "/"; + } + String hostAddress = "localhost"; + try { + hostAddress = InetAddress.getLocalHost().getHostAddress(); + } catch (UnknownHostException e) { + log.warn("The host name could not be determined, using `localhost` as fallback"); + } + log.info("\n----------------------------------------------------------\n\t" + + "Application '{}' is running! Access URLs:\n\t" + + "Local: \t\t{}://localhost:{}{}\n\t" + + "External: \t{}://{}:{}{}\n\t" + + "Profile(s): \t{}\n----------------------------------------------------------", + env.getProperty("spring.application.name"), + protocol, + serverPort, + contextPath, + protocol, + hostAddress, + serverPort, + contextPath, + env.getActiveProfiles()); + + String configServerStatus = env.getProperty("configserver.status"); + if (configServerStatus == null) { + configServerStatus = "Not found or not setup for this application"; + } + log.info("\n----------------------------------------------------------\n\t" + + "Config Server: \t{}\n----------------------------------------------------------", configServerStatus); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/aop/logging/LoggingAspect.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/aop/logging/LoggingAspect.java new file mode 100644 index 0000000000..1563bf25bf --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/aop/logging/LoggingAspect.java @@ -0,0 +1,98 @@ +package com.baeldung.jhipster.gateway.aop.logging; + +import io.github.jhipster.config.JHipsterConstants; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.env.Environment; + +import java.util.Arrays; + +/** + * Aspect for logging execution of service and repository Spring components. + * + * By default, it only runs with the "dev" profile. + */ +@Aspect +public class LoggingAspect { + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + private final Environment env; + + public LoggingAspect(Environment env) { + this.env = env; + } + + /** + * Pointcut that matches all repositories, services and Web REST endpoints. + */ + @Pointcut("within(@org.springframework.stereotype.Repository *)" + + " || within(@org.springframework.stereotype.Service *)" + + " || within(@org.springframework.web.bind.annotation.RestController *)") + public void springBeanPointcut() { + // Method is empty as this is just a Pointcut, the implementations are in the advices. + } + + /** + * Pointcut that matches all Spring beans in the application's main packages. + */ + @Pointcut("within(com.baeldung.jhipster.gateway.repository..*)"+ + " || within(com.baeldung.jhipster.gateway.service..*)"+ + " || within(com.baeldung.jhipster.gateway.web.rest..*)") + public void applicationPackagePointcut() { + // Method is empty as this is just a Pointcut, the implementations are in the advices. + } + + /** + * Advice that logs methods throwing exceptions. + * + * @param joinPoint join point for advice + * @param e exception + */ + @AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e") + public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e); + + } else { + log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL"); + } + } + + /** + * Advice that logs when a method is entered and exited. + * + * @param joinPoint join point for advice + * @return result + * @throws Throwable throws IllegalArgumentException + */ + @Around("applicationPackagePointcut() && springBeanPointcut()") + public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { + if (log.isDebugEnabled()) { + log.debug("Enter: {}.{}() with argument[s] = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs())); + } + try { + Object result = joinPoint.proceed(); + if (log.isDebugEnabled()) { + log.debug("Exit: {}.{}() with result = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), result); + } + return result; + } catch (IllegalArgumentException e) { + log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), + joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName()); + + throw e; + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/ApplicationProperties.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/ApplicationProperties.java new file mode 100644 index 0000000000..01beaf3416 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/ApplicationProperties.java @@ -0,0 +1,14 @@ +package com.baeldung.jhipster.gateway.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Properties specific to Gateway. + *

+ * Properties are configured in the application.yml file. + * See {@link io.github.jhipster.config.JHipsterProperties} for a good example. + */ +@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) +public class ApplicationProperties { + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/AsyncConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/AsyncConfiguration.java new file mode 100644 index 0000000000..ba3a65750a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/AsyncConfiguration.java @@ -0,0 +1,59 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; +import io.github.jhipster.config.JHipsterProperties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.*; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.annotation.SchedulingConfigurer; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; + +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; + +@Configuration +@EnableAsync +@EnableScheduling +public class AsyncConfiguration implements AsyncConfigurer, SchedulingConfigurer { + + private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); + + private final JHipsterProperties jHipsterProperties; + + public AsyncConfiguration(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + } + + @Override + @Bean(name = "taskExecutor") + public Executor getAsyncExecutor() { + log.debug("Creating Async Task Executor"); + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); + executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); + executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); + executor.setThreadNamePrefix("gateway-Executor-"); + return new ExceptionHandlingAsyncTaskExecutor(executor); + } + + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return new SimpleAsyncUncaughtExceptionHandler(); + } + + @Override + public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { + taskRegistrar.setScheduler(scheduledTaskExecutor()); + } + + @Bean + public Executor scheduledTaskExecutor() { + return Executors.newScheduledThreadPool(jHipsterProperties.getAsync().getCorePoolSize()); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CacheConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CacheConfiguration.java new file mode 100644 index 0000000000..f4d9a818c9 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CacheConfiguration.java @@ -0,0 +1,155 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; + +import com.hazelcast.config.*; +import com.hazelcast.core.HazelcastInstance; +import com.hazelcast.core.Hazelcast; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.web.ServerProperties; + +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.cloud.client.serviceregistry.Registration; +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; + +import javax.annotation.PreDestroy; + +@Configuration +@EnableCaching +public class CacheConfiguration { + + private final Logger log = LoggerFactory.getLogger(CacheConfiguration.class); + + private final Environment env; + + private final ServerProperties serverProperties; + + private final DiscoveryClient discoveryClient; + + private Registration registration; + + public CacheConfiguration(Environment env, ServerProperties serverProperties, DiscoveryClient discoveryClient) { + this.env = env; + this.serverProperties = serverProperties; + this.discoveryClient = discoveryClient; + } + + @Autowired(required = false) + public void setRegistration(Registration registration) { + this.registration = registration; + } + + @PreDestroy + public void destroy() { + log.info("Closing Cache Manager"); + Hazelcast.shutdownAll(); + } + + @Bean + public CacheManager cacheManager(HazelcastInstance hazelcastInstance) { + log.debug("Starting HazelcastCacheManager"); + CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance); + return cacheManager; + } + + @Bean + public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties) { + log.debug("Configuring Hazelcast"); + HazelcastInstance hazelCastInstance = Hazelcast.getHazelcastInstanceByName("gateway"); + if (hazelCastInstance != null) { + log.debug("Hazelcast already initialized"); + return hazelCastInstance; + } + Config config = new Config(); + config.setInstanceName("gateway"); + config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); + if (this.registration == null) { + log.warn("No discovery service is set up, Hazelcast cannot create a cluster."); + } else { + // The serviceId is by default the application's name, + // see the "spring.application.name" standard Spring property + String serviceId = registration.getServiceId(); + log.debug("Configuring Hazelcast clustering for instanceId: {}", serviceId); + // In development, everything goes through 127.0.0.1, with a different port + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + log.debug("Application is running with the \"dev\" profile, Hazelcast " + + "cluster will only work with localhost instances"); + + System.setProperty("hazelcast.local.localAddress", "127.0.0.1"); + config.getNetworkConfig().setPort(serverProperties.getPort() + 5701); + config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); + for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { + String clusterMember = "127.0.0.1:" + (instance.getPort() + 5701); + log.debug("Adding Hazelcast (dev) cluster member " + clusterMember); + config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); + } + } else { // Production configuration, one host per instance all using port 5701 + config.getNetworkConfig().setPort(5701); + config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); + for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { + String clusterMember = instance.getHost() + ":5701"; + log.debug("Adding Hazelcast (prod) cluster member " + clusterMember); + config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); + } + } + } + config.getMapConfigs().put("default", initializeDefaultMapConfig(jHipsterProperties)); + + // Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + config.setManagementCenterConfig(initializeDefaultManagementCenterConfig(jHipsterProperties)); + config.getMapConfigs().put("com.baeldung.jhipster.gateway.domain.*", initializeDomainMapConfig(jHipsterProperties)); + return Hazelcast.newHazelcastInstance(config); + } + + private ManagementCenterConfig initializeDefaultManagementCenterConfig(JHipsterProperties jHipsterProperties) { + ManagementCenterConfig managementCenterConfig = new ManagementCenterConfig(); + managementCenterConfig.setEnabled(jHipsterProperties.getCache().getHazelcast().getManagementCenter().isEnabled()); + managementCenterConfig.setUrl(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUrl()); + managementCenterConfig.setUpdateInterval(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUpdateInterval()); + return managementCenterConfig; + } + + private MapConfig initializeDefaultMapConfig(JHipsterProperties jHipsterProperties) { + MapConfig mapConfig = new MapConfig(); + + /* + Number of backups. If 1 is set as the backup-count for example, + then all entries of the map will be copied to another JVM for + fail-safety. Valid numbers are 0 (no backup), 1, 2, 3. + */ + mapConfig.setBackupCount(jHipsterProperties.getCache().getHazelcast().getBackupCount()); + + /* + Valid values are: + NONE (no eviction), + LRU (Least Recently Used), + LFU (Least Frequently Used). + NONE is the default. + */ + mapConfig.setEvictionPolicy(EvictionPolicy.LRU); + + /* + Maximum size of the map. When max size is reached, + map is evicted based on the policy defined. + Any integer between 0 and Integer.MAX_VALUE. 0 means + Integer.MAX_VALUE. Default is 0. + */ + mapConfig.setMaxSizeConfig(new MaxSizeConfig(0, MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE)); + + return mapConfig; + } + + private MapConfig initializeDomainMapConfig(JHipsterProperties jHipsterProperties) { + MapConfig mapConfig = new MapConfig(); + mapConfig.setTimeToLiveSeconds(jHipsterProperties.getCache().getHazelcast().getTimeToLiveSeconds()); + return mapConfig; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CloudDatabaseConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CloudDatabaseConfiguration.java new file mode 100644 index 0000000000..0614a2a3d0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/CloudDatabaseConfiguration.java @@ -0,0 +1,24 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.config.JHipsterConstants; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.CacheManager; +import org.springframework.cloud.config.java.AbstractCloudConfig; +import org.springframework.context.annotation.*; + +import javax.sql.DataSource; + +@Configuration +@Profile(JHipsterConstants.SPRING_PROFILE_CLOUD) +public class CloudDatabaseConfiguration extends AbstractCloudConfig { + + private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class); + + @Bean + public DataSource dataSource(CacheManager cacheManager) { + log.info("Configuring JDBC datasource from a cloud provider"); + return connectionFactory().dataSource(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/Constants.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/Constants.java new file mode 100644 index 0000000000..48542e5196 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/Constants.java @@ -0,0 +1,17 @@ +package com.baeldung.jhipster.gateway.config; + +/** + * Application constants. + */ +public final class Constants { + + // Regex for acceptable logins + public static final String LOGIN_REGEX = "^[_.@A-Za-z0-9-]*$"; + + public static final String SYSTEM_ACCOUNT = "system"; + public static final String ANONYMOUS_USER = "anonymoususer"; + public static final String DEFAULT_LANGUAGE = "en"; + + private Constants() { + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DatabaseConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DatabaseConfiguration.java new file mode 100644 index 0000000000..ae5103f8b0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DatabaseConfiguration.java @@ -0,0 +1,39 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.h2.H2ConfigurationHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import java.sql.SQLException; + +@Configuration +@EnableJpaRepositories("com.baeldung.jhipster.gateway.repository") +@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") +@EnableTransactionManagement +public class DatabaseConfiguration { + + private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); + + + /** + * Open the TCP port for the H2 database, so it is available remotely. + * + * @return the H2 database TCP server + * @throws SQLException if the server failed to start + */ + @Bean(initMethod = "start", destroyMethod = "stop") + @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) + public Object h2TCPServer() throws SQLException { + log.debug("Starting H2 database"); + return H2ConfigurationHelper.createServer(); + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DateTimeFormatConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DateTimeFormatConfiguration.java new file mode 100644 index 0000000000..1fb622a04e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DateTimeFormatConfiguration.java @@ -0,0 +1,20 @@ +package com.baeldung.jhipster.gateway.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * Configure the converters to use the ISO format for dates by default. + */ +@Configuration +public class DateTimeFormatConfiguration implements WebMvcConfigurer { + + @Override + public void addFormatters(FormatterRegistry registry) { + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setUseIsoFormat(true); + registrar.registerFormatters(registry); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DefaultProfileUtil.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DefaultProfileUtil.java new file mode 100644 index 0000000000..b6c6209cd4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/DefaultProfileUtil.java @@ -0,0 +1,51 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.config.JHipsterConstants; + +import org.springframework.boot.SpringApplication; +import org.springframework.core.env.Environment; + +import java.util.*; + +/** + * Utility class to load a Spring profile to be used as default + * when there is no spring.profiles.active set in the environment or as command line argument. + * If the value is not available in application.yml then dev profile will be used as default. + */ +public final class DefaultProfileUtil { + + private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default"; + + private DefaultProfileUtil() { + } + + /** + * Set a default to use when no profile is configured. + * + * @param app the Spring application + */ + public static void addDefaultProfile(SpringApplication app) { + Map defProperties = new HashMap<>(); + /* + * The default profile to use when no other profiles are defined + * This cannot be set in the application.yml file. + * See https://github.com/spring-projects/spring-boot/issues/1219 + */ + defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); + app.setDefaultProperties(defProperties); + } + + /** + * Get the profiles that are applied else get default profiles. + * + * @param env spring environment + * @return profiles + */ + public static String[] getActiveProfiles(Environment env) { + String[] profiles = env.getActiveProfiles(); + if (profiles.length == 0) { + return env.getDefaultProfiles(); + } + return profiles; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/GatewayConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/GatewayConfiguration.java new file mode 100644 index 0000000000..cd1000ad80 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/GatewayConfiguration.java @@ -0,0 +1,55 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.config.JHipsterProperties; + +import com.baeldung.jhipster.gateway.gateway.ratelimiting.RateLimitingFilter; +import com.baeldung.jhipster.gateway.gateway.accesscontrol.AccessControlFilter; +import com.baeldung.jhipster.gateway.gateway.responserewriting.SwaggerBasePathRewritingFilter; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.cloud.netflix.zuul.filters.RouteLocator; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class GatewayConfiguration { + + @Configuration + public static class SwaggerBasePathRewritingConfiguration { + + @Bean + public SwaggerBasePathRewritingFilter swaggerBasePathRewritingFilter(){ + return new SwaggerBasePathRewritingFilter(); + } + } + + @Configuration + public static class AccessControlFilterConfiguration { + + @Bean + public AccessControlFilter accessControlFilter(RouteLocator routeLocator, JHipsterProperties jHipsterProperties){ + return new AccessControlFilter(routeLocator, jHipsterProperties); + } + } + + /** + * Configures the Zuul filter that limits the number of API calls per user. + *

+ * This uses Bucket4J to limit the API calls, see {@link com.baeldung.jhipster.gateway.gateway.ratelimiting.RateLimitingFilter}. + */ + @Configuration + @ConditionalOnProperty("jhipster.gateway.rate-limiting.enabled") + public static class RateLimitingConfiguration { + + private final JHipsterProperties jHipsterProperties; + + public RateLimitingConfiguration(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + } + + @Bean + public RateLimitingFilter rateLimitingFilter() { + return new RateLimitingFilter(jHipsterProperties); + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/JacksonConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/JacksonConfiguration.java new file mode 100644 index 0000000000..c90a10558b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/JacksonConfiguration.java @@ -0,0 +1,63 @@ +package com.baeldung.jhipster.gateway.config; + +import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.module.afterburner.AfterburnerModule; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.zalando.problem.ProblemModule; +import org.zalando.problem.violations.ConstraintViolationProblemModule; + +@Configuration +public class JacksonConfiguration { + + /** + * Support for Java date and time API. + * @return the corresponding Jackson module. + */ + @Bean + public JavaTimeModule javaTimeModule() { + return new JavaTimeModule(); + } + + @Bean + public Jdk8Module jdk8TimeModule() { + return new Jdk8Module(); + } + + + /* + * Support for Hibernate types in Jackson. + */ + @Bean + public Hibernate5Module hibernate5Module() { + return new Hibernate5Module(); + } + + /* + * Jackson Afterburner module to speed up serialization/deserialization. + */ + @Bean + public AfterburnerModule afterburnerModule() { + return new AfterburnerModule(); + } + + /* + * Module for serialization/deserialization of RFC7807 Problem. + */ + @Bean + ProblemModule problemModule() { + return new ProblemModule(); + } + + /* + * Module for serialization/deserialization of ConstraintViolationProblem. + */ + @Bean + ConstraintViolationProblemModule constraintViolationProblemModule() { + return new ConstraintViolationProblemModule(); + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LiquibaseConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LiquibaseConfiguration.java new file mode 100644 index 0000000000..8e67a70d1d --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LiquibaseConfiguration.java @@ -0,0 +1,53 @@ +package com.baeldung.jhipster.gateway.config; + +import javax.sql.DataSource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.core.task.TaskExecutor; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.liquibase.AsyncSpringLiquibase; +import liquibase.integration.spring.SpringLiquibase; + +@Configuration +public class LiquibaseConfiguration { + + private final Logger log = LoggerFactory.getLogger(LiquibaseConfiguration.class); + + private final Environment env; + + private final CacheManager cacheManager; + + public LiquibaseConfiguration(Environment env, CacheManager cacheManager) { + this.env = env; + this.cacheManager = cacheManager; + } + + @Bean + public SpringLiquibase liquibase(@Qualifier("taskExecutor") TaskExecutor taskExecutor, + DataSource dataSource, LiquibaseProperties liquibaseProperties) { + + // Use liquibase.integration.spring.SpringLiquibase if you don't want Liquibase to start asynchronously + SpringLiquibase liquibase = new AsyncSpringLiquibase(taskExecutor, env); + liquibase.setDataSource(dataSource); + liquibase.setChangeLog("classpath:config/liquibase/master.xml"); + liquibase.setContexts(liquibaseProperties.getContexts()); + liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema()); + liquibase.setDropFirst(liquibaseProperties.isDropFirst()); + liquibase.setChangeLogParameters(liquibaseProperties.getParameters()); + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE)) { + liquibase.setShouldRun(false); + } else { + liquibase.setShouldRun(liquibaseProperties.isEnabled()); + log.debug("Configuring Liquibase"); + } + return liquibase; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LocaleConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LocaleConfiguration.java new file mode 100644 index 0000000000..ac7c3c8299 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LocaleConfiguration.java @@ -0,0 +1,27 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.config.locale.AngularCookieLocaleResolver; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.LocaleResolver; +import org.springframework.web.servlet.config.annotation.*; +import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; + +@Configuration +public class LocaleConfiguration implements WebMvcConfigurer { + + @Bean(name = "localeResolver") + public LocaleResolver localeResolver() { + AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); + cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); + return cookieLocaleResolver; + } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); + localeChangeInterceptor.setParamName("language"); + registry.addInterceptor(localeChangeInterceptor); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingAspectConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingAspectConfiguration.java new file mode 100644 index 0000000000..16b9c16515 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingAspectConfiguration.java @@ -0,0 +1,19 @@ +package com.baeldung.jhipster.gateway.config; + +import com.baeldung.jhipster.gateway.aop.logging.LoggingAspect; + +import io.github.jhipster.config.JHipsterConstants; + +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; + +@Configuration +@EnableAspectJAutoProxy +public class LoggingAspectConfiguration { + + @Bean + @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) + public LoggingAspect loggingAspect(Environment env) { + return new LoggingAspect(env); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingConfiguration.java new file mode 100644 index 0000000000..8e7443dc34 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/LoggingConfiguration.java @@ -0,0 +1,163 @@ +package com.baeldung.jhipster.gateway.config; + +import java.net.InetSocketAddress; +import java.util.Iterator; + +import io.github.jhipster.config.JHipsterProperties; + +import ch.qos.logback.classic.AsyncAppender; +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.boolex.OnMarkerEvaluator; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.LoggerContextListener; +import ch.qos.logback.core.Appender; +import ch.qos.logback.core.filter.EvaluatorFilter; +import ch.qos.logback.core.spi.ContextAwareBase; +import ch.qos.logback.core.spi.FilterReply; +import net.logstash.logback.appender.LogstashTcpSocketAppender; +import net.logstash.logback.encoder.LogstashEncoder; +import net.logstash.logback.stacktrace.ShortenedThrowableConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.context.annotation.Configuration; + +@Configuration +@RefreshScope +public class LoggingConfiguration { + + private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH"; + + private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH"; + + private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class); + + private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + + private final String appName; + + private final String serverPort; + + private final String version; + + private final JHipsterProperties jHipsterProperties; + + public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, + @Value("${info.project.version:}") String version, JHipsterProperties jHipsterProperties) { + this.appName = appName; + this.serverPort = serverPort; + this.version = version; + this.jHipsterProperties = jHipsterProperties; + if (jHipsterProperties.getLogging().getLogstash().isEnabled()) { + addLogstashAppender(context); + addContextListener(context); + } + if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { + setMetricsMarkerLogbackFilter(context); + } + } + + private void addContextListener(LoggerContext context) { + LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener(); + loggerContextListener.setContext(context); + context.addListener(loggerContextListener); + } + + private void addLogstashAppender(LoggerContext context) { + log.info("Initializing Logstash logging"); + + LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender(); + logstashAppender.setName(LOGSTASH_APPENDER_NAME); + logstashAppender.setContext(context); + String optionalFields = ""; + String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"," + + optionalFields + "\"version\":\"" + version + "\"}"; + + // More documentation is available at: https://github.com/logstash/logstash-logback-encoder + LogstashEncoder logstashEncoder = new LogstashEncoder(); + // Set the Logstash appender config from JHipster properties + logstashEncoder.setCustomFields(customFields); + // Set the Logstash appender config from JHipster properties + logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(), jHipsterProperties.getLogging().getLogstash().getPort())); + + ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter(); + throwableConverter.setRootCauseFirst(true); + logstashEncoder.setThrowableConverter(throwableConverter); + logstashEncoder.setCustomFields(customFields); + + logstashAppender.setEncoder(logstashEncoder); + logstashAppender.start(); + + // Wrap the appender in an Async appender for performance + AsyncAppender asyncLogstashAppender = new AsyncAppender(); + asyncLogstashAppender.setContext(context); + asyncLogstashAppender.setName(ASYNC_LOGSTASH_APPENDER_NAME); + asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize()); + asyncLogstashAppender.addAppender(logstashAppender); + asyncLogstashAppender.start(); + + context.getLogger("ROOT").addAppender(asyncLogstashAppender); + } + + // Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender + private void setMetricsMarkerLogbackFilter(LoggerContext context) { + log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME); + OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator(); + onMarkerMetricsEvaluator.setContext(context); + onMarkerMetricsEvaluator.addMarker("metrics"); + onMarkerMetricsEvaluator.start(); + EvaluatorFilter metricsFilter = new EvaluatorFilter<>(); + metricsFilter.setContext(context); + metricsFilter.setEvaluator(onMarkerMetricsEvaluator); + metricsFilter.setOnMatch(FilterReply.DENY); + metricsFilter.start(); + + for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) { + for (Iterator> it = logger.iteratorForAppenders(); it.hasNext();) { + Appender appender = it.next(); + if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) { + log.debug("Filter metrics logs from the {} appender", appender.getName()); + appender.setContext(context); + appender.addFilter(metricsFilter); + appender.start(); + } + } + } + } + + /** + * Logback configuration is achieved by configuration file and API. + * When configuration file change is detected, the configuration is reset. + * This listener ensures that the programmatic configuration is also re-applied after reset. + */ + class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener { + + @Override + public boolean isResetResistant() { + return true; + } + + @Override + public void onStart(LoggerContext context) { + addLogstashAppender(context); + } + + @Override + public void onReset(LoggerContext context) { + addLogstashAppender(context); + } + + @Override + public void onStop(LoggerContext context) { + // Nothing to do. + } + + @Override + public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) { + // Nothing to do. + } + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/MetricsConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/MetricsConfiguration.java new file mode 100644 index 0000000000..0626cdade7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/MetricsConfiguration.java @@ -0,0 +1,99 @@ +package com.baeldung.jhipster.gateway.config; + +import io.github.jhipster.config.JHipsterProperties; + +import com.codahale.metrics.JmxReporter; +import com.codahale.metrics.JvmAttributeGaugeSet; +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.Slf4jReporter; +import com.codahale.metrics.health.HealthCheckRegistry; +import com.codahale.metrics.jvm.*; +import com.ryantenney.metrics.spring.config.annotation.EnableMetrics; +import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter; +import com.zaxxer.hikari.HikariDataSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.*; + +import javax.annotation.PostConstruct; +import java.lang.management.ManagementFactory; +import java.util.concurrent.TimeUnit; + +@Configuration +@EnableMetrics(proxyTargetClass = true) +public class MetricsConfiguration extends MetricsConfigurerAdapter { + + private static final String PROP_METRIC_REG_JVM_MEMORY = "jvm.memory"; + private static final String PROP_METRIC_REG_JVM_GARBAGE = "jvm.garbage"; + private static final String PROP_METRIC_REG_JVM_THREADS = "jvm.threads"; + private static final String PROP_METRIC_REG_JVM_FILES = "jvm.files"; + private static final String PROP_METRIC_REG_JVM_BUFFERS = "jvm.buffers"; + private static final String PROP_METRIC_REG_JVM_ATTRIBUTE_SET = "jvm.attributes"; + + private final Logger log = LoggerFactory.getLogger(MetricsConfiguration.class); + + private MetricRegistry metricRegistry = new MetricRegistry(); + + private HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); + + private final JHipsterProperties jHipsterProperties; + + private HikariDataSource hikariDataSource; + + public MetricsConfiguration(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + } + + @Autowired(required = false) + public void setHikariDataSource(HikariDataSource hikariDataSource) { + this.hikariDataSource = hikariDataSource; + } + + @Override + @Bean + public MetricRegistry getMetricRegistry() { + return metricRegistry; + } + + @Override + @Bean + public HealthCheckRegistry getHealthCheckRegistry() { + return healthCheckRegistry; + } + + @PostConstruct + public void init() { + log.debug("Registering JVM gauges"); + metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge()); + metricRegistry.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); + metricRegistry.register(PROP_METRIC_REG_JVM_ATTRIBUTE_SET, new JvmAttributeGaugeSet()); + if (hikariDataSource != null) { + log.debug("Monitoring the datasource"); + // remove the factory created by HikariDataSourceMetricsPostProcessor until JHipster migrate to Micrometer + hikariDataSource.setMetricsTrackerFactory(null); + hikariDataSource.setMetricRegistry(metricRegistry); + } + if (jHipsterProperties.getMetrics().getJmx().isEnabled()) { + log.debug("Initializing Metrics JMX reporting"); + JmxReporter jmxReporter = JmxReporter.forRegistry(metricRegistry).build(); + jmxReporter.start(); + } + if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { + log.info("Initializing Metrics Log reporting"); + Marker metricsMarker = MarkerFactory.getMarker("metrics"); + final Slf4jReporter reporter = Slf4jReporter.forRegistry(metricRegistry) + .outputTo(LoggerFactory.getLogger("metrics")) + .markWith(metricsMarker) + .convertRatesTo(TimeUnit.SECONDS) + .convertDurationsTo(TimeUnit.MILLISECONDS) + .build(); + reporter.start(jHipsterProperties.getMetrics().getLogs().getReportFrequency(), TimeUnit.SECONDS); + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/SecurityConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/SecurityConfiguration.java new file mode 100644 index 0000000000..bdc0650901 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/SecurityConfiguration.java @@ -0,0 +1,83 @@ +package com.baeldung.jhipster.gateway.config; + +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2JwtAccessTokenConverter; +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2Properties; +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2SignatureVerifierClient; +import com.baeldung.jhipster.gateway.security.AuthoritiesConstants; + +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; +import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; +import org.springframework.security.web.csrf.CookieCsrfTokenRepository; +import org.springframework.security.web.csrf.CsrfFilter; +import org.springframework.web.filter.CorsFilter; +import org.springframework.web.client.RestTemplate; + +@Configuration +@EnableResourceServer +@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) +public class SecurityConfiguration extends ResourceServerConfigurerAdapter { + private final OAuth2Properties oAuth2Properties; + + private final CorsFilter corsFilter; + + public SecurityConfiguration(OAuth2Properties oAuth2Properties, CorsFilter corsFilter) { + this.oAuth2Properties = oAuth2Properties; + this.corsFilter = corsFilter; + } + + @Override + public void configure(HttpSecurity http) throws Exception { + http + .csrf() + .ignoringAntMatchers("/h2-console/**") + .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) + .and() + .addFilterBefore(corsFilter, CsrfFilter.class) + .headers() + .frameOptions() + .disable() + .and() + .sessionManagement() + .sessionCreationPolicy(SessionCreationPolicy.STATELESS) + .and() + .authorizeRequests() + .antMatchers("/api/**").authenticated() + .antMatchers("/management/health").permitAll() + .antMatchers("/management/info").permitAll() + .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN); + } + + @Bean + public TokenStore tokenStore(JwtAccessTokenConverter jwtAccessTokenConverter) { + return new JwtTokenStore(jwtAccessTokenConverter); + } + + @Bean + public JwtAccessTokenConverter jwtAccessTokenConverter(OAuth2SignatureVerifierClient signatureVerifierClient) { + return new OAuth2JwtAccessTokenConverter(oAuth2Properties, signatureVerifierClient); + } + + @Bean + @Qualifier("loadBalancedRestTemplate") + public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) { + RestTemplate restTemplate = new RestTemplate(); + customizer.customize(restTemplate); + return restTemplate; + } + + @Bean + @Qualifier("vanillaRestTemplate") + public RestTemplate vanillaRestTemplate() { + return new RestTemplate(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/WebConfigurer.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/WebConfigurer.java new file mode 100644 index 0000000000..3bc1d6ad88 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/WebConfigurer.java @@ -0,0 +1,210 @@ +package com.baeldung.jhipster.gateway.config; + +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.servlet.InstrumentedFilter; +import com.codahale.metrics.servlets.MetricsServlet; +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; +import io.github.jhipster.config.h2.H2ConfigurationHelper; +import io.github.jhipster.web.filter.CachingHttpHeadersFilter; +import io.undertow.UndertowOptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.*; +import org.springframework.boot.web.servlet.ServletContextInitializer; +import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.http.MediaType; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import javax.servlet.*; +import java.io.File; +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Paths; +import java.util.*; + +import static java.net.URLDecoder.decode; + +/** + * Configuration of web application with Servlet 3.0 APIs. + */ +@Configuration +public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer { + + private final Logger log = LoggerFactory.getLogger(WebConfigurer.class); + + private final Environment env; + + private final JHipsterProperties jHipsterProperties; + + private MetricRegistry metricRegistry; + + public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) { + + this.env = env; + this.jHipsterProperties = jHipsterProperties; + } + + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + if (env.getActiveProfiles().length != 0) { + log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); + } + EnumSet disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC); + initMetrics(servletContext, disps); + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { + initCachingHttpHeadersFilter(servletContext, disps); + } + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + initH2Console(servletContext); + } + log.info("Web application fully configured"); + } + + /** + * Customize the Servlet engine: Mime types, the document root, the cache. + */ + @Override + public void customize(WebServerFactory server) { + setMimeMappings(server); + // When running in an IDE or with ./mvnw spring-boot:run, set location of the static web assets. + setLocationForStaticAssets(server); + + /* + * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288 + * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1. + * See the JHipsterProperties class and your application-*.yml configuration files + * for more information. + */ + if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && + server instanceof UndertowServletWebServerFactory) { + + ((UndertowServletWebServerFactory) server) + .addBuilderCustomizers(builder -> + builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)); + } + } + + private void setMimeMappings(WebServerFactory server) { + if (server instanceof ConfigurableServletWebServerFactory) { + MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); + // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711 + mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); + // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64 + mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); + ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; + servletWebServer.setMimeMappings(mappings); + } + } + + private void setLocationForStaticAssets(WebServerFactory server) { + if (server instanceof ConfigurableServletWebServerFactory) { + ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; + File root; + String prefixPath = resolvePathPrefix(); + root = new File(prefixPath + "target/www/"); + if (root.exists() && root.isDirectory()) { + servletWebServer.setDocumentRoot(root); + } + } + } + + /** + * Resolve path prefix to static resources. + */ + private String resolvePathPrefix() { + String fullExecutablePath; + try { + fullExecutablePath = decode(this.getClass().getResource("").getPath(), StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + /* try without decoding if this ever happens */ + fullExecutablePath = this.getClass().getResource("").getPath(); + } + String rootPath = Paths.get(".").toUri().normalize().getPath(); + String extractedPath = fullExecutablePath.replace(rootPath, ""); + int extractionEndIndex = extractedPath.indexOf("target/"); + if (extractionEndIndex <= 0) { + return ""; + } + return extractedPath.substring(0, extractionEndIndex); + } + + /** + * Initializes the caching HTTP Headers Filter. + */ + private void initCachingHttpHeadersFilter(ServletContext servletContext, + EnumSet disps) { + log.debug("Registering Caching HTTP Headers Filter"); + FilterRegistration.Dynamic cachingHttpHeadersFilter = + servletContext.addFilter("cachingHttpHeadersFilter", + new CachingHttpHeadersFilter(jHipsterProperties)); + + cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/i18n/*"); + cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*"); + cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*"); + cachingHttpHeadersFilter.setAsyncSupported(true); + } + + /** + * Initializes Metrics. + */ + private void initMetrics(ServletContext servletContext, EnumSet disps) { + log.debug("Initializing Metrics registries"); + servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, + metricRegistry); + servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, + metricRegistry); + + log.debug("Registering Metrics Filter"); + FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter", + new InstrumentedFilter()); + + metricsFilter.addMappingForUrlPatterns(disps, true, "/*"); + metricsFilter.setAsyncSupported(true); + + log.debug("Registering Metrics Servlet"); + ServletRegistration.Dynamic metricsAdminServlet = + servletContext.addServlet("metricsServlet", new MetricsServlet()); + + metricsAdminServlet.addMapping("/management/metrics/*"); + metricsAdminServlet.setAsyncSupported(true); + metricsAdminServlet.setLoadOnStartup(2); + } + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = jHipsterProperties.getCors(); + if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { + log.debug("Registering CORS filter"); + source.registerCorsConfiguration("/api/**", config); + source.registerCorsConfiguration("/management/**", config); + source.registerCorsConfiguration("/v2/api-docs", config); + source.registerCorsConfiguration("/auth/**", config); + source.registerCorsConfiguration("/*/api/**", config); + source.registerCorsConfiguration("/*/management/**", config); + source.registerCorsConfiguration("/*/oauth/**", config); + } + return new CorsFilter(source); + } + + /** + * Initializes H2 console. + */ + private void initH2Console(ServletContext servletContext) { + log.debug("Initialize H2 console"); + H2ConfigurationHelper.initH2Console(servletContext); + } + + @Autowired(required = false) + public void setMetricRegistry(MetricRegistry metricRegistry) { + this.metricRegistry = metricRegistry; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/apidoc/GatewaySwaggerResourcesProvider.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/apidoc/GatewaySwaggerResourcesProvider.java new file mode 100644 index 0000000000..69bf50d30f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/apidoc/GatewaySwaggerResourcesProvider.java @@ -0,0 +1,54 @@ +package com.baeldung.jhipster.gateway.config.apidoc; + +import java.util.ArrayList; +import java.util.List; + +import io.github.jhipster.config.JHipsterConstants; + +import org.springframework.context.annotation.*; +import org.springframework.cloud.netflix.zuul.filters.Route; +import org.springframework.cloud.netflix.zuul.filters.RouteLocator; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Component; + +import springfox.documentation.swagger.web.SwaggerResource; +import springfox.documentation.swagger.web.SwaggerResourcesProvider; + +/** + * Retrieves all registered microservices Swagger resources. + */ +@Component +@Primary +@Profile(JHipsterConstants.SPRING_PROFILE_SWAGGER) +public class GatewaySwaggerResourcesProvider implements SwaggerResourcesProvider { + + private final RouteLocator routeLocator; + + public GatewaySwaggerResourcesProvider(RouteLocator routeLocator) { + this.routeLocator = routeLocator; + } + + @Override + public List get() { + List resources = new ArrayList<>(); + + //Add the default swagger resource that correspond to the gateway's own swagger doc + resources.add(swaggerResource("default", "/v2/api-docs")); + + //Add the registered microservices swagger docs as additional swagger resources + List routes = routeLocator.getRoutes(); + routes.forEach(route -> { + resources.add(swaggerResource(route.getId(), route.getFullPath().replace("**", "v2/api-docs"))); + }); + + return resources; + } + + private SwaggerResource swaggerResource(String name, String location) { + SwaggerResource swaggerResource = new SwaggerResource(); + swaggerResource.setName(name); + swaggerResource.setLocation(location); + swaggerResource.setSwaggerVersion("2.0"); + return swaggerResource; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/AuditEventConverter.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/AuditEventConverter.java new file mode 100644 index 0000000000..f8745d0918 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/AuditEventConverter.java @@ -0,0 +1,86 @@ +package com.baeldung.jhipster.gateway.config.audit; + +import com.baeldung.jhipster.gateway.domain.PersistentAuditEvent; + +import org.springframework.boot.actuate.audit.AuditEvent; +import org.springframework.security.web.authentication.WebAuthenticationDetails; +import org.springframework.stereotype.Component; + +import java.util.*; + +@Component +public class AuditEventConverter { + + /** + * Convert a list of PersistentAuditEvent to a list of AuditEvent + * + * @param persistentAuditEvents the list to convert + * @return the converted list. + */ + public List convertToAuditEvent(Iterable persistentAuditEvents) { + if (persistentAuditEvents == null) { + return Collections.emptyList(); + } + List auditEvents = new ArrayList<>(); + for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) { + auditEvents.add(convertToAuditEvent(persistentAuditEvent)); + } + return auditEvents; + } + + /** + * Convert a PersistentAuditEvent to an AuditEvent + * + * @param persistentAuditEvent the event to convert + * @return the converted list. + */ + public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) { + if (persistentAuditEvent == null) { + return null; + } + return new AuditEvent(persistentAuditEvent.getAuditEventDate(), persistentAuditEvent.getPrincipal(), + persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData())); + } + + /** + * Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface + * + * @param data the data to convert + * @return a map of String, Object + */ + public Map convertDataToObjects(Map data) { + Map results = new HashMap<>(); + + if (data != null) { + for (Map.Entry entry : data.entrySet()) { + results.put(entry.getKey(), entry.getValue()); + } + } + return results; + } + + /** + * Internal conversion. This method will allow to save additional data. + * By default, it will save the object as string + * + * @param data the data to convert + * @return a map of String, String + */ + public Map convertDataToStrings(Map data) { + Map results = new HashMap<>(); + + if (data != null) { + for (Map.Entry entry : data.entrySet()) { + // Extract the data that will be saved. + if (entry.getValue() instanceof WebAuthenticationDetails) { + WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) entry.getValue(); + results.put("remoteAddress", authenticationDetails.getRemoteAddress()); + results.put("sessionId", authenticationDetails.getSessionId()); + } else { + results.put(entry.getKey(), Objects.toString(entry.getValue())); + } + } + } + return results; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/package-info.java new file mode 100644 index 0000000000..2772f6041d --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/audit/package-info.java @@ -0,0 +1,4 @@ +/** + * Audit specific code. + */ +package com.baeldung.jhipster.gateway.config.audit; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2AuthenticationConfiguration.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2AuthenticationConfiguration.java new file mode 100644 index 0000000000..bc5a4979a1 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2AuthenticationConfiguration.java @@ -0,0 +1,80 @@ +package com.baeldung.jhipster.gateway.config.oauth2; + +import com.baeldung.jhipster.gateway.security.oauth2.CookieTokenExtractor; +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2AuthenticationService; +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2CookieHelper; +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2TokenEndpointClient; +import com.baeldung.jhipster.gateway.web.filter.RefreshTokenFilterConfigurer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; +import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; +import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer; +import org.springframework.security.oauth2.provider.authentication.TokenExtractor; +import org.springframework.security.oauth2.provider.token.TokenStore; + +/** + * Configures the RefreshFilter refreshing expired OAuth2 token Cookies. + */ +@Configuration +@EnableResourceServer +@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) +public class OAuth2AuthenticationConfiguration extends ResourceServerConfigurerAdapter { + private final OAuth2Properties oAuth2Properties; + private final OAuth2TokenEndpointClient tokenEndpointClient; + private final TokenStore tokenStore; + + public OAuth2AuthenticationConfiguration(OAuth2Properties oAuth2Properties, OAuth2TokenEndpointClient tokenEndpointClient, TokenStore tokenStore) { + this.oAuth2Properties = oAuth2Properties; + this.tokenEndpointClient = tokenEndpointClient; + this.tokenStore = tokenStore; + } + + @Override + public void configure(HttpSecurity http) throws Exception { + http + .authorizeRequests() + .antMatchers("/auth/login").permitAll() + .antMatchers("/auth/logout").authenticated() + .and() + .apply(refreshTokenSecurityConfigurerAdapter()); + } + + /** + * A SecurityConfigurerAdapter to install a servlet filter that refreshes OAuth2 tokens. + */ + private RefreshTokenFilterConfigurer refreshTokenSecurityConfigurerAdapter() { + return new RefreshTokenFilterConfigurer(uaaAuthenticationService(), tokenStore); + } + + @Bean + public OAuth2CookieHelper cookieHelper() { + return new OAuth2CookieHelper(oAuth2Properties); + } + + @Bean + public OAuth2AuthenticationService uaaAuthenticationService() { + return new OAuth2AuthenticationService(tokenEndpointClient, cookieHelper()); + } + + /** + * Configure the ResourceServer security by installing a new TokenExtractor. + */ + @Override + public void configure(ResourceServerSecurityConfigurer resources) throws Exception { + resources.tokenExtractor(tokenExtractor()); + } + + /** + * The new TokenExtractor can extract tokens from Cookies and Authorization headers. + * + * @return the CookieTokenExtractor bean. + */ + @Bean + public TokenExtractor tokenExtractor() { + return new CookieTokenExtractor(); + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2JwtAccessTokenConverter.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2JwtAccessTokenConverter.java new file mode 100644 index 0000000000..64bbac0008 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2JwtAccessTokenConverter.java @@ -0,0 +1,109 @@ +package com.baeldung.jhipster.gateway.config.oauth2; + +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2SignatureVerifierClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.jwt.crypto.sign.SignatureVerifier; +import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.security.oauth2.provider.OAuth2Authentication; + +import java.util.Map; + +/** + * Improved JwtAccessTokenConverter that can handle lazy fetching of public verifier keys. + */ +public class OAuth2JwtAccessTokenConverter extends JwtAccessTokenConverter { + private final Logger log = LoggerFactory.getLogger(OAuth2JwtAccessTokenConverter.class); + + private final OAuth2Properties oAuth2Properties; + private final OAuth2SignatureVerifierClient signatureVerifierClient; + /** + * When did we last fetch the public key? + */ + private long lastKeyFetchTimestamp; + + public OAuth2JwtAccessTokenConverter(OAuth2Properties oAuth2Properties, OAuth2SignatureVerifierClient signatureVerifierClient) { + this.oAuth2Properties = oAuth2Properties; + this.signatureVerifierClient = signatureVerifierClient; + tryCreateSignatureVerifier(); + } + + /** + * Try to decode the token with the current public key. + * If it fails, contact the OAuth2 server to get a new public key, then try again. + * We might not have fetched it in the first place or it might have changed. + * + * @param token the JWT token to decode. + * @return the resulting claims. + * @throws InvalidTokenException if we cannot decode the token. + */ + @Override + protected Map decode(String token) { + try { + //check if our public key and thus SignatureVerifier have expired + long ttl = oAuth2Properties.getSignatureVerification().getTtl(); + if (ttl > 0 && System.currentTimeMillis() - lastKeyFetchTimestamp > ttl) { + throw new InvalidTokenException("public key expired"); + } + return super.decode(token); + } catch (InvalidTokenException ex) { + if (tryCreateSignatureVerifier()) { + return super.decode(token); + } + throw ex; + } + } + + /** + * Fetch a new public key from the AuthorizationServer. + * + * @return true, if we could fetch it; false, if we could not. + */ + private boolean tryCreateSignatureVerifier() { + long t = System.currentTimeMillis(); + if (t - lastKeyFetchTimestamp < oAuth2Properties.getSignatureVerification().getPublicKeyRefreshRateLimit()) { + return false; + } + try { + SignatureVerifier verifier = signatureVerifierClient.getSignatureVerifier(); + if (verifier != null) { + setVerifier(verifier); + lastKeyFetchTimestamp = t; + log.debug("Public key retrieved from OAuth2 server to create SignatureVerifier"); + return true; + } + } catch (Throwable ex) { + log.error("could not get public key from OAuth2 server to create SignatureVerifier", ex); + } + return false; + } + /** + * Extract JWT claims and set it to OAuth2Authentication decoded details. + * Here is how to get details: + * + *

+     * 
+     *  SecurityContext securityContext = SecurityContextHolder.getContext();
+     *  Authentication authentication = securityContext.getAuthentication();
+     *  if (authentication != null) {
+     *      Object details = authentication.getDetails();
+     *      if(details instanceof OAuth2AuthenticationDetails) {
+     *          Object decodedDetails = ((OAuth2AuthenticationDetails) details).getDecodedDetails();
+     *          if(decodedDetails != null && decodedDetails instanceof Map) {
+     *             String detailFoo = ((Map) decodedDetails).get("foo");
+     *          }
+     *      }
+     *  }
+     * 
+     *  
+ * @param claims OAuth2JWTToken claims + * @return OAuth2Authentication + */ + @Override + public OAuth2Authentication extractAuthentication(Map claims) { + OAuth2Authentication authentication = super.extractAuthentication(claims); + authentication.setDetails(claims); + return authentication; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2Properties.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2Properties.java new file mode 100644 index 0000000000..1280994304 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/oauth2/OAuth2Properties.java @@ -0,0 +1,118 @@ +package com.baeldung.jhipster.gateway.config.oauth2; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * OAuth2 properties define properties for OAuth2-based microservices. + */ +@Component +@ConfigurationProperties(prefix = "oauth2", ignoreUnknownFields = false) +public class OAuth2Properties { + private WebClientConfiguration webClientConfiguration = new WebClientConfiguration(); + + private SignatureVerification signatureVerification = new SignatureVerification(); + + public WebClientConfiguration getWebClientConfiguration() { + return webClientConfiguration; + } + + public SignatureVerification getSignatureVerification() { + return signatureVerification; + } + + public static class WebClientConfiguration { + private String clientId = "web_app"; + private String secret = "changeit"; + /** + * Holds the session timeout in seconds for non-remember-me sessions. + * After so many seconds of inactivity, the session will be terminated. + * Only checked during token refresh, so long access token validity may + * delay the session timeout accordingly. + */ + private int sessionTimeoutInSeconds = 1800; + /** + * Defines the cookie domain. If specified, cookies will be set on this domain. + * If not configured, then cookies will be set on the top-level domain of the + * request you sent, i.e. if you send a request to app1.your-domain.com, + * then cookies will be set on .your-domain.com, such that they + * are also valid for app2.your-domain.com. + */ + private String cookieDomain; + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public int getSessionTimeoutInSeconds() { + return sessionTimeoutInSeconds; + } + + public void setSessionTimeoutInSeconds(int sessionTimeoutInSeconds) { + this.sessionTimeoutInSeconds = sessionTimeoutInSeconds; + } + + public String getCookieDomain() { + return cookieDomain; + } + + public void setCookieDomain(String cookieDomain) { + this.cookieDomain = cookieDomain; + } + } + + public static class SignatureVerification { + /** + * Maximum refresh rate for public keys in ms. + * We won't fetch new public keys any faster than that to avoid spamming UAA in case + * we receive a lot of "illegal" tokens. + */ + private long publicKeyRefreshRateLimit = 10 * 1000L; + /** + * Maximum TTL for the public key in ms. + * The public key will be fetched again from UAA if it gets older than that. + * That way, we make sure that we get the newest keys always in case they are updated there. + */ + private long ttl = 24 * 60 * 60 * 1000L; + /** + * Endpoint where to retrieve the public key used to verify token signatures. + */ + private String publicKeyEndpointUri = "http://uaa/oauth/token_key"; + + public long getPublicKeyRefreshRateLimit() { + return publicKeyRefreshRateLimit; + } + + public void setPublicKeyRefreshRateLimit(long publicKeyRefreshRateLimit) { + this.publicKeyRefreshRateLimit = publicKeyRefreshRateLimit; + } + + public long getTtl() { + return ttl; + } + + public void setTtl(long ttl) { + this.ttl = ttl; + } + + public String getPublicKeyEndpointUri() { + return publicKeyEndpointUri; + } + + public void setPublicKeyEndpointUri(String publicKeyEndpointUri) { + this.publicKeyEndpointUri = publicKeyEndpointUri; + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/package-info.java new file mode 100644 index 0000000000..2ee9067535 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/config/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Framework configuration files. + */ +package com.baeldung.jhipster.gateway.config; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/AbstractAuditingEntity.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/AbstractAuditingEntity.java new file mode 100644 index 0000000000..b626ca0633 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/AbstractAuditingEntity.java @@ -0,0 +1,79 @@ +package com.baeldung.jhipster.gateway.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.hibernate.envers.Audited; +import org.springframework.data.annotation.CreatedBy; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedBy; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import java.io.Serializable; +import java.time.Instant; +import javax.persistence.Column; +import javax.persistence.EntityListeners; +import javax.persistence.MappedSuperclass; + +/** + * Base abstract class for entities which will hold definitions for created, last modified by and created, + * last modified by date. + */ +@MappedSuperclass +@Audited +@EntityListeners(AuditingEntityListener.class) +public abstract class AbstractAuditingEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @CreatedBy + @Column(name = "created_by", nullable = false, length = 50, updatable = false) + @JsonIgnore + private String createdBy; + + @CreatedDate + @Column(name = "created_date", nullable = false, updatable = false) + @JsonIgnore + private Instant createdDate = Instant.now(); + + @LastModifiedBy + @Column(name = "last_modified_by", length = 50) + @JsonIgnore + private String lastModifiedBy; + + @LastModifiedDate + @Column(name = "last_modified_date") + @JsonIgnore + private Instant lastModifiedDate = Instant.now(); + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Instant getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Instant createdDate) { + this.createdDate = createdDate; + } + + public String getLastModifiedBy() { + return lastModifiedBy; + } + + public void setLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + public Instant getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Instant lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/PersistentAuditEvent.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/PersistentAuditEvent.java new file mode 100644 index 0000000000..3922b96000 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/PersistentAuditEvent.java @@ -0,0 +1,81 @@ +package com.baeldung.jhipster.gateway.domain; + +import javax.persistence.*; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; + +/** + * Persist AuditEvent managed by the Spring Boot actuator. + * + * @see org.springframework.boot.actuate.audit.AuditEvent + */ +@Entity +@Table(name = "jhi_persistent_audit_event") +public class PersistentAuditEvent implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "event_id") + private Long id; + + @NotNull + @Column(nullable = false) + private String principal; + + @Column(name = "event_date") + private Instant auditEventDate; + + @Column(name = "event_type") + private String auditEventType; + + @ElementCollection + @MapKeyColumn(name = "name") + @Column(name = "value") + @CollectionTable(name = "jhi_persistent_audit_evt_data", joinColumns=@JoinColumn(name="event_id")) + private Map data = new HashMap<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPrincipal() { + return principal; + } + + public void setPrincipal(String principal) { + this.principal = principal; + } + + public Instant getAuditEventDate() { + return auditEventDate; + } + + public void setAuditEventDate(Instant auditEventDate) { + this.auditEventDate = auditEventDate; + } + + public String getAuditEventType() { + return auditEventType; + } + + public void setAuditEventType(String auditEventType) { + this.auditEventType = auditEventType; + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/package-info.java new file mode 100644 index 0000000000..912c64f019 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/domain/package-info.java @@ -0,0 +1,4 @@ +/** + * JPA domain objects. + */ +package com.baeldung.jhipster.gateway.domain; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/accesscontrol/AccessControlFilter.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/accesscontrol/AccessControlFilter.java new file mode 100644 index 0000000000..102789c198 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/accesscontrol/AccessControlFilter.java @@ -0,0 +1,99 @@ +package com.baeldung.jhipster.gateway.gateway.accesscontrol; + +import io.github.jhipster.config.JHipsterProperties; + +import java.util.List; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cloud.netflix.zuul.filters.Route; +import org.springframework.cloud.netflix.zuul.filters.RouteLocator; +import org.springframework.http.HttpStatus; + +import com.netflix.zuul.ZuulFilter; +import com.netflix.zuul.context.RequestContext; + +/** + * Zuul filter for restricting access to backend micro-services endpoints. + */ +public class AccessControlFilter extends ZuulFilter { + + private final Logger log = LoggerFactory.getLogger(AccessControlFilter.class); + + private final RouteLocator routeLocator; + + private final JHipsterProperties jHipsterProperties; + + public AccessControlFilter(RouteLocator routeLocator, JHipsterProperties jHipsterProperties) { + this.routeLocator = routeLocator; + this.jHipsterProperties = jHipsterProperties; + } + + @Override + public String filterType() { + return "pre"; + } + + @Override + public int filterOrder() { + return 0; + } + + /** + * Filter requests on endpoints that are not in the list of authorized microservices endpoints. + */ + @Override + public boolean shouldFilter() { + String requestUri = RequestContext.getCurrentContext().getRequest().getRequestURI(); + String contextPath = RequestContext.getCurrentContext().getRequest().getContextPath(); + + // If the request Uri does not start with the path of the authorized endpoints, we block the request + for (Route route : routeLocator.getRoutes()) { + String serviceUrl = contextPath + route.getFullPath(); + String serviceName = route.getId(); + + // If this route correspond to the current request URI + // We do a substring to remove the "**" at the end of the route URL + if (requestUri.startsWith(serviceUrl.substring(0, serviceUrl.length() - 2))) { + return !isAuthorizedRequest(serviceUrl, serviceName, requestUri); + } + } + return true; + } + + private boolean isAuthorizedRequest(String serviceUrl, String serviceName, String requestUri) { + Map> authorizedMicroservicesEndpoints = jHipsterProperties.getGateway() + .getAuthorizedMicroservicesEndpoints(); + + // If the authorized endpoints list was left empty for this route, all access are allowed + if (authorizedMicroservicesEndpoints.get(serviceName) == null) { + log.debug("Access Control: allowing access for {}, as no access control policy has been set up for " + + "service: {}", requestUri, serviceName); + return true; + } else { + List authorizedEndpoints = authorizedMicroservicesEndpoints.get(serviceName); + + // Go over the authorized endpoints to control that the request URI matches it + for (String endpoint : authorizedEndpoints) { + // We do a substring to remove the "**/" at the end of the route URL + String gatewayEndpoint = serviceUrl.substring(0, serviceUrl.length() - 3) + endpoint; + if (requestUri.startsWith(gatewayEndpoint)) { + log.debug("Access Control: allowing access for {}, as it matches the following authorized " + + "microservice endpoint: {}", requestUri, gatewayEndpoint); + return true; + } + } + } + return false; + } + + @Override + public Object run() { + RequestContext ctx = RequestContext.getCurrentContext(); + ctx.setResponseStatusCode(HttpStatus.FORBIDDEN.value()); + ctx.setSendZuulResponse(false); + log.debug("Access Control: filtered unauthorized access on endpoint {}", ctx.getRequest().getRequestURI()); + return null; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/ratelimiting/RateLimitingFilter.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/ratelimiting/RateLimitingFilter.java new file mode 100644 index 0000000000..4c0673282c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/ratelimiting/RateLimitingFilter.java @@ -0,0 +1,121 @@ +package com.baeldung.jhipster.gateway.gateway.ratelimiting; + +import com.baeldung.jhipster.gateway.security.SecurityUtils; + +import java.time.Duration; +import java.util.function.Supplier; +import javax.cache.CacheManager; +import javax.cache.Caching; +import javax.cache.configuration.CompleteConfiguration; +import javax.cache.configuration.MutableConfiguration; +import javax.cache.spi.CachingProvider; +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; + +import com.netflix.zuul.ZuulFilter; +import com.netflix.zuul.context.RequestContext; + +import io.github.bucket4j.*; +import io.github.bucket4j.grid.GridBucketState; +import io.github.bucket4j.grid.ProxyManager; +import io.github.bucket4j.grid.jcache.JCache; +import io.github.jhipster.config.JHipsterProperties; + +/** + * Zuul filter for limiting the number of HTTP calls per client. + * + * See the Bucket4j documentation at https://github.com/vladimir-bukhtoyarov/bucket4j + * https://github.com/vladimir-bukhtoyarov/bucket4j/blob/master/doc-pages/jcache-usage + * .md#example-1---limiting-access-to-http-server-by-ip-address + */ +public class RateLimitingFilter extends ZuulFilter { + + private final Logger log = LoggerFactory.getLogger(RateLimitingFilter.class); + + public final static String GATEWAY_RATE_LIMITING_CACHE_NAME = "gateway-rate-limiting"; + + private final JHipsterProperties jHipsterProperties; + + private javax.cache.Cache cache; + + private ProxyManager buckets; + + public RateLimitingFilter(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + + CachingProvider cachingProvider = Caching.getCachingProvider(); + CacheManager cacheManager = cachingProvider.getCacheManager(); + CompleteConfiguration config = + new MutableConfiguration() + .setTypes(String.class, GridBucketState.class); + + this.cache = cacheManager.createCache(GATEWAY_RATE_LIMITING_CACHE_NAME, config); + this.buckets = Bucket4j.extension(JCache.class).proxyManagerForCache(cache); + } + + @Override + public String filterType() { + return "pre"; + } + + @Override + public int filterOrder() { + return 10; + } + + @Override + public boolean shouldFilter() { + // specific APIs can be filtered out using + // if (RequestContext.getCurrentContext().getRequest().getRequestURI().startsWith("/api")) { ... } + return true; + } + + @Override + public Object run() { + String bucketId = getId(RequestContext.getCurrentContext().getRequest()); + Bucket bucket = buckets.getProxy(bucketId, getConfigSupplier()); + if (bucket.tryConsume(1)) { + // the limit is not exceeded + log.debug("API rate limit OK for {}", bucketId); + } else { + // limit is exceeded + log.info("API rate limit exceeded for {}", bucketId); + apiLimitExceeded(); + } + return null; + } + + private Supplier getConfigSupplier() { + return () -> { + JHipsterProperties.Gateway.RateLimiting rateLimitingProperties = + jHipsterProperties.getGateway().getRateLimiting(); + + return Bucket4j.configurationBuilder() + .addLimit(Bandwidth.simple(rateLimitingProperties.getLimit(), + Duration.ofSeconds(rateLimitingProperties.getDurationInSeconds()))) + .build(); + }; + } + + /** + * Create a Zuul response error when the API limit is exceeded. + */ + private void apiLimitExceeded() { + RequestContext ctx = RequestContext.getCurrentContext(); + ctx.setResponseStatusCode(HttpStatus.TOO_MANY_REQUESTS.value()); + if (ctx.getResponseBody() == null) { + ctx.setResponseBody("API rate limit exceeded"); + ctx.setSendZuulResponse(false); + } + } + + /** + * The ID that will identify the limit: the user login or the user IP address. + */ + private String getId(HttpServletRequest httpServletRequest) { + return SecurityUtils.getCurrentUserLogin().orElse(httpServletRequest.getRemoteAddr()); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilter.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilter.java new file mode 100644 index 0000000000..6dd2d4de8f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilter.java @@ -0,0 +1,99 @@ +package com.baeldung.jhipster.gateway.gateway.responserewriting; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.netflix.zuul.context.RequestContext; +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cloud.netflix.zuul.filters.ZuulProperties; +import org.springframework.cloud.netflix.zuul.filters.post.SendResponseFilter; +import springfox.documentation.swagger2.web.Swagger2Controller; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.LinkedHashMap; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +/** + * Zuul filter to rewrite micro-services Swagger URL Base Path. + */ +public class SwaggerBasePathRewritingFilter extends SendResponseFilter { + + private final Logger log = LoggerFactory.getLogger(SwaggerBasePathRewritingFilter.class); + + private ObjectMapper mapper = new ObjectMapper(); + + public SwaggerBasePathRewritingFilter() { + super(new ZuulProperties()); + } + + @Override + public String filterType() { + return "post"; + } + + @Override + public int filterOrder() { + return 100; + } + + /** + * Filter requests to micro-services Swagger docs. + */ + @Override + public boolean shouldFilter() { + return RequestContext.getCurrentContext().getRequest().getRequestURI().endsWith(Swagger2Controller.DEFAULT_URL); + } + + @Override + public Object run() { + RequestContext context = RequestContext.getCurrentContext(); + + context.getResponse().setCharacterEncoding("UTF-8"); + + String rewrittenResponse = rewriteBasePath(context); + if (context.getResponseGZipped()) { + try { + context.setResponseDataStream(new ByteArrayInputStream(gzipData(rewrittenResponse))); + } catch (IOException e) { + log.error("Swagger-docs filter error", e); + } + } else { + context.setResponseBody(rewrittenResponse); + } + return null; + } + + @SuppressWarnings("unchecked") + private String rewriteBasePath(RequestContext context) { + InputStream responseDataStream = context.getResponseDataStream(); + String requestUri = RequestContext.getCurrentContext().getRequest().getRequestURI(); + try { + if (context.getResponseGZipped()) { + responseDataStream = new GZIPInputStream(context.getResponseDataStream()); + } + String response = IOUtils.toString(responseDataStream, StandardCharsets.UTF_8); + if (response != null) { + LinkedHashMap map = this.mapper.readValue(response, LinkedHashMap.class); + + String basePath = requestUri.replace(Swagger2Controller.DEFAULT_URL, ""); + map.put("basePath", basePath); + log.debug("Swagger-docs: rewritten Base URL with correct micro-service route: {}", basePath); + return mapper.writeValueAsString(map); + } + } catch (IOException e) { + log.error("Swagger-docs filter error", e); + } + return null; + } + + public static byte[] gzipData(String content) throws IOException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + PrintWriter gzip = new PrintWriter(new GZIPOutputStream(bos)); + gzip.print(content); + gzip.flush(); + gzip.close(); + return bos.toByteArray(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/repository/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/repository/package-info.java new file mode 100644 index 0000000000..10a1bec77c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/repository/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Data JPA repositories. + */ +package com.baeldung.jhipster.gateway.repository; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/AuthoritiesConstants.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/AuthoritiesConstants.java new file mode 100644 index 0000000000..31480b886b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/AuthoritiesConstants.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.gateway.security; + +/** + * Constants for Spring Security authorities. + */ +public final class AuthoritiesConstants { + + public static final String ADMIN = "ROLE_ADMIN"; + + public static final String USER = "ROLE_USER"; + + public static final String ANONYMOUS = "ROLE_ANONYMOUS"; + + private AuthoritiesConstants() { + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SecurityUtils.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SecurityUtils.java new file mode 100644 index 0000000000..e7d4ca3238 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SecurityUtils.java @@ -0,0 +1,64 @@ +package com.baeldung.jhipster.gateway.security; + +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Optional; + +/** + * Utility class for Spring Security. + */ +public final class SecurityUtils { + + private SecurityUtils() { + } + + /** + * Get the login of the current user. + * + * @return the login of the current user + */ + public static Optional getCurrentUserLogin() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> { + if (authentication.getPrincipal() instanceof UserDetails) { + UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); + return springSecurityUser.getUsername(); + } else if (authentication.getPrincipal() instanceof String) { + return (String) authentication.getPrincipal(); + } + return null; + }); + } + + /** + * Check if a user is authenticated. + * + * @return true if the user is authenticated, false otherwise + */ + public static boolean isAuthenticated() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> authentication.getAuthorities().stream() + .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS))) + .orElse(false); + } + + /** + * If the current user has a specific authority (security role). + *

+ * The name of this method comes from the isUserInRole() method in the Servlet API + * + * @param authority the authority to check + * @return true if the current user has the authority, false otherwise + */ + public static boolean isCurrentUserInRole(String authority) { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> authentication.getAuthorities().stream() + .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority))) + .orElse(false); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SpringSecurityAuditorAware.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SpringSecurityAuditorAware.java new file mode 100644 index 0000000000..0329d5202b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/SpringSecurityAuditorAware.java @@ -0,0 +1,20 @@ +package com.baeldung.jhipster.gateway.security; + +import com.baeldung.jhipster.gateway.config.Constants; + +import java.util.Optional; + +import org.springframework.data.domain.AuditorAware; +import org.springframework.stereotype.Component; + +/** + * Implementation of AuditorAware based on Spring Security. + */ +@Component +public class SpringSecurityAuditorAware implements AuditorAware { + + @Override + public Optional getCurrentAuditor() { + return Optional.of(SecurityUtils.getCurrentUserLogin().orElse(Constants.SYSTEM_ACCOUNT)); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollection.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollection.java new file mode 100644 index 0000000000..7810ed8661 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollection.java @@ -0,0 +1,139 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import javax.servlet.http.Cookie; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * A Collection of Cookies that allows modification - unlike a mere array. + *

+ * Since {@link Cookie} doesn't implement hashCode nor equals, + * we cannot simply put it into a HashSet. + */ +public class CookieCollection implements Collection { + private final Map cookieMap; + + public CookieCollection() { + cookieMap = new HashMap<>(); + } + + public CookieCollection(Cookie... cookies) { + this(Arrays.asList(cookies)); + } + + public CookieCollection(Collection cookies) { + cookieMap = new HashMap<>(cookies.size()); + addAll(cookies); + } + + @Override + public int size() { + return cookieMap.size(); + } + + @Override + public boolean isEmpty() { + return cookieMap.isEmpty(); + } + + @Override + public boolean contains(Object o) { + if (o instanceof String) { + return cookieMap.containsKey(o); + } + if (o instanceof Cookie) { + return cookieMap.containsValue(o); + } + return false; + } + + @Override + public Iterator iterator() { + return cookieMap.values().iterator(); + } + + public Cookie[] toArray() { + Cookie[] cookies = new Cookie[cookieMap.size()]; + return toArray(cookies); + } + + @Override + public T[] toArray(T[] ts) { + return cookieMap.values().toArray(ts); + } + + @Override + public boolean add(Cookie cookie) { + if (cookie == null) { + return false; + } + cookieMap.put(cookie.getName(), cookie); + return true; + } + + @Override + public boolean remove(Object o) { + if (o instanceof String) { + return cookieMap.remove((String)o) != null; + } + if (o instanceof Cookie) { + Cookie c = (Cookie)o; + return cookieMap.remove(c.getName()) != null; + } + return false; + } + + public Cookie get(String name) { + return cookieMap.get(name); + } + + @Override + public boolean containsAll(Collection collection) { + for(Object o : collection) { + if (!contains(o)) { + return false; + } + } + return true; + } + + @Override + public boolean addAll(Collection collection) { + boolean result = false; + for(Cookie cookie : collection) { + result|= add(cookie); + } + return result; + } + + @Override + public boolean removeAll(Collection collection) { + boolean result = false; + for(Object cookie : collection) { + result|= remove(cookie); + } + return result; + } + + @Override + public boolean retainAll(Collection collection) { + boolean result = false; + Iterator> it = cookieMap.entrySet().iterator(); + while(it.hasNext()) { + Map.Entry e = it.next(); + if (!collection.contains(e.getKey()) && !collection.contains(e.getValue())) { + it.remove(); + result = true; + } + } + return result; + } + + @Override + public void clear() { + cookieMap.clear(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractor.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractor.java new file mode 100644 index 0000000000..0128d80c46 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractor.java @@ -0,0 +1,33 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import org.springframework.security.oauth2.provider.authentication.BearerTokenExtractor; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; + +/** + * Extracts the access token from a cookie. + * Falls back to a BearerTokenExtractor extracting information from the Authorization header, if no + * cookie was found. + */ +public class CookieTokenExtractor extends BearerTokenExtractor { + /** + * Extract the JWT access token from the request, if present. + * If not, then it falls back to the {@link BearerTokenExtractor} behaviour. + * + * @param request the request containing the cookies. + * @return the extracted JWT token; or null. + */ + @Override + protected String extractToken(HttpServletRequest request) { + String result; + Cookie accessTokenCookie = OAuth2CookieHelper.getAccessTokenCookie(request); + if (accessTokenCookie != null) { + result = accessTokenCookie.getValue(); + } else { + result = super.extractToken(request); + } + return result; + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookiesHttpServletRequestWrapper.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookiesHttpServletRequestWrapper.java new file mode 100644 index 0000000000..98fa68188f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/CookiesHttpServletRequestWrapper.java @@ -0,0 +1,31 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; + +/** + * A request mapper used to modify the cookies in the original request. + * This is needed such that we can modify the cookies of the request during a token refresh. + * The token refresh happens before authentication by the OAuth2AuthenticationProcessingFilter + * so we must make sure that further in the filter chain, we have the new cookies and not the expired/missing ones. + */ +class CookiesHttpServletRequestWrapper extends HttpServletRequestWrapper { + /** + * The new cookies of the request. Use these instead of the ones found in the wrapped request. + */ + private Cookie[] cookies; + + public CookiesHttpServletRequestWrapper(HttpServletRequest request, Cookie[] cookies) { + super(request); + this.cookies = cookies; + } + + /** + * Return the modified cookies instead of the original ones. + */ + @Override + public Cookie[] getCookies() { + return cookies; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationService.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationService.java new file mode 100644 index 0000000000..ba8dcaf988 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationService.java @@ -0,0 +1,163 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import com.baeldung.jhipster.gateway.web.rest.errors.InvalidPasswordException; +import io.github.jhipster.security.PersistentTokenCache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.ResponseEntity; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.web.client.HttpClientErrorException; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +/** + * Manages authentication cases for OAuth2 updating the cookies holding access and refresh tokens accordingly. + *

+ * It can authenticate users, refresh the token cookies should they expire and log users out. + */ +public class OAuth2AuthenticationService { + + private final Logger log = LoggerFactory.getLogger(OAuth2AuthenticationService.class); + + /** + * Number of milliseconds to cache refresh token grants so we don't have to repeat them in case of parallel requests. + */ + private static final long REFRESH_TOKEN_VALIDITY_MILLIS = 10000l; + + /** + * Used to contact the OAuth2 token endpoint. + */ + private final OAuth2TokenEndpointClient authorizationClient; + + /** + * Helps us with cookie handling. + */ + private final OAuth2CookieHelper cookieHelper; + + /** + * Caches Refresh grant results for a refresh token value so we can reuse them. + * This avoids hammering UAA in case of several multi-threaded requests arriving in parallel. + */ + private final PersistentTokenCache recentlyRefreshed; + + public OAuth2AuthenticationService(OAuth2TokenEndpointClient authorizationClient, OAuth2CookieHelper cookieHelper) { + this.authorizationClient = authorizationClient; + this.cookieHelper = cookieHelper; + recentlyRefreshed = new PersistentTokenCache<>(REFRESH_TOKEN_VALIDITY_MILLIS); + } + + /** + * Authenticate the user by username and password. + * + * @param request the request coming from the client. + * @param response the response going back to the server. + * @param params the params holding the username, password and rememberMe. + * @return the OAuth2AccessToken as a ResponseEntity. Will return OK (200), if successful. + * If the UAA cannot authenticate the user, the status code returned by UAA will be returned. + */ + public ResponseEntity authenticate(HttpServletRequest request, HttpServletResponse response, + Map params) { + try { + String username = params.get("username"); + String password = params.get("password"); + boolean rememberMe = Boolean.valueOf(params.get("rememberMe")); + OAuth2AccessToken accessToken = authorizationClient.sendPasswordGrant(username, password); + OAuth2Cookies cookies = new OAuth2Cookies(); + cookieHelper.createCookies(request, accessToken, rememberMe, cookies); + cookies.addCookiesTo(response); + if (log.isDebugEnabled()) { + log.debug("successfully authenticated user {}", params.get("username")); + } + return ResponseEntity.ok(accessToken); + } catch (HttpClientErrorException ex) { + log.error("failed to get OAuth2 tokens from UAA", ex); + throw new InvalidPasswordException(); + } + } + + /** + * Try to refresh the access token using the refresh token provided as cookie. + * Note that browsers typically send multiple requests in parallel which means the access token + * will be expired on multiple threads. We don't want to send multiple requests to UAA though, + * so we need to cache results for a certain duration and synchronize threads to avoid sending + * multiple requests in parallel. + * + * @param request the request potentially holding the refresh token. + * @param response the response setting the new cookies (if refresh was successful). + * @param refreshCookie the refresh token cookie. Must not be null. + * @return the new servlet request containing the updated cookies for relaying downstream. + */ + public HttpServletRequest refreshToken(HttpServletRequest request, HttpServletResponse response, Cookie + refreshCookie) { + //check if non-remember-me session has expired + if (cookieHelper.isSessionExpired(refreshCookie)) { + log.info("session has expired due to inactivity"); + logout(request, response); //logout to clear cookies in browser + return stripTokens(request); //don't include cookies downstream + } + OAuth2Cookies cookies = getCachedCookies(refreshCookie.getValue()); + synchronized (cookies) { + //check if we have a result from another thread already + if (cookies.getAccessTokenCookie() == null) { //no, we are first! + //send a refresh_token grant to UAA, getting new tokens + String refreshCookieValue = OAuth2CookieHelper.getRefreshTokenValue(refreshCookie); + OAuth2AccessToken accessToken = authorizationClient.sendRefreshGrant(refreshCookieValue); + boolean rememberMe = OAuth2CookieHelper.isRememberMe(refreshCookie); + cookieHelper.createCookies(request, accessToken, rememberMe, cookies); + //add cookies to response to update browser + cookies.addCookiesTo(response); + } else { + log.debug("reusing cached refresh_token grant"); + } + //replace cookies in original request with new ones + CookieCollection requestCookies = new CookieCollection(request.getCookies()); + requestCookies.add(cookies.getAccessTokenCookie()); + requestCookies.add(cookies.getRefreshTokenCookie()); + return new CookiesHttpServletRequestWrapper(request, requestCookies.toArray()); + } + } + + /** + * Get the result from the cache in a thread-safe manner. + * + * @param refreshTokenValue the refresh token for which we want the results. + * @return a RefreshGrantResult for that token. This will either be empty, if we are the first one to do the + * request, + * or contain some results already, if another thread already handled the grant for us. + */ + private OAuth2Cookies getCachedCookies(String refreshTokenValue) { + synchronized (recentlyRefreshed) { + OAuth2Cookies ctx = recentlyRefreshed.get(refreshTokenValue); + if (ctx == null) { + ctx = new OAuth2Cookies(); + recentlyRefreshed.put(refreshTokenValue, ctx); + } + return ctx; + } + } + + /** + * Logs the user out by clearing all cookies. + * + * @param httpServletRequest the request containing the Cookies. + * @param httpServletResponse the response used to clear them. + */ + public void logout(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { + cookieHelper.clearCookies(httpServletRequest, httpServletResponse); + } + + /** + * Strips token cookies preventing them from being used further down the chain. + * For example, the OAuth2 client won't checked them and they won't be relayed to other services. + * + * @param httpServletRequest the incoming request. + * @return the request to replace it with which has the tokens stripped. + */ + public HttpServletRequest stripTokens(HttpServletRequest httpServletRequest) { + Cookie[] cookies = cookieHelper.stripCookies(httpServletRequest.getCookies()); + return new CookiesHttpServletRequestWrapper(httpServletRequest, cookies); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelper.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelper.java new file mode 100644 index 0000000000..7250fbd219 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelper.java @@ -0,0 +1,334 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.json.JsonParser; +import org.springframework.boot.json.JsonParserFactory; +import org.springframework.security.jwt.Jwt; +import org.springframework.security.jwt.JwtHelper; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.common.OAuth2RefreshToken; +import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; +import org.springframework.security.oauth2.provider.token.AccessTokenConverter; +import org.springframework.util.StringUtils; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import static org.apache.http.conn.util.InetAddressUtils.isIPv4Address; +import static org.apache.http.conn.util.InetAddressUtils.isIPv6Address; +import org.apache.http.conn.util.PublicSuffixMatcher; +import org.apache.http.conn.util.PublicSuffixMatcherLoader; + +/** + * Helps with OAuth2 cookie handling. + */ +public class OAuth2CookieHelper { + /** + * Name of the access token cookie. + */ + public static final String ACCESS_TOKEN_COOKIE = OAuth2AccessToken.ACCESS_TOKEN; + /** + * Name of the refresh token cookie in case of remember me. + */ + public static final String REFRESH_TOKEN_COOKIE = OAuth2AccessToken.REFRESH_TOKEN; + /** + * Name of the session-only refresh token in case the user did not check remember me. + */ + public static final String SESSION_TOKEN_COOKIE = "session_token"; + /** + * The names of the Cookies we set. + */ + private static final List COOKIE_NAMES = Arrays.asList(ACCESS_TOKEN_COOKIE, REFRESH_TOKEN_COOKIE, + SESSION_TOKEN_COOKIE); + /** + * Number of seconds to expire refresh token cookies before the enclosed token expires. + * This makes sure we don't run into race conditions where the cookie is still there but + * expires while we process it. + */ + private static final long REFRESH_TOKEN_EXPIRATION_WINDOW_SECS = 3L; + + /** + * Public suffix matcher (to strip private subdomains off cookie scope). + */ + PublicSuffixMatcher suffixMatcher; + + private final Logger log = LoggerFactory.getLogger(OAuth2CookieHelper.class); + + private OAuth2Properties oAuth2Properties; + + /** + * Used to parse JWT claims. + */ + private JsonParser jsonParser = JsonParserFactory.getJsonParser(); + + public OAuth2CookieHelper(OAuth2Properties oAuth2Properties) { + this.oAuth2Properties = oAuth2Properties; + + // Alternatively, always get an up-to-date list by passing an URL + this.suffixMatcher = PublicSuffixMatcherLoader.getDefault(); + } + + public static Cookie getAccessTokenCookie(HttpServletRequest request) { + return getCookie(request, ACCESS_TOKEN_COOKIE); + } + + public static Cookie getRefreshTokenCookie(HttpServletRequest request) { + Cookie cookie = getCookie(request, REFRESH_TOKEN_COOKIE); + if (cookie == null) { + cookie = getCookie(request, SESSION_TOKEN_COOKIE); + } + return cookie; + } + + + /** + * Get a cookie by name from the given servlet request. + * + * @param request the request containing the cookie. + * @param cookieName the case-sensitive name of the cookie to get. + * @return the resulting Cookie; or null, if not found. + */ + private static Cookie getCookie(HttpServletRequest request, String cookieName) { + if (request.getCookies() != null) { + for (Cookie cookie : request.getCookies()) { + if (cookie.getName().equals(cookieName)) { + String value = cookie.getValue(); + if (StringUtils.hasText(value)) { + return cookie; + } + } + } + } + return null; + } + + /** + * Create cookies using the provided values. + * + * @param request the request we are handling. + * @param accessToken the access token and enclosed refresh token for our cookies. + * @param rememberMe whether the user had originally checked "remember me". + * @param result will get the resulting cookies set. + */ + public void createCookies(HttpServletRequest request, OAuth2AccessToken accessToken, boolean rememberMe, + OAuth2Cookies result) { + String domain = getCookieDomain(request); + log.debug("creating cookies for domain {}", domain); + Cookie accessTokenCookie = new Cookie(ACCESS_TOKEN_COOKIE, accessToken.getValue()); + setCookieProperties(accessTokenCookie, request.isSecure(), domain); + log.debug("created access token cookie '{}'", accessTokenCookie.getName()); + + OAuth2RefreshToken refreshToken = accessToken.getRefreshToken(); + Cookie refreshTokenCookie = createRefreshTokenCookie(refreshToken, rememberMe); + setCookieProperties(refreshTokenCookie, request.isSecure(), domain); + log.debug("created refresh token cookie '{}', age: {}", refreshTokenCookie.getName(), refreshTokenCookie + .getMaxAge()); + + result.setCookies(accessTokenCookie, refreshTokenCookie); + } + + /** + * Create a cookie out of the given refresh token. + * Refresh token cookies contain the base64 encoded refresh token (a JWT token). + * They also contain a hint whether the refresh token was for remember me or not. + * If not, then the cookie will be prefixed by the timestamp it was created at followed by a pipe '|'. + * This gives us the chance to expire session cookies regardless of the token duration. + */ + private Cookie createRefreshTokenCookie(OAuth2RefreshToken refreshToken, boolean rememberMe) { + int maxAge = -1; + String name = SESSION_TOKEN_COOKIE; + String value = refreshToken.getValue(); + if (rememberMe) { + name = REFRESH_TOKEN_COOKIE; + //get expiration in seconds from the token's "exp" claim + Integer exp = getClaim(refreshToken.getValue(), AccessTokenConverter.EXP, Integer.class); + if (exp != null) { + int now = (int) (System.currentTimeMillis() / 1000L); + maxAge = exp - now; + log.debug("refresh token valid for another {} secs", maxAge); + //let cookie expire a bit earlier than the token to avoid race conditions + maxAge -= REFRESH_TOKEN_EXPIRATION_WINDOW_SECS; + } + } + Cookie refreshTokenCookie = new Cookie(name, value); + refreshTokenCookie.setMaxAge(maxAge); + return refreshTokenCookie; + } + + /** + * Returns true if the refresh token cookie was set with remember me checked. + * We can recognize this by the name of the cookie. + * + * @param refreshTokenCookie the cookie holding the refresh token. + * @return true, if it was set persistently (i.e. for "remember me"). + */ + public static boolean isRememberMe(Cookie refreshTokenCookie) { + return refreshTokenCookie.getName().equals(REFRESH_TOKEN_COOKIE); + } + + /** + * Extracts the refresh token from the refresh token cookie. + * Since we encode additional information into the cookie, this needs to be called to get + * hold of the enclosed JWT. + * + * @param refreshCookie the cookie we store the value in. + * @return the refresh JWT from the cookie. + */ + public static String getRefreshTokenValue(Cookie refreshCookie) { + String value = refreshCookie.getValue(); + int i = value.indexOf('|'); + if (i > 0) { + return value.substring(i + 1); + } + return value; + } + + /** + * Checks if the refresh token session has expired. + * Only makes sense for non-persistent cookies, i.e. when remember me was not checked. + * The motivation for this is that we want to throw out a user after a while if he's inactive. + * We cannot do this via refresh token validity because that one is also used for remember me. + * + * @param refreshCookie the refresh token cookie to check. + * @return true, if the session is expired. + */ + public boolean isSessionExpired(Cookie refreshCookie) { + if (isRememberMe(refreshCookie)) { //no session expiration for "remember me" + return false; + } + //read non-remember-me session length in secs + int validity = oAuth2Properties.getWebClientConfiguration().getSessionTimeoutInSeconds(); + if (validity < 0) { //no session expiration configured + return false; + } + Integer iat = getClaim(refreshCookie.getValue(), "iat", Integer.class); + if (iat == null) { //token creating timestamp in secs is missing, session does not expire + return false; + } + int now = (int) (System.currentTimeMillis() / 1000L); + int sessionDuration = now - iat; + log.debug("session duration {} secs, will timeout at {}", sessionDuration, validity); + return sessionDuration > validity; //session has expired + } + + /** + * Retrieve the given claim from the given token. + * + * @param refreshToken the JWT token to examine. + * @param claimName name of the claim to get. + * @param clazz the Class we expect to find there. + * @return the desired claim. + * @throws InvalidTokenException if we cannot find the claim in the token or it is of wrong type. + */ + @SuppressWarnings("unchecked") + private T getClaim(String refreshToken, String claimName, Class clazz) { + Jwt jwt = JwtHelper.decode(refreshToken); + String claims = jwt.getClaims(); + Map claimsMap = jsonParser.parseMap(claims); + Object claimValue = claimsMap.get(claimName); + if (claimValue == null) { + return null; + } + if (!clazz.isAssignableFrom(claimValue.getClass())) { + throw new InvalidTokenException("claim is not of expected type: " + claimName); + } + return (T) claimValue; + } + + /** + * Set cookie properties of access and refresh tokens. + * + * @param cookie the cookie to modify. + * @param isSecure whether it is coming from a secure request. + * @param domain the domain for which the cookie is valid. If null, then will fall back to default. + */ + private void setCookieProperties(Cookie cookie, boolean isSecure, String domain) { + cookie.setHttpOnly(true); + cookie.setPath("/"); + cookie.setSecure(isSecure); //if the request comes per HTTPS set the secure option on the cookie + if (domain != null) { + cookie.setDomain(domain); + } + } + + /** + * Logs the user out by clearing all cookies. + * + * @param httpServletRequest the request containing the Cookies. + * @param httpServletResponse the response used to clear them. + */ + public void clearCookies(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { + String domain = getCookieDomain(httpServletRequest); + for (String cookieName : COOKIE_NAMES) { + clearCookie(httpServletRequest, httpServletResponse, domain, cookieName); + } + } + + private void clearCookie(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, + String domain, String cookieName) { + Cookie cookie = new Cookie(cookieName, ""); + setCookieProperties(cookie, httpServletRequest.isSecure(), domain); + cookie.setMaxAge(0); + httpServletResponse.addCookie(cookie); + log.debug("clearing cookie {}", cookie.getName()); + } + + /** + * Returns the top level domain of the server from the request. This is used to limit the Cookie + * to the top domain instead of the full domain name. + *

+ * A lot of times, individual gateways of the same domain get their own subdomain but authentication + * shall work across all subdomains of the top level domain. + *

+ * For example, when sending a request to app1.domain.com, + * this returns .domain.com. + * + * @param request the HTTP request we received from the client. + * @return the top level domain to set the cookies for. + * Returns null if the domain is not under a public suffix (.com, .co.uk), e.g. for localhost. + */ + private String getCookieDomain(HttpServletRequest request) { + String domain = oAuth2Properties.getWebClientConfiguration().getCookieDomain(); + if (domain != null) { + return domain; + } + // if not explicitly defined, use top-level domain + domain = request.getServerName().toLowerCase(); + // strip off leading www. + if (domain.startsWith("www.")) { + domain = domain.substring(4); + } + // if it isn't an IP address + if (!isIPv4Address(domain) && !isIPv6Address(domain)) { + // strip off private subdomains, leaving public TLD only + String suffix = suffixMatcher.getDomainRoot(domain); + if (suffix != null && !suffix.equals(domain)) { + // preserve leading dot + return "." + suffix; + } + } + // no top-level domain, stick with default domain + return null; + } + + /** + * Strip our token cookies from the array. + * + * @param cookies the cookies we receive as input. + * @return the new cookie array without our tokens. + */ + Cookie[] stripCookies(Cookie[] cookies) { + CookieCollection cc = new CookieCollection(cookies); + if (cc.removeAll(COOKIE_NAMES)) { + return cc.toArray(); + } + return cookies; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2Cookies.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2Cookies.java new file mode 100644 index 0000000000..5dfc898b24 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2Cookies.java @@ -0,0 +1,35 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletResponse; + +/** + * Holds the access token and refresh token cookies. + */ +class OAuth2Cookies { + private Cookie accessTokenCookie; + private Cookie refreshTokenCookie; + + public Cookie getAccessTokenCookie() { + return accessTokenCookie; + } + + public Cookie getRefreshTokenCookie() { + return refreshTokenCookie; + } + + public void setCookies(Cookie accessTokenCookie, Cookie refreshTokenCookie) { + this.accessTokenCookie = accessTokenCookie; + this.refreshTokenCookie = refreshTokenCookie; + } + + /** + * Add the access token and refresh token as cookies to the response after successful authentication. + * + * @param response the response to add them to. + */ + void addCookiesTo(HttpServletResponse response) { + response.addCookie(getAccessTokenCookie()); + response.addCookie(getRefreshTokenCookie()); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2SignatureVerifierClient.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2SignatureVerifierClient.java new file mode 100644 index 0000000000..5c07b38b8a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2SignatureVerifierClient.java @@ -0,0 +1,23 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import org.springframework.security.jwt.crypto.sign.SignatureVerifier; + +/** + * Abstracts how to create a SignatureVerifier to verify JWT tokens with a public key. + * Implementations will have to contact the OAuth2 authorization server to fetch the public key + * and use it to build a SignatureVerifier in a server specific way. + * + * @see UaaSignatureVerifierClient + */ +public interface OAuth2SignatureVerifierClient { + /** + * Returns the SignatureVerifier used to verify JWT tokens. + * Fetches the public key from the Authorization server to create + * this verifier. + * + * @return the new verifier used to verify JWT signatures. + * Will be null if we cannot contact the token endpoint. + * @throws Exception if we could not create a SignatureVerifier or contact the token endpoint. + */ + SignatureVerifier getSignatureVerifier() throws Exception; +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClient.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClient.java new file mode 100644 index 0000000000..9a68d4e93f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClient.java @@ -0,0 +1,32 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import org.springframework.security.oauth2.common.OAuth2AccessToken; + +/** + * Client talking to an OAuth2 Authorization server token endpoint. + * + * @see UaaTokenEndpointClient + * @see OAuth2TokenEndpointClientAdapter + */ +public interface OAuth2TokenEndpointClient { + /** + * Send a password grant to the token endpoint. + * + * @param username the username to authenticate. + * @param password his password. + * @return the access token and enclosed refresh token received from the token endpoint. + * @throws org.springframework.security.oauth2.common.exceptions.ClientAuthenticationException + * if we cannot contact the token endpoint. + */ + OAuth2AccessToken sendPasswordGrant(String username, String password); + + /** + * Send a refresh_token grant to the token endpoint. + * + * @param refreshTokenValue the refresh token used to get new tokens. + * @return the new access/refresh token pair. + * @throws org.springframework.security.oauth2.common.exceptions.ClientAuthenticationException + * if we cannot contact the token endpoint. + */ + OAuth2AccessToken sendRefreshGrant(String refreshTokenValue); +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClientAdapter.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClientAdapter.java new file mode 100644 index 0000000000..5506ce895c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2TokenEndpointClientAdapter.java @@ -0,0 +1,120 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2Properties; +import io.github.jhipster.config.JHipsterProperties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.common.exceptions.InvalidClientException; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; + +/** + * Default base class for an OAuth2TokenEndpointClient. + * Individual implementations for a particular OAuth2 provider can use this as a starting point. + */ +public abstract class OAuth2TokenEndpointClientAdapter implements OAuth2TokenEndpointClient { + private final Logger log = LoggerFactory.getLogger(OAuth2TokenEndpointClientAdapter.class); + protected final RestTemplate restTemplate; + protected final JHipsterProperties jHipsterProperties; + protected final OAuth2Properties oAuth2Properties; + + public OAuth2TokenEndpointClientAdapter(RestTemplate restTemplate, JHipsterProperties jHipsterProperties, OAuth2Properties oAuth2Properties) { + this.restTemplate = restTemplate; + this.jHipsterProperties = jHipsterProperties; + this.oAuth2Properties = oAuth2Properties; + } + + /** + * Sends a password grant to the token endpoint. + * + * @param username the username to authenticate. + * @param password his password. + * @return the access token. + */ + @Override + public OAuth2AccessToken sendPasswordGrant(String username, String password) { + HttpHeaders reqHeaders = new HttpHeaders(); + reqHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + MultiValueMap formParams = new LinkedMultiValueMap<>(); + formParams.set("username", username); + formParams.set("password", password); + formParams.set("grant_type", "password"); + addAuthentication(reqHeaders, formParams); + HttpEntity> entity = new HttpEntity<>(formParams, reqHeaders); + log.debug("contacting OAuth2 token endpoint to login user: {}", username); + ResponseEntity + responseEntity = restTemplate.postForEntity(getTokenEndpoint(), entity, OAuth2AccessToken.class); + if (responseEntity.getStatusCode() != HttpStatus.OK) { + log.debug("failed to authenticate user with OAuth2 token endpoint, status: {}", responseEntity.getStatusCodeValue()); + throw new HttpClientErrorException(responseEntity.getStatusCode()); + } + OAuth2AccessToken accessToken = responseEntity.getBody(); + return accessToken; + } + + /** + * Sends a refresh grant to the token endpoint using the current refresh token to obtain new tokens. + * + * @param refreshTokenValue the refresh token to use to obtain new tokens. + * @return the new, refreshed access token. + */ + @Override + public OAuth2AccessToken sendRefreshGrant(String refreshTokenValue) { + MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("grant_type", "refresh_token"); + params.add("refresh_token", refreshTokenValue); + HttpHeaders headers = new HttpHeaders(); + addAuthentication(headers, params); + HttpEntity> entity = new HttpEntity<>(params, headers); + log.debug("contacting OAuth2 token endpoint to refresh OAuth2 JWT tokens"); + ResponseEntity responseEntity = restTemplate.postForEntity(getTokenEndpoint(), entity, + OAuth2AccessToken.class); + if (responseEntity.getStatusCode() != HttpStatus.OK) { + log.debug("failed to refresh tokens: {}", responseEntity.getStatusCodeValue()); + throw new HttpClientErrorException(responseEntity.getStatusCode()); + } + OAuth2AccessToken accessToken = responseEntity.getBody(); + log.info("refreshed OAuth2 JWT cookies using refresh_token grant"); + return accessToken; + } + + protected abstract void addAuthentication(HttpHeaders reqHeaders, MultiValueMap formParams); + + protected String getClientSecret() { + String clientSecret = oAuth2Properties.getWebClientConfiguration().getSecret(); + if (clientSecret == null) { + throw new InvalidClientException("no client-secret configured in application properties"); + } + return clientSecret; + } + + protected String getClientId() { + String clientId = oAuth2Properties.getWebClientConfiguration().getClientId(); + if (clientId == null) { + throw new InvalidClientException("no client-id configured in application properties"); + } + return clientId; + } + + /** + * Returns the configured OAuth2 token endpoint URI. + * + * @return the OAuth2 token endpoint URI. + */ + protected String getTokenEndpoint() { + String tokenEndpointUrl = jHipsterProperties.getSecurity().getClientAuthorization().getAccessTokenUri(); + if (tokenEndpointUrl == null) { + throw new InvalidClientException("no token endpoint configured in application properties"); + } + return tokenEndpointUrl; + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaSignatureVerifierClient.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaSignatureVerifierClient.java new file mode 100644 index 0000000000..1a4ff10852 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaSignatureVerifierClient.java @@ -0,0 +1,63 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.security.jwt.crypto.sign.RsaVerifier; +import org.springframework.security.jwt.crypto.sign.SignatureVerifier; +import org.springframework.security.oauth2.common.exceptions.InvalidClientException; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.util.Map; + +/** + * Client fetching the public key from UAA to create a SignatureVerifier. + */ +@Component +public class UaaSignatureVerifierClient implements OAuth2SignatureVerifierClient { + private final Logger log = LoggerFactory.getLogger(UaaSignatureVerifierClient.class); + private final RestTemplate restTemplate; + protected final OAuth2Properties oAuth2Properties; + + public UaaSignatureVerifierClient(DiscoveryClient discoveryClient, @Qualifier("loadBalancedRestTemplate") RestTemplate restTemplate, + OAuth2Properties oAuth2Properties) { + this.restTemplate = restTemplate; + this.oAuth2Properties = oAuth2Properties; + // Load available UAA servers + discoveryClient.getServices(); + } + + /** + * Fetches the public key from the UAA. + * + * @return the public key used to verify JWT tokens; or null. + */ + @Override + public SignatureVerifier getSignatureVerifier() throws Exception { + try { + HttpEntity request = new HttpEntity(new HttpHeaders()); + String key = (String) restTemplate + .exchange(getPublicKeyEndpoint(), HttpMethod.GET, request, Map.class).getBody() + .get("value"); + return new RsaVerifier(key); + } catch (IllegalStateException ex) { + log.warn("could not contact UAA to get public key"); + return null; + } + } + + /** Returns the configured endpoint URI to retrieve the public key. */ + private String getPublicKeyEndpoint() { + String tokenEndpointUrl = oAuth2Properties.getSignatureVerification().getPublicKeyEndpointUri(); + if (tokenEndpointUrl == null) { + throw new InvalidClientException("no token endpoint configured in application properties"); + } + return tokenEndpointUrl; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaTokenEndpointClient.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaTokenEndpointClient.java new file mode 100644 index 0000000000..01c8febdb2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/oauth2/UaaTokenEndpointClient.java @@ -0,0 +1,40 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2Properties; +import io.github.jhipster.config.JHipsterProperties; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.HttpHeaders; +import org.springframework.stereotype.Component; +import org.springframework.util.Base64Utils; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestTemplate; + +import java.nio.charset.StandardCharsets; + +/** + * Client talking to UAA's token endpoint to do different OAuth2 grants. + */ +@Component +public class UaaTokenEndpointClient extends OAuth2TokenEndpointClientAdapter implements OAuth2TokenEndpointClient { + + public UaaTokenEndpointClient(@Qualifier("loadBalancedRestTemplate") RestTemplate restTemplate, + JHipsterProperties jHipsterProperties, OAuth2Properties oAuth2Properties) { + super(restTemplate, jHipsterProperties, oAuth2Properties); + } + + @Override + protected void addAuthentication(HttpHeaders reqHeaders, MultiValueMap formParams) { + reqHeaders.add("Authorization", getAuthorizationHeader()); + } + + /** + * @return a Basic authorization header to be used to talk to UAA. + */ + protected String getAuthorizationHeader() { + String clientId = getClientId(); + String clientSecret = getClientSecret(); + String authorization = clientId + ":" + clientSecret; + return "Basic " + Base64Utils.encodeToString(authorization.getBytes(StandardCharsets.UTF_8)); + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/package-info.java new file mode 100644 index 0000000000..ae119e4f05 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/security/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Security configuration. + */ +package com.baeldung.jhipster.gateway.security; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/service/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/service/package-info.java new file mode 100644 index 0000000000..14fd609c71 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/service/package-info.java @@ -0,0 +1,4 @@ +/** + * Service layer beans. + */ +package com.baeldung.jhipster.gateway.service; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilter.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilter.java new file mode 100644 index 0000000000..07ba790047 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilter.java @@ -0,0 +1,118 @@ +package com.baeldung.jhipster.gateway.web.filter; + +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2AuthenticationService; +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2CookieHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.common.exceptions.ClientAuthenticationException; +import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; +import org.springframework.security.oauth2.common.exceptions.UnauthorizedClientException; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.filter.GenericFilterBean; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * Filters incoming requests and refreshes the access token before it expires. + */ +public class RefreshTokenFilter extends GenericFilterBean { + /** + * Number of seconds before expiry to start refreshing access tokens so we don't run into race conditions when forwarding + * requests downstream. Otherwise, access tokens may still be valid when we check here but may then be expired + * when relayed to another microservice a wee bit later. + */ + private static final int REFRESH_WINDOW_SECS = 30; + + private final Logger log = LoggerFactory.getLogger(RefreshTokenFilter.class); + + /** + * The OAuth2AuthenticationService is doing the actual work. We are just a simple filter after all. + */ + private final OAuth2AuthenticationService authenticationService; + private final TokenStore tokenStore; + + public RefreshTokenFilter(OAuth2AuthenticationService authenticationService, TokenStore tokenStore) { + this.authenticationService = authenticationService; + this.tokenStore = tokenStore; + } + + /** + * Check access token cookie and refresh it, if it is either not present, expired or about to expire. + */ + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) + throws IOException, ServletException { + HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; + HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; + try { + httpServletRequest = refreshTokensIfExpiring(httpServletRequest, httpServletResponse); + } catch (ClientAuthenticationException ex) { + log.warn("Security exception: could not refresh tokens", ex); + httpServletRequest = authenticationService.stripTokens(httpServletRequest); + } + filterChain.doFilter(httpServletRequest, servletResponse); + } + + /** + * Refresh the access and refresh tokens if they are about to expire. + * + * @param httpServletRequest the servlet request holding the current cookies. If no refresh cookie is present, + * then we are out of luck. + * @param httpServletResponse the servlet response that gets the new set-cookie headers, if they had to be + * refreshed. + * @return a new request to use downstream that contains the new cookies, if they had to be refreshed. + * @throws InvalidTokenException if the tokens could not be refreshed. + */ + public HttpServletRequest refreshTokensIfExpiring(HttpServletRequest httpServletRequest, HttpServletResponse + httpServletResponse) { + HttpServletRequest newHttpServletRequest = httpServletRequest; + //get access token from cookie + Cookie accessTokenCookie = OAuth2CookieHelper.getAccessTokenCookie(httpServletRequest); + if (mustRefreshToken(accessTokenCookie)) { //we either have no access token, or it is expired, or it is about to expire + //get the refresh token cookie and, if present, request new tokens + Cookie refreshCookie = OAuth2CookieHelper.getRefreshTokenCookie(httpServletRequest); + if (refreshCookie != null) { + try { + newHttpServletRequest = authenticationService.refreshToken(httpServletRequest, httpServletResponse, refreshCookie); + } catch (HttpClientErrorException ex) { + throw new UnauthorizedClientException("could not refresh OAuth2 token", ex); + } + } else if (accessTokenCookie != null) { + log.warn("access token found, but no refresh token, stripping them all"); + OAuth2AccessToken token = tokenStore.readAccessToken(accessTokenCookie.getValue()); + if (token.isExpired()) { + throw new InvalidTokenException("access token has expired, but there's no refresh token"); + } + } + } + return newHttpServletRequest; + } + + /** + * Check if we must refresh the access token. + * We must refresh it, if we either have no access token, or it is expired, or it is about to expire. + * + * @param accessTokenCookie the current access token. + * @return true, if it must be refreshed; false, otherwise. + */ + private boolean mustRefreshToken(Cookie accessTokenCookie) { + if (accessTokenCookie == null) { + return true; + } + OAuth2AccessToken token = tokenStore.readAccessToken(accessTokenCookie.getValue()); + //check if token is expired or about to expire + if (token.isExpired() || token.getExpiresIn() < REFRESH_WINDOW_SECS) { + return true; + } + return false; //access token is still fine + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilterConfigurer.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilterConfigurer.java new file mode 100644 index 0000000000..dda1da763a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/filter/RefreshTokenFilterConfigurer.java @@ -0,0 +1,36 @@ +package com.baeldung.jhipster.gateway.web.filter; + +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2AuthenticationService; + +import org.springframework.security.config.annotation.SecurityConfigurerAdapter; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.web.DefaultSecurityFilterChain; + +/** + * Configures a RefreshTokenFilter to refresh access tokens if they are about to expire. + * + * @see RefreshTokenFilter + */ +public class RefreshTokenFilterConfigurer extends SecurityConfigurerAdapter { + /** + * RefreshTokenFilter needs the OAuth2AuthenticationService to refresh cookies using the refresh token. + */ + private OAuth2AuthenticationService authenticationService; + private final TokenStore tokenStore; + + public RefreshTokenFilterConfigurer(OAuth2AuthenticationService authenticationService, TokenStore tokenStore) { + this.authenticationService = authenticationService; + this.tokenStore = tokenStore; + } + + /** + * Install RefreshTokenFilter as a servlet Filter. + */ + @Override + public void configure(HttpSecurity http) throws Exception { + RefreshTokenFilter customFilter = new RefreshTokenFilter(authenticationService, tokenStore); + http.addFilterBefore(customFilter, OAuth2AuthenticationProcessingFilter.class); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/AuthResource.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/AuthResource.java new file mode 100644 index 0000000000..0a5d89b6d8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/AuthResource.java @@ -0,0 +1,68 @@ +package com.baeldung.jhipster.gateway.web.rest; + +import com.codahale.metrics.annotation.Timed; +import com.baeldung.jhipster.gateway.security.oauth2.OAuth2AuthenticationService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +/** + * Authentication endpoint for web client. + * Used to authenticate a user using OAuth2 access tokens or log him out. + * + * @author markus.oellinger + */ +@RestController +@RequestMapping("/auth") +public class AuthResource { + + private final Logger log = LoggerFactory.getLogger(AuthResource.class); + + private OAuth2AuthenticationService authenticationService; + + public AuthResource(OAuth2AuthenticationService authenticationService) { + this.authenticationService = authenticationService; + } + + /** + * Authenticates a user setting the access and refresh token cookies. + * + * @param request the HttpServletRequest holding - among others - the headers passed from the client. + * @param response the HttpServletResponse getting the cookies set upon successful authentication. + * @param params the login params (username, password, rememberMe). + * @return the access token of the authenticated user. Will return an error code if it fails to authenticate the user. + */ + @RequestMapping(value = "/login", method = RequestMethod.POST, consumes = MediaType + .APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity authenticate(HttpServletRequest request, HttpServletResponse response, @RequestBody + Map params) { + return authenticationService.authenticate(request, response, params); + } + + /** + * Logout current user deleting his cookies. + * + * @param request the HttpServletRequest holding - among others - the headers passed from the client. + * @param response the HttpServletResponse getting the cookies set upon successful authentication. + * @return an empty response entity. + */ + @RequestMapping(value = "/logout", method = RequestMethod.POST) + @Timed + public ResponseEntity logout(HttpServletRequest request, HttpServletResponse response) { + log.info("logging out user {}", SecurityContextHolder.getContext().getAuthentication().getName()); + authenticationService.logout(request, response); + return ResponseEntity.noContent().build(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/GatewayResource.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/GatewayResource.java new file mode 100644 index 0000000000..13cd7d60ec --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/GatewayResource.java @@ -0,0 +1,54 @@ +package com.baeldung.jhipster.gateway.web.rest; + +import com.baeldung.jhipster.gateway.web.rest.vm.RouteVM; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.cloud.netflix.zuul.filters.Route; +import org.springframework.cloud.netflix.zuul.filters.RouteLocator; +import org.springframework.http.*; +import org.springframework.security.access.annotation.Secured; +import com.baeldung.jhipster.gateway.security.AuthoritiesConstants; +import org.springframework.web.bind.annotation.*; + +import com.codahale.metrics.annotation.Timed; + +/** + * REST controller for managing Gateway configuration. + */ +@RestController +@RequestMapping("/api/gateway") +public class GatewayResource { + + private final RouteLocator routeLocator; + + private final DiscoveryClient discoveryClient; + + public GatewayResource(RouteLocator routeLocator, DiscoveryClient discoveryClient) { + this.routeLocator = routeLocator; + this.discoveryClient = discoveryClient; + } + + /** + * GET /routes : get the active routes. + * + * @return the ResponseEntity with status 200 (OK) and with body the list of routes + */ + @GetMapping("/routes") + @Timed + @Secured(AuthoritiesConstants.ADMIN) + public ResponseEntity> activeRoutes() { + List routes = routeLocator.getRoutes(); + List routeVMs = new ArrayList<>(); + routes.forEach(route -> { + RouteVM routeVM = new RouteVM(); + routeVM.setPath(route.getFullPath()); + routeVM.setServiceId(route.getId()); + routeVM.setServiceInstances(discoveryClient.getInstances(route.getLocation())); + routeVMs.add(routeVM); + }); + return new ResponseEntity<>(routeVMs, HttpStatus.OK); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/LogsResource.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/LogsResource.java new file mode 100644 index 0000000000..c631d57c02 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/LogsResource.java @@ -0,0 +1,39 @@ +package com.baeldung.jhipster.gateway.web.rest; + +import com.baeldung.jhipster.gateway.web.rest.vm.LoggerVM; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; +import com.codahale.metrics.annotation.Timed; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * Controller for view and managing Log Level at runtime. + */ +@RestController +@RequestMapping("/management") +public class LogsResource { + + @GetMapping("/logs") + @Timed + public List getList() { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + return context.getLoggerList() + .stream() + .map(LoggerVM::new) + .collect(Collectors.toList()); + } + + @PutMapping("/logs") + @ResponseStatus(HttpStatus.NO_CONTENT) + @Timed + public void changeLevel(@RequestBody LoggerVM jsonLogger) { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + context.getLogger(jsonLogger.getName()).setLevel(Level.valueOf(jsonLogger.getLevel())); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/BadRequestAlertException.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/BadRequestAlertException.java new file mode 100644 index 0000000000..981b964c69 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/BadRequestAlertException.java @@ -0,0 +1,42 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +public class BadRequestAlertException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + private final String entityName; + + private final String errorKey; + + public BadRequestAlertException(String defaultMessage, String entityName, String errorKey) { + this(ErrorConstants.DEFAULT_TYPE, defaultMessage, entityName, errorKey); + } + + public BadRequestAlertException(URI type, String defaultMessage, String entityName, String errorKey) { + super(type, defaultMessage, Status.BAD_REQUEST, null, null, null, getAlertParameters(entityName, errorKey)); + this.entityName = entityName; + this.errorKey = errorKey; + } + + public String getEntityName() { + return entityName; + } + + public String getErrorKey() { + return errorKey; + } + + private static Map getAlertParameters(String entityName, String errorKey) { + Map parameters = new HashMap<>(); + parameters.put("message", "error." + errorKey); + parameters.put("params", entityName); + return parameters; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/CustomParameterizedException.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/CustomParameterizedException.java new file mode 100644 index 0000000000..640e80b911 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/CustomParameterizedException.java @@ -0,0 +1,54 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; + +import java.util.HashMap; +import java.util.Map; + +import static org.zalando.problem.Status.BAD_REQUEST; + +/** + * Custom, parameterized exception, which can be translated on the client side. + * For example: + * + *

+ * throw new CustomParameterizedException("myCustomError", "hello", "world");
+ * 
+ * + * Can be translated with: + * + *
+ * "error.myCustomError" :  "The server says {{param0}} to {{param1}}"
+ * 
+ */ +public class CustomParameterizedException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + private static final String PARAM = "param"; + + public CustomParameterizedException(String message, String... params) { + this(message, toParamMap(params)); + } + + public CustomParameterizedException(String message, Map paramMap) { + super(ErrorConstants.PARAMETERIZED_TYPE, "Parameterized Exception", BAD_REQUEST, null, null, null, toProblemParameters(message, paramMap)); + } + + public static Map toParamMap(String... params) { + Map paramMap = new HashMap<>(); + if (params != null && params.length > 0) { + for (int i = 0; i < params.length; i++) { + paramMap.put(PARAM + i, params[i]); + } + } + return paramMap; + } + + public static Map toProblemParameters(String message, Map paramMap) { + Map parameters = new HashMap<>(); + parameters.put("message", message); + parameters.put("params", paramMap); + return parameters; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailAlreadyUsedException.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailAlreadyUsedException.java new file mode 100644 index 0000000000..37df808e98 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailAlreadyUsedException.java @@ -0,0 +1,10 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +public class EmailAlreadyUsedException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public EmailAlreadyUsedException() { + super(ErrorConstants.EMAIL_ALREADY_USED_TYPE, "Email is already in use!", "userManagement", "emailexists"); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailNotFoundException.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailNotFoundException.java new file mode 100644 index 0000000000..42a3bad8bf --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/EmailNotFoundException.java @@ -0,0 +1,13 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +public class EmailNotFoundException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public EmailNotFoundException() { + super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ErrorConstants.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ErrorConstants.java new file mode 100644 index 0000000000..15c9755956 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ErrorConstants.java @@ -0,0 +1,21 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import java.net.URI; + +public final class ErrorConstants { + + public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; + public static final String ERR_VALIDATION = "error.validation"; + public static final String PROBLEM_BASE_URL = "https://www.jhipster.tech/problem"; + public static final URI DEFAULT_TYPE = URI.create(PROBLEM_BASE_URL + "/problem-with-message"); + public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create(PROBLEM_BASE_URL + "/constraint-violation"); + public static final URI PARAMETERIZED_TYPE = URI.create(PROBLEM_BASE_URL + "/parameterized"); + public static final URI ENTITY_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/entity-not-found"); + public static final URI INVALID_PASSWORD_TYPE = URI.create(PROBLEM_BASE_URL + "/invalid-password"); + public static final URI EMAIL_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/email-already-used"); + public static final URI LOGIN_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/login-already-used"); + public static final URI EMAIL_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/email-not-found"); + + private ErrorConstants() { + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslator.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslator.java new file mode 100644 index 0000000000..d5c9e577a6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslator.java @@ -0,0 +1,107 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import com.baeldung.jhipster.gateway.web.rest.util.HeaderUtil; + +import org.springframework.dao.ConcurrencyFailureException; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.context.request.NativeWebRequest; +import org.zalando.problem.DefaultProblem; +import org.zalando.problem.Problem; +import org.zalando.problem.ProblemBuilder; +import org.zalando.problem.Status; +import org.zalando.problem.spring.web.advice.ProblemHandling; +import org.zalando.problem.violations.ConstraintViolationProblem; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.stream.Collectors; + +/** + * Controller advice to translate the server side exceptions to client-friendly json structures. + * The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807) + */ +@ControllerAdvice +public class ExceptionTranslator implements ProblemHandling { + + /** + * Post-process the Problem payload to add the message key for the front-end if needed + */ + @Override + public ResponseEntity process(@Nullable ResponseEntity entity, NativeWebRequest request) { + if (entity == null) { + return entity; + } + Problem problem = entity.getBody(); + if (!(problem instanceof ConstraintViolationProblem || problem instanceof DefaultProblem)) { + return entity; + } + ProblemBuilder builder = Problem.builder() + .withType(Problem.DEFAULT_TYPE.equals(problem.getType()) ? ErrorConstants.DEFAULT_TYPE : problem.getType()) + .withStatus(problem.getStatus()) + .withTitle(problem.getTitle()) + .with("path", request.getNativeRequest(HttpServletRequest.class).getRequestURI()); + + if (problem instanceof ConstraintViolationProblem) { + builder + .with("violations", ((ConstraintViolationProblem) problem).getViolations()) + .with("message", ErrorConstants.ERR_VALIDATION); + } else { + builder + .withCause(((DefaultProblem) problem).getCause()) + .withDetail(problem.getDetail()) + .withInstance(problem.getInstance()); + problem.getParameters().forEach(builder::with); + if (!problem.getParameters().containsKey("message") && problem.getStatus() != null) { + builder.with("message", "error.http." + problem.getStatus().getStatusCode()); + } + } + return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode()); + } + + @Override + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex, @Nonnull NativeWebRequest request) { + BindingResult result = ex.getBindingResult(); + List fieldErrors = result.getFieldErrors().stream() + .map(f -> new FieldErrorVM(f.getObjectName(), f.getField(), f.getCode())) + .collect(Collectors.toList()); + + Problem problem = Problem.builder() + .withType(ErrorConstants.CONSTRAINT_VIOLATION_TYPE) + .withTitle("Method argument not valid") + .withStatus(defaultConstraintViolationStatus()) + .with("message", ErrorConstants.ERR_VALIDATION) + .with("fieldErrors", fieldErrors) + .build(); + return create(ex, problem, request); + } + + @ExceptionHandler + public ResponseEntity handleNoSuchElementException(NoSuchElementException ex, NativeWebRequest request) { + Problem problem = Problem.builder() + .withStatus(Status.NOT_FOUND) + .with("message", ErrorConstants.ENTITY_NOT_FOUND_TYPE) + .build(); + return create(ex, problem, request); + } + + @ExceptionHandler + public ResponseEntity handleBadRequestAlertException(BadRequestAlertException ex, NativeWebRequest request) { + return create(ex, request, HeaderUtil.createFailureAlert(ex.getEntityName(), ex.getErrorKey(), ex.getMessage())); + } + + @ExceptionHandler + public ResponseEntity handleConcurrencyFailure(ConcurrencyFailureException ex, NativeWebRequest request) { + Problem problem = Problem.builder() + .withStatus(Status.CONFLICT) + .with("message", ErrorConstants.ERR_CONCURRENCY_FAILURE) + .build(); + return create(ex, problem, request); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/FieldErrorVM.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/FieldErrorVM.java new file mode 100644 index 0000000000..cb49de90eb --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/FieldErrorVM.java @@ -0,0 +1,33 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import java.io.Serializable; + +public class FieldErrorVM implements Serializable { + + private static final long serialVersionUID = 1L; + + private final String objectName; + + private final String field; + + private final String message; + + public FieldErrorVM(String dto, String field, String message) { + this.objectName = dto; + this.field = field; + this.message = message; + } + + public String getObjectName() { + return objectName; + } + + public String getField() { + return field; + } + + public String getMessage() { + return message; + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InternalServerErrorException.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InternalServerErrorException.java new file mode 100644 index 0000000000..7e64638fe1 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InternalServerErrorException.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +/** + * Simple exception with a message, that returns an Internal Server Error code. + */ +public class InternalServerErrorException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public InternalServerErrorException(String message) { + super(ErrorConstants.DEFAULT_TYPE, message, Status.INTERNAL_SERVER_ERROR); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InvalidPasswordException.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InvalidPasswordException.java new file mode 100644 index 0000000000..101763b703 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/InvalidPasswordException.java @@ -0,0 +1,13 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +public class InvalidPasswordException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public InvalidPasswordException() { + super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/LoginAlreadyUsedException.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/LoginAlreadyUsedException.java new file mode 100644 index 0000000000..60518572fe --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/LoginAlreadyUsedException.java @@ -0,0 +1,10 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +public class LoginAlreadyUsedException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public LoginAlreadyUsedException() { + super(ErrorConstants.LOGIN_ALREADY_USED_TYPE, "Login name already used!", "userManagement", "userexists"); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/package-info.java new file mode 100644 index 0000000000..f13641c5b8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/errors/package-info.java @@ -0,0 +1,6 @@ +/** + * Specific errors used with Zalando's "problem-spring-web" library. + * + * More information on https://github.com/zalando/problem-spring-web + */ +package com.baeldung.jhipster.gateway.web.rest.errors; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/package-info.java new file mode 100644 index 0000000000..e64efc7eed --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring MVC REST controllers. + */ +package com.baeldung.jhipster.gateway.web.rest; diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/HeaderUtil.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/HeaderUtil.java new file mode 100644 index 0000000000..979064f3d7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/HeaderUtil.java @@ -0,0 +1,45 @@ +package com.baeldung.jhipster.gateway.web.rest.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; + +/** + * Utility class for HTTP headers creation. + */ +public final class HeaderUtil { + + private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class); + + private static final String APPLICATION_NAME = "gatewayApp"; + + private HeaderUtil() { + } + + public static HttpHeaders createAlert(String message, String param) { + HttpHeaders headers = new HttpHeaders(); + headers.add("X-" + APPLICATION_NAME + "-alert", message); + headers.add("X-" + APPLICATION_NAME + "-params", param); + return headers; + } + + public static HttpHeaders createEntityCreationAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".created", param); + } + + public static HttpHeaders createEntityUpdateAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".updated", param); + } + + public static HttpHeaders createEntityDeletionAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".deleted", param); + } + + public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) { + log.error("Entity processing failed, {}", defaultMessage); + HttpHeaders headers = new HttpHeaders(); + headers.add("X-" + APPLICATION_NAME + "-error", "error." + errorKey); + headers.add("X-" + APPLICATION_NAME + "-params", entityName); + return headers; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtil.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtil.java new file mode 100644 index 0000000000..bf6308068d --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtil.java @@ -0,0 +1,45 @@ +package com.baeldung.jhipster.gateway.web.rest.util; + +import org.springframework.data.domain.Page; +import org.springframework.http.HttpHeaders; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Utility class for handling pagination. + * + *

+ * Pagination uses the same principles as the GitHub API, + * and follow RFC 5988 (Link header). + */ +public final class PaginationUtil { + + private PaginationUtil() { + } + + public static HttpHeaders generatePaginationHttpHeaders(Page page, String baseUrl) { + + HttpHeaders headers = new HttpHeaders(); + headers.add("X-Total-Count", Long.toString(page.getTotalElements())); + String link = ""; + if ((page.getNumber() + 1) < page.getTotalPages()) { + link = "<" + generateUri(baseUrl, page.getNumber() + 1, page.getSize()) + ">; rel=\"next\","; + } + // prev link + if ((page.getNumber()) > 0) { + link += "<" + generateUri(baseUrl, page.getNumber() - 1, page.getSize()) + ">; rel=\"prev\","; + } + // last and first link + int lastPage = 0; + if (page.getTotalPages() > 0) { + lastPage = page.getTotalPages() - 1; + } + link += "<" + generateUri(baseUrl, lastPage, page.getSize()) + ">; rel=\"last\","; + link += "<" + generateUri(baseUrl, 0, page.getSize()) + ">; rel=\"first\""; + headers.add(HttpHeaders.LINK, link); + return headers; + } + + private static String generateUri(String baseUrl, int page, int size) { + return UriComponentsBuilder.fromUriString(baseUrl).queryParam("page", page).queryParam("size", size).toUriString(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/LoggerVM.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/LoggerVM.java new file mode 100644 index 0000000000..b5a25603de --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/LoggerVM.java @@ -0,0 +1,46 @@ +package com.baeldung.jhipster.gateway.web.rest.vm; + +import ch.qos.logback.classic.Logger; + +/** + * View Model object for storing a Logback logger. + */ +public class LoggerVM { + + private String name; + + private String level; + + public LoggerVM(Logger logger) { + this.name = logger.getName(); + this.level = logger.getEffectiveLevel().toString(); + } + + public LoggerVM() { + // Empty public constructor used by Jackson. + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + @Override + public String toString() { + return "LoggerVM{" + + "name='" + name + '\'' + + ", level='" + level + '\'' + + '}'; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/RouteVM.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/RouteVM.java new file mode 100644 index 0000000000..28ff5578f5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/RouteVM.java @@ -0,0 +1,41 @@ +package com.baeldung.jhipster.gateway.web.rest.vm; + +import java.util.List; + +import org.springframework.cloud.client.ServiceInstance; + +/** + * View Model that stores a route managed by the Gateway. + */ +public class RouteVM { + + private String path; + + private String serviceId; + + private List serviceInstances; + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public List getServiceInstances() { + return serviceInstances; + } + + public void setServiceInstances(List serviceInstances) { + this.serviceInstances = serviceInstances; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/package-info.java b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/package-info.java new file mode 100644 index 0000000000..a20ce3226e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/java/com/baeldung/jhipster/gateway/web/rest/vm/package-info.java @@ -0,0 +1,4 @@ +/** + * View Models used by Spring MVC REST controllers. + */ +package com.baeldung.jhipster.gateway.web.rest.vm; diff --git a/jhipster/jhipster-uaa/gateway/src/main/jib/entrypoint.sh b/jhipster/jhipster-uaa/gateway/src/main/jib/entrypoint.sh new file mode 100644 index 0000000000..5ac1e54b29 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/jib/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} +exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "com.baeldung.jhipster.gateway.GatewayApp" "$@" diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/.h2.server.properties b/jhipster/jhipster-uaa/gateway/src/main/resources/.h2.server.properties new file mode 100644 index 0000000000..22c176d4ac --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/.h2.server.properties @@ -0,0 +1,6 @@ +#H2 Server Properties +#Tue Oct 16 03:48:16 BRT 2018 +0=JHipster H2 (Disk)|org.h2.Driver|jdbc\:h2\:file\:./target/h2db/db/gateway|gateway +webAllowOthers=true +webPort=8082 +webSSL=false diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/banner.txt b/jhipster/jhipster-uaa/gateway/src/main/resources/banner.txt new file mode 100644 index 0000000000..e0bc55aaff --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/banner.txt @@ -0,0 +1,10 @@ + + ${AnsiColor.GREEN} ██╗${AnsiColor.RED} ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗ + ${AnsiColor.GREEN} ██║${AnsiColor.RED} ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗ + ${AnsiColor.GREEN} ██║${AnsiColor.RED} ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝ + ${AnsiColor.GREEN}██╗ ██║${AnsiColor.RED} ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ + ${AnsiColor.GREEN}╚██████╔╝${AnsiColor.RED} ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ + ${AnsiColor.GREEN} ╚═════╝ ${AnsiColor.RED} ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ + +${AnsiColor.BRIGHT_BLUE}:: JHipster 🤓 :: Running Spring Boot ${spring-boot.version} :: +:: https://www.jhipster.tech ::${AnsiColor.DEFAULT} diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-dev.yml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-dev.yml new file mode 100644 index 0000000000..c2a47d3ab9 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-dev.yml @@ -0,0 +1,168 @@ +# =================================================================== +# Spring Boot configuration for the "dev" profile. +# +# This configuration overrides the application.yml file. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +logging: + level: + ROOT: DEBUG + io.github.jhipster: DEBUG + com.baeldung.jhipster.gateway: DEBUG + +eureka: + instance: + prefer-ip-address: true + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ + +spring: + profiles: + active: dev + include: + - swagger + # Uncomment to activate TLS for the dev profile + #- tls + devtools: + restart: + enabled: true + livereload: + enabled: false # we use Webpack dev server + BrowserSync for livereload + jackson: + serialization.indent_output: true + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:h2:file:./target/h2db/db/gateway;DB_CLOSE_DELAY=-1 + username: gateway + password: + hikari: + auto-commit: false + h2: + console: + enabled: false + jpa: + database-platform: io.github.jhipster.domain.util.FixedH2Dialect + database: H2 + show-sql: true + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: true + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: true + hibernate.cache.region.factory_class: com.hazelcast.hibernate.HazelcastCacheRegionFactory + hibernate.cache.hazelcast.instance_name: gateway + hibernate.cache.use_minimal_puts: true + hibernate.cache.hazelcast.use_lite_member: true + liquibase: + contexts: dev + mail: + host: localhost + port: 25 + username: + password: + messages: + cache-duration: PT1S # 1 second, see the ISO 8601 standard + thymeleaf: + cache: false + sleuth: + sampler: + percentage: 1 # report 100% of traces + zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies + base-url: http://localhost:9411 + enabled: false + locator: + discovery: + enabled: true + +server: + port: 8080 + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + gateway: + rate-limiting: + enabled: false + limit: 100000 + duration-in-seconds: 3600 + authorized-microservices-endpoints: # Access Control Policy, if left empty for a route, all endpoints will be accessible + app1: /api,/v2/api-docs # recommended dev configuration + http: + version: V_1_1 # To use HTTP/2 you will need to activate TLS (see application-tls.yml) + cache: # Cache configuration + hazelcast: # Hazelcast distributed cache + time-to-live-seconds: 3600 + backup-count: 1 + management-center: # Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + enabled: false + update-interval: 3 + url: http://localhost:8180/mancenter + # CORS is only enabled by default with the "dev" profile, so BrowserSync can access the API + cors: + allowed-origins: "*" + allowed-methods: "*" + allowed-headers: "*" + exposed-headers: "Authorization,Link,X-Total-Count" + allow-credentials: true + max-age: 1800 + security: + client-authorization: + access-token-uri: http://uaa/oauth/token + token-service-id: uaa + client-id: internal + client-secret: internal + mail: # specific JHipster mail property, for standard properties see MailProperties + from: gateway@localhost + base-url: http://127.0.0.1:8080 + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx: + enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: false + report-frequency: 60 # in seconds + logging: + logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration + enabled: false + host: localhost + port: 5000 + queue-size: 512 +oauth2: + signature-verification: + public-key-endpoint-uri: http://uaa/oauth/token_key + #ttl for public keys to verify JWT tokens (in ms) + ttl: 3600000 + #max. rate at which public keys will be fetched (in ms) + public-key-refresh-rate-limit: 10000 + web-client-configuration: + #keep in sync with UAA configuration + client-id: web_app + secret: changeit + # Controls session expiration due to inactivity (ignored for remember-me). + # Negative values disable session inactivity expiration. + session-timeout-in-seconds: 1800 + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-prod.yml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-prod.yml new file mode 100644 index 0000000000..a0f1a00859 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-prod.yml @@ -0,0 +1,175 @@ +# =================================================================== +# Spring Boot configuration for the "prod" profile. +# +# This configuration overrides the application.yml file. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +logging: + level: + ROOT: INFO + com.baeldung.jhipster.gateway: INFO + io.github.jhipster: INFO + +eureka: + instance: + prefer-ip-address: true + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ + +spring: + devtools: + restart: + enabled: false + livereload: + enabled: false + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:mysql://localhost:3306/gateway?useUnicode=true&characterEncoding=utf8&useSSL=false + username: root + password: + hikari: + auto-commit: false + data-source-properties: + cachePrepStmts: true + prepStmtCacheSize: 250 + prepStmtCacheSqlLimit: 2048 + useServerPrepStmts: true + jpa: + database-platform: org.hibernate.dialect.MySQL5InnoDBDialect + database: MYSQL + show-sql: false + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: true + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: false + hibernate.cache.region.factory_class: com.hazelcast.hibernate.HazelcastCacheRegionFactory + hibernate.cache.hazelcast.instance_name: gateway + hibernate.cache.use_minimal_puts: true + hibernate.cache.hazelcast.use_lite_member: true + liquibase: + contexts: prod + mail: + host: localhost + port: 25 + username: + password: + thymeleaf: + cache: true + sleuth: + sampler: + percentage: 1 # report 100% of traces + zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies + base-url: http://localhost:9411 + enabled: false + locator: + discovery: + enabled: true + +# =================================================================== +# To enable TLS in production, generate a certificate using: +# keytool -genkey -alias gateway -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650 +# +# You can also use Let's Encrypt: +# https://maximilian-boehm.com/hp2121/Create-a-Java-Keystore-JKS-from-Let-s-Encrypt-Certificates.htm +# +# Then, modify the server.ssl properties so your "server" configuration looks like: +# +# server: +# port: 443 +# ssl: +# key-store: classpath:config/tls/keystore.p12 +# key-store-password: password +# key-store-type: PKCS12 +# key-alias: gateway +# # The ciphers suite enforce the security by deactivating some old and deprecated SSL cipher, this list was tested against SSL Labs (https://www.ssllabs.com/ssltest/) +# ciphers: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 ,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,TLS_RSA_WITH_CAMELLIA_128_CBC_SHA +# =================================================================== +server: + port: 8080 + compression: + enabled: true + mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json + min-response-size: 1024 + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + gateway: + rate-limiting: + enabled: false + authorized-microservices-endpoints: # Access Control Policy, if left empty for a route, all endpoints will be accessible + app1: /api # recommended prod configuration + http: + version: V_1_1 # To use HTTP/2 you will need SSL support (see above the "server.ssl" configuration) + cache: # Used by the CachingHttpHeadersFilter + timeToLiveInDays: 1461 + cache: # Cache configuration + hazelcast: # Hazelcast distributed cache + time-to-live-seconds: 3600 + backup-count: 1 + management-center: # Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + enabled: false + update-interval: 3 + url: + security: + client-authorization: + access-token-uri: http://uaa/oauth/token + token-service-id: uaa + client-id: internal + client-secret: internal + mail: # specific JHipster mail property, for standard properties see MailProperties + from: gateway@localhost + base-url: http://my-server-url-to-change # Modify according to your server's URL + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx: + enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: false + report-frequency: 60 # in seconds + logging: + logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration + enabled: false + host: localhost + port: 5000 + queue-size: 512 +oauth2: + signature-verification: + public-key-endpoint-uri: http://uaa/oauth/token_key + #ttl for public keys to verify JWT tokens (in ms) + ttl: 3600000 + #max. rate at which public keys will be fetched (in ms) + public-key-refresh-rate-limit: 10000 + web-client-configuration: + #change client secret in production, keep in sync with UAA configuration + client-id: web_app + secret: changeit + # Controls session expiration due to inactivity (ignored for remember-me). + # Negative values disable session inactivity expiration. + session-timeout-in-seconds: 1800 + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-tls.yml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-tls.yml new file mode 100644 index 0000000000..e082c8f455 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application-tls.yml @@ -0,0 +1,18 @@ +# =================================================================== +# Activate this profile to enable TLS and HTTP/2. +# +# JHipster has generated a self-signed certificate, which will be used to encrypt traffic. +# As your browser will not understand this certificate, you will need to import it. +# +# Another (easiest) solution with Chrome is to enable the "allow-insecure-localhost" flag +# at chrome://flags/#allow-insecure-localhost +# =================================================================== +server: + ssl: + key-store: classpath:config/tls/keystore.p12 + key-store-password: password + key-store-type: PKCS12 + key-alias: selfsigned +jhipster: + http: + version: V_2_0 diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/application.yml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application.yml new file mode 100644 index 0000000000..b5848e8963 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/application.yml @@ -0,0 +1,157 @@ +# =================================================================== +# Spring Boot configuration. +# +# This configuration will be overridden by the Spring profile you use, +# for example application-dev.yml if you use the "dev" profile. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +eureka: + client: + enabled: true + healthcheck: + enabled: true + fetch-registry: true + register-with-eureka: true + instance-info-replication-interval-seconds: 10 + registry-fetch-interval-seconds: 10 + instance: + appname: gateway + instanceId: gateway:${spring.application.instance-id:${random.value}} + lease-renewal-interval-in-seconds: 5 + lease-expiration-duration-in-seconds: 10 + status-page-url-path: ${management.endpoints.web.base-path}/info + health-check-url-path: ${management.endpoints.web.base-path}/health + metadata-map: + zone: primary # This is needed for the load balancer + profile: ${spring.profiles.active} + version: ${info.project.version:} + git-version: ${git.commit.id.describe:} + git-commit: ${git.commit.id.abbrev:} + git-branch: ${git.branch:} +ribbon: + eureka: + enabled: true +# See http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html +zuul: # those values must be configured depending on the application specific needs + sensitive-headers: Cookie,Set-Cookie #see https://github.com/spring-cloud/spring-cloud-netflix/issues/3126 + host: + max-total-connections: 1000 + max-per-route-connections: 100 + semaphore: + max-semaphores: 500 + +# See https://github.com/Netflix/Hystrix/wiki/Configuration +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 10000 + +management: + endpoints: + web: + base-path: /management + exposure: + include: ["configprops", "env", "health", "info", "threaddump", "logfile" ] + endpoint: + health: + show-details: when_authorized + info: + git: + mode: full + health: + mail: + enabled: false # When using the MailService, configure an SMTP server and set this to true + metrics: + enabled: false # http://micrometer.io/ is disabled by default, as we use http://metrics.dropwizard.io/ instead + +spring: + application: + name: gateway + jpa: + open-in-view: false + hibernate: + ddl-auto: none + naming: + physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + messages: + basename: i18n/messages + mvc: + favicon: + enabled: false + thymeleaf: + mode: HTML +security: + oauth2: + resource: + filter-order: 3 + +server: + servlet: + session: + cookie: + http-only: true + +# Properties to be exposed on the /info management endpoint +info: + # Comma separated list of profiles that will trigger the ribbon to show + display-ribbon-on-profiles: "dev" + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + async: + core-pool-size: 2 + max-pool-size: 50 + queue-capacity: 10000 + # By default CORS is disabled. Uncomment to enable. + #cors: + #allowed-origins: "*" + #allowed-methods: "*" + #allowed-headers: "*" + #exposed-headers: "Authorization,Link,X-Total-Count" + #allow-credentials: true + #max-age: 1800 + mail: + from: gateway@localhost + swagger: + default-include-pattern: /api/.* + title: gateway API + description: gateway API documentation + version: 0.0.1 + terms-of-service-url: + contact-name: + contact-url: + contact-email: + license: + license-url: + +logging: + file: target/gateway.log + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap-prod.yml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap-prod.yml new file mode 100644 index 0000000000..9d8989f5a6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap-prod.yml @@ -0,0 +1,22 @@ +# =================================================================== +# Spring Cloud Config bootstrap configuration for the "prod" profile +# =================================================================== + +spring: + cloud: + config: + fail-fast: true + retry: + initial-interval: 1000 + max-interval: 2000 + max-attempts: 100 + uri: http://admin:${jhipster.registry.password}@localhost:8761/config + # name of the config server's property source (file.yml) that we want to use + name: gateway + profile: prod # profile(s) of the property source + label: master # toggle to switch to a different version of the configuration as stored in git + # it can be set to any label, branch or commit of the configuration source Git repository + +jhipster: + registry: + password: admin diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap.yml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap.yml new file mode 100644 index 0000000000..a6ebd56b33 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/bootstrap.yml @@ -0,0 +1,26 @@ +# =================================================================== +# Spring Cloud Config bootstrap configuration for the "dev" profile +# In prod profile, properties will be overwriten by the ones defined in bootstrap-prod.yml +# =================================================================== + +jhipster: + registry: + password: admin + +spring: + application: + name: gateway + profiles: + # The commented value for `active` can be replaced with valid Spring profiles to load. + # Otherwise, it will be filled in by maven when building the WAR file + # Either way, it can be overridden by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS` + active: #spring.profiles.active# + cloud: + config: + fail-fast: false # if not in "prod" profile, do not force to use Spring Cloud Config + uri: http://admin:${jhipster.registry.password}@localhost:8761/config + # name of the config server's property source (file.yml) that we want to use + name: gateway + profile: dev # profile(s) of the property source + label: master # toggle to switch to a different version of the configuration as stored in git + # it can be set to any label, branch or commit of the configuration source Git repository diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml new file mode 100644 index 0000000000..d75921613c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/master.xml b/jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/master.xml new file mode 100644 index 0000000000..f2b0b1f7e6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/config/liquibase/master.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/config/tls/keystore.p12 b/jhipster/jhipster-uaa/gateway/src/main/resources/config/tls/keystore.p12 new file mode 100644 index 0000000000000000000000000000000000000000..f308de393d160c99da5188f58922be2c4ced52e3 GIT binary patch literal 2620 zcmY+Ec{~%0AIE1lY?!Pu=a{QGo(yvzA@`k%J(bipDN~e$j95`DP1)=VBlP z{^+W$n`(WMU@iS?YC6OYEIVcm1cCq{Du~7LyCPpErvb$xlju^(jjC%+~i&+|loxo-ktOZNSh(0o%4$QMv8@1uxD2NW*G_`P%i=kgH z-4cp<8#deEcEU5j4LhkCob}@z59$RKQPOx*E@_;T=!YoGqS&*nX9T-FkMvf8_g>aIEX8K$$!G zQ{xkX=BiAsuBRCU;(RF=c7Ck!x=0##`Rn`UqYTHQi*p*fAv{(RpCm4{5<0j)R{BTV z&mkvD$(mipP8!veu!nd2dJJYWTsO+RlW#hBcB2$kUpePJb6ihYF%yzmk%tFIzhC(a z-rmQ#Z0vSUQ66Y}&DE(r4;5R5>3;L)RV*^a`z1_geeR^`uDqeJO#+RvY|*P*oZ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hipster/jhipster-uaa/gateway/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000000..124274d5c3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Your request cannot be processed +error.subtitle=Sorry, an error has occurred. +error.status=Status: +error.message=Message: + +# Activation email +email.activation.title=gateway account activation +email.activation.greeting=Dear {0} +email.activation.text1=Your gateway account has been created, please click on the URL below to activate it: +email.activation.text2=Regards, +email.signature=gateway Team. + +# Creation email +email.creation.text1=Your gateway account has been created, please click on the URL below to access it: + +# Reset email +email.reset.title=gateway password reset +email.reset.greeting=Dear {0} +email.reset.text1=For your gateway account a password reset was requested, please click on the URL below to reset it: +email.reset.text2=Regards, diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_en.properties b/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_en.properties new file mode 100644 index 0000000000..124274d5c3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_en.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Your request cannot be processed +error.subtitle=Sorry, an error has occurred. +error.status=Status: +error.message=Message: + +# Activation email +email.activation.title=gateway account activation +email.activation.greeting=Dear {0} +email.activation.text1=Your gateway account has been created, please click on the URL below to activate it: +email.activation.text2=Regards, +email.signature=gateway Team. + +# Creation email +email.creation.text1=Your gateway account has been created, please click on the URL below to access it: + +# Reset email +email.reset.title=gateway password reset +email.reset.greeting=Dear {0} +email.reset.text1=For your gateway account a password reset was requested, please click on the URL below to reset it: +email.reset.text2=Regards, diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_fr.properties b/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_fr.properties new file mode 100644 index 0000000000..84cea81d74 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_fr.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Votre demande ne peut être traitée +error.subtitle=Désolé, une erreur s'est produite. +error.status=Statut : +error.message=Message : + +# Activation email +email.activation.title=Activation de votre compte gateway +email.activation.greeting=Cher {0} +email.activation.text1=Votre compte gateway a été créé, pour l'activer merci de cliquer sur le lien ci-dessous : +email.activation.text2=Cordialement, +email.signature=gateway. + +# Creation email +email.creation.text1=Votre compte gateway a été créé, merci de cliquer sur le lien ci-dessous pour y accéder : + +# Reset email +email.reset.title=gateway Réinitialisation de mot de passe +email.reset.greeting=Cher {0} +email.reset.text1=Un nouveau mot de passe pour votre compte gateway a été demandé, veuillez cliquer sur le lien ci-dessous pour le réinitialiser : +email.reset.text2=Cordialement, diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_pt_br.properties b/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_pt_br.properties new file mode 100644 index 0000000000..f8853b507a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/i18n/messages_pt_br.properties @@ -0,0 +1,21 @@ +# Error page +error.title=A requisição não pode ser processada +error.subtitle=Desculpe, ocorreu um erro. +error.status=Status: +error.message=Mensagem: + +# Activation email +email.activation.title=gateway ativação +email.activation.greeting=Caro {0} +email.activation.text1=Sua conta gateway foi criada, por favor click na URL abaixo para ativar: +email.activation.text2=Atenciosamente, +email.signature=gateway. + +# Creation email +email.creation.text1=Sua gateway account foi criada, por favor clique no URL abaixo para acessá-lo: + +# Reset email +email.reset.title=A Senha da aplicação gateway foi reiniciada +email.reset.greeting=Caro {0} +email.reset.text1=Foi solicitado o reinicio de senha da sua conta gateway. Por favor clique na url abaixo para alterá-la: +email.reset.text2=Prezado, diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/logback-spring.xml b/jhipster/jhipster-uaa/gateway/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..a30ab8c1d2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/logback-spring.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/resources/templates/error.html b/jhipster/jhipster-uaa/gateway/src/main/resources/templates/error.html new file mode 100644 index 0000000000..08616bcf1e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/resources/templates/error.html @@ -0,0 +1,163 @@ + + + + + + Your request cannot be processed + + + +

+

Your request cannot be processed :(

+ +

Sorry, an error has occurred.

+ + Status:  ()
+ + Message: 
+
+ + + +
+ + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/404.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/404.html new file mode 100644 index 0000000000..3fdc0bee1a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/404.html @@ -0,0 +1,61 @@ + + + + + Page Not Found + + + + + +

Page Not Found

+

Sorry, but the page you were trying to view does not exist.

+ + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.module.ts new file mode 100644 index 0000000000..e597aa0052 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.module.ts @@ -0,0 +1,30 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { GatewaySharedModule } from 'app/shared'; + +import { + PasswordStrengthBarComponent, + RegisterComponent, + ActivateComponent, + PasswordComponent, + PasswordResetInitComponent, + PasswordResetFinishComponent, + SettingsComponent, + accountState +} from './'; + +@NgModule({ + imports: [GatewaySharedModule, RouterModule.forChild(accountState)], + declarations: [ + ActivateComponent, + RegisterComponent, + PasswordComponent, + PasswordStrengthBarComponent, + PasswordResetInitComponent, + PasswordResetFinishComponent, + SettingsComponent + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GatewayAccountModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.route.ts new file mode 100644 index 0000000000..f849342e69 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/account.route.ts @@ -0,0 +1,12 @@ +import { Routes } from '@angular/router'; + +import { activateRoute, passwordRoute, passwordResetFinishRoute, passwordResetInitRoute, registerRoute, settingsRoute } from './'; + +const ACCOUNT_ROUTES = [activateRoute, passwordRoute, passwordResetFinishRoute, passwordResetInitRoute, registerRoute, settingsRoute]; + +export const accountState: Routes = [ + { + path: '', + children: ACCOUNT_ROUTES + } +]; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.html new file mode 100644 index 0000000000..6a28eef775 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.html @@ -0,0 +1,17 @@ +
+
+
+

Activation

+ +
+ Your user account has been activated. Please + sign in. +
+ +
+ Your user could not be activated. Please use the registration form to sign up. +
+ +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.ts new file mode 100644 index 0000000000..5c398073c3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.component.ts @@ -0,0 +1,37 @@ +import { Component, OnInit } from '@angular/core'; +import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { ActivatedRoute } from '@angular/router'; + +import { LoginModalService } from 'app/core'; +import { ActivateService } from './activate.service'; + +@Component({ + selector: 'jhi-activate', + templateUrl: './activate.component.html' +}) +export class ActivateComponent implements OnInit { + error: string; + success: string; + modalRef: NgbModalRef; + + constructor(private activateService: ActivateService, private loginModalService: LoginModalService, private route: ActivatedRoute) {} + + ngOnInit() { + this.route.queryParams.subscribe(params => { + this.activateService.get(params['key']).subscribe( + () => { + this.error = null; + this.success = 'OK'; + }, + () => { + this.success = null; + this.error = 'ERROR'; + } + ); + }); + } + + login() { + this.modalRef = this.loginModalService.open(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.route.ts new file mode 100644 index 0000000000..f958dcfd51 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.route.ts @@ -0,0 +1,14 @@ +import { Route } from '@angular/router'; + +import { UserRouteAccessService } from 'app/core'; +import { ActivateComponent } from './activate.component'; + +export const activateRoute: Route = { + path: 'activate', + component: ActivateComponent, + data: { + authorities: [], + pageTitle: 'activate.title' + }, + canActivate: [UserRouteAccessService] +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.service.ts new file mode 100644 index 0000000000..0e7297c64d --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/activate/activate.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class ActivateService { + constructor(private http: HttpClient) {} + + get(key: string): Observable { + return this.http.get(SERVER_API_URL + 'uaa/api/activate', { + params: new HttpParams().set('key', key) + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/index.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/index.ts new file mode 100644 index 0000000000..aeada0551c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/index.ts @@ -0,0 +1,19 @@ +export * from './activate/activate.component'; +export * from './activate/activate.service'; +export * from './activate/activate.route'; +export * from './password/password.component'; +export * from './password/password-strength-bar.component'; +export * from './password/password.service'; +export * from './password/password.route'; +export * from './password-reset/finish/password-reset-finish.component'; +export * from './password-reset/finish/password-reset-finish.service'; +export * from './password-reset/finish/password-reset-finish.route'; +export * from './password-reset/init/password-reset-init.component'; +export * from './password-reset/init/password-reset-init.service'; +export * from './password-reset/init/password-reset-init.route'; +export * from './register/register.component'; +export * from './register/register.service'; +export * from './register/register.route'; +export * from './settings/settings.component'; +export * from './settings/settings.route'; +export * from './account.route'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html new file mode 100644 index 0000000000..bcbc911114 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html @@ -0,0 +1,77 @@ +
+
+
+

Reset password

+ +
+ The password reset key is missing. +
+ +
+

Choose a new password

+
+ +
+

Your password couldn't be reset. Remember a password request is only valid for 24 hours.

+
+ +

+ Your password has been reset. Please + sign in. +

+ +
+ The password and its confirmation do not match! +
+ +
+
+
+ + +
+ + Your password is required. + + + Your password is required to be at least 4 characters. + + + Your password cannot be longer than 50 characters. + +
+ +
+ +
+ + +
+ + Your password confirmation is required. + + + Your password confirmation is required to be at least 4 characters. + + + Your password confirmation cannot be longer than 50 characters. + +
+
+ + +
+ +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts new file mode 100644 index 0000000000..72aac25c96 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts @@ -0,0 +1,65 @@ +import { Component, OnInit, AfterViewInit, Renderer, ElementRef } from '@angular/core'; +import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { ActivatedRoute } from '@angular/router'; + +import { LoginModalService } from 'app/core'; +import { PasswordResetFinishService } from './password-reset-finish.service'; + +@Component({ + selector: 'jhi-password-reset-finish', + templateUrl: './password-reset-finish.component.html' +}) +export class PasswordResetFinishComponent implements OnInit, AfterViewInit { + confirmPassword: string; + doNotMatch: string; + error: string; + keyMissing: boolean; + resetAccount: any; + success: string; + modalRef: NgbModalRef; + key: string; + + constructor( + private passwordResetFinishService: PasswordResetFinishService, + private loginModalService: LoginModalService, + private route: ActivatedRoute, + private elementRef: ElementRef, + private renderer: Renderer + ) {} + + ngOnInit() { + this.route.queryParams.subscribe(params => { + this.key = params['key']; + }); + this.resetAccount = {}; + this.keyMissing = !this.key; + } + + ngAfterViewInit() { + if (this.elementRef.nativeElement.querySelector('#password') != null) { + this.renderer.invokeElementMethod(this.elementRef.nativeElement.querySelector('#password'), 'focus', []); + } + } + + finishReset() { + this.doNotMatch = null; + this.error = null; + if (this.resetAccount.password !== this.confirmPassword) { + this.doNotMatch = 'ERROR'; + } else { + this.passwordResetFinishService.save({ key: this.key, newPassword: this.resetAccount.password }).subscribe( + () => { + this.success = 'OK'; + }, + () => { + this.success = null; + this.error = 'ERROR'; + } + ); + } + } + + login() { + this.modalRef = this.loginModalService.open(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.route.ts new file mode 100644 index 0000000000..686cb972e3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.route.ts @@ -0,0 +1,12 @@ +import { Route } from '@angular/router'; + +import { PasswordResetFinishComponent } from './password-reset-finish.component'; + +export const passwordResetFinishRoute: Route = { + path: 'reset/finish', + component: PasswordResetFinishComponent, + data: { + authorities: [], + pageTitle: 'global.menu.account.password' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.ts new file mode 100644 index 0000000000..0e483d882b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class PasswordResetFinishService { + constructor(private http: HttpClient) {} + + save(keyAndPassword: any): Observable { + return this.http.post(SERVER_API_URL + 'uaa/api/account/reset-password/finish', keyAndPassword); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html new file mode 100644 index 0000000000..8f42e600e2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html @@ -0,0 +1,46 @@ +
+
+
+

Reset your password

+ +
+ Email address isn't registered! Please check and try again. +
+ +
+

Enter the email address you used to register.

+
+ +
+

Check your emails for details on how to reset your password.

+
+ +
+
+ + +
+ + Your email is required. + + + Your email is invalid. + + + Your email is required to be at least 5 characters. + + + Your email cannot be longer than 100 characters. + +
+
+ + +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts new file mode 100644 index 0000000000..e32617341c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts @@ -0,0 +1,43 @@ +import { Component, OnInit, AfterViewInit, Renderer, ElementRef } from '@angular/core'; +import { EMAIL_NOT_FOUND_TYPE } from 'app/shared'; +import { PasswordResetInitService } from './password-reset-init.service'; + +@Component({ + selector: 'jhi-password-reset-init', + templateUrl: './password-reset-init.component.html' +}) +export class PasswordResetInitComponent implements OnInit, AfterViewInit { + error: string; + errorEmailNotExists: string; + resetAccount: any; + success: string; + + constructor(private passwordResetInitService: PasswordResetInitService, private elementRef: ElementRef, private renderer: Renderer) {} + + ngOnInit() { + this.resetAccount = {}; + } + + ngAfterViewInit() { + this.renderer.invokeElementMethod(this.elementRef.nativeElement.querySelector('#email'), 'focus', []); + } + + requestReset() { + this.error = null; + this.errorEmailNotExists = null; + + this.passwordResetInitService.save(this.resetAccount.email).subscribe( + () => { + this.success = 'OK'; + }, + response => { + this.success = null; + if (response.status === 400 && response.error.type === EMAIL_NOT_FOUND_TYPE) { + this.errorEmailNotExists = 'ERROR'; + } else { + this.error = 'ERROR'; + } + } + ); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.route.ts new file mode 100644 index 0000000000..6d7da08cd7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.route.ts @@ -0,0 +1,12 @@ +import { Route } from '@angular/router'; + +import { PasswordResetInitComponent } from './password-reset-init.component'; + +export const passwordResetInitRoute: Route = { + path: 'reset/request', + component: PasswordResetInitComponent, + data: { + authorities: [], + pageTitle: 'global.menu.account.password' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.service.ts new file mode 100644 index 0000000000..462eee3f91 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password-reset/init/password-reset-init.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class PasswordResetInitService { + constructor(private http: HttpClient) {} + + save(mail: string): Observable { + return this.http.post(SERVER_API_URL + 'uaa/api/account/reset-password/init', mail); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.component.ts new file mode 100644 index 0000000000..326b5ec888 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.component.ts @@ -0,0 +1,84 @@ +import { Component, ElementRef, Input, Renderer } from '@angular/core'; + +@Component({ + selector: 'jhi-password-strength-bar', + template: ` +
+ Password strength: +
    +
  • +
  • +
  • +
  • +
  • +
+
`, + styleUrls: ['password-strength-bar.scss'] +}) +export class PasswordStrengthBarComponent { + colors = ['#F00', '#F90', '#FF0', '#9F0', '#0F0']; + + constructor(private renderer: Renderer, private elementRef: ElementRef) {} + + measureStrength(p: string): number { + let force = 0; + const regex = /[$-/:-?{-~!"^_`\[\]]/g; // " + const lowerLetters = /[a-z]+/.test(p); + const upperLetters = /[A-Z]+/.test(p); + const numbers = /[0-9]+/.test(p); + const symbols = regex.test(p); + + const flags = [lowerLetters, upperLetters, numbers, symbols]; + const passedMatches = flags.filter((isMatchedFlag: boolean) => { + return isMatchedFlag === true; + }).length; + + force += 2 * p.length + (p.length >= 10 ? 1 : 0); + force += passedMatches * 10; + + // penality (short password) + force = p.length <= 6 ? Math.min(force, 10) : force; + + // penality (poor variety of characters) + force = passedMatches === 1 ? Math.min(force, 10) : force; + force = passedMatches === 2 ? Math.min(force, 20) : force; + force = passedMatches === 3 ? Math.min(force, 40) : force; + + return force; + } + + getColor(s: number): any { + let idx = 0; + if (s <= 10) { + idx = 0; + } else if (s <= 20) { + idx = 1; + } else if (s <= 30) { + idx = 2; + } else if (s <= 40) { + idx = 3; + } else { + idx = 4; + } + return { idx: idx + 1, col: this.colors[idx] }; + } + + @Input() + set passwordToCheck(password: string) { + if (password) { + const c = this.getColor(this.measureStrength(password)); + const element = this.elementRef.nativeElement; + if (element.className) { + this.renderer.setElementClass(element, element.className, false); + } + const lis = element.getElementsByTagName('li'); + for (let i = 0; i < lis.length; i++) { + if (i < c.idx) { + this.renderer.setElementStyle(lis[i], 'backgroundColor', c.col); + } else { + this.renderer.setElementStyle(lis[i], 'backgroundColor', '#DDD'); + } + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.scss b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.scss new file mode 100644 index 0000000000..9744b9b784 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password-strength-bar.scss @@ -0,0 +1,23 @@ +/* ========================================================================== +start Password strength bar style +========================================================================== */ +ul#strength { + display: inline; + list-style: none; + margin: 0; + margin-left: 15px; + padding: 0; + vertical-align: 2px; +} + +.point { + background: #ddd; + border-radius: 2px; + display: inline-block; + height: 5px; + margin-right: 1px; + width: 20px; + &:last-child { + margin: 0 !important; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.html new file mode 100644 index 0000000000..fafe672d8b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.html @@ -0,0 +1,77 @@ +
+
+
+

Password for [{{account.login}}]

+ +
+ Password changed! +
+
+ An error has occurred! The password could not be changed. +
+ +
+ The password and its confirmation do not match! +
+ +
+ +
+ + +
+ + Your password is required. + +
+
+
+ + +
+ + Your password is required. + + + Your password is required to be at least 4 characters. + + + Your password cannot be longer than 50 characters. + +
+ +
+
+ + +
+ + Your confirmation password is required. + + + Your confirmation password is required to be at least 4 characters. + + + Your confirmation password cannot be longer than 50 characters. + +
+
+ + + +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.ts new file mode 100644 index 0000000000..64d4d87f00 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.component.ts @@ -0,0 +1,46 @@ +import { Component, OnInit } from '@angular/core'; + +import { Principal } from 'app/core'; +import { PasswordService } from './password.service'; + +@Component({ + selector: 'jhi-password', + templateUrl: './password.component.html' +}) +export class PasswordComponent implements OnInit { + doNotMatch: string; + error: string; + success: string; + account: any; + currentPassword: string; + newPassword: string; + confirmPassword: string; + + constructor(private passwordService: PasswordService, private principal: Principal) {} + + ngOnInit() { + this.principal.identity().then(account => { + this.account = account; + }); + } + + changePassword() { + if (this.newPassword !== this.confirmPassword) { + this.error = null; + this.success = null; + this.doNotMatch = 'ERROR'; + } else { + this.doNotMatch = null; + this.passwordService.save(this.newPassword, this.currentPassword).subscribe( + () => { + this.error = null; + this.success = 'OK'; + }, + () => { + this.success = null; + this.error = 'ERROR'; + } + ); + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.route.ts new file mode 100644 index 0000000000..2a6ec475ed --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.route.ts @@ -0,0 +1,14 @@ +import { Route } from '@angular/router'; + +import { UserRouteAccessService } from 'app/core'; +import { PasswordComponent } from './password.component'; + +export const passwordRoute: Route = { + path: 'password', + component: PasswordComponent, + data: { + authorities: ['ROLE_USER'], + pageTitle: 'global.menu.account.password' + }, + canActivate: [UserRouteAccessService] +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.service.ts new file mode 100644 index 0000000000..b93ab26d33 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/password/password.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class PasswordService { + constructor(private http: HttpClient) {} + + save(newPassword: string, currentPassword: string): Observable { + return this.http.post(SERVER_API_URL + 'uaa/api/account/change-password', { currentPassword, newPassword }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.html new file mode 100644 index 0000000000..fd5c89e2de --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.html @@ -0,0 +1,124 @@ +
+
+
+

Registration

+ +
+ Registration saved! Please check your email for confirmation. +
+ +
+ Registration failed! Please try again later. +
+ +
+ Login name already registered! Please choose another one. +
+ +
+ Email is already in use! Please choose another one. +
+ +
+ The password and its confirmation do not match! +
+
+
+
+
+
+
+ + +
+ + Your username is required. + + + Your username is required to be at least 1 character. + + + Your username cannot be longer than 50 characters. + + + Your username can only contain letters and digits. + +
+
+
+ + +
+ + Your email is required. + + + Your email is invalid. + + + Your email is required to be at least 5 characters. + + + Your email cannot be longer than 100 characters. + +
+
+
+ + +
+ + Your password is required. + + + Your password is required to be at least 4 characters. + + + Your password cannot be longer than 50 characters. + +
+ +
+
+ + +
+ + Your confirmation password is required. + + + Your confirmation password is required to be at least 4 characters. + + + Your confirmation password cannot be longer than 50 characters. + +
+
+ + + +

+
+ If you want to + sign in, you can try the default accounts:
- Administrator (login="admin" and password="admin")
- User (login="user" and password="user").
+
+
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.ts new file mode 100644 index 0000000000..de97a880df --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.component.ts @@ -0,0 +1,75 @@ +import { Component, OnInit, AfterViewInit, Renderer, ElementRef } from '@angular/core'; +import { HttpErrorResponse } from '@angular/common/http'; +import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { JhiLanguageService } from 'ng-jhipster'; + +import { EMAIL_ALREADY_USED_TYPE, LOGIN_ALREADY_USED_TYPE } from 'app/shared'; +import { LoginModalService } from 'app/core'; +import { Register } from './register.service'; + +@Component({ + selector: 'jhi-register', + templateUrl: './register.component.html' +}) +export class RegisterComponent implements OnInit, AfterViewInit { + confirmPassword: string; + doNotMatch: string; + error: string; + errorEmailExists: string; + errorUserExists: string; + registerAccount: any; + success: boolean; + modalRef: NgbModalRef; + + constructor( + private languageService: JhiLanguageService, + private loginModalService: LoginModalService, + private registerService: Register, + private elementRef: ElementRef, + private renderer: Renderer + ) {} + + ngOnInit() { + this.success = false; + this.registerAccount = {}; + } + + ngAfterViewInit() { + this.renderer.invokeElementMethod(this.elementRef.nativeElement.querySelector('#login'), 'focus', []); + } + + register() { + if (this.registerAccount.password !== this.confirmPassword) { + this.doNotMatch = 'ERROR'; + } else { + this.doNotMatch = null; + this.error = null; + this.errorUserExists = null; + this.errorEmailExists = null; + this.languageService.getCurrent().then(key => { + this.registerAccount.langKey = key; + this.registerService.save(this.registerAccount).subscribe( + () => { + this.success = true; + }, + response => this.processError(response) + ); + }); + } + } + + openLogin() { + this.modalRef = this.loginModalService.open(); + } + + private processError(response: HttpErrorResponse) { + this.success = null; + if (response.status === 400 && response.error.type === LOGIN_ALREADY_USED_TYPE) { + this.errorUserExists = 'ERROR'; + } else if (response.status === 400 && response.error.type === EMAIL_ALREADY_USED_TYPE) { + this.errorEmailExists = 'ERROR'; + } else { + this.error = 'ERROR'; + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.route.ts new file mode 100644 index 0000000000..ca834d5d58 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.route.ts @@ -0,0 +1,12 @@ +import { Route } from '@angular/router'; + +import { RegisterComponent } from './register.component'; + +export const registerRoute: Route = { + path: 'register', + component: RegisterComponent, + data: { + authorities: [], + pageTitle: 'register.title' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.service.ts new file mode 100644 index 0000000000..e9b14c42ba --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/register/register.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class Register { + constructor(private http: HttpClient) {} + + save(account: any): Observable { + return this.http.post(SERVER_API_URL + 'uaa/api/register', account); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.html new file mode 100644 index 0000000000..b0c114b819 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.html @@ -0,0 +1,86 @@ +
+
+
+

User settings for [{{settingsAccount.login}}]

+ +
+ Settings saved! +
+ + + +
+ +
+ + +
+ + Your first name is required. + + + Your first name is required to be at least 1 character. + + + Your first name cannot be longer than 50 characters. + +
+
+
+ + +
+ + Your last name is required. + + + Your last name is required to be at least 1 character. + + + Your last name cannot be longer than 50 characters. + +
+
+
+ + +
+ + Your email is required. + + + Your email is invalid. + + + Your email is required to be at least 5 characters. + + + Your email cannot be longer than 100 characters. + +
+
+
+ + +
+ + +
+
+ +
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.ts new file mode 100644 index 0000000000..1b5b88b626 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit } from '@angular/core'; +import { JhiLanguageService } from 'ng-jhipster'; + +import { Principal, AccountService, JhiLanguageHelper } from 'app/core'; + +@Component({ + selector: 'jhi-settings', + templateUrl: './settings.component.html' +}) +export class SettingsComponent implements OnInit { + error: string; + success: string; + settingsAccount: any; + languages: any[]; + + constructor( + private account: AccountService, + private principal: Principal, + private languageService: JhiLanguageService, + private languageHelper: JhiLanguageHelper + ) {} + + ngOnInit() { + this.principal.identity().then(account => { + this.settingsAccount = this.copyAccount(account); + }); + this.languageHelper.getAll().then(languages => { + this.languages = languages; + }); + } + + save() { + this.account.save(this.settingsAccount).subscribe( + () => { + this.error = null; + this.success = 'OK'; + this.principal.identity(true).then(account => { + this.settingsAccount = this.copyAccount(account); + }); + this.languageService.getCurrent().then(current => { + if (this.settingsAccount.langKey !== current) { + this.languageService.changeLanguage(this.settingsAccount.langKey); + } + }); + }, + () => { + this.success = null; + this.error = 'ERROR'; + } + ); + } + + copyAccount(account) { + return { + activated: account.activated, + email: account.email, + firstName: account.firstName, + langKey: account.langKey, + lastName: account.lastName, + login: account.login, + imageUrl: account.imageUrl + }; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.route.ts new file mode 100644 index 0000000000..95c2de6e0f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/account/settings/settings.route.ts @@ -0,0 +1,14 @@ +import { Route } from '@angular/router'; + +import { UserRouteAccessService } from 'app/core'; +import { SettingsComponent } from './settings.component'; + +export const settingsRoute: Route = { + path: 'settings', + component: SettingsComponent, + data: { + authorities: ['ROLE_USER'], + pageTitle: 'global.menu.account.settings' + }, + canActivate: [UserRouteAccessService] +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.module.ts new file mode 100644 index 0000000000..3ecbaa49ff --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.module.ts @@ -0,0 +1,57 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { JhiLanguageService } from 'ng-jhipster'; +import { JhiLanguageHelper } from 'app/core'; +import { GatewaySharedModule } from 'app/shared'; +/* jhipster-needle-add-admin-module-import - JHipster will add admin modules imports here */ + +import { + adminState, + AuditsComponent, + UserMgmtComponent, + UserMgmtDetailComponent, + UserMgmtUpdateComponent, + UserMgmtDeleteDialogComponent, + LogsComponent, + JhiMetricsMonitoringModalComponent, + JhiMetricsMonitoringComponent, + JhiHealthModalComponent, + JhiHealthCheckComponent, + JhiConfigurationComponent, + JhiDocsComponent, + JhiGatewayComponent +} from './'; + +@NgModule({ + imports: [ + GatewaySharedModule, + RouterModule.forChild(adminState) + /* jhipster-needle-add-admin-module - JHipster will add admin modules here */ + ], + declarations: [ + AuditsComponent, + UserMgmtComponent, + UserMgmtDetailComponent, + UserMgmtUpdateComponent, + UserMgmtDeleteDialogComponent, + LogsComponent, + JhiConfigurationComponent, + JhiHealthCheckComponent, + JhiHealthModalComponent, + JhiDocsComponent, + JhiGatewayComponent, + JhiMetricsMonitoringComponent, + JhiMetricsMonitoringModalComponent + ], + entryComponents: [UserMgmtDeleteDialogComponent, JhiHealthModalComponent, JhiMetricsMonitoringModalComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GatewayAdminModule { + constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) { + this.languageHelper.language.subscribe((languageKey: string) => { + if (languageKey !== undefined) { + this.languageService.changeLanguage(languageKey); + } + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.route.ts new file mode 100644 index 0000000000..79fb15cf7a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/admin.route.ts @@ -0,0 +1,18 @@ +import { Routes } from '@angular/router'; + +import { auditsRoute, configurationRoute, docsRoute, healthRoute, logsRoute, metricsRoute, gatewayRoute, userMgmtRoute } from './'; + +import { UserRouteAccessService } from 'app/core'; + +const ADMIN_ROUTES = [auditsRoute, configurationRoute, docsRoute, healthRoute, logsRoute, gatewayRoute, ...userMgmtRoute, metricsRoute]; + +export const adminState: Routes = [ + { + path: '', + data: { + authorities: ['ROLE_ADMIN'] + }, + canActivate: [UserRouteAccessService], + children: ADMIN_ROUTES + } +]; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit-data.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit-data.model.ts new file mode 100644 index 0000000000..a2506c4090 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit-data.model.ts @@ -0,0 +1,3 @@ +export class AuditData { + constructor(public remoteAddress: string, public sessionId: string) {} +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit.model.ts new file mode 100644 index 0000000000..6497fb444e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audit.model.ts @@ -0,0 +1,5 @@ +import { AuditData } from './audit-data.model'; + +export class Audit { + constructor(public data: AuditData, public principal: string, public timestamp: string, public type: string) {} +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.html new file mode 100644 index 0000000000..e55799e91e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.html @@ -0,0 +1,52 @@ +
+

Audits

+ +
+
+

Filter by date

+
+
+ from +
+ + +
+ To +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + +
DateUserStateExtra data
{{audit.timestamp| date:'medium'}}{{audit.principal}}{{audit.type}} + {{audit.data.message}} + Remote Address {{audit.data.remoteAddress}} +
+ +
+
+ +
+
+ +
+
+ diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.ts new file mode 100644 index 0000000000..bda472d634 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.component.ts @@ -0,0 +1,128 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { HttpResponse } from '@angular/common/http'; +import { DatePipe } from '@angular/common'; +import { ActivatedRoute, Router } from '@angular/router'; +import { JhiParseLinks, JhiAlertService } from 'ng-jhipster'; + +import { ITEMS_PER_PAGE } from 'app/shared'; +import { Audit } from './audit.model'; +import { AuditsService } from './audits.service'; + +@Component({ + selector: 'jhi-audit', + templateUrl: './audits.component.html' +}) +export class AuditsComponent implements OnInit, OnDestroy { + audits: Audit[]; + fromDate: string; + itemsPerPage: any; + links: any; + queryCount: number; + page: number; + routeData: any; + predicate: any; + previousPage: any; + reverse: boolean; + toDate: string; + totalItems: number; + + constructor( + private auditsService: AuditsService, + private alertService: JhiAlertService, + private parseLinks: JhiParseLinks, + private activatedRoute: ActivatedRoute, + private datePipe: DatePipe, + private router: Router + ) { + this.itemsPerPage = ITEMS_PER_PAGE; + this.routeData = this.activatedRoute.data.subscribe(data => { + this.page = data['pagingParams'].page; + this.previousPage = data['pagingParams'].page; + this.reverse = data['pagingParams'].ascending; + this.predicate = data['pagingParams'].predicate; + }); + } + + ngOnInit() { + this.today(); + this.previousMonth(); + this.loadAll(); + } + + ngOnDestroy() { + this.routeData.unsubscribe(); + } + + previousMonth() { + const dateFormat = 'yyyy-MM-dd'; + let fromDate: Date = new Date(); + + if (fromDate.getMonth() === 0) { + fromDate = new Date(fromDate.getFullYear() - 1, 11, fromDate.getDate()); + } else { + fromDate = new Date(fromDate.getFullYear(), fromDate.getMonth() - 1, fromDate.getDate()); + } + + this.fromDate = this.datePipe.transform(fromDate, dateFormat); + } + + today() { + const dateFormat = 'yyyy-MM-dd'; + // Today + 1 day - needed if the current day must be included + const today: Date = new Date(); + today.setDate(today.getDate() + 1); + const date = new Date(today.getFullYear(), today.getMonth(), today.getDate()); + this.toDate = this.datePipe.transform(date, dateFormat); + } + + loadAll() { + this.auditsService + .query({ + page: this.page - 1, + size: this.itemsPerPage, + sort: this.sort(), + fromDate: this.fromDate, + toDate: this.toDate + }) + .subscribe( + (res: HttpResponse) => this.onSuccess(res.body, res.headers), + (res: HttpResponse) => this.onError(res.body) + ); + } + + sort() { + const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')]; + if (this.predicate !== 'id') { + result.push('id'); + } + return result; + } + + loadPage(page: number) { + if (page !== this.previousPage) { + this.previousPage = page; + this.transition(); + } + } + + transition() { + this.router.navigate(['/admin/audits'], { + queryParams: { + page: this.page, + sort: this.predicate + ',' + (this.reverse ? 'asc' : 'desc') + } + }); + this.loadAll(); + } + + private onSuccess(data, headers) { + this.links = this.parseLinks.parse(headers.get('link')); + this.totalItems = headers.get('X-Total-Count'); + this.queryCount = this.totalItems; + this.audits = data; + } + + private onError(error) { + this.alertService.error(error.error, error.message, null); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.route.ts new file mode 100644 index 0000000000..9c161dca4a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.route.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Route } from '@angular/router'; +import { JhiPaginationUtil, JhiResolvePagingParams } from 'ng-jhipster'; + +import { AuditsComponent } from './audits.component'; + +export const auditsRoute: Route = { + path: 'audits', + component: AuditsComponent, + resolve: { + pagingParams: JhiResolvePagingParams + }, + data: { + pageTitle: 'audits.title', + defaulSort: 'auditEventDate,desc' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.service.ts new file mode 100644 index 0000000000..fba5285b6e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/audits/audits.service.ts @@ -0,0 +1,25 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { createRequestOption } from 'app/shared'; +import { SERVER_API_URL } from 'app/app.constants'; +import { Audit } from './audit.model'; + +@Injectable({ providedIn: 'root' }) +export class AuditsService { + constructor(private http: HttpClient) {} + + query(req: any): Observable> { + const params: HttpParams = createRequestOption(req); + params.set('fromDate', req.fromDate); + params.set('toDate', req.toDate); + + const requestURL = SERVER_API_URL + 'uaa/management/audits'; + + return this.http.get(requestURL, { + params, + observe: 'response' + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.html new file mode 100644 index 0000000000..c95775a0ab --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.html @@ -0,0 +1,46 @@ +
+

Configuration

+ + Filter (by prefix) +

Spring configuration

+ + + + + + + + + + + + + +
PrefixProperties
{{entry.prefix}} +
+
{{key}}
+
+ {{entry.properties[key] | json}} +
+
+
+
+

{{key}}

+ + + + + + + + + + + + + +
PropertyValue
{{item.key}} + {{item.val}} +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.ts new file mode 100644 index 0000000000..6867210c91 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.component.ts @@ -0,0 +1,43 @@ +import { Component, OnInit } from '@angular/core'; + +import { JhiConfigurationService } from './configuration.service'; + +@Component({ + selector: 'jhi-configuration', + templateUrl: './configuration.component.html' +}) +export class JhiConfigurationComponent implements OnInit { + allConfiguration: any = null; + configuration: any = null; + configKeys: any[]; + filter: string; + orderProp: string; + reverse: boolean; + + constructor(private configurationService: JhiConfigurationService) { + this.configKeys = []; + this.filter = ''; + this.orderProp = 'prefix'; + this.reverse = false; + } + + keys(dict): Array { + return dict === undefined ? [] : Object.keys(dict); + } + + ngOnInit() { + this.configurationService.get().subscribe(configuration => { + this.configuration = configuration; + + for (const config of configuration) { + if (config.properties !== undefined) { + this.configKeys.push(Object.keys(config.properties)); + } + } + }); + + this.configurationService.getEnv().subscribe(configuration => { + this.allConfiguration = configuration; + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.route.ts new file mode 100644 index 0000000000..1ff61dfa57 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.route.ts @@ -0,0 +1,11 @@ +import { Route } from '@angular/router'; + +import { JhiConfigurationComponent } from './configuration.component'; + +export const configurationRoute: Route = { + path: 'jhi-configuration', + component: JhiConfigurationComponent, + data: { + pageTitle: 'configuration.title' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.service.ts new file mode 100644 index 0000000000..cd6ba93766 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/configuration/configuration.service.ts @@ -0,0 +1,67 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class JhiConfigurationService { + constructor(private http: HttpClient) {} + + get(): Observable { + return this.http.get(SERVER_API_URL + 'management/configprops', { observe: 'response' }).pipe( + map((res: HttpResponse) => { + const properties: any[] = []; + const propertiesObject = this.getConfigPropertiesObjects(res.body); + for (const key in propertiesObject) { + if (propertiesObject.hasOwnProperty(key)) { + properties.push(propertiesObject[key]); + } + } + + return properties.sort((propertyA, propertyB) => { + return propertyA.prefix === propertyB.prefix ? 0 : propertyA.prefix < propertyB.prefix ? -1 : 1; + }); + }) + ); + } + + getConfigPropertiesObjects(res: Object) { + // This code is for Spring Boot 2 + if (res['contexts'] !== undefined) { + for (const key in res['contexts']) { + // If the key is not bootstrap, it will be the ApplicationContext Id + // For default app, it is baseName + // For microservice, it is baseName-1 + if (!key.startsWith('bootstrap')) { + return res['contexts'][key]['beans']; + } + } + } + // by default, use the default ApplicationContext Id + return res['contexts']['gateway']['beans']; + } + + getEnv(): Observable { + return this.http.get(SERVER_API_URL + 'management/env', { observe: 'response' }).pipe( + map((res: HttpResponse) => { + const properties: any = {}; + const propertySources = res.body['propertySources']; + + for (const propertyObject of propertySources) { + const name = propertyObject['name']; + const detailProperties = propertyObject['properties']; + const vals: any[] = []; + for (const keyDetail in detailProperties) { + if (detailProperties.hasOwnProperty(keyDetail)) { + vals.push({ key: keyDetail, val: detailProperties[keyDetail]['value'] }); + } + } + properties[name] = vals; + } + return properties; + }) + ); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.html new file mode 100644 index 0000000000..30efbbb93e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.html @@ -0,0 +1,2 @@ + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.ts new file mode 100644 index 0000000000..b338e7c3a6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'jhi-docs', + templateUrl: './docs.component.html' +}) +export class JhiDocsComponent { + constructor() {} +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.route.ts new file mode 100644 index 0000000000..9a3a3f80c2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/docs/docs.route.ts @@ -0,0 +1,11 @@ +import { Route } from '@angular/router'; + +import { JhiDocsComponent } from './docs.component'; + +export const docsRoute: Route = { + path: 'docs', + component: JhiDocsComponent, + data: { + pageTitle: 'global.menu.admin.apidocs' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-route.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-route.model.ts new file mode 100644 index 0000000000..d8a304ea3c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-route.model.ts @@ -0,0 +1,3 @@ +export class GatewayRoute { + constructor(public path: string, public serviceId: string, public serviceInstances: any[]) {} +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-routes.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-routes.service.ts new file mode 100644 index 0000000000..ad3a2eee5c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway-routes.service.ts @@ -0,0 +1,15 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; +import { GatewayRoute } from './gateway-route.model'; + +@Injectable() +export class GatewayRoutesService { + constructor(private http: HttpClient) {} + + findAll(): Observable { + return this.http.get(SERVER_API_URL + 'api/gateway/routes/'); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.html new file mode 100644 index 0000000000..7154c4b3b7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.html @@ -0,0 +1,50 @@ +
+

+ Gateway + +

+

Current routes

+
+ + + + + + + + + + + + + + + +
URLServiceAvailable servers
{{route.path}}{{route.serviceId}} +
+ Warning: no server available! +
+
+ + + + + + +
{{instance.uri}} +
{{instance.instanceInfo.status}}
+
?
+
+ + + {{entry.key}} + {{entry.value}} + + +
+
+
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.ts new file mode 100644 index 0000000000..55bc9cc42f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; + +import { GatewayRoutesService } from './gateway-routes.service'; +import { GatewayRoute } from './gateway-route.model'; + +@Component({ + selector: 'jhi-gateway', + templateUrl: './gateway.component.html', + providers: [GatewayRoutesService] +}) +export class JhiGatewayComponent implements OnInit { + gatewayRoutes: GatewayRoute[]; + updatingRoutes: Boolean; + + constructor(private gatewayRoutesService: GatewayRoutesService) {} + + ngOnInit() { + this.refresh(); + } + + refresh() { + this.updatingRoutes = true; + this.gatewayRoutesService.findAll().subscribe(gatewayRoutes => { + this.gatewayRoutes = gatewayRoutes; + this.updatingRoutes = false; + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.route.ts new file mode 100644 index 0000000000..fffcd6a8a8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/gateway/gateway.route.ts @@ -0,0 +1,11 @@ +import { Route } from '@angular/router'; + +import { JhiGatewayComponent } from './gateway.component'; + +export const gatewayRoute: Route = { + path: 'gateway', + component: JhiGatewayComponent, + data: { + pageTitle: 'gateway.title' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.html new file mode 100644 index 0000000000..4f698460d0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.html @@ -0,0 +1,36 @@ + + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.ts new file mode 100644 index 0000000000..28128bf321 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health-modal.component.ts @@ -0,0 +1,41 @@ +import { Component } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; + +import { JhiHealthService } from './health.service'; + +@Component({ + selector: 'jhi-health-modal', + templateUrl: './health-modal.component.html' +}) +export class JhiHealthModalComponent { + currentHealth: any; + + constructor(private healthService: JhiHealthService, public activeModal: NgbActiveModal) {} + + baseName(name) { + return this.healthService.getBaseName(name); + } + + subSystemName(name) { + return this.healthService.getSubSystemName(name); + } + + readableValue(value: number) { + if (this.currentHealth.name === 'diskSpace') { + // Should display storage space in an human readable unit + const val = value / 1073741824; + if (val > 1) { + // Value + return val.toFixed(2) + ' GB'; + } else { + return (value / 1048576).toFixed(2) + ' MB'; + } + } + + if (typeof value === 'object') { + return JSON.stringify(value); + } else { + return value.toString(); + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.html new file mode 100644 index 0000000000..c17bde9af1 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.html @@ -0,0 +1,34 @@ +
+

+ Health Checks + +

+
+ + + + + + + + + + + + + + + +
Service NameStatusDetails
{{'health.indicator.' + baseName(health.name) | translate}} {{subSystemName(health.name)}} + + {{health.status}} + + + + + +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.ts new file mode 100644 index 0000000000..ada3ef62f4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.component.ts @@ -0,0 +1,66 @@ +import { Component, OnInit } from '@angular/core'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; + +import { JhiHealthService } from './health.service'; +import { JhiHealthModalComponent } from './health-modal.component'; + +@Component({ + selector: 'jhi-health', + templateUrl: './health.component.html' +}) +export class JhiHealthCheckComponent implements OnInit { + healthData: any; + updatingHealth: boolean; + + constructor(private modalService: NgbModal, private healthService: JhiHealthService) {} + + ngOnInit() { + this.refresh(); + } + + baseName(name: string) { + return this.healthService.getBaseName(name); + } + + getBadgeClass(statusState) { + if (statusState === 'UP') { + return 'badge-success'; + } else { + return 'badge-danger'; + } + } + + refresh() { + this.updatingHealth = true; + + this.healthService.checkHealth().subscribe( + health => { + this.healthData = this.healthService.transformHealthData(health); + this.updatingHealth = false; + }, + error => { + if (error.status === 503) { + this.healthData = this.healthService.transformHealthData(error.error); + this.updatingHealth = false; + } + } + ); + } + + showHealth(health: any) { + const modalRef = this.modalService.open(JhiHealthModalComponent); + modalRef.componentInstance.currentHealth = health; + modalRef.result.then( + result => { + // Left blank intentionally, nothing to do here + }, + reason => { + // Left blank intentionally, nothing to do here + } + ); + } + + subSystemName(name: string) { + return this.healthService.getSubSystemName(name); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.route.ts new file mode 100644 index 0000000000..df801e0c0e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.route.ts @@ -0,0 +1,11 @@ +import { Route } from '@angular/router'; + +import { JhiHealthCheckComponent } from './health.component'; + +export const healthRoute: Route = { + path: 'jhi-health', + component: JhiHealthCheckComponent, + data: { + pageTitle: 'health.title' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.service.ts new file mode 100644 index 0000000000..4c1b0e5ec8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/health/health.service.ts @@ -0,0 +1,133 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class JhiHealthService { + separator: string; + + constructor(private http: HttpClient) { + this.separator = '.'; + } + + checkHealth(): Observable { + return this.http.get(SERVER_API_URL + 'management/health'); + } + + transformHealthData(data): any { + const response = []; + this.flattenHealthData(response, null, data.details); + return response; + } + + getBaseName(name): string { + if (name) { + const split = name.split('.'); + return split[0]; + } + } + + getSubSystemName(name): string { + if (name) { + const split = name.split('.'); + split.splice(0, 1); + const remainder = split.join('.'); + return remainder ? ' - ' + remainder : ''; + } + } + + /* private methods */ + private addHealthObject(result, isLeaf, healthObject, name): any { + const healthData: any = { + name + }; + + const details = {}; + let hasDetails = false; + + for (const key in healthObject) { + if (healthObject.hasOwnProperty(key)) { + const value = healthObject[key]; + if (key === 'status' || key === 'error') { + healthData[key] = value; + } else { + if (!this.isHealthObject(value)) { + details[key] = value; + hasDetails = true; + } + } + } + } + + // Add the details + if (hasDetails) { + healthData.details = details; + } + + // Only add nodes if they provide additional information + if (isLeaf || hasDetails || healthData.error) { + result.push(healthData); + } + return healthData; + } + + private flattenHealthData(result, path, data): any { + for (const key in data) { + if (data.hasOwnProperty(key)) { + const value = data[key]; + if (this.isHealthObject(value)) { + if (this.hasSubSystem(value)) { + this.addHealthObject(result, false, value, this.getModuleName(path, key)); + this.flattenHealthData(result, this.getModuleName(path, key), value); + } else { + this.addHealthObject(result, true, value, this.getModuleName(path, key)); + } + } + } + } + return result; + } + + private getModuleName(path, name): string { + let result; + if (path && name) { + result = path + this.separator + name; + } else if (path) { + result = path; + } else if (name) { + result = name; + } else { + result = ''; + } + return result; + } + + private hasSubSystem(healthObject): boolean { + let result = false; + + for (const key in healthObject) { + if (healthObject.hasOwnProperty(key)) { + const value = healthObject[key]; + if (value && value.status) { + result = true; + } + } + } + return result; + } + + private isHealthObject(healthObject): boolean { + let result = false; + + for (const key in healthObject) { + if (healthObject.hasOwnProperty(key)) { + if (key === 'status') { + result = true; + } + } + } + return result; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/index.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/index.ts new file mode 100644 index 0000000000..c5bfdb81a7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/index.ts @@ -0,0 +1,32 @@ +export * from './audits/audits.component'; +export * from './audits/audits.service'; +export * from './audits/audits.route'; +export * from './audits/audit.model'; +export * from './audits/audit-data.model'; +export * from './configuration/configuration.component'; +export * from './configuration/configuration.service'; +export * from './configuration/configuration.route'; +export * from './docs/docs.component'; +export * from './docs/docs.route'; +export * from './health/health.component'; +export * from './health/health-modal.component'; +export * from './health/health.service'; +export * from './health/health.route'; +export * from './logs/logs.component'; +export * from './logs/logs.service'; +export * from './logs/logs.route'; +export * from './logs/log.model'; +export * from './gateway/gateway.component'; +export * from './gateway/gateway-routes.service'; +export * from './gateway/gateway.route'; +export * from './gateway/gateway-route.model'; +export * from './metrics/metrics.component'; +export * from './metrics/metrics-modal.component'; +export * from './metrics/metrics.service'; +export * from './metrics/metrics.route'; +export * from './user-management/user-management-update.component'; +export * from './user-management/user-management-delete-dialog.component'; +export * from './user-management/user-management-detail.component'; +export * from './user-management/user-management.component'; +export * from './user-management/user-management.route'; +export * from './admin.route'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/log.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/log.model.ts new file mode 100644 index 0000000000..3f27b6728c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/log.model.ts @@ -0,0 +1,3 @@ +export class Log { + constructor(public name: string, public level: string) {} +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.html new file mode 100644 index 0000000000..0a3f7de683 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.html @@ -0,0 +1,28 @@ +
+

Logs

+ +

There are {{ loggers.length }} loggers.

+ + Filter + + + + + + + + + + + + + +
NameLevel
{{logger.name | slice:0:140}} + + + + + + +
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.ts new file mode 100644 index 0000000000..28547f9ae6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.component.ts @@ -0,0 +1,32 @@ +import { Component, OnInit } from '@angular/core'; + +import { Log } from './log.model'; +import { LogsService } from './logs.service'; + +@Component({ + selector: 'jhi-logs', + templateUrl: './logs.component.html' +}) +export class LogsComponent implements OnInit { + loggers: Log[]; + filter: string; + orderProp: string; + reverse: boolean; + + constructor(private logsService: LogsService) { + this.filter = ''; + this.orderProp = 'name'; + this.reverse = false; + } + + ngOnInit() { + this.logsService.findAll().subscribe(response => (this.loggers = response.body)); + } + + changeLevel(name: string, level: string) { + const log = new Log(name, level); + this.logsService.changeLevel(log).subscribe(() => { + this.logsService.findAll().subscribe(response => (this.loggers = response.body)); + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.route.ts new file mode 100644 index 0000000000..1de755c758 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.route.ts @@ -0,0 +1,11 @@ +import { Route } from '@angular/router'; + +import { LogsComponent } from './logs.component'; + +export const logsRoute: Route = { + path: 'logs', + component: LogsComponent, + data: { + pageTitle: 'logs.title' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.service.ts new file mode 100644 index 0000000000..71a596b0ab --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/logs/logs.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; +import { Log } from './log.model'; + +@Injectable({ providedIn: 'root' }) +export class LogsService { + constructor(private http: HttpClient) {} + + changeLevel(log: Log): Observable> { + return this.http.put(SERVER_API_URL + 'management/logs', log, { observe: 'response' }); + } + + findAll(): Observable> { + return this.http.get(SERVER_API_URL + 'management/logs', { observe: 'response' }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.html new file mode 100644 index 0000000000..72da2ff6ce --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.html @@ -0,0 +1,56 @@ + + + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.ts new file mode 100644 index 0000000000..24585fb44e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics-modal.component.ts @@ -0,0 +1,46 @@ +import { Component, OnInit } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'jhi-metrics-modal', + templateUrl: './metrics-modal.component.html' +}) +export class JhiMetricsMonitoringModalComponent implements OnInit { + threadDumpFilter: any; + threadDump: any; + threadDumpAll = 0; + threadDumpBlocked = 0; + threadDumpRunnable = 0; + threadDumpTimedWaiting = 0; + threadDumpWaiting = 0; + + constructor(public activeModal: NgbActiveModal) {} + + ngOnInit() { + this.threadDump.forEach(value => { + if (value.threadState === 'RUNNABLE') { + this.threadDumpRunnable += 1; + } else if (value.threadState === 'WAITING') { + this.threadDumpWaiting += 1; + } else if (value.threadState === 'TIMED_WAITING') { + this.threadDumpTimedWaiting += 1; + } else if (value.threadState === 'BLOCKED') { + this.threadDumpBlocked += 1; + } + }); + + this.threadDumpAll = this.threadDumpRunnable + this.threadDumpWaiting + this.threadDumpTimedWaiting + this.threadDumpBlocked; + } + + getBadgeClass(threadState) { + if (threadState === 'RUNNABLE') { + return 'badge-success'; + } else if (threadState === 'WAITING') { + return 'badge-info'; + } else if (threadState === 'TIMED_WAITING') { + return 'badge-warning'; + } else if (threadState === 'BLOCKED') { + return 'badge-danger'; + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.html new file mode 100644 index 0000000000..2cf13dad55 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.html @@ -0,0 +1,216 @@ +
+

+ Application Metrics + +

+ +

JVM Metrics

+
+
+ Memory +

Total Memory ({{metrics.gauges['jvm.memory.total.used'].value / 1048576 | number:'1.0-0'}}M / {{metrics.gauges['jvm.memory.total.max'].value / 1048576 | number:'1.0-0'}}M)

+ + {{metrics.gauges['jvm.memory.total.used'].value * 100 / metrics.gauges['jvm.memory.total.max'].value | number:'1.0-0'}}% + +

Heap Memory ({{metrics.gauges['jvm.memory.heap.used'].value / 1048576 | number:'1.0-0'}}M / {{metrics.gauges['jvm.memory.heap.max'].value / 1048576 | number:'1.0-0'}}M)

+ + {{metrics.gauges['jvm.memory.heap.used'].value * 100 / metrics.gauges['jvm.memory.heap.max'].value | number:'1.0-0'}}% + +

Non-Heap Memory ({{metrics.gauges['jvm.memory.non-heap.used'].value / 1048576 | number:'1.0-0'}}M / {{metrics.gauges['jvm.memory.non-heap.committed'].value / 1048576 | number:'1.0-0'}}M)

+ + {{metrics.gauges['jvm.memory.non-heap.used'].value * 100 / metrics.gauges['jvm.memory.non-heap.committed'].value | number:'1.0-0'}}% + +
+
+ Threads (Total: {{metrics.gauges['jvm.threads.count'].value}}) +

Runnable {{metrics.gauges['jvm.threads.runnable.count'].value}}

+ + {{metrics.gauges['jvm.threads.runnable.count'].value * 100 / metrics.gauges['jvm.threads.count'].value | number:'1.0-0'}}% + +

Timed Waiting ({{metrics.gauges['jvm.threads.timed_waiting.count'].value}})

+ + {{metrics.gauges['jvm.threads.timed_waiting.count'].value * 100 / metrics.gauges['jvm.threads.count'].value | number:'1.0-0'}}% + +

Waiting ({{metrics.gauges['jvm.threads.waiting.count'].value}})

+ + {{metrics.gauges['jvm.threads.waiting.count'].value * 100 / metrics.gauges['jvm.threads.count'].value | number:'1.0-0'}}% + +

Blocked ({{metrics.gauges['jvm.threads.blocked.count'].value}})

+ + {{metrics.gauges['jvm.threads.blocked.count'].value * 100 / metrics.gauges['jvm.threads.count'].value | number:'1.0-0'}}% + +
+
+ Garbage collections +
+
Mark Sweep count
+
{{metrics.gauges['jvm.garbage.PS-MarkSweep.count'].value}}
+
+
+
Mark Sweep time
+
{{metrics.gauges['jvm.garbage.PS-MarkSweep.time'].value}}ms
+
+
+
Scavenge count
+
{{metrics.gauges['jvm.garbage.PS-Scavenge.count'].value}}
+
+
+
Scavenge time
+
{{metrics.gauges['jvm.garbage.PS-Scavenge.time'].value}}ms
+
+
+
+
Updating...
+ +

HTTP requests (events per second)

+

+ Active requests {{metrics.counters['com.codahale.metrics.servlet.InstrumentedFilter.activeRequests'].count | number:'1.0-0'}} - Total requests {{metrics.timers['com.codahale.metrics.servlet.InstrumentedFilter.requests'].count | number:'1.0-0'}} +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeCountMeanAverage (1 min)Average (5 min)Average (15 min)
OK + + {{metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.ok'].count}} + + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.ok'].mean_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.ok'].m1_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.ok'].m5_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.ok'].m15_rate) | number:'1.0-2'}} +
Not Found + + {{metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.notFound'].count}} + + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.notFound'].mean_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.notFound'].m1_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.notFound'].m5_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.notFound'].m15_rate) | number:'1.0-2'}} +
Server error + + {{metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.serverError'].count}} + + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.serverError'].mean_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.serverError'].m1_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.serverError'].m5_rate) | number:'1.0-2'}} + + {{filterNaN(metrics.meters['com.codahale.metrics.servlet.InstrumentedFilter.responseCodes.serverError'].m15_rate) | number:'1.0-2'}} +
+
+ +

Services statistics (time in millisecond)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Service nameCountMeanMinp50p75p95p99Max
{{entry.key}}{{entry.value.count}}{{entry.value.mean * 1024 | number:'1.0-0'}}{{entry.value.min * 1024 | number:'1.0-0'}}{{entry.value.p50 * 1024 | number:'1.0-0'}}{{entry.value.p75 * 1024 | number:'1.0-0'}}{{entry.value.p95 * 1024 | number:'1.0-0'}}{{entry.value.p99 * 1024 | number:'1.0-0'}}{{entry.value.max * 1024 | number:'1.0-0'}}
+
+

DataSource statistics (time in millisecond)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Usage ({{metrics.gauges['HikariPool-1.pool.ActiveConnections'].value}} / {{metrics.gauges['HikariPool-1.pool.TotalConnections'].value}})CountMeanMinp50p75p95p99Max
+
+ + {{metrics.gauges['HikariPool-1.pool.ActiveConnections'].value * 100 / metrics.gauges['HikariPool-1.pool.TotalConnections'].value | number:'1.0-0'}}% + +
+
{{metrics.histograms['HikariPool-1.pool.Usage'].count}}{{filterNaN(metrics.histograms['HikariPool-1.pool.Usage'].mean) | number:'1.0-2'}}{{filterNaN(metrics.histograms['HikariPool-1.pool.Usage'].min) | number:'1.0-2'}}{{filterNaN(metrics.histograms['HikariPool-1.pool.Usage'].p50) | number:'1.0-2'}}{{filterNaN(metrics.histograms['HikariPool-1.pool.Usage'].p75) | number:'1.0-2'}}{{filterNaN(metrics.histograms['HikariPool-1.pool.Usage'].p95) | number:'1.0-2'}}{{filterNaN(metrics.histograms['HikariPool-1.pool.Usage'].p99) | number:'1.0-2'}}{{filterNaN(metrics.histograms['HikariPool-1.pool.Usage'].max) | number:'1.0-2'}}
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.ts new file mode 100644 index 0000000000..c86c9f1c97 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.component.ts @@ -0,0 +1,77 @@ +import { Component, OnInit } from '@angular/core'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; + +import { JhiMetricsMonitoringModalComponent } from './metrics-modal.component'; +import { JhiMetricsService } from './metrics.service'; + +@Component({ + selector: 'jhi-metrics', + templateUrl: './metrics.component.html' +}) +export class JhiMetricsMonitoringComponent implements OnInit { + metrics: any = {}; + cachesStats: any = {}; + servicesStats: any = {}; + updatingMetrics = true; + JCACHE_KEY: string; + + constructor(private modalService: NgbModal, private metricsService: JhiMetricsService) { + this.JCACHE_KEY = 'jcache.statistics'; + } + + ngOnInit() { + this.refresh(); + } + + refresh() { + this.updatingMetrics = true; + this.metricsService.getMetrics().subscribe(metrics => { + this.metrics = metrics; + this.updatingMetrics = false; + this.servicesStats = {}; + this.cachesStats = {}; + Object.keys(metrics.timers).forEach(key => { + const value = metrics.timers[key]; + if (key.includes('web.rest') || key.includes('service')) { + this.servicesStats[key] = value; + } + }); + Object.keys(metrics.gauges).forEach(key => { + if (key.includes('jcache.statistics')) { + const value = metrics.gauges[key].value; + // remove gets or puts + const index = key.lastIndexOf('.'); + const newKey = key.substr(0, index); + + // Keep the name of the domain + this.cachesStats[newKey] = { + name: this.JCACHE_KEY.length, + value + }; + } + }); + }); + } + + refreshThreadDumpData() { + this.metricsService.threadDump().subscribe(data => { + const modalRef = this.modalService.open(JhiMetricsMonitoringModalComponent, { size: 'lg' }); + modalRef.componentInstance.threadDump = data.threads; + modalRef.result.then( + result => { + // Left blank intentionally, nothing to do here + }, + reason => { + // Left blank intentionally, nothing to do here + } + ); + }); + } + + filterNaN(input) { + if (isNaN(input)) { + return 0; + } + return input; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.route.ts new file mode 100644 index 0000000000..ba8f59363a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.route.ts @@ -0,0 +1,11 @@ +import { Route } from '@angular/router'; + +import { JhiMetricsMonitoringComponent } from './metrics.component'; + +export const metricsRoute: Route = { + path: 'jhi-metrics', + component: JhiMetricsMonitoringComponent, + data: { + pageTitle: 'metrics.title' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.service.ts new file mode 100644 index 0000000000..16ccc07324 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/metrics/metrics.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class JhiMetricsService { + constructor(private http: HttpClient) {} + + getMetrics(): Observable { + return this.http.get(SERVER_API_URL + 'management/metrics'); + } + + threadDump(): Observable { + return this.http.get(SERVER_API_URL + 'management/threaddump'); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.html new file mode 100644 index 0000000000..5b2eec36e2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.html @@ -0,0 +1,19 @@ +
+ + + +
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.ts new file mode 100644 index 0000000000..d7674f6cd9 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.ts @@ -0,0 +1,29 @@ +import { Component } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { JhiEventManager } from 'ng-jhipster'; + +import { User, UserService } from 'app/core'; + +@Component({ + selector: 'jhi-user-mgmt-delete-dialog', + templateUrl: './user-management-delete-dialog.component.html' +}) +export class UserMgmtDeleteDialogComponent { + user: User; + + constructor(private userService: UserService, public activeModal: NgbActiveModal, private eventManager: JhiEventManager) {} + + clear() { + this.activeModal.dismiss('cancel'); + } + + confirmDelete(login) { + this.userService.delete(login).subscribe(response => { + this.eventManager.broadcast({ + name: 'userListModification', + content: 'Deleted a user' + }); + this.activeModal.dismiss(true); + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.html new file mode 100644 index 0000000000..0fee91b953 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.html @@ -0,0 +1,49 @@ +
+
+
+

+ User [{{user.login}}] +

+
+
Login
+
+ {{user.login}} + + +
+
First Name
+
{{user.firstName}}
+
Last Name
+
{{user.lastName}}
+
Email
+
{{user.email}}
+
Lang Key
+
{{user.langKey}}
+
Created By
+
{{user.createdBy}}
+
Created Date
+
{{user.createdDate | date:'dd/MM/yy HH:mm' }}
+
Last Modified By
+
{{user.lastModifiedBy}}
+
Last Modified Date
+
{{user.lastModifiedDate | date:'dd/MM/yy HH:mm'}}
+
Profiles
+
+
    +
  • + {{authority}} +
  • +
+
+
+ +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.ts new file mode 100644 index 0000000000..0b323d89a0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-detail.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { User } from 'app/core'; + +@Component({ + selector: 'jhi-user-mgmt-detail', + templateUrl: './user-management-detail.component.html' +}) +export class UserMgmtDetailComponent implements OnInit { + user: User; + + constructor(private route: ActivatedRoute) {} + + ngOnInit() { + this.route.data.subscribe(({ user }) => { + this.user = user.body ? user.body : user; + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.html new file mode 100644 index 0000000000..3d1975ae86 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.html @@ -0,0 +1,124 @@ +
+
+
+

+ Create or edit a User +

+
+ +
+ + +
+ +
+ + + +
+ + This field is required. + + + + This field cannot be longer than 50 characters. + + + + This field can only contain letters, digits and e-mail addresses. + +
+
+
+ + + +
+ + This field cannot be longer than 50 characters. + +
+
+
+ + + +
+ + This field cannot be longer than 50 characters. + +
+
+
+ + + +
+ + This field is required. + + + + This field cannot be longer than 100 characters. + + + + This field is required to be at least 5 characters. + + + + Your email is invalid. + +
+
+
+ +
+ +
+ + +
+
+ + +
+
+
+ + +
+
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.ts new file mode 100644 index 0000000000..84e06c5bdf --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management-update.component.ts @@ -0,0 +1,58 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +import { JhiLanguageHelper, User, UserService } from 'app/core'; + +@Component({ + selector: 'jhi-user-mgmt-update', + templateUrl: './user-management-update.component.html' +}) +export class UserMgmtUpdateComponent implements OnInit { + user: User; + languages: any[]; + authorities: any[]; + isSaving: boolean; + + constructor( + private languageHelper: JhiLanguageHelper, + private userService: UserService, + private route: ActivatedRoute, + private router: Router + ) {} + + ngOnInit() { + this.isSaving = false; + this.route.data.subscribe(({ user }) => { + this.user = user.body ? user.body : user; + }); + this.authorities = []; + this.userService.authorities().subscribe(authorities => { + this.authorities = authorities; + }); + this.languageHelper.getAll().then(languages => { + this.languages = languages; + }); + } + + previousState() { + window.history.back(); + } + + save() { + this.isSaving = true; + if (this.user.id !== null) { + this.userService.update(this.user).subscribe(response => this.onSaveSuccess(response), () => this.onSaveError()); + } else { + this.userService.create(this.user).subscribe(response => this.onSaveSuccess(response), () => this.onSaveError()); + } + } + + private onSaveSuccess(result) { + this.isSaving = false; + this.previousState(); + } + + private onSaveError() { + this.isSaving = false; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.html new file mode 100644 index 0000000000..7cbf79c460 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.html @@ -0,0 +1,79 @@ +
+

+ Users + +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID Login Email Lang Key ProfilesCreated Date Last Modified By Last Modified Date
{{user.id}}{{user.login}}{{user.email}} + + + {{user.langKey}} +
+ {{ authority }} +
+
{{user.createdDate | date:'dd/MM/yy HH:mm'}}{{user.lastModifiedBy}}{{user.lastModifiedDate | date:'dd/MM/yy HH:mm'}} +
+ + + +
+
+
+
+
+ +
+
+ +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.ts new file mode 100644 index 0000000000..9ef046d655 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.component.ts @@ -0,0 +1,146 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { HttpResponse } from '@angular/common/http'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; + +import { ActivatedRoute, Router } from '@angular/router'; +import { JhiEventManager, JhiParseLinks, JhiAlertService } from 'ng-jhipster'; + +import { ITEMS_PER_PAGE } from 'app/shared'; +import { Principal, UserService, User } from 'app/core'; +import { UserMgmtDeleteDialogComponent } from 'app/admin'; + +@Component({ + selector: 'jhi-user-mgmt', + templateUrl: './user-management.component.html' +}) +export class UserMgmtComponent implements OnInit, OnDestroy { + currentAccount: any; + users: User[]; + error: any; + success: any; + routeData: any; + links: any; + totalItems: any; + queryCount: any; + itemsPerPage: any; + page: any; + predicate: any; + previousPage: any; + reverse: any; + + constructor( + private userService: UserService, + private alertService: JhiAlertService, + private principal: Principal, + private parseLinks: JhiParseLinks, + private activatedRoute: ActivatedRoute, + private router: Router, + private eventManager: JhiEventManager, + private modalService: NgbModal + ) { + this.itemsPerPage = ITEMS_PER_PAGE; + this.routeData = this.activatedRoute.data.subscribe(data => { + this.page = data['pagingParams'].page; + this.previousPage = data['pagingParams'].page; + this.reverse = data['pagingParams'].ascending; + this.predicate = data['pagingParams'].predicate; + }); + } + + ngOnInit() { + this.principal.identity().then(account => { + this.currentAccount = account; + this.loadAll(); + this.registerChangeInUsers(); + }); + } + + ngOnDestroy() { + this.routeData.unsubscribe(); + } + + registerChangeInUsers() { + this.eventManager.subscribe('userListModification', response => this.loadAll()); + } + + setActive(user, isActivated) { + user.activated = isActivated; + + this.userService.update(user).subscribe(response => { + if (response.status === 200) { + this.error = null; + this.success = 'OK'; + this.loadAll(); + } else { + this.success = null; + this.error = 'ERROR'; + } + }); + } + + loadAll() { + this.userService + .query({ + page: this.page - 1, + size: this.itemsPerPage, + sort: this.sort() + }) + .subscribe( + (res: HttpResponse) => this.onSuccess(res.body, res.headers), + (res: HttpResponse) => this.onError(res.body) + ); + } + + trackIdentity(index, item: User) { + return item.id; + } + + sort() { + const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')]; + if (this.predicate !== 'id') { + result.push('id'); + } + return result; + } + + loadPage(page: number) { + if (page !== this.previousPage) { + this.previousPage = page; + this.transition(); + } + } + + transition() { + this.router.navigate(['/admin/user-management'], { + queryParams: { + page: this.page, + sort: this.predicate + ',' + (this.reverse ? 'asc' : 'desc') + } + }); + this.loadAll(); + } + + deleteUser(user: User) { + const modalRef = this.modalService.open(UserMgmtDeleteDialogComponent, { size: 'lg', backdrop: 'static' }); + modalRef.componentInstance.user = user; + modalRef.result.then( + result => { + // Left blank intentionally, nothing to do here + }, + reason => { + // Left blank intentionally, nothing to do here + } + ); + } + + private onSuccess(data, headers) { + this.links = this.parseLinks.parse(headers.get('link')); + this.totalItems = headers.get('X-Total-Count'); + this.queryCount = this.totalItems; + this.users = data; + } + + private onError(error) { + this.alertService.error(error.error, error.message, null); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.route.ts new file mode 100644 index 0000000000..29675e93d8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/admin/user-management/user-management.route.ts @@ -0,0 +1,68 @@ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes, CanActivate } from '@angular/router'; +import { JhiPaginationUtil, JhiResolvePagingParams } from 'ng-jhipster'; + +import { Principal, User, UserService } from 'app/core'; +import { UserMgmtComponent } from './user-management.component'; +import { UserMgmtDetailComponent } from './user-management-detail.component'; +import { UserMgmtUpdateComponent } from './user-management-update.component'; + +@Injectable({ providedIn: 'root' }) +export class UserResolve implements CanActivate { + constructor(private principal: Principal) {} + + canActivate() { + return this.principal.identity().then(account => this.principal.hasAnyAuthority(['ROLE_ADMIN'])); + } +} + +@Injectable({ providedIn: 'root' }) +export class UserMgmtResolve implements Resolve { + constructor(private service: UserService) {} + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { + const id = route.params['login'] ? route.params['login'] : null; + if (id) { + return this.service.find(id); + } + return new User(); + } +} + +export const userMgmtRoute: Routes = [ + { + path: 'user-management', + component: UserMgmtComponent, + resolve: { + pagingParams: JhiResolvePagingParams + }, + data: { + pageTitle: 'userManagement.home.title', + defaultSort: 'id,asc' + } + }, + { + path: 'user-management/:login/view', + component: UserMgmtDetailComponent, + resolve: { + user: UserMgmtResolve + }, + data: { + pageTitle: 'userManagement.home.title' + } + }, + { + path: 'user-management/new', + component: UserMgmtUpdateComponent, + resolve: { + user: UserMgmtResolve + } + }, + { + path: 'user-management/:login/edit', + component: UserMgmtUpdateComponent, + resolve: { + user: UserMgmtResolve + } + } +]; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app-routing.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app-routing.module.ts new file mode 100644 index 0000000000..8491f5ffea --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app-routing.module.ts @@ -0,0 +1,23 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { errorRoute, navbarRoute } from './layouts'; +import { DEBUG_INFO_ENABLED } from 'app/app.constants'; + +const LAYOUT_ROUTES = [navbarRoute, ...errorRoute]; + +@NgModule({ + imports: [ + RouterModule.forRoot( + [ + ...LAYOUT_ROUTES, + { + path: 'admin', + loadChildren: './admin/admin.module#GatewayAdminModule' + } + ], + { useHash: true, enableTracing: DEBUG_INFO_ENABLED } + ) + ], + exports: [RouterModule] +}) +export class GatewayAppRoutingModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.constants.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.constants.ts new file mode 100644 index 0000000000..9760a49a91 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.constants.ts @@ -0,0 +1,8 @@ +// These constants are injected via webpack environment variables. +// You can add more variables in webpack.common.js or in profile specific webpack..js files. +// If you change the values in the webpack config files, you need to re run webpack to update the application + +export const VERSION = process.env.VERSION; +export const DEBUG_INFO_ENABLED: boolean = !!process.env.DEBUG_INFO_ENABLED; +export const SERVER_API_URL = process.env.SERVER_API_URL; +export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.main.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.main.ts new file mode 100644 index 0000000000..0404cd69e8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.main.ts @@ -0,0 +1,14 @@ +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { ProdConfig } from './blocks/config/prod.config'; +import { GatewayAppModule } from './app.module'; + +ProdConfig(); + +if (module['hot']) { + module['hot'].accept(); +} + +platformBrowserDynamic() + .bootstrapModule(GatewayAppModule, { preserveWhitespaces: true }) + .then(success => console.log(`Application started`)) + .catch(err => console.error(err)); diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.module.ts new file mode 100644 index 0000000000..a490c03db8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/app.module.ts @@ -0,0 +1,62 @@ +import './vendor.ts'; + +import { NgModule, Injector } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { HTTP_INTERCEPTORS } from '@angular/common/http'; +import { NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap'; +import { Ng2Webstorage } from 'ngx-webstorage'; +import { JhiEventManager } from 'ng-jhipster'; + +import { AuthExpiredInterceptor } from './blocks/interceptor/auth-expired.interceptor'; +import { ErrorHandlerInterceptor } from './blocks/interceptor/errorhandler.interceptor'; +import { NotificationInterceptor } from './blocks/interceptor/notification.interceptor'; +import { GatewaySharedModule } from 'app/shared'; +import { GatewayCoreModule } from 'app/core'; +import { GatewayAppRoutingModule } from './app-routing.module'; +import { GatewayHomeModule } from './home/home.module'; +import { GatewayAccountModule } from './account/account.module'; +import { GatewayEntityModule } from './entities/entity.module'; +import * as moment from 'moment'; +// jhipster-needle-angular-add-module-import JHipster will add new module here +import { JhiMainComponent, NavbarComponent, FooterComponent, PageRibbonComponent, ActiveMenuDirective, ErrorComponent } from './layouts'; + +@NgModule({ + imports: [ + BrowserModule, + GatewayAppRoutingModule, + Ng2Webstorage.forRoot({ prefix: 'jhi', separator: '-' }), + GatewaySharedModule, + GatewayCoreModule, + GatewayHomeModule, + GatewayAccountModule, + GatewayEntityModule + // jhipster-needle-angular-add-module JHipster will add new module here + ], + declarations: [JhiMainComponent, NavbarComponent, ErrorComponent, PageRibbonComponent, ActiveMenuDirective, FooterComponent], + providers: [ + { + provide: HTTP_INTERCEPTORS, + useClass: AuthExpiredInterceptor, + multi: true, + deps: [Injector] + }, + { + provide: HTTP_INTERCEPTORS, + useClass: ErrorHandlerInterceptor, + multi: true, + deps: [JhiEventManager] + }, + { + provide: HTTP_INTERCEPTORS, + useClass: NotificationInterceptor, + multi: true, + deps: [Injector] + } + ], + bootstrap: [JhiMainComponent] +}) +export class GatewayAppModule { + constructor(private dpConfig: NgbDatepickerConfig) { + this.dpConfig.minDate = { year: moment().year() - 100, month: 1, day: 1 }; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/prod.config.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/prod.config.ts new file mode 100644 index 0000000000..c6221c1eaf --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/prod.config.ts @@ -0,0 +1,9 @@ +import { enableProdMode } from '@angular/core'; +import { DEBUG_INFO_ENABLED } from 'app/app.constants'; + +export function ProdConfig() { + // disable debug data on prod profile to improve performance + if (!DEBUG_INFO_ENABLED) { + enableProdMode(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/uib-pagination.config.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/uib-pagination.config.ts new file mode 100644 index 0000000000..0c2ea94808 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/config/uib-pagination.config.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; +import { NgbPaginationConfig } from '@ng-bootstrap/ng-bootstrap'; +import { ITEMS_PER_PAGE } from 'app/shared'; + +@Injectable({ providedIn: 'root' }) +export class PaginationConfig { + // tslint:disable-next-line: no-unused-variable + constructor(private config: NgbPaginationConfig) { + config.boundaryLinks = true; + config.maxSize = 5; + config.pageSize = ITEMS_PER_PAGE; + config.size = 'sm'; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/auth-expired.interceptor.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/auth-expired.interceptor.ts new file mode 100644 index 0000000000..a4a67f3bf4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/auth-expired.interceptor.ts @@ -0,0 +1,39 @@ +import { Injector } from '@angular/core'; +import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpErrorResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { tap } from 'rxjs/operators'; +import { Router } from '@angular/router'; + +import { LoginModalService } from 'app/core/login/login-modal.service'; +import { Principal } from 'app/core/auth/principal.service'; +import { LoginService } from 'app/core/login/login.service'; + +export class AuthExpiredInterceptor implements HttpInterceptor { + constructor(private injector: Injector) {} + + intercept(request: HttpRequest, next: HttpHandler): Observable> { + return next.handle(request).pipe( + tap( + (event: HttpEvent) => {}, + (err: any) => { + if (err instanceof HttpErrorResponse) { + if (err.status === 401) { + const principal = this.injector.get(Principal); + + if (principal.isAuthenticated()) { + principal.authenticate(null); + const loginModalService: LoginModalService = this.injector.get(LoginModalService); + loginModalService.open(); + } else { + const loginService: LoginService = this.injector.get(LoginService); + loginService.logout(); + const router = this.injector.get(Router); + router.navigate(['/']); + } + } + } + } + ) + ); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/errorhandler.interceptor.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/errorhandler.interceptor.ts new file mode 100644 index 0000000000..dba028244e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/errorhandler.interceptor.ts @@ -0,0 +1,25 @@ +import { JhiEventManager } from 'ng-jhipster'; +import { HttpInterceptor, HttpRequest, HttpErrorResponse, HttpHandler, HttpEvent } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { tap } from 'rxjs/operators'; + +export class ErrorHandlerInterceptor implements HttpInterceptor { + constructor(private eventManager: JhiEventManager) {} + + intercept(request: HttpRequest, next: HttpHandler): Observable> { + return next.handle(request).pipe( + tap( + (event: HttpEvent) => {}, + (err: any) => { + if (err instanceof HttpErrorResponse) { + if (!(err.status === 401 && (err.message === '' || (err.url && err.url.includes('/api/account'))))) { + if (this.eventManager !== undefined) { + this.eventManager.broadcast({ name: 'gatewayApp.httpError', content: err }); + } + } + } + } + ) + ); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/notification.interceptor.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/notification.interceptor.ts new file mode 100644 index 0000000000..5edfdcfa64 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/blocks/interceptor/notification.interceptor.ts @@ -0,0 +1,43 @@ +import { JhiAlertService } from 'ng-jhipster'; +import { HttpInterceptor, HttpRequest, HttpResponse, HttpHandler, HttpEvent } from '@angular/common/http'; +import { Injector } from '@angular/core'; +import { Observable } from 'rxjs'; +import { tap } from 'rxjs/operators'; + +export class NotificationInterceptor implements HttpInterceptor { + private alertService: JhiAlertService; + + // tslint:disable-next-line: no-unused-variable + constructor(private injector: Injector) { + setTimeout(() => (this.alertService = injector.get(JhiAlertService))); + } + + intercept(request: HttpRequest, next: HttpHandler): Observable> { + return next.handle(request).pipe( + tap( + (event: HttpEvent) => { + if (event instanceof HttpResponse) { + const arr = event.headers.keys(); + let alert = null; + let alertParams = null; + arr.forEach(entry => { + if (entry.toLowerCase().endsWith('app-alert')) { + alert = event.headers.get(entry); + } else if (entry.toLowerCase().endsWith('app-params')) { + alertParams = event.headers.get(entry); + } + }); + if (alert) { + if (typeof alert === 'string') { + if (this.alertService) { + this.alertService.success(alert, { param: alertParams }, null); + } + } + } + } + }, + (err: any) => {} + ) + ); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/account.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/account.service.ts new file mode 100644 index 0000000000..fab4e415bc --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/account.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class AccountService { + constructor(private http: HttpClient) {} + + get(): Observable> { + return this.http.get(SERVER_API_URL + 'uaa/api/account', { observe: 'response' }); + } + + save(account: any): Observable> { + return this.http.post(SERVER_API_URL + 'uaa/api/account', account, { observe: 'response' }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/auth-jwt.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/auth-jwt.service.ts new file mode 100644 index 0000000000..221f5586bd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/auth-jwt.service.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; + +import { SERVER_API_URL } from 'app/app.constants'; + +@Injectable({ providedIn: 'root' }) +export class AuthServerProvider { + constructor(private http: HttpClient) {} + + getToken() { + return null; + } + + login(credentials): Observable { + const data = { + username: credentials.username, + password: credentials.password, + rememberMe: credentials.rememberMe + }; + return this.http.post(SERVER_API_URL + 'auth/login', data, {}); + } + + loginWithToken(jwt, rememberMe) { + if (jwt) { + this.storeAuthenticationToken(jwt, rememberMe); + return Promise.resolve(jwt); + } else { + return Promise.reject('auth-jwt-service Promise reject'); // Put appropriate error message here + } + } + + storeAuthenticationToken(jwt, rememberMe) {} + + logout(): Observable { + return this.http.post(SERVER_API_URL + 'auth/logout', null); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/csrf.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/csrf.service.ts new file mode 100644 index 0000000000..1eeee79972 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/csrf.service.ts @@ -0,0 +1,12 @@ +import { Injectable } from '@angular/core'; +import { CookieService } from 'ngx-cookie'; + +@Injectable({ providedIn: 'root' }) +export class CSRFService { + constructor(private cookieService: CookieService) {} + + getCSRF(name?: string) { + name = `${name ? name : 'XSRF-TOKEN'}`; + return this.cookieService.get(name); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/principal.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/principal.service.ts new file mode 100644 index 0000000000..a074bbd3bb --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/principal.service.ts @@ -0,0 +1,102 @@ +import { Injectable } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; +import { AccountService } from './account.service'; + +@Injectable({ providedIn: 'root' }) +export class Principal { + private userIdentity: any; + private authenticated = false; + private authenticationState = new Subject(); + + constructor(private account: AccountService) {} + + authenticate(identity) { + this.userIdentity = identity; + this.authenticated = identity !== null; + this.authenticationState.next(this.userIdentity); + } + + hasAnyAuthority(authorities: string[]): Promise { + return Promise.resolve(this.hasAnyAuthorityDirect(authorities)); + } + + hasAnyAuthorityDirect(authorities: string[]): boolean { + if (!this.authenticated || !this.userIdentity || !this.userIdentity.authorities) { + return false; + } + + for (let i = 0; i < authorities.length; i++) { + if (this.userIdentity.authorities.includes(authorities[i])) { + return true; + } + } + + return false; + } + + hasAuthority(authority: string): Promise { + if (!this.authenticated) { + return Promise.resolve(false); + } + + return this.identity().then( + id => { + return Promise.resolve(id.authorities && id.authorities.includes(authority)); + }, + () => { + return Promise.resolve(false); + } + ); + } + + identity(force?: boolean): Promise { + if (force === true) { + this.userIdentity = undefined; + } + + // check and see if we have retrieved the userIdentity data from the server. + // if we have, reuse it by immediately resolving + if (this.userIdentity) { + return Promise.resolve(this.userIdentity); + } + + // retrieve the userIdentity data from the server, update the identity object, and then resolve. + return this.account + .get() + .toPromise() + .then(response => { + const account = response.body; + if (account) { + this.userIdentity = account; + this.authenticated = true; + } else { + this.userIdentity = null; + this.authenticated = false; + } + this.authenticationState.next(this.userIdentity); + return this.userIdentity; + }) + .catch(err => { + this.userIdentity = null; + this.authenticated = false; + this.authenticationState.next(this.userIdentity); + return null; + }); + } + + isAuthenticated(): boolean { + return this.authenticated; + } + + isIdentityResolved(): boolean { + return this.userIdentity !== undefined; + } + + getAuthenticationState(): Observable { + return this.authenticationState.asObservable(); + } + + getImageUrl(): string { + return this.isIdentityResolved() ? this.userIdentity.imageUrl : null; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/state-storage.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/state-storage.service.ts new file mode 100644 index 0000000000..0e5befbfc3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/state-storage.service.ts @@ -0,0 +1,46 @@ +import { Injectable } from '@angular/core'; +import { SessionStorageService } from 'ngx-webstorage'; + +@Injectable({ providedIn: 'root' }) +export class StateStorageService { + constructor(private $sessionStorage: SessionStorageService) {} + + getPreviousState() { + return this.$sessionStorage.retrieve('previousState'); + } + + resetPreviousState() { + this.$sessionStorage.clear('previousState'); + } + + storePreviousState(previousStateName, previousStateParams) { + const previousState = { name: previousStateName, params: previousStateParams }; + this.$sessionStorage.store('previousState', previousState); + } + + getDestinationState() { + return this.$sessionStorage.retrieve('destinationState'); + } + + storeUrl(url: string) { + this.$sessionStorage.store('previousUrl', url); + } + + getUrl() { + return this.$sessionStorage.retrieve('previousUrl'); + } + + storeDestinationState(destinationState, destinationStateParams, fromState) { + const destinationInfo = { + destination: { + name: destinationState.name, + data: destinationState.data + }, + params: destinationStateParams, + from: { + name: fromState.name + } + }; + this.$sessionStorage.store('destinationState', destinationInfo); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/user-route-access-service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/user-route-access-service.ts new file mode 100644 index 0000000000..e86cba3497 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/auth/user-route-access-service.ts @@ -0,0 +1,56 @@ +import { Injectable, isDevMode } from '@angular/core'; +import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; + +import { Principal } from '../'; +import { LoginModalService } from '../login/login-modal.service'; +import { StateStorageService } from './state-storage.service'; + +@Injectable({ providedIn: 'root' }) +export class UserRouteAccessService implements CanActivate { + constructor( + private router: Router, + private loginModalService: LoginModalService, + private principal: Principal, + private stateStorageService: StateStorageService + ) {} + + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | Promise { + const authorities = route.data['authorities']; + // We need to call the checkLogin / and so the principal.identity() function, to ensure, + // that the client has a principal too, if they already logged in by the server. + // This could happen on a page refresh. + return this.checkLogin(authorities, state.url); + } + + checkLogin(authorities: string[], url: string): Promise { + const principal = this.principal; + return Promise.resolve( + principal.identity().then(account => { + if (!authorities || authorities.length === 0) { + return true; + } + + if (account) { + return principal.hasAnyAuthority(authorities).then(response => { + if (response) { + return true; + } + if (isDevMode()) { + console.error('User has not any of required authorities: ', authorities); + } + return false; + }); + } + + this.stateStorageService.storeUrl(url); + this.router.navigate(['accessdenied']).then(() => { + // only show the login dialog, if the user hasn't logged in yet + if (!account) { + this.loginModalService.open(); + } + }); + return false; + }) + ); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/core.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/core.module.ts new file mode 100644 index 0000000000..92807732dd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/core.module.ts @@ -0,0 +1,24 @@ +import { NgModule, LOCALE_ID } from '@angular/core'; +import { DatePipe, registerLocaleData } from '@angular/common'; +import { HttpClientModule } from '@angular/common/http'; +import { Title } from '@angular/platform-browser'; +import locale from '@angular/common/locales/en'; + +@NgModule({ + imports: [HttpClientModule], + exports: [], + declarations: [], + providers: [ + Title, + { + provide: LOCALE_ID, + useValue: 'en' + }, + DatePipe + ] +}) +export class GatewayCoreModule { + constructor() { + registerLocaleData(locale); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/index.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/index.ts new file mode 100644 index 0000000000..7663d225ad --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/index.ts @@ -0,0 +1,14 @@ +export * from './auth/csrf.service'; +export * from './auth/state-storage.service'; +export * from './auth/account.service'; +export * from './auth/auth-jwt.service'; +export * from './language/language.helper'; +export * from './language/language.constants'; +export * from './user/account.model'; +export * from './user/user.model'; +export * from './auth/principal.service'; +export * from './auth/user-route-access-service'; +export * from './login/login-modal.service'; +export * from './login/login.service'; +export * from './user/user.service'; +export * from './core.module'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.constants.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.constants.ts new file mode 100644 index 0000000000..000d72837a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.constants.ts @@ -0,0 +1,10 @@ +/* + Languages codes are ISO_639-1 codes, see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes + They are written in English to avoid character encoding issues (not a perfect solution) +*/ +export const LANGUAGES: string[] = [ + 'en', + 'fr', + 'pt-br' + // jhipster-needle-i18n-language-constant - JHipster will add/remove languages in this array +]; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.helper.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.helper.ts new file mode 100644 index 0000000000..6abfc8d271 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/language/language.helper.ts @@ -0,0 +1,66 @@ +import { Injectable, RendererFactory2, Renderer2 } from '@angular/core'; +import { Title } from '@angular/platform-browser'; +import { Router, ActivatedRouteSnapshot } from '@angular/router'; +import { TranslateService, LangChangeEvent } from '@ngx-translate/core'; +import { BehaviorSubject, Observable } from 'rxjs'; + +import { LANGUAGES } from 'app/core/language/language.constants'; + +@Injectable({ providedIn: 'root' }) +export class JhiLanguageHelper { + renderer: Renderer2 = null; + private _language: BehaviorSubject; + + constructor( + private translateService: TranslateService, + // tslint:disable-next-line: no-unused-variable + private rootRenderer: RendererFactory2, + private titleService: Title, + private router: Router + ) { + this._language = new BehaviorSubject(this.translateService.currentLang); + this.renderer = rootRenderer.createRenderer(document.querySelector('html'), null); + this.init(); + } + + getAll(): Promise { + return Promise.resolve(LANGUAGES); + } + + get language(): Observable { + return this._language.asObservable(); + } + + /** + * Update the window title using params in the following + * order: + * 1. titleKey parameter + * 2. $state.$current.data.pageTitle (current state page title) + * 3. 'global.title' + */ + updateTitle(titleKey?: string) { + if (!titleKey) { + titleKey = this.getPageTitle(this.router.routerState.snapshot.root); + } + + this.translateService.get(titleKey).subscribe(title => { + this.titleService.setTitle(title); + }); + } + + private init() { + this.translateService.onLangChange.subscribe((event: LangChangeEvent) => { + this._language.next(this.translateService.currentLang); + this.renderer.setAttribute(document.querySelector('html'), 'lang', this.translateService.currentLang); + this.updateTitle(); + }); + } + + private getPageTitle(routeSnapshot: ActivatedRouteSnapshot) { + let title: string = routeSnapshot.data && routeSnapshot.data['pageTitle'] ? routeSnapshot.data['pageTitle'] : 'gatewayApp'; + if (routeSnapshot.firstChild) { + title = this.getPageTitle(routeSnapshot.firstChild) || title; + } + return title; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login-modal.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login-modal.service.ts new file mode 100644 index 0000000000..a0002aa56b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login-modal.service.ts @@ -0,0 +1,27 @@ +import { Injectable } from '@angular/core'; +import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; + +import { JhiLoginModalComponent } from 'app/shared/login/login.component'; + +@Injectable({ providedIn: 'root' }) +export class LoginModalService { + private isOpen = false; + constructor(private modalService: NgbModal) {} + + open(): NgbModalRef { + if (this.isOpen) { + return; + } + this.isOpen = true; + const modalRef = this.modalService.open(JhiLoginModalComponent); + modalRef.result.then( + result => { + this.isOpen = false; + }, + reason => { + this.isOpen = false; + } + ); + return modalRef; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login.service.ts new file mode 100644 index 0000000000..0a2970dc02 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/login/login.service.ts @@ -0,0 +1,47 @@ +import { Injectable } from '@angular/core'; +import { JhiLanguageService } from 'ng-jhipster'; + +import { Principal } from '../auth/principal.service'; +import { AuthServerProvider } from '../auth/auth-jwt.service'; + +@Injectable({ providedIn: 'root' }) +export class LoginService { + constructor( + private languageService: JhiLanguageService, + private principal: Principal, + private authServerProvider: AuthServerProvider + ) {} + + login(credentials, callback?) { + const cb = callback || function() {}; + + return new Promise((resolve, reject) => { + this.authServerProvider.login(credentials).subscribe( + data => { + this.principal.identity(true).then(account => { + // After the login the language will be changed to + // the language selected by the user during his registration + if (account !== null) { + this.languageService.changeLanguage(account.langKey); + } + resolve(data); + }); + return cb(); + }, + err => { + this.logout(); + reject(err); + return cb(err); + } + ); + }); + } + + logout() { + if (this.principal.isAuthenticated()) { + this.authServerProvider.logout().subscribe(() => this.principal.authenticate(null)); + } else { + this.principal.authenticate(null); + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/account.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/account.model.ts new file mode 100644 index 0000000000..35679657e3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/account.model.ts @@ -0,0 +1,12 @@ +export class Account { + constructor( + public activated: boolean, + public authorities: string[], + public email: string, + public firstName: string, + public langKey: string, + public lastName: string, + public login: string, + public imageUrl: string + ) {} +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.model.ts new file mode 100644 index 0000000000..e82da11ac5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.model.ts @@ -0,0 +1,47 @@ +export interface IUser { + id?: any; + login?: string; + firstName?: string; + lastName?: string; + email?: string; + activated?: boolean; + langKey?: string; + authorities?: any[]; + createdBy?: string; + createdDate?: Date; + lastModifiedBy?: string; + lastModifiedDate?: Date; + password?: string; +} + +export class User implements IUser { + constructor( + public id?: any, + public login?: string, + public firstName?: string, + public lastName?: string, + public email?: string, + public activated?: boolean, + public langKey?: string, + public authorities?: any[], + public createdBy?: string, + public createdDate?: Date, + public lastModifiedBy?: string, + public lastModifiedDate?: Date, + public password?: string + ) { + this.id = id ? id : null; + this.login = login ? login : null; + this.firstName = firstName ? firstName : null; + this.lastName = lastName ? lastName : null; + this.email = email ? email : null; + this.activated = activated ? activated : false; + this.langKey = langKey ? langKey : null; + this.authorities = authorities ? authorities : null; + this.createdBy = createdBy ? createdBy : null; + this.createdDate = createdDate ? createdDate : null; + this.lastModifiedBy = lastModifiedBy ? lastModifiedBy : null; + this.lastModifiedDate = lastModifiedDate ? lastModifiedDate : null; + this.password = password ? password : null; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.service.ts new file mode 100644 index 0000000000..2b0a46f7cd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/core/user/user.service.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { Observable, of } from 'rxjs'; + +import { SERVER_API_URL } from 'app/app.constants'; +import { createRequestOption } from 'app/shared/util/request-util'; +import { IUser } from './user.model'; + +@Injectable({ providedIn: 'root' }) +export class UserService { + private resourceUrl = SERVER_API_URL + 'uaa/api/users'; + + constructor(private http: HttpClient) {} + + create(user: IUser): Observable> { + return this.http.post(this.resourceUrl, user, { observe: 'response' }); + } + + update(user: IUser): Observable> { + return this.http.put(this.resourceUrl, user, { observe: 'response' }); + } + + find(login: string): Observable> { + return this.http.get(`${this.resourceUrl}/${login}`, { observe: 'response' }); + } + + query(req?: any): Observable> { + const options = createRequestOption(req); + return this.http.get(this.resourceUrl, { params: options, observe: 'response' }); + } + + delete(login: string): Observable> { + return this.http.delete(`${this.resourceUrl}/${login}`, { observe: 'response' }); + } + + authorities(): Observable { + return this.http.get(SERVER_API_URL + 'uaa/api/users/authorities'); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/entity.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/entity.module.ts new file mode 100644 index 0000000000..0c0ba652ad --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/entity.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; + +import { GatewayQuoteModule as QuotesQuoteModule } from './quotes/quote/quote.module'; +/* jhipster-needle-add-entity-module-import - JHipster will add entity modules imports here */ + +@NgModule({ + // prettier-ignore + imports: [ + QuotesQuoteModule, + /* jhipster-needle-add-entity-module - JHipster will add entity modules here */ + ], + declarations: [], + entryComponents: [], + providers: [], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GatewayEntityModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/index.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/index.ts new file mode 100644 index 0000000000..0944894e50 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/index.ts @@ -0,0 +1,6 @@ +export * from './quote.service'; +export * from './quote-update.component'; +export * from './quote-delete-dialog.component'; +export * from './quote-detail.component'; +export * from './quote.component'; +export * from './quote.route'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.html new file mode 100644 index 0000000000..c915ac0411 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.html @@ -0,0 +1,19 @@ +
+ + + +
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.ts new file mode 100644 index 0000000000..585f3bbcdd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-delete-dialog.component.ts @@ -0,0 +1,65 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { JhiEventManager } from 'ng-jhipster'; + +import { IQuote } from 'app/shared/model/quotes/quote.model'; +import { QuoteService } from './quote.service'; + +@Component({ + selector: 'jhi-quote-delete-dialog', + templateUrl: './quote-delete-dialog.component.html' +}) +export class QuoteDeleteDialogComponent { + quote: IQuote; + + constructor(private quoteService: QuoteService, public activeModal: NgbActiveModal, private eventManager: JhiEventManager) {} + + clear() { + this.activeModal.dismiss('cancel'); + } + + confirmDelete(id: number) { + this.quoteService.delete(id).subscribe(response => { + this.eventManager.broadcast({ + name: 'quoteListModification', + content: 'Deleted an quote' + }); + this.activeModal.dismiss(true); + }); + } +} + +@Component({ + selector: 'jhi-quote-delete-popup', + template: '' +}) +export class QuoteDeletePopupComponent implements OnInit, OnDestroy { + private ngbModalRef: NgbModalRef; + + constructor(private activatedRoute: ActivatedRoute, private router: Router, private modalService: NgbModal) {} + + ngOnInit() { + this.activatedRoute.data.subscribe(({ quote }) => { + setTimeout(() => { + this.ngbModalRef = this.modalService.open(QuoteDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' }); + this.ngbModalRef.componentInstance.quote = quote; + this.ngbModalRef.result.then( + result => { + this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' }); + this.ngbModalRef = null; + }, + reason => { + this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' }); + this.ngbModalRef = null; + } + ); + }, 0); + }); + } + + ngOnDestroy() { + this.ngbModalRef = null; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.html new file mode 100644 index 0000000000..b18be8b19f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.html @@ -0,0 +1,35 @@ +
+
+
+

Quote {{quote.id}}

+
+ +
+
Symbol
+
+ {{quote.symbol}} +
+
Price
+
+ {{quote.price}} +
+
Last Trade
+
+ {{quote.lastTrade}} +
+
+ + + + +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.ts new file mode 100644 index 0000000000..9c6ac3e8f1 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-detail.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { IQuote } from 'app/shared/model/quotes/quote.model'; + +@Component({ + selector: 'jhi-quote-detail', + templateUrl: './quote-detail.component.html' +}) +export class QuoteDetailComponent implements OnInit { + quote: IQuote; + + constructor(private activatedRoute: ActivatedRoute) {} + + ngOnInit() { + this.activatedRoute.data.subscribe(({ quote }) => { + this.quote = quote; + }); + } + + previousState() { + window.history.back(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.html new file mode 100644 index 0000000000..fe76ccd9e6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.html @@ -0,0 +1,67 @@ +
+
+
+

Create or edit a Quote

+
+ +
+ + +
+
+ + +
+ + This field is required. + +
+
+
+ + +
+ + This field is required. + + + This field should be a number. + +
+
+
+ +
+ +
+
+ + This field is required. + + + This field should be a date and time. + +
+
+ +
+
+ + +
+
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.ts new file mode 100644 index 0000000000..06badc70dd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote-update.component.ts @@ -0,0 +1,56 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import * as moment from 'moment'; +import { DATE_TIME_FORMAT } from 'app/shared/constants/input.constants'; + +import { IQuote } from 'app/shared/model/quotes/quote.model'; +import { QuoteService } from './quote.service'; + +@Component({ + selector: 'jhi-quote-update', + templateUrl: './quote-update.component.html' +}) +export class QuoteUpdateComponent implements OnInit { + quote: IQuote; + isSaving: boolean; + lastTrade: string; + + constructor(private quoteService: QuoteService, private activatedRoute: ActivatedRoute) {} + + ngOnInit() { + this.isSaving = false; + this.activatedRoute.data.subscribe(({ quote }) => { + this.quote = quote; + this.lastTrade = this.quote.lastTrade != null ? this.quote.lastTrade.format(DATE_TIME_FORMAT) : null; + }); + } + + previousState() { + window.history.back(); + } + + save() { + this.isSaving = true; + this.quote.lastTrade = this.lastTrade != null ? moment(this.lastTrade, DATE_TIME_FORMAT) : null; + if (this.quote.id !== undefined) { + this.subscribeToSaveResponse(this.quoteService.update(this.quote)); + } else { + this.subscribeToSaveResponse(this.quoteService.create(this.quote)); + } + } + + private subscribeToSaveResponse(result: Observable>) { + result.subscribe((res: HttpResponse) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError()); + } + + private onSaveSuccess() { + this.isSaving = false; + this.previousState(); + } + + private onSaveError() { + this.isSaving = false; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.html new file mode 100644 index 0000000000..20362f3799 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.html @@ -0,0 +1,66 @@ +
+

+ Quotes + +

+ +
+
+ + + + + + + + + + + + + + + + + + + +
ID Symbol Price Last Trade
{{quote.id}}{{quote.symbol}}{{quote.price}}{{quote.lastTrade | date:'medium'}} +
+ + + +
+
+
+
+
+ +
+
+ +
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.ts new file mode 100644 index 0000000000..c855ceeafb --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.component.ts @@ -0,0 +1,132 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { HttpErrorResponse, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Subscription } from 'rxjs'; +import { JhiEventManager, JhiParseLinks, JhiAlertService } from 'ng-jhipster'; + +import { IQuote } from 'app/shared/model/quotes/quote.model'; +import { Principal } from 'app/core'; + +import { ITEMS_PER_PAGE } from 'app/shared'; +import { QuoteService } from './quote.service'; + +@Component({ + selector: 'jhi-quote', + templateUrl: './quote.component.html' +}) +export class QuoteComponent implements OnInit, OnDestroy { + currentAccount: any; + quotes: IQuote[]; + error: any; + success: any; + eventSubscriber: Subscription; + routeData: any; + links: any; + totalItems: any; + queryCount: any; + itemsPerPage: any; + page: any; + predicate: any; + previousPage: any; + reverse: any; + + constructor( + private quoteService: QuoteService, + private parseLinks: JhiParseLinks, + private jhiAlertService: JhiAlertService, + private principal: Principal, + private activatedRoute: ActivatedRoute, + private router: Router, + private eventManager: JhiEventManager + ) { + this.itemsPerPage = ITEMS_PER_PAGE; + this.routeData = this.activatedRoute.data.subscribe(data => { + this.page = data.pagingParams.page; + this.previousPage = data.pagingParams.page; + this.reverse = data.pagingParams.ascending; + this.predicate = data.pagingParams.predicate; + }); + } + + loadAll() { + this.quoteService + .query({ + page: this.page - 1, + size: this.itemsPerPage, + sort: this.sort() + }) + .subscribe( + (res: HttpResponse) => this.paginateQuotes(res.body, res.headers), + (res: HttpErrorResponse) => this.onError(res.message) + ); + } + + loadPage(page: number) { + if (page !== this.previousPage) { + this.previousPage = page; + this.transition(); + } + } + + transition() { + this.router.navigate(['/quote'], { + queryParams: { + page: this.page, + size: this.itemsPerPage, + sort: this.predicate + ',' + (this.reverse ? 'asc' : 'desc') + } + }); + this.loadAll(); + } + + clear() { + this.page = 0; + this.router.navigate([ + '/quote', + { + page: this.page, + sort: this.predicate + ',' + (this.reverse ? 'asc' : 'desc') + } + ]); + this.loadAll(); + } + + ngOnInit() { + this.loadAll(); + this.principal.identity().then(account => { + this.currentAccount = account; + }); + this.registerChangeInQuotes(); + } + + ngOnDestroy() { + this.eventManager.destroy(this.eventSubscriber); + } + + trackId(index: number, item: IQuote) { + return item.id; + } + + registerChangeInQuotes() { + this.eventSubscriber = this.eventManager.subscribe('quoteListModification', response => this.loadAll()); + } + + sort() { + const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')]; + if (this.predicate !== 'id') { + result.push('id'); + } + return result; + } + + private paginateQuotes(data: IQuote[], headers: HttpHeaders) { + this.links = this.parseLinks.parse(headers.get('link')); + this.totalItems = parseInt(headers.get('X-Total-Count'), 10); + this.queryCount = this.totalItems; + this.quotes = data; + } + + private onError(errorMessage: string) { + this.jhiAlertService.error(errorMessage, null, null); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.module.ts new file mode 100644 index 0000000000..b29613b4a4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.module.ts @@ -0,0 +1,23 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { GatewaySharedModule } from 'app/shared'; +import { + QuoteComponent, + QuoteDetailComponent, + QuoteUpdateComponent, + QuoteDeletePopupComponent, + QuoteDeleteDialogComponent, + quoteRoute, + quotePopupRoute +} from './'; + +const ENTITY_STATES = [...quoteRoute, ...quotePopupRoute]; + +@NgModule({ + imports: [GatewaySharedModule, RouterModule.forChild(ENTITY_STATES)], + declarations: [QuoteComponent, QuoteDetailComponent, QuoteUpdateComponent, QuoteDeleteDialogComponent, QuoteDeletePopupComponent], + entryComponents: [QuoteComponent, QuoteUpdateComponent, QuoteDeleteDialogComponent, QuoteDeletePopupComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GatewayQuoteModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.route.ts new file mode 100644 index 0000000000..1479f1c56a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.route.ts @@ -0,0 +1,95 @@ +import { Injectable } from '@angular/core'; +import { HttpResponse } from '@angular/common/http'; +import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router'; +import { JhiPaginationUtil, JhiResolvePagingParams } from 'ng-jhipster'; +import { UserRouteAccessService } from 'app/core'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { Quote } from 'app/shared/model/quotes/quote.model'; +import { QuoteService } from './quote.service'; +import { QuoteComponent } from './quote.component'; +import { QuoteDetailComponent } from './quote-detail.component'; +import { QuoteUpdateComponent } from './quote-update.component'; +import { QuoteDeletePopupComponent } from './quote-delete-dialog.component'; +import { IQuote } from 'app/shared/model/quotes/quote.model'; + +@Injectable({ providedIn: 'root' }) +export class QuoteResolve implements Resolve { + constructor(private service: QuoteService) {} + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { + const id = route.params['id'] ? route.params['id'] : null; + if (id) { + return this.service.find(id).pipe(map((quote: HttpResponse) => quote.body)); + } + return of(new Quote()); + } +} + +export const quoteRoute: Routes = [ + { + path: 'quote', + component: QuoteComponent, + resolve: { + pagingParams: JhiResolvePagingParams + }, + data: { + authorities: ['ROLE_USER'], + defaultSort: 'id,asc', + pageTitle: 'gatewayApp.quotesQuote.home.title' + }, + canActivate: [UserRouteAccessService] + }, + { + path: 'quote/:id/view', + component: QuoteDetailComponent, + resolve: { + quote: QuoteResolve + }, + data: { + authorities: ['ROLE_USER'], + pageTitle: 'gatewayApp.quotesQuote.home.title' + }, + canActivate: [UserRouteAccessService] + }, + { + path: 'quote/new', + component: QuoteUpdateComponent, + resolve: { + quote: QuoteResolve + }, + data: { + authorities: ['ROLE_USER'], + pageTitle: 'gatewayApp.quotesQuote.home.title' + }, + canActivate: [UserRouteAccessService] + }, + { + path: 'quote/:id/edit', + component: QuoteUpdateComponent, + resolve: { + quote: QuoteResolve + }, + data: { + authorities: ['ROLE_USER'], + pageTitle: 'gatewayApp.quotesQuote.home.title' + }, + canActivate: [UserRouteAccessService] + } +]; + +export const quotePopupRoute: Routes = [ + { + path: 'quote/:id/delete', + component: QuoteDeletePopupComponent, + resolve: { + quote: QuoteResolve + }, + data: { + authorities: ['ROLE_USER'], + pageTitle: 'gatewayApp.quotesQuote.home.title' + }, + canActivate: [UserRouteAccessService], + outlet: 'popup' + } +]; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.service.ts new file mode 100644 index 0000000000..3551d0e3e8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/entities/quotes/quote/quote.service.ts @@ -0,0 +1,70 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import * as moment from 'moment'; +import { DATE_FORMAT } from 'app/shared/constants/input.constants'; +import { map } from 'rxjs/operators'; + +import { SERVER_API_URL } from 'app/app.constants'; +import { createRequestOption } from 'app/shared'; +import { IQuote } from 'app/shared/model/quotes/quote.model'; + +type EntityResponseType = HttpResponse; +type EntityArrayResponseType = HttpResponse; + +@Injectable({ providedIn: 'root' }) +export class QuoteService { + private resourceUrl = SERVER_API_URL + 'quotes/api/quotes'; + + constructor(private http: HttpClient) {} + + create(quote: IQuote): Observable { + const copy = this.convertDateFromClient(quote); + return this.http + .post(this.resourceUrl, copy, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + + update(quote: IQuote): Observable { + const copy = this.convertDateFromClient(quote); + return this.http + .put(this.resourceUrl, copy, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + + find(id: number): Observable { + return this.http + .get(`${this.resourceUrl}/${id}`, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + + query(req?: any): Observable { + const options = createRequestOption(req); + return this.http + .get(this.resourceUrl, { params: options, observe: 'response' }) + .pipe(map((res: EntityArrayResponseType) => this.convertDateArrayFromServer(res))); + } + + delete(id: number): Observable> { + return this.http.delete(`${this.resourceUrl}/${id}`, { observe: 'response' }); + } + + private convertDateFromClient(quote: IQuote): IQuote { + const copy: IQuote = Object.assign({}, quote, { + lastTrade: quote.lastTrade != null && quote.lastTrade.isValid() ? quote.lastTrade.toJSON() : null + }); + return copy; + } + + private convertDateFromServer(res: EntityResponseType): EntityResponseType { + res.body.lastTrade = res.body.lastTrade != null ? moment(res.body.lastTrade) : null; + return res; + } + + private convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType { + res.body.forEach((quote: IQuote) => { + quote.lastTrade = quote.lastTrade != null ? moment(quote.lastTrade) : null; + }); + return res; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.html new file mode 100644 index 0000000000..0afe9ec7ed --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.html @@ -0,0 +1,41 @@ +
+
+ +
+
+

Welcome, Java Hipster!

+

This is your homepage

+ +
+
+ You are logged in as user "{{account.login}}". +
+ +
+ If you want to + sign in, you can try the default accounts:
- Administrator (login="admin" and password="admin")
- User (login="user" and password="user").
+
+
+ You don't have an account yet?  + Register a new account +
+
+ +

+ If you have any question on JHipster: +

+ + + +

+ If you like JHipster, don't forget to give us a star on GitHub! +

+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.ts new file mode 100644 index 0000000000..4c155c521b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.component.ts @@ -0,0 +1,40 @@ +import { Component, OnInit } from '@angular/core'; +import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { JhiEventManager } from 'ng-jhipster'; + +import { LoginModalService, Principal, Account } from 'app/core'; + +@Component({ + selector: 'jhi-home', + templateUrl: './home.component.html', + styleUrls: ['home.scss'] +}) +export class HomeComponent implements OnInit { + account: Account; + modalRef: NgbModalRef; + + constructor(private principal: Principal, private loginModalService: LoginModalService, private eventManager: JhiEventManager) {} + + ngOnInit() { + this.principal.identity().then(account => { + this.account = account; + }); + this.registerAuthenticationSuccess(); + } + + registerAuthenticationSuccess() { + this.eventManager.subscribe('authenticationSuccess', message => { + this.principal.identity().then(account => { + this.account = account; + }); + }); + } + + isAuthenticated() { + return this.principal.isAuthenticated(); + } + + login() { + this.modalRef = this.loginModalService.open(); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.module.ts new file mode 100644 index 0000000000..9d3e34c3d3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.module.ts @@ -0,0 +1,12 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { GatewaySharedModule } from 'app/shared'; +import { HOME_ROUTE, HomeComponent } from './'; + +@NgModule({ + imports: [GatewaySharedModule, RouterModule.forChild([HOME_ROUTE])], + declarations: [HomeComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GatewayHomeModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.route.ts new file mode 100644 index 0000000000..cfa1a3fb42 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.route.ts @@ -0,0 +1,12 @@ +import { Route } from '@angular/router'; + +import { HomeComponent } from './'; + +export const HOME_ROUTE: Route = { + path: '', + component: HomeComponent, + data: { + authorities: [], + pageTitle: 'home.title' + } +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.scss b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.scss new file mode 100644 index 0000000000..e0545ef6f5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/home.scss @@ -0,0 +1,23 @@ +/* ========================================================================== +Main page styles +========================================================================== */ + +.hipster { + display: inline-block; + width: 347px; + height: 497px; + background: url('../../content/images/hipster.png') no-repeat center top; + background-size: contain; +} + +/* wait autoprefixer update to allow simple generation of high pixel density media query */ +@media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (-moz-min-device-pixel-ratio: 2), + only screen and (-o-min-device-pixel-ratio: 2/1), + only screen and (min-resolution: 192dpi), + only screen and (min-resolution: 2dppx) { + .hipster { + background: url('../../content/images/hipster2x.png') no-repeat center top; + background-size: contain; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/index.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/index.ts new file mode 100644 index 0000000000..d76285b277 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/home/index.ts @@ -0,0 +1,3 @@ +export * from './home.component'; +export * from './home.route'; +export * from './home.module'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.html new file mode 100644 index 0000000000..78e20d984e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.html @@ -0,0 +1,17 @@ +
+
+
+ +
+
+

Error Page!

+ +
+
{{errorMessage}} +
+
+
You are not authorized to access this page. +
+
+
+
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.ts new file mode 100644 index 0000000000..3548172827 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'jhi-error', + templateUrl: './error.component.html' +}) +export class ErrorComponent implements OnInit { + errorMessage: string; + error403: boolean; + + constructor(private route: ActivatedRoute) {} + + ngOnInit() { + this.route.data.subscribe(routeData => { + if (routeData.error403) { + this.error403 = routeData.error403; + } + if (routeData.errorMessage) { + this.errorMessage = routeData.errorMessage; + } + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.route.ts new file mode 100644 index 0000000000..365249d627 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/error/error.route.ts @@ -0,0 +1,23 @@ +import { Routes } from '@angular/router'; + +import { ErrorComponent } from './error.component'; + +export const errorRoute: Routes = [ + { + path: 'error', + component: ErrorComponent, + data: { + authorities: [], + pageTitle: 'error.title' + } + }, + { + path: 'accessdenied', + component: ErrorComponent, + data: { + authorities: [], + pageTitle: 'error.title', + error403: true + } + } +]; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.html new file mode 100644 index 0000000000..9312ad063e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.html @@ -0,0 +1,3 @@ + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.ts new file mode 100644 index 0000000000..37da8bca75 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/footer/footer.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'jhi-footer', + templateUrl: './footer.component.html' +}) +export class FooterComponent {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/index.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/index.ts new file mode 100644 index 0000000000..d7432602a7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/index.ts @@ -0,0 +1,10 @@ +export * from './error/error.component'; +export * from './error/error.route'; +export * from './main/main.component'; +export * from './footer/footer.component'; +export * from './navbar/navbar.component'; +export * from './navbar/navbar.route'; +export * from './navbar/active-menu.directive'; +export * from './profiles/page-ribbon.component'; +export * from './profiles/profile.service'; +export * from './profiles/profile-info.model'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.html new file mode 100644 index 0000000000..5bcd12ab0b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.html @@ -0,0 +1,11 @@ + +
+ +
+
+
+ + +
+ +
diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.ts new file mode 100644 index 0000000000..4554218504 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/main/main.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRouteSnapshot, NavigationEnd } from '@angular/router'; + +import { JhiLanguageHelper } from 'app/core'; + +@Component({ + selector: 'jhi-main', + templateUrl: './main.component.html' +}) +export class JhiMainComponent implements OnInit { + constructor(private jhiLanguageHelper: JhiLanguageHelper, private router: Router) {} + + private getPageTitle(routeSnapshot: ActivatedRouteSnapshot) { + let title: string = routeSnapshot.data && routeSnapshot.data['pageTitle'] ? routeSnapshot.data['pageTitle'] : 'gatewayApp'; + if (routeSnapshot.firstChild) { + title = this.getPageTitle(routeSnapshot.firstChild) || title; + } + return title; + } + + ngOnInit() { + this.router.events.subscribe(event => { + if (event instanceof NavigationEnd) { + this.jhiLanguageHelper.updateTitle(this.getPageTitle(this.router.routerState.snapshot.root)); + } + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/active-menu.directive.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/active-menu.directive.ts new file mode 100644 index 0000000000..edbdeb94fd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/active-menu.directive.ts @@ -0,0 +1,26 @@ +import { Directive, OnInit, ElementRef, Renderer, Input } from '@angular/core'; +import { TranslateService, LangChangeEvent } from '@ngx-translate/core'; + +@Directive({ + selector: '[jhiActiveMenu]' +}) +export class ActiveMenuDirective implements OnInit { + @Input() jhiActiveMenu: string; + + constructor(private el: ElementRef, private renderer: Renderer, private translateService: TranslateService) {} + + ngOnInit() { + this.translateService.onLangChange.subscribe((event: LangChangeEvent) => { + this.updateActiveFlag(event.lang); + }); + this.updateActiveFlag(this.translateService.currentLang); + } + + updateActiveFlag(selectedLanguage) { + if (this.jhiActiveMenu === selectedLanguage) { + this.renderer.setElementClass(this.el.nativeElement, 'active', true); + } else { + this.renderer.setElementClass(this.el.nativeElement, 'active', false); + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.html new file mode 100644 index 0000000000..4491fd34bb --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.html @@ -0,0 +1,166 @@ + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.ts new file mode 100644 index 0000000000..e16b4d343f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.component.ts @@ -0,0 +1,76 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { JhiLanguageService } from 'ng-jhipster'; + +import { VERSION } from 'app/app.constants'; +import { JhiLanguageHelper, Principal, LoginModalService, LoginService } from 'app/core'; +import { ProfileService } from '../profiles/profile.service'; + +@Component({ + selector: 'jhi-navbar', + templateUrl: './navbar.component.html', + styleUrls: ['navbar.scss'] +}) +export class NavbarComponent implements OnInit { + inProduction: boolean; + isNavbarCollapsed: boolean; + languages: any[]; + swaggerEnabled: boolean; + modalRef: NgbModalRef; + version: string; + + constructor( + private loginService: LoginService, + private languageService: JhiLanguageService, + private languageHelper: JhiLanguageHelper, + private principal: Principal, + private loginModalService: LoginModalService, + private profileService: ProfileService, + private router: Router + ) { + this.version = VERSION ? 'v' + VERSION : ''; + this.isNavbarCollapsed = true; + } + + ngOnInit() { + this.languageHelper.getAll().then(languages => { + this.languages = languages; + }); + + this.profileService.getProfileInfo().then(profileInfo => { + this.inProduction = profileInfo.inProduction; + this.swaggerEnabled = profileInfo.swaggerEnabled; + }); + } + + changeLanguage(languageKey: string) { + this.languageService.changeLanguage(languageKey); + } + + collapseNavbar() { + this.isNavbarCollapsed = true; + } + + isAuthenticated() { + return this.principal.isAuthenticated(); + } + + login() { + this.modalRef = this.loginModalService.open(); + } + + logout() { + this.collapseNavbar(); + this.loginService.logout(); + this.router.navigate(['']); + } + + toggleNavbar() { + this.isNavbarCollapsed = !this.isNavbarCollapsed; + } + + getImageUrl() { + return this.isAuthenticated() ? this.principal.getImageUrl() : null; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.route.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.route.ts new file mode 100644 index 0000000000..317d99604b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.route.ts @@ -0,0 +1,9 @@ +import { Route } from '@angular/router'; + +import { NavbarComponent } from './navbar.component'; + +export const navbarRoute: Route = { + path: '', + component: NavbarComponent, + outlet: 'navbar' +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.scss b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.scss new file mode 100644 index 0000000000..be76638270 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/navbar/navbar.scss @@ -0,0 +1,78 @@ +/* ========================================================================== +Navbar +========================================================================== */ + +.navbar-version { + font-size: 10px; + color: #ccc; +} + +.jh-navbar { + background-color: #353d47; + padding: 0.2em 1em; + .profile-image { + margin: -10px 0px; + height: 40px; + width: 40px; + border-radius: 50%; + } + .dropdown-item.active, + .dropdown-item.active:focus, + .dropdown-item.active:hover { + background-color: #353d47; + } + .dropdown-toggle::after { + margin-left: 0.15em; + } + ul.navbar-nav { + padding: 0.5em; + .nav-item { + margin-left: 1.5rem; + } + } + a.nav-link { + font-weight: 400; + } + .jh-navbar-toggler { + color: #ccc; + font-size: 1.5em; + padding: 10px; + &:hover { + color: #fff; + } + } +} + +@media screen and (min-width: 768px) { + .jh-navbar-toggler { + display: none; + } +} + +@media screen and (max-width: 992px) { + .jh-logo-container { + width: 100%; + } +} + +.navbar-title { + display: inline-block; + vertical-align: middle; +} + +/* ========================================================================== +Logo styles +========================================================================== */ +.navbar-brand { + &.logo { + padding: 5px 15px; + .logo-img { + height: 45px; + width: 70px; + display: inline-block; + vertical-align: middle; + background: url('../../../content/images/logo-jhipster.png') no-repeat center center; + background-size: contain; + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.component.ts new file mode 100644 index 0000000000..f2c48078b4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import { ProfileService } from './profile.service'; +import { ProfileInfo } from './profile-info.model'; + +@Component({ + selector: 'jhi-page-ribbon', + template: ``, + styleUrls: ['page-ribbon.scss'] +}) +export class PageRibbonComponent implements OnInit { + profileInfo: ProfileInfo; + ribbonEnv: string; + + constructor(private profileService: ProfileService) {} + + ngOnInit() { + this.profileService.getProfileInfo().then(profileInfo => { + this.profileInfo = profileInfo; + this.ribbonEnv = profileInfo.ribbonEnv; + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.scss b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.scss new file mode 100644 index 0000000000..90125b70cb --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/page-ribbon.scss @@ -0,0 +1,31 @@ +/* ========================================================================== +Developement Ribbon +========================================================================== */ +.ribbon { + background-color: rgba(170, 0, 0, 0.5); + left: -3.5em; + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + overflow: hidden; + position: absolute; + top: 40px; + white-space: nowrap; + width: 15em; + z-index: 9999; + pointer-events: none; + opacity: 0.75; + a { + color: #fff; + display: block; + font-weight: 400; + margin: 1px 0; + padding: 10px 50px; + text-align: center; + text-decoration: none; + text-shadow: 0 0 5px #444; + pointer-events: none; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile-info.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile-info.model.ts new file mode 100644 index 0000000000..f1adc52c7b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile-info.model.ts @@ -0,0 +1,6 @@ +export class ProfileInfo { + activeProfiles: string[]; + ribbonEnv: string; + inProduction: boolean; + swaggerEnabled: boolean; +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile.service.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile.service.ts new file mode 100644 index 0000000000..d07fad7e7f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/layouts/profiles/profile.service.ts @@ -0,0 +1,40 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpResponse } from '@angular/common/http'; + +import { SERVER_API_URL } from 'app/app.constants'; +import { ProfileInfo } from './profile-info.model'; +import { map } from 'rxjs/operators'; + +@Injectable({ providedIn: 'root' }) +export class ProfileService { + private infoUrl = SERVER_API_URL + 'management/info'; + private profileInfo: Promise; + + constructor(private http: HttpClient) {} + + getProfileInfo(): Promise { + if (!this.profileInfo) { + this.profileInfo = this.http + .get(this.infoUrl, { observe: 'response' }) + .pipe( + map((res: HttpResponse) => { + const data = res.body; + const pi = new ProfileInfo(); + pi.activeProfiles = data['activeProfiles']; + const displayRibbonOnProfiles = data['display-ribbon-on-profiles'].split(','); + if (pi.activeProfiles) { + const ribbonProfiles = displayRibbonOnProfiles.filter(profile => pi.activeProfiles.includes(profile)); + if (ribbonProfiles.length !== 0) { + pi.ribbonEnv = ribbonProfiles[0]; + } + pi.inProduction = pi.activeProfiles.includes('prod'); + pi.swaggerEnabled = pi.activeProfiles.includes('swagger'); + } + return pi; + }) + ) + .toPromise(); + } + return this.profileInfo; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/polyfills.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/polyfills.ts new file mode 100644 index 0000000000..cf38f3221b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/polyfills.ts @@ -0,0 +1,70 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es7/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ +// import 'intl/locale-data/jsonp/en'; + +require('../manifest.webapp'); diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert-error.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert-error.component.ts new file mode 100644 index 0000000000..6553dcc312 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert-error.component.ts @@ -0,0 +1,115 @@ +import { Component, OnDestroy } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; +import { JhiEventManager, JhiAlertService } from 'ng-jhipster'; +import { Subscription } from 'rxjs'; + +@Component({ + selector: 'jhi-alert-error', + template: ` + ` +}) +export class JhiAlertErrorComponent implements OnDestroy { + alerts: any[]; + cleanHttpErrorListener: Subscription; + /* tslint:disable */ + constructor(private alertService: JhiAlertService, private eventManager: JhiEventManager, private translateService: TranslateService) { + /* tslint:enable */ + this.alerts = []; + + this.cleanHttpErrorListener = eventManager.subscribe('gatewayApp.httpError', response => { + let i; + const httpErrorResponse = response.content; + switch (httpErrorResponse.status) { + // connection refused, server not reachable + case 0: + this.addErrorAlert('Server not reachable', 'error.server.not.reachable'); + break; + + case 400: + const arr = httpErrorResponse.headers.keys(); + let errorHeader = null; + let entityKey = null; + arr.forEach(entry => { + if (entry.toLowerCase().endsWith('app-error')) { + errorHeader = httpErrorResponse.headers.get(entry); + } else if (entry.toLowerCase().endsWith('app-params')) { + entityKey = httpErrorResponse.headers.get(entry); + } + }); + if (errorHeader) { + const entityName = translateService.instant('global.menu.entities.' + entityKey); + this.addErrorAlert(errorHeader, errorHeader, { entityName }); + } else if (httpErrorResponse.error !== '' && httpErrorResponse.error.fieldErrors) { + const fieldErrors = httpErrorResponse.error.fieldErrors; + for (i = 0; i < fieldErrors.length; i++) { + const fieldError = fieldErrors[i]; + if (['Min', 'Max', 'DecimalMin', 'DecimalMax'].includes(fieldError.message)) { + fieldError.message = 'Size'; + } + // convert 'something[14].other[4].id' to 'something[].other[].id' so translations can be written to it + const convertedField = fieldError.field.replace(/\[\d*\]/g, '[]'); + const fieldName = translateService.instant('gatewayApp.' + fieldError.objectName + '.' + convertedField); + this.addErrorAlert('Error on field "' + fieldName + '"', 'error.' + fieldError.message, { fieldName }); + } + } else if (httpErrorResponse.error !== '' && httpErrorResponse.error.message) { + this.addErrorAlert( + httpErrorResponse.error.message, + httpErrorResponse.error.message, + httpErrorResponse.error.params + ); + } else { + this.addErrorAlert(httpErrorResponse.error); + } + break; + + case 404: + this.addErrorAlert('Not found', 'error.url.not.found'); + break; + + default: + if (httpErrorResponse.error !== '' && httpErrorResponse.error.message) { + this.addErrorAlert(httpErrorResponse.error.message); + } else { + this.addErrorAlert(httpErrorResponse.error); + } + } + }); + } + + setClasses(alert) { + return { + toast: !!alert.toast, + [alert.position]: true + }; + } + + ngOnDestroy() { + if (this.cleanHttpErrorListener !== undefined && this.cleanHttpErrorListener !== null) { + this.eventManager.destroy(this.cleanHttpErrorListener); + this.alerts = []; + } + } + + addErrorAlert(message, key?, data?) { + key = key && key !== null ? key : message; + this.alerts.push( + this.alertService.addAlert( + { + type: 'danger', + msg: key, + params: data, + timeout: 5000, + toast: this.alertService.isToast(), + scoped: true + }, + this.alerts + ) + ); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert.component.ts new file mode 100644 index 0000000000..b864f53066 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/alert/alert.component.ts @@ -0,0 +1,34 @@ +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { JhiAlertService } from 'ng-jhipster'; + +@Component({ + selector: 'jhi-alert', + template: ` + ` +}) +export class JhiAlertComponent implements OnInit, OnDestroy { + alerts: any[]; + + constructor(private alertService: JhiAlertService) {} + + ngOnInit() { + this.alerts = this.alertService.get(); + } + + setClasses(alert) { + return { + toast: !!alert.toast, + [alert.position]: true + }; + } + + ngOnDestroy() { + this.alerts = []; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/auth/has-any-authority.directive.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/auth/has-any-authority.directive.ts new file mode 100644 index 0000000000..16a7d40858 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/auth/has-any-authority.directive.ts @@ -0,0 +1,39 @@ +import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; +import { Principal } from 'app/core/auth/principal.service'; + +/** + * @whatItDoes Conditionally includes an HTML element if current user has any + * of the authorities passed as the `expression`. + * + * @howToUse + * ``` + * ... + * + * ... + * ``` + */ +@Directive({ + selector: '[jhiHasAnyAuthority]' +}) +export class HasAnyAuthorityDirective { + private authorities: string[]; + + constructor(private principal: Principal, private templateRef: TemplateRef, private viewContainerRef: ViewContainerRef) {} + + @Input() + set jhiHasAnyAuthority(value: string | string[]) { + this.authorities = typeof value === 'string' ? [value] : value; + this.updateView(); + // Get notified each time authentication state changes. + this.principal.getAuthenticationState().subscribe(identity => this.updateView()); + } + + private updateView(): void { + this.principal.hasAnyAuthority(this.authorities).then(result => { + this.viewContainerRef.clear(); + if (result) { + this.viewContainerRef.createEmbeddedView(this.templateRef); + } + }); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/error.constants.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/error.constants.ts new file mode 100644 index 0000000000..2ebea94220 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/error.constants.ts @@ -0,0 +1,4 @@ +export const PROBLEM_BASE_URL = 'https://www.jhipster.tech/problem'; +export const EMAIL_ALREADY_USED_TYPE = PROBLEM_BASE_URL + '/email-already-used'; +export const LOGIN_ALREADY_USED_TYPE = PROBLEM_BASE_URL + '/login-already-used'; +export const EMAIL_NOT_FOUND_TYPE = PROBLEM_BASE_URL + '/email-not-found'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/input.constants.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/input.constants.ts new file mode 100644 index 0000000000..1e3978a9b3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/input.constants.ts @@ -0,0 +1,2 @@ +export const DATE_FORMAT = 'YYYY-MM-DD'; +export const DATE_TIME_FORMAT = 'YYYY-MM-DDTHH:mm'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/pagination.constants.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/pagination.constants.ts new file mode 100644 index 0000000000..a148d4579b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/constants/pagination.constants.ts @@ -0,0 +1 @@ +export const ITEMS_PER_PAGE = 20; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/index.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/index.ts new file mode 100644 index 0000000000..27d7cc078c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/index.ts @@ -0,0 +1,13 @@ +export * from './constants/error.constants'; +export * from './constants/pagination.constants'; +export * from './constants/input.constants'; +export * from './alert/alert.component'; +export * from './alert/alert-error.component'; +export * from './auth/has-any-authority.directive'; +export * from './language/find-language-from-key.pipe'; +export * from './login/login.component'; +export * from './util/request-util'; +export * from './shared-libs.module'; +export * from './shared-common.module'; +export * from './shared.module'; +export * from './util/datepicker-adapter'; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts new file mode 100644 index 0000000000..0886c9297b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts @@ -0,0 +1,14 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ name: 'findLanguageFromKey' }) +export class FindLanguageFromKeyPipe implements PipeTransform { + private languages: any = { + en: { name: 'English' }, + fr: { name: 'Français' }, + 'pt-br': { name: 'Português (Brasil)' } + // jhipster-needle-i18n-language-key-pipe - JHipster will add/remove languages in this object + }; + transform(lang: string): string { + return this.languages[lang].name; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.html new file mode 100644 index 0000000000..6112e0a657 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.html @@ -0,0 +1,43 @@ + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.ts new file mode 100644 index 0000000000..6715983b2c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/login/login.component.ts @@ -0,0 +1,87 @@ +import { Component, AfterViewInit, Renderer, ElementRef } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { Router } from '@angular/router'; +import { JhiEventManager } from 'ng-jhipster'; + +import { LoginService } from 'app/core/login/login.service'; +import { StateStorageService } from 'app/core/auth/state-storage.service'; + +@Component({ + selector: 'jhi-login-modal', + templateUrl: './login.component.html' +}) +export class JhiLoginModalComponent implements AfterViewInit { + authenticationError: boolean; + password: string; + rememberMe: boolean; + username: string; + credentials: any; + + constructor( + private eventManager: JhiEventManager, + private loginService: LoginService, + private stateStorageService: StateStorageService, + private elementRef: ElementRef, + private renderer: Renderer, + private router: Router, + public activeModal: NgbActiveModal + ) { + this.credentials = {}; + } + + ngAfterViewInit() { + setTimeout(() => this.renderer.invokeElementMethod(this.elementRef.nativeElement.querySelector('#username'), 'focus', []), 0); + } + + cancel() { + this.credentials = { + username: null, + password: null, + rememberMe: true + }; + this.authenticationError = false; + this.activeModal.dismiss('cancel'); + } + + login() { + this.loginService + .login({ + username: this.username, + password: this.password, + rememberMe: this.rememberMe + }) + .then(() => { + this.authenticationError = false; + this.activeModal.dismiss('login success'); + if (this.router.url === '/register' || /^\/activate\//.test(this.router.url) || /^\/reset\//.test(this.router.url)) { + this.router.navigate(['']); + } + + this.eventManager.broadcast({ + name: 'authenticationSuccess', + content: 'Sending Authentication Success' + }); + + // previousState was set in the authExpiredInterceptor before being redirected to login modal. + // since login is succesful, go to stored previousState and clear previousState + const redirect = this.stateStorageService.getUrl(); + if (redirect) { + this.stateStorageService.storeUrl(null); + this.router.navigate([redirect]); + } + }) + .catch(() => { + this.authenticationError = true; + }); + } + + register() { + this.activeModal.dismiss('to state register'); + this.router.navigate(['/register']); + } + + requestResetPassword() { + this.activeModal.dismiss('to state requestReset'); + this.router.navigate(['/reset', 'request']); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/model/quotes/quote.model.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/model/quotes/quote.model.ts new file mode 100644 index 0000000000..a937ab8589 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/model/quotes/quote.model.ts @@ -0,0 +1,12 @@ +import { Moment } from 'moment'; + +export interface IQuote { + id?: number; + symbol?: string; + price?: number; + lastTrade?: Moment; +} + +export class Quote implements IQuote { + constructor(public id?: number, public symbol?: string, public price?: number, public lastTrade?: Moment) {} +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-common.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-common.module.ts new file mode 100644 index 0000000000..af68857fe2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-common.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; + +import { GatewaySharedLibsModule, FindLanguageFromKeyPipe, JhiAlertComponent, JhiAlertErrorComponent } from './'; + +@NgModule({ + imports: [GatewaySharedLibsModule], + declarations: [FindLanguageFromKeyPipe, JhiAlertComponent, JhiAlertErrorComponent], + exports: [GatewaySharedLibsModule, FindLanguageFromKeyPipe, JhiAlertComponent, JhiAlertErrorComponent] +}) +export class GatewaySharedCommonModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-libs.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-libs.module.ts new file mode 100644 index 0000000000..b5fdd1457c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared-libs.module.ts @@ -0,0 +1,26 @@ +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { CommonModule } from '@angular/common'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgJhipsterModule } from 'ng-jhipster'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; +import { CookieModule } from 'ngx-cookie'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; + +@NgModule({ + imports: [ + NgbModule.forRoot(), + NgJhipsterModule.forRoot({ + // set below to true to make alerts look like toast + alertAsToast: false, + alertTimeout: 5000, + i18nEnabled: true, + defaultI18nLang: 'en' + }), + InfiniteScrollModule, + CookieModule.forRoot(), + FontAwesomeModule + ], + exports: [FormsModule, CommonModule, NgbModule, NgJhipsterModule, InfiniteScrollModule, FontAwesomeModule] +}) +export class GatewaySharedLibsModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared.module.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared.module.ts new file mode 100644 index 0000000000..d83c1a54f9 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/shared.module.ts @@ -0,0 +1,15 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap'; + +import { NgbDateMomentAdapter } from './util/datepicker-adapter'; +import { GatewaySharedLibsModule, GatewaySharedCommonModule, JhiLoginModalComponent, HasAnyAuthorityDirective } from './'; + +@NgModule({ + imports: [GatewaySharedLibsModule, GatewaySharedCommonModule], + declarations: [JhiLoginModalComponent, HasAnyAuthorityDirective], + providers: [{ provide: NgbDateAdapter, useClass: NgbDateMomentAdapter }], + entryComponents: [JhiLoginModalComponent], + exports: [GatewaySharedCommonModule, JhiLoginModalComponent, HasAnyAuthorityDirective], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GatewaySharedModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/datepicker-adapter.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/datepicker-adapter.ts new file mode 100644 index 0000000000..61b1bf02dd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/datepicker-adapter.ts @@ -0,0 +1,21 @@ +/** + * Angular bootstrap Date adapter + */ +import { Injectable } from '@angular/core'; +import { NgbDateAdapter, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap'; +import { Moment } from 'moment'; +import * as moment from 'moment'; + +@Injectable() +export class NgbDateMomentAdapter extends NgbDateAdapter { + fromModel(date: Moment): NgbDateStruct { + if (date != null && date.isValid()) { + return { year: date.year(), month: date.month() + 1, day: date.date() }; + } + return null; + } + + toModel(date: NgbDateStruct): Moment { + return date ? moment(date.year + '-' + date.month + '-' + date.day, 'YYYY-MM-DD') : null; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/request-util.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/request-util.ts new file mode 100644 index 0000000000..6579c3cb2a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/shared/util/request-util.ts @@ -0,0 +1,18 @@ +import { HttpParams } from '@angular/common/http'; + +export const createRequestOption = (req?: any): HttpParams => { + let options: HttpParams = new HttpParams(); + if (req) { + Object.keys(req).forEach(key => { + if (key !== 'sort') { + options = options.set(key, req[key]); + } + }); + if (req.sort) { + req.sort.forEach(val => { + options = options.append('sort', val); + }); + } + } + return options; +}; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/app/vendor.ts b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/vendor.ts new file mode 100644 index 0000000000..e8923d5c66 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/app/vendor.ts @@ -0,0 +1,81 @@ +/* after changing this file run 'npm run webpack:build' */ +/* tslint:disable */ +import '../content/scss/vendor.scss'; + +// Imports all fontawesome core and solid icons + +import { library } from '@fortawesome/fontawesome-svg-core'; +import { + faUser, + faSort, + faSortUp, + faSortDown, + faSync, + faEye, + faBan, + faTimes, + faArrowLeft, + faSave, + faPlus, + faPencilAlt, + faBars, + faThList, + faUserPlus, + faRoad, + faTachometerAlt, + faHeart, + faList, + faBell, + faBook, + faHdd, + faFlag, + faWrench, + faClock, + faCloud, + faSignOutAlt, + faSignInAlt, + faCalendarAlt, + faSearch, + faTrashAlt, + faAsterisk, + faTasks, + faHome +} from '@fortawesome/free-solid-svg-icons'; + +// Adds the SVG icon to the library so you can use it in your page +library.add(faUser); +library.add(faSort); +library.add(faSortUp); +library.add(faSortDown); +library.add(faSync); +library.add(faEye); +library.add(faBan); +library.add(faTimes); +library.add(faArrowLeft); +library.add(faSave); +library.add(faPlus); +library.add(faPencilAlt); +library.add(faBars); +library.add(faHome); +library.add(faThList); +library.add(faUserPlus); +library.add(faRoad); +library.add(faTachometerAlt); +library.add(faHeart); +library.add(faList); +library.add(faBell); +library.add(faTasks); +library.add(faBook); +library.add(faHdd); +library.add(faFlag); +library.add(faWrench); +library.add(faClock); +library.add(faCloud); +library.add(faSignOutAlt); +library.add(faSignInAlt); +library.add(faCalendarAlt); +library.add(faSearch); +library.add(faTrashAlt); +library.add(faAsterisk); + +// jhipster-needle-add-element-to-vendor - JHipster will add new menu items here diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster.png b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster.png new file mode 100644 index 0000000000000000000000000000000000000000..141778d482528a8c6636d56d6683f74b21a34394 GIT binary patch literal 9499 zcmX9^WmFtZ*MtDU3GM_!aQEQB-GeV~!FF*A!QEXJ_u$Shun-d5HRuAt-9040x6k+X zndzyjd%I@(o}P31N5^PsDB@yKVj&?R;VLW1=^!B?0}%Hm1`0yC$viheLVA^@rKT&7 zpxMc(|Nj0pGcuQw*K14)6qC{v{iu%UMI_ZEWOe>W#ih0Gj&~6XA|xTBbGy4Lt)PFi zvx-o}q%>rejjmRwMI=-a4l*i6%_$*>e1uhVO7P3ei?XJrl7|Y& zlY*{Sr~a3K&=H_HHROK@P02ww8}rZ4&xlOKg#ZX00dCf3o}Qi{84-vc;dAqQ4iUOo z97RNrr+fb=B6LV*L`!N2!fCkF?I z5%_d&;PU?)0!zqfBYMQ^5LO6h#8^ax-@S@YNJc-O%iV_xJb$^bx&8=OxM!K~1tYzXSCR@smW(Qg!u-WR&-oD|X>YUJs#G>K~ zLlcLX*i_r%g{%F|slM)6Xk}M-Z(RfAc4uW|bYir=u&=$v+TQcx;=;dXJ~u0Cdv>I` z>YJvfCTw7~sCRR5e6X^#WbNo~dh;@-by>tBdLRC4VEITou=V)r&(-N+!^D9_;k<4P zR4sMN($Z2y$Hm45D5_>-3Z9hHceOuIAx11s6HgtDPe`cGSdb&VYyG(=Pun2MYid!LbQ__J`GqKj3Unh2Patj$-{bhK&vi_ut}W zuAH`-mln^Cf90o#jAhxV!~0IQ)_u%95|NPJEh@`N>-w&oEH}k&^WeX>$Q^L8JQD?8N>X-0Yf?;itE(sXCI`_g<5Tk9!PzoR@1QCiO^$ zVfl4SYurMqucnfgDIICu4u<1V_=7FuKVNhFvLAVD?WW!Fe ze`?L?ft1ip{qU2ib&jGi;ro!xtJZYx5Nh0{)QYSCuVzoUpH-RQk(TXGwKrlnaT(*W zEYrQPx922HBCYn~2LB{~<3fh@sD4<`!~--@-bk}ImAF{03uMpiw72F4CsWE^V*0k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%EGFNt&fucYt7JHUQ6=16=<`YnHhA z291E=e2e(A(m5mY{GIk%-Sk~b#C`~Y0@_?mARrWgVAX}&MlpLRwtfKrebnERJ)e>n z+wGtn_Sb4cr@fKWAz8u63;2?U`zP~*FV&U0BN3J#eK0W*Pi{m2Z1Va_r-~pFixWs5 zr8y!M5JL zXUFQ__7@3gYPOs)i>d1L=RHi1=q literal 0 HcmV?d00001 diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster256.png b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster256.png new file mode 100644 index 0000000000000000000000000000000000000000..49d6c76d5d889931b97ea7bce50e970ac5a4eb46 GIT binary patch literal 40780 zcmZ^~1yCMAvo5?Z?ry=|o#5{7PH=a3eF+XBxVyVUfZzlt!QI_0xbx>b=Uk~<^>5YI z%=A9pJ>63~+dVTIrJ^K_jDU{-006SAjD#8hfc{lM036J}Lf^IA@?QaEC8{V201a`7 zuO`s{+N5SOYKj2hOAP?vPyl%TM*<%KfCno8oEQTDUpfHbI%oe>75Mi6-dRT1?Oz+? zKR3uKZ|0u{2t*qV9d{i?1wJz;2WAs(m#bmQ|D zB>yi2-@p2Q$SmZf{{?Zk6C~GBR3R02a`ea!}5RA{$ISZ ztBu7!`~IUwi0yyy|2OUb#j995xjX&ywX2PptfRYy>px}x!~MTH`2UaiA6Wt{|8dv< z<-Y$OoByKz8yq170ha$g&_W2|GqsceAOgrrh-!F)&T?S0*R?$kFRNy&e48k}<TgRJpL(pL3};1_lX9#|NgAC>8&=3=Nq-txCQ3-cKcOiZJsn+o#sj|Jg-ROq{aOd5Un|+mN745-Qq8q?^||id@T->AHFgBn9@mdyX3WqYu3a%FG{}!i1zI;z2Te_d zvrgl+b`3rzo<;5VCyv4HV^O%iJ7gr3<2&UU<{OW+5&tKmpsNbp3Wl}8#y?r&?J}07 z4zy)?S;Vvy;P&Iiuy{KecHhwGJ%}A`q18qKETtYpR{tX4-2>u$+_s7VdTN3yQI)L@s*PIc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c00000 literal 0 HcmV?d00001 diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster2x.png b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster2x.png new file mode 100644 index 0000000000000000000000000000000000000000..4751c91680c4ecb0fab13de77eee534be6cc2285 GIT binary patch literal 18872 zcmYg%byyqE_jPf1cekR&-QA^Vu;P*+Emoi{?(R}rq__tN?(QxjxLeR7Ev0?)`TqWS z_sO%l_sqHH-r1Q=b~lq)eO)y?Y-;RRuU_G4s4E-3dW8&m^$KMV69s{Ew|K<2TRiAl#Rygi{#aeWfTqMRNmel?H~+EIUQ|-cT)1Y z(hB-=%5NXe4iE@9HAGTQS4L4EoErM_^3s$R_HeX$zq6#N|L*VKzl|v&h#=H^BvaY{DszZb%ej!Q>Wh~OYnBV-Yr|HBbdB9dxC?<35^1;n*`x9M_wbe`QRnv{dGv(>ecb6ey@k$yN zrRB9N=Lgqf;MzzuX_Jy8;939KF}4hJKX%=xYUA*}55ytx<;@5 z;$R9>{B@?`Fs@@O=zCuFSCx#lIJ}bz{OGejpPOayQ}^hozPQaLH3iyt*D%#~J?9FW z?(aNWIjw`u*JT}@=dh?azJK*fO;$r$;cdYB#YUqCOn?yGwj3R^I|NA~p0O_<-Tih! z;_0yqC7UJ&|6Np}*V74T0lC&U4QTjw-{N1ZggS&Fd;jJHkLdr~Uicv@=2`7kaH*cjTct?RHAbU?fvA(a44XHU7UyqH z``++#cuuzYEk1USXaM~a=Dq)Eni`@7==@7Lfnb8%0+FlX)GtIPXv-RK@l?bQ=BTx zjA02sRrE?Zt*Z3ts`2+V=C;C> z_m5M&R$zEa-{X;G+6wd2^^MpRFRvHnV%RWM`U3Nljgj?H7Bd;Ip}0GGTx~o)h%ltR zR7DljqJghx?aW{5+Z}40si->hiYf)5n~R)wgf8GpzUlIVh-V@_3##@)FMrOhuadBB z^xKyS>f*RsBLc>!ozN`3+N*m^zN)pnJHyFO0v60I77gshYh}IbyMKA_->M%4Qf0>2 z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hgr&)6BQ0Y%z~foTk%r1+1&Nu}esjUMk=Ut1cnw zsD7w`uQ_!INoV`GX(Ghbv^Q6+bf|#qEJC+QpB^hc|86W=sU`@9wKaz{w>{`oMmPbhJ4jt>uRgR%(_SlJ zU3;B;Rl03T$}t7Qb{h4%E~U2Z%lG(qx@-+-6JX&%3n0UYb-id2-0)&euey#l0cH-; zd`uJIVXwKECcs5gOSB0HW~Unwy~X;T^eto)u%$Few5&Jocu{0K{}RyzOtYPTozy(HDDjj@BXnz5DZ1$W80HAew1O%du)5e@i}tlV_S(X0Xg%r zt;8$=Kdjb|;HV54+q5msEhd?78zgcG$Qh??`Avoi_S*)^7CHNEgZQ6MD6soTD6cK9 zvR{&MnS+e~l8i|La`sCylHwQ&Q?{%dkg?zG5){W+fZZ;c1dK%3?TT+D;8UEk<-7rx z><=Kx+oHrjNkiEpAvL%v$kq7}WA_?e)DO(~57z>bFB$9w$n6hQJi(Z(r zWw(nl|CD&mk_-buUR$;exDeyDW!r$EAg?Xk1`I?gTgJ8+h*GwkNpZ8$3ivss=fN_z70{0Jv zvLi#zeN9Gdi=6%7mev+U-lGKKUnnvEO-7CeMb`HX1QPzYbH_LggD@0^Wo2RT<`GXF zaFl!a{#WW=B~_bL0o4CHgZ1=;0UQ{4Pew<;p0Qhk@F6qyjeMJia|9e4cH_V`8r-5d zVT<{g5Vn|)31N%*nCDLjs|MVt1ZTFG&r*eofca?TMb4%H_p`_=oMMYEtVx~~WG#9r z)$Mda)xxv_00000006*0cmhdadc5A5%OU^(002ovPDHLkV1fXQwKxC( literal 0 HcmV?d00001 diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster384.png b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster384.png new file mode 100644 index 0000000000000000000000000000000000000000..616e470fce11f7fe316c88feb9e9e68f9ec06cdd GIT binary patch literal 58618 zcmZ^~1yCHpw=cZAxVuBp;O?%$-3jgvi%YP@LvRf)!8N!$3GVLh9vp&vzEcVY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h0Gmb*Uwlj?c7&j zBf~j1N|%sarBYNRnBhR_E(!vtNJKg6n4mX=EXK3I%eOs5`S1HD-oHotp z#)d$xhyfZK%C*otVLB0`fMm0%B|i|}r4X|Q)4=^HRZfS?Tgp(Iyb|K`5~7|jAsPAX z$zAJqDdZoDdX$X69+AI{GjLX-DhPoXnvEdXe zo{?x$8YBb|3myS?jk(QmAHOIjELyOM00;nPosX7OGh+> z>Zr0Yq(=6d?S~hlh`$Ahuj1_E3WI}hHPa@EooT*&91vg^AflDUx9*)6n-kjy5m+xEi`{{(wIC!<#ghn(UTS6zyFqE3w07txTqLojTjqI1Ww z%egnOj$OkVGoH9sBx62z3B<4+_sT>(CuCr9#^=;o3p+3>kF~UGh0M8!`?svPHE4EI z^)rCO?ETv$0JCuHBhK$rTYvlk*G}%nqS^-GH?ge)muQGcLPQhenH$383uh@m6Kkk2my`Aaz~0Ci($q>z=75W7wyP8vTk2oBlVRbd+;-ilIH26HLip5Ja+5$OGg zj6iAAn&H_8f$=Qz*$0)`&|@WU4-nAOyPmxRL~)xDOMXmo>;-lN%Dxe?f=DV|B&iTp zA}gVBX-ge!dWHO7$p024dJQdp;CTD#e?~}N9X5)*xn5=al`xo!XNW=Pwtf>EMoKSN zs_fj^cZugDuSQ2}J#hRe1MrD>+r9q685vy?fs!o^Ncx!tzyc?Kkof^;RW?5Oh-M zKri4IK}e{xXni1}*Vs7x)yq21pZd`)Z60r+S1^@N2s9K>#$LLj6@-53m!>tx}Ad`m+}T{{x?%uCAflIm`e6002ovPDHLkV1mqw&gTFC literal 0 HcmV?d00001 diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster512.png b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/hipster512.png new file mode 100644 index 0000000000000000000000000000000000000000..61a543639d4bbb394659612fe1a919af9245b09c GIT binary patch literal 80621 zcmZ^~1yq#L(=fh8cT0zWNS8G1(kLm2gmiaz?NWl$qNIePfJ#f(E+HY^2uMgbNW-%G z$K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Gtyo+0zj*DDe})1ey*XiD%@(nh4^Z^@fMHwGT1%+Alu^O3*~?1XlmBinjBZ%>)wmfSLE@kG z`E3vY;W4m89RYk48(nez=lt-MVBzt$TEw-S3oDV&K=p18=N~Z?z#al=0Ac_h6*cUK zh8T#S`q3U@=Q$AlgkzvSKK}F<=Kfd>mrk7M$H626fh>W*P;8)CGIZ0;%!fdSEcKkv z{AzO0a&Cu)_>BxQ<0EAnUUR=yW&-_N%l;{!mEgl5rqt*I(g!YqLRy<5F8V9+M$BcOgT9^OVU-7l^B{N=w@Sq$Y=r7R&?$ ztl`EE4Sx6^M(v)54PNeuy7uFR(c)b%es@uaQXd;4;&1pei3WDTq@jjD3WY&(1qx0c zsd8eaGvQM3Cd}F*%tr;fLSg{%=YjVX_a??!(xQS+J>>>?nh7L9NFN1C5fOAn6#0J@ zjm7@`*)LtTNmZuSg5msh0<8Iw6%gS1H_1RC(;=YOsoJaOeEOd8uI(;|Q2rzMaKkUA ztKB{ig2=&h8F7g0{Qw$ShZ{eMMItYFfymxzdrBJVlOR#AIqfGvk-m$#p1_xRrtcuW z5QVT%ic2b8H!>Zh-1~sF7h^6*lBolFt{5zPvgiBUZE}Jn77b(J!Msyed6xSvt2OeB z@9Q7c8RXw*n3@8a1A)H35t-9>)02FIK+;s6D0Ax1$Q58Z)ei{#e|}6g*XgzN Ql>h($07*qoM6N<$f;kaE>i_@% literal 0 HcmV?d00001 diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/logo-jhipster.png b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/images/logo-jhipster.png new file mode 100644 index 0000000000000000000000000000000000000000..d8eb48da05c157571eed9fd7303f8d9566f2ea12 GIT binary patch literal 4459 zcmX|E1yB@V)238FK~j(qNkODUIgmU;(gO(*P${JZ=?3XM8YCs8kB$SRLmH0mJmRPW zjygDwxc}z=zWHYM-FJ7N_u1LmnVoqzLJOo!LC!=@KtMpDs-mckzrWy*J1H?wbcBiIKI{l~?l|FQ8}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)92o+OptB0cG)f2QenpN3%SK()G}pmOAlw z;V;Jwcr|pc#yOsi56A88BsX<;n2T)0tR0GbJy)a7-P(#?h^R6XWKI%WT7KU6cp-*R z))-sFUI}hMaGi<1v`^3KwoTO_t8^(e3a7-hm!*xWFPbp+EwlW9yJpo7k#tVp&AMy; z#CbKRssTPPgTz{;cG&P;ks zCK=NTkv9~J{(jY(&vi7QzQQ9lx=r>(=q&3?vC>x^g}V9qA>|GH7n1e49$HhxbtU@g zurasC?2 zpSV+LOR8ry;d`rq(;nM7)zD9dFL{I_1L02;h}u;-T540Mdh%O!qAiX#0I033rG@sF zE2bjRr?i0+V&4KPU+*S)8gzLt2{=cb-f5fwSu!NL9kRsxyI5Wy{BH1S*SIUbnj7N5 z)z=`wLHg%o+dEN3XJZ3}XboI|; zw$wN=wz)#G?^5$Q!+%HHMa1(5bUTtD5l$oW;ld;pfXmx1N);-qi09(zj-6xLsoZy# zh|R~HP;R-_X$X7Y8n3}XK5k{?}!pLX)rY{_UUfu#VUb{(7$|a7K169Sg5ld|Up*q5gfl@ChTK{qZb-;uhx{ z%Le-;u|%5UOyw@?F@^HCuF24RY9Tl4+EJz0mxdoQbg^08G$ltWIH#SyQNI=xu5?;>Amv4PB-Q^XbyB^*O>oqurI-2z% z!jbbv%2#2{(TNFfSgsq^=P&*(*RFTQ_h$ra)tsTv`UZg2)!u%L7>I0ns=5mEd%93d z+8wSQITdztdd2Y6zgp|W%g~Pn%SlLH1E{=v;gI}il|Nejy>9U@njE5pAqF7{(B77$ zxCCgZNhcTgmMK(^Ebz7V3mGcw`>pP&!(XFjttWpDNu;5&E=Re+w3=^x{~)19f+~iOopzsOqPCO^+0B(Q-PVeg^emHYpY_2J|xyo{9yA9|~+- zJAJ6^(+%oCu?Z%sbAJ$nxYItG!)yi|5FAz-T-idyryDq%Y2fLrVX#vSEo4bEb=*@VxG&b#1g` element. + +$body-bg: #e4e5e6; + +// Typography: +// Font, line-height, and color for body text, headings, and more. + +$font-size-base: 1rem; diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/global.scss b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/global.scss new file mode 100644 index 0000000000..cfbb9bf5b8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/global.scss @@ -0,0 +1,226 @@ +@import 'bootstrap-variables'; + +/* ============================================================== +Bootstrap tweaks +===============================================================*/ + +body, +h1, +h2, +h3, +h4 { + font-weight: 300; +} + +a { + color: #533f03; + font-weight: bold; +} + +a:hover { + color: #533f03; + font-weight: bold; + /* make sure browsers use the pointer cursor for anchors, even with no href */ + cursor: pointer; +} + +/* ========================================================================== +Browser Upgrade Prompt +========================================================================== */ +.browserupgrade { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} + +/* ========================================================================== +Generic styles +========================================================================== */ + +/* Error highlight on input fields */ +.ng-valid[required], +.ng-valid.required { + border-left: 5px solid green; +} + +.ng-invalid:not(form) { + border-left: 5px solid red; +} + +/* other generic styles */ + +.jh-card { + padding: 1.5%; + margin-top: 20px; + border: none; +} + +.error { + color: white; + background-color: red; +} + +.pad { + padding: 10px; +} + +.w-40 { + width: 40% !important; +} + +.w-60 { + width: 60% !important; +} + +.break { + white-space: normal; + word-break: break-all; +} + +.readonly { + background-color: #eee; + opacity: 1; +} + +.footer { + border-top: 1px solid rgba(0, 0, 0, 0.125); +} + +.hand, +[jhisortby] { + cursor: pointer; +} + +/* ========================================================================== +Custom alerts for notification +========================================================================== */ +.alerts { + .alert { + text-overflow: ellipsis; + pre { + background: none; + border: none; + font: inherit; + color: inherit; + padding: 0; + margin: 0; + } + .popover pre { + font-size: 10px; + } + } + .toast { + position: fixed; + width: 100%; + &.left { + left: 5px; + } + &.right { + right: 5px; + } + &.top { + top: 55px; + } + &.bottom { + bottom: 55px; + } + } +} + +@media screen and (min-width: 480px) { + .alerts .toast { + width: 50%; + } +} + +/* ========================================================================== +entity tables helpers +========================================================================== */ + +/* Remove Bootstrap padding from the element +http://stackoverflow.com/questions/19562903/remove-padding-from-columns-in-bootstrap-3 */ +@mixin no-padding($side) { + @if $side == 'all' { + .no-padding { + padding: 0 !important; + } + } @else { + .no-padding-#{$side} { + padding-#{$side}: 0 !important; + } + } +} +@include no-padding('left'); +@include no-padding('right'); +@include no-padding('top'); +@include no-padding('bottom'); +@include no-padding('all'); + +/* bootstrap 3 input-group 100% width +http://stackoverflow.com/questions/23436430/bootstrap-3-input-group-100-width */ +.width-min { + width: 1% !important; +} + +/* Makes toolbar not wrap on smaller screens +http://www.sketchingwithcss.com/samplechapter/cheatsheet.html#right */ +.flex-btn-group-container { + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + flex-direction: row; + -webkit-justify-content: flex-end; + justify-content: flex-end; +} + +/* ========================================================================== +entity detail page css +========================================================================== */ +.row.jh-entity-details > { + dd { + margin-bottom: 15px; + } +} + +@media screen and (min-width: 768px) { + .row.jh-entity-details > { + dt { + margin-bottom: 15px; + } + dd { + border-bottom: 1px solid #eee; + padding-left: 180px; + margin-left: 0; + } + } +} + +/* ========================================================================== +ui bootstrap tweaks +========================================================================== */ +.nav, +.pagination, +.carousel, +.panel-title a { + cursor: pointer; +} + +.datetime-picker-dropdown > li.date-picker-menu div > table .btn-default, +.uib-datepicker-popup > li > div.uib-datepicker > table .btn-default { + border: 0; +} + +.datetime-picker-dropdown > li.date-picker-menu div > table:focus, +.uib-datepicker-popup > li > div.uib-datepicker > table:focus { + outline: none; +} + +.thread-dump-modal-lock { + max-width: 450px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +/* jhipster-needle-scss-add-main JHipster will add new css style */ diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/vendor.scss b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/vendor.scss new file mode 100644 index 0000000000..12a8f54b83 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/content/scss/vendor.scss @@ -0,0 +1,12 @@ +/* after changing this file run 'npm run webpack:build' */ + +/*************************** +put Sass variables here: +eg $input-color: red; +****************************/ +// Override Boostrap variables +@import 'bootstrap-variables'; +// Import Bootstrap source files from node_modules +@import '~bootstrap/scss/bootstrap'; + +/* jhipster-needle-scss-add-vendor JHipster will add new css style */ diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/favicon.ico b/jhipster/jhipster-uaa/gateway/src/main/webapp/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..44c7595f58f5a2c52f5e21451e5e6868d6caea7f GIT binary patch literal 5430 zcmbVQX-r(#6@F949v6{~8a{D_jOKcXm#nzTRCEmGSkiK--0)hcb>)OEbZ z#jIvC#%9NW&0@@E%)T3&0fWIXz|1fVFboX)j=?|(s}278oeR$$LkW(NKb<%CopZl) z&pq$lbFFEQY2VSFdrqU=qwRe{(_YdvZO@*K-@3&@8Cw~B5y%R1Zb>5jf>IBHT+Zm7oK!~~ko{RPeOf5+UyA}*w+ zqt{%7_BIRZ+h%5TJ6%>7hy3k>v#@0zL%*pQ!!4yS=LEo7oq<7P7J7{Nu;=^0-r0uo z`hj5GPM6&8`u?eV$jYxmRaFDBvrA#^8b^EoEG}miqq?RMm$J&xJ+>?{P15aj$=DBd z4lkpj{T5P-EGVsYqGNDLp~5)8{V=1}I!=t@%afN4x}7dLHfHRYL|gv?I)|2Nw}|$E z|3T*N8ePGqGAs8n*RI>?lKi&Nq)PNotU`3_+a`!fIEGi?9J>SO_$qGNCR9E!zshwx zU2-hcJtR-%n&jKDpllpFl>_DrVl(OxnNrQMEKpCri685By5!gohzUaFs&8}|ZA;)6 zeT8{j%>2(2Tfqm!w)~SZ;$@;wa^0Kxdh&cF?Q+#T@|*AWZR+i0FLOLY{E7H2=Lw=8 zwoapNfwfZQ5XbeLc|b~jh!3o32EV8h%_pL08+4wXq${V(^M2Ou`&{ZfIF*Hi ze(5+w@EcX{HtMm|^gOVp`^cX8MVD-%RAbIP%KBe&U9b2d@eWC>L{gp!@!3r{9bciw zWc{M6OY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B9WzF+$NF2=*j`6Vu{{lEU)*1xEH5*;}!pjHvy*x{7##wjd-XmwRoY$PY>>>Ee8k~u}{lTy#V>s9)dqy`UdIkg5t{6 ze6rt?i)QYBNsSX1@|uWd-sO5&*XA+Ab5HmNrsPb7iktW@ahH9U`N%DJ^C9@(7hUOl z4*6dKdwiU~To3m2Y95(yzfY>l=fm7n_E?BxUrRKmpvCyPq{>6!OSMFfW z`;E0ve51}2#DMr9eoHSUoClecZrm47j{8QH!iV=i@9-jcN0upH_OnlsZ&bcL@lWmu zF6%Z5x8NbxFM4~0e=B4@;g-8&U|a>r*U>7*N~-;&;Zi`~z4ZjleUe&s9mlU?WXPxku_;{KXlpC6Hb`&{9L8sq*h{|}>x zd$K_8CGvz4-*x5N`n-*QYour user account has been activated. Please ", + "error": "Your user could not be activated. Please use the registration form to sign up." + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/audits.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/audits.json new file mode 100644 index 0000000000..ed5e16d4c5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/audits.json @@ -0,0 +1,27 @@ +{ + "audits": { + "title": "Audits", + "filter": { + "title": "Filter per date", + "from": "from", + "to": "to", + "button": { + "weeks": "Weeks", + "today": "today", + "clear": "clear", + "close": "close" + } + }, + "table": { + "header": { + "principal": "User", + "date": "Date", + "status": "State", + "data": "Extra data" + }, + "data": { + "remoteAddress": "Remote Address:" + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/configuration.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/configuration.json new file mode 100644 index 0000000000..81e208de5c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/configuration.json @@ -0,0 +1,10 @@ +{ + "configuration": { + "title": "Configuration", + "filter": "Filter (by prefix)", + "table": { + "prefix": "Prefix", + "properties": "Properties" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/error.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/error.json new file mode 100644 index 0000000000..943389899c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/error.json @@ -0,0 +1,13 @@ +{ + "error": { + "title": "Error page!", + "http": { + "400": "Bad request.", + "403": "You are not authorized to access this page.", + "405": "The HTTP verb you used is not supported for this URL.", + "500": "Internal server error." + }, + "concurrencyFailure": "Another user modified this data at the same time as you. Your changes were rejected.", + "validation": "Validation error on the server." + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/gateway.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/gateway.json new file mode 100644 index 0000000000..6eb7791bc2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/gateway.json @@ -0,0 +1,15 @@ +{ + "gateway": { + "title": "Gateway", + "routes": { + "title": "Current routes", + "url": "URL", + "service": "Service", + "servers": "Available servers", + "error": "Warning: no server available!" + }, + "refresh": { + "button": "Refresh" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/global.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/global.json new file mode 100644 index 0000000000..2de18534e0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/global.json @@ -0,0 +1,138 @@ +{ + "global": { + "title": "Gateway", + "browsehappy": "You are using an outdated browser. Please upgrade your browser to improve your experience.", + "menu": { + "home": "Home", + "jhipster-needle-menu-add-element": "JHipster will add additional menu entries here (do not translate!)", + "entities": { + "main": "Entities", + "quotesQuote": "Quote", + "jhipster-needle-menu-add-entry": "JHipster will add additional entities here (do not translate!)" + }, + "account": { + "main": "Account", + "settings": "Settings", + "password": "Password", + "sessions": "Sessions", + "login": "Sign in", + "logout": "Sign out", + "register": "Register" + }, + "admin": { + "main": "Administration", + "gateway": "Gateway", + "userManagement": "User management", + "tracker": "User tracker", + "metrics": "Metrics", + "health": "Health", + "configuration": "Configuration", + "logs": "Logs", + "audits": "Audits", + "apidocs": "API", + "database": "Database", + "jhipster-needle-menu-add-admin-element": "JHipster will add additional menu entries here (do not translate!)" + }, + "language": "Language" + }, + "form": { + "username": "Username", + "username.placeholder": "Your username", + "currentpassword": "Current password", + "currentpassword.placeholder": "Current password", + "newpassword": "New password", + "newpassword.placeholder": "New password", + "confirmpassword": "New password confirmation", + "confirmpassword.placeholder": "Confirm the new password", + "email": "Email", + "email.placeholder": "Your email" + }, + "messages": { + "info": { + "authenticated": { + "prefix": "If you want to ", + "link": "sign in", + "suffix": ", you can try the default accounts:
- Administrator (login=\"admin\" and password=\"admin\")
- User (login=\"user\" and password=\"user\")." + }, + "register": { + "noaccount": "You don't have an account yet?", + "link": "Register a new account" + } + }, + "error": { + "dontmatch": "The password and its confirmation do not match!" + }, + "validate": { + "newpassword": { + "required": "Your password is required.", + "minlength": "Your password is required to be at least 4 characters.", + "maxlength": "Your password cannot be longer than 50 characters.", + "strength": "Password strength:" + }, + "confirmpassword": { + "required": "Your confirmation password is required.", + "minlength": "Your confirmation password is required to be at least 4 characters.", + "maxlength": "Your confirmation password cannot be longer than 50 characters." + }, + "email": { + "required": "Your email is required.", + "invalid": "Your email is invalid.", + "minlength": "Your email is required to be at least 5 characters.", + "maxlength": "Your email cannot be longer than 50 characters." + } + } + }, + "field": { + "id": "ID" + }, + "ribbon": { + "dev":"Development" + }, + "item-count": "Showing {{first}} - {{second}} of {{total}} items." + }, + "entity": { + "action": { + "addblob": "Add blob", + "addimage": "Add image", + "back": "Back", + "cancel": "Cancel", + "delete": "Delete", + "edit": "Edit", + "open": "Open", + "save": "Save", + "view": "View" + }, + "detail": { + "field": "Field", + "value": "Value" + }, + "delete": { + "title": "Confirm delete operation" + }, + "validation": { + "required": "This field is required.", + "minlength": "This field is required to be at least {{ min }} characters.", + "maxlength": "This field cannot be longer than {{ max }} characters.", + "min": "This field should be at least {{ min }}.", + "max": "This field cannot be more than {{ max }}.", + "minbytes": "This field should be at least {{ min }} bytes.", + "maxbytes": "This field cannot be more than {{ max }} bytes.", + "pattern": "This field should follow pattern for {{ pattern }}.", + "number": "This field should be a number.", + "datetimelocal": "This field should be a date and time.", + "patternLogin": "This field can only contain letters, digits and e-mail addresses." + } + }, + "error": { + "internalServerError": "Internal server error", + "server.not.reachable": "Server not reachable", + "url.not.found": "Not found", + "NotNull": "Field {{ fieldName }} cannot be empty!", + "Size": "Field {{ fieldName }} does not meet min/max size requirements!", + "userexists": "Login name already used!", + "emailexists": "Email is already in use!", + "idexists": "A new {{ entityName }} cannot already have an ID", + "idnull": "Invalid ID" + }, + "footer": "This is your footer" +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/health.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/health.json new file mode 100644 index 0000000000..6084146524 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/health.json @@ -0,0 +1,32 @@ +{ + "health": { + "title": "Health Checks", + "refresh.button": "Refresh", + "stacktrace": "Stacktrace", + "details": { + "details": "Details", + "properties": "Properties", + "name": "Name", + "value": "Value", + "error": "Error" + }, + "indicator": { + "discoveryComposite": "Discovery Composite", + "refreshScope": "Microservice Refresh Scope", + "configServer": "Microservice Config Server", + "hystrix": "Hystrix", + "diskSpace": "Disk space", + "mail": "Email", + "db": "Database" + }, + "table": { + "service": "Service name", + "status": "Status" + }, + "status": { + "UNKNOWN": "UNKNOWN", + "UP": "UP", + "DOWN": "DOWN" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/home.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/home.json new file mode 100644 index 0000000000..402f18700a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/home.json @@ -0,0 +1,19 @@ +{ + "home": { + "title": "Welcome, Java Hipster!", + "subtitle": "This is your homepage", + "logged": { + "message": "You are logged in as user \"{{username}}\"." + }, + "question": "If you have any question on JHipster:", + "link": { + "homepage": "JHipster homepage", + "stackoverflow": "JHipster on Stack Overflow", + "bugtracker": "JHipster bug tracker", + "chat": "JHipster public chat room", + "follow": "follow @java_hipster on Twitter" + }, + "like": "If you like JHipster, don't forget to give us a star on", + "github": "GitHub" + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/login.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/login.json new file mode 100644 index 0000000000..3a000852e6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/login.json @@ -0,0 +1,19 @@ +{ + "login": { + "title": "Sign in", + "form": { + "password": "Password", + "password.placeholder": "Your password", + "rememberme": "Remember me", + "button": "Sign in" + }, + "messages": { + "error": { + "authentication": "Failed to sign in! Please check your credentials and try again." + } + }, + "password" : { + "forgot": "Did you forget your password?" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/logs.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/logs.json new file mode 100644 index 0000000000..a614b128da --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/logs.json @@ -0,0 +1,11 @@ +{ + "logs": { + "title": "Logs", + "nbloggers": "There are {{ total }} loggers.", + "filter": "Filter", + "table": { + "name": "Name", + "level": "Level" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/metrics.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/metrics.json new file mode 100644 index 0000000000..9d804947c5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/metrics.json @@ -0,0 +1,101 @@ +{ + "metrics": { + "title": "Application Metrics", + "refresh.button": "Refresh", + "updating": "Updating...", + "jvm": { + "title": "JVM Metrics", + "memory": { + "title": "Memory", + "total": "Total Memory", + "heap": "Heap Memory", + "nonheap": "Non-Heap Memory" + }, + "threads": { + "title": "Threads", + "all": "All", + "runnable": "Runnable", + "timedwaiting": "Timed waiting", + "waiting": "Waiting", + "blocked": "Blocked", + "dump": { + "title": "Threads dump", + "id": "Id: ", + "blockedtime": "Blocked Time", + "blockedcount": "Blocked Count", + "waitedtime": "Waited Time", + "waitedcount": "Waited Count", + "lockname": "Lock name", + "stacktrace": "Stacktrace", + "show": "Show Stacktrace", + "hide": "Hide Stacktrace" + } + }, + "gc": { + "title": "Garbage collections", + "marksweepcount": "Mark Sweep count", + "marksweeptime": "Mark Sweep time", + "scavengecount": "Scavenge count", + "scavengetime": "Scavenge time" + }, + "http": { + "title": "HTTP requests (events per second)", + "active": "Active requests:", + "total": "Total requests:", + "table": { + "code": "Code", + "count": "Count", + "mean": "Mean", + "average": "Average" + }, + "code": { + "ok": "Ok", + "notfound": "Not found", + "servererror": "Server Error" + } + } + }, + "servicesstats": { + "title": "Services statistics (time in millisecond)", + "table": { + "name": "Service name", + "count": "Count", + "mean": "Mean", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + }, + "cache": { + "title": "Cache statistics", + "cachename": "Cache name", + "hits": "Cache Hits", + "misses": "Cache Misses", + "gets": "Cache Gets", + "puts": "Cache Puts", + "removals": "Cache Removals", + "evictions": "Cache Evictions", + "hitPercent": "Cache Hit %", + "missPercent": "Cache Miss %", + "averageGetTime": "Average get time (µs)", + "averagePutTime": "Average put time (µs)", + "averageRemoveTime": "Average remove time (µs)" + }, + "datasource": { + "usage": "Usage", + "title": "DataSource statistics (time in millisecond)", + "name": "Pool usage", + "count": "Count", + "mean": "Mean", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/password.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/password.json new file mode 100644 index 0000000000..46227a7702 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/password.json @@ -0,0 +1,12 @@ +{ + "password": { + "title": "Password for [{{username}}]", + "form": { + "button": "Save" + }, + "messages": { + "error": "An error has occurred! The password could not be changed.", + "success": "Password changed!" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/quotesQuote.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/quotesQuote.json new file mode 100644 index 0000000000..f538c6c895 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/quotesQuote.json @@ -0,0 +1,28 @@ + +{ + "gatewayApp": { + "quotesQuote" : { + "home": { + "title": "Quotes", + "createLabel": "Create a new Quote", + "createOrEditLabel": "Create or edit a Quote" + }, + "delete": { + "question": "Are you sure you want to delete Quote {{ id }}?" + }, + "detail": { + "title": "Quote" + }, + "symbol": "Symbol", + "price": "Price", + "lastTrade": "Last Trade" + } + }, + "quotesApp": { + "quotesQuote" : { + "created": "A new Quote is created with identifier {{ param }}", + "updated": "A Quote is updated with identifier {{ param }}", + "deleted": "A Quote is deleted with identifier {{ param }}" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/register.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/register.json new file mode 100644 index 0000000000..3a03980bf2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/register.json @@ -0,0 +1,24 @@ +{ + "register": { + "title": "Registration", + "form": { + "button": "Register" + }, + "messages": { + "validate": { + "login": { + "required": "Your username is required.", + "minlength": "Your username is required to be at least 1 character.", + "maxlength": "Your username cannot be longer than 50 characters.", + "pattern": "Your username can only contain letters and digits." + } + }, + "success": "Registration saved! Please check your email for confirmation.", + "error": { + "fail": "Registration failed! Please try again later.", + "userexists": "Login name already registered! Please choose another one.", + "emailexists": "Email is already in use! Please choose another one." + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/reset.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/reset.json new file mode 100644 index 0000000000..92edb191cd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/reset.json @@ -0,0 +1,27 @@ +{ + "reset": { + "request": { + "title": "Reset your password", + "form": { + "button": "Reset password" + }, + "messages": { + "info": "Enter the email address you used to register", + "success": "Check your emails for details on how to reset your password.", + "notfound": "Email address isn't registered! Please check and try again" + } + }, + "finish" : { + "title": "Reset password", + "form": { + "button": "Validate new password" + }, + "messages": { + "info": "Choose a new password", + "success": "Your password has been reset. Please ", + "keymissing": "The reset key is missing.", + "error": "Your password couldn't be reset. Remember a password request is only valid for 24 hours." + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/sessions.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/sessions.json new file mode 100644 index 0000000000..d410035ee7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/sessions.json @@ -0,0 +1,15 @@ +{ + "sessions": { + "title": "Active sessions for [{{username}}]", + "table": { + "ipaddress": "IP address", + "useragent": "User Agent", + "date": "Date", + "button": "Invalidate" + }, + "messages": { + "success": "Session invalidated!", + "error": "An error has occurred! The session could not be invalidated." + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/settings.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/settings.json new file mode 100644 index 0000000000..d941381969 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/settings.json @@ -0,0 +1,32 @@ +{ + "settings": { + "title": "User settings for [{{username}}]", + "form": { + "firstname": "First Name", + "firstname.placeholder": "Your first name", + "lastname": "Last Name", + "lastname.placeholder": "Your last name", + "language": "Language", + "button": "Save" + }, + "messages": { + "error": { + "fail": "An error has occurred! Settings could not be saved.", + "emailexists": "Email is already in use! Please choose another one." + }, + "success": "Settings saved!", + "validate": { + "firstname": { + "required": "Your first name is required.", + "minlength": "Your first name is required to be at least 1 character", + "maxlength": "Your first name cannot be longer than 50 characters" + }, + "lastname": { + "required": "Your last name is required.", + "minlength": "Your last name is required to be at least 1 character", + "maxlength": "Your last name cannot be longer than 50 characters" + } + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/user-management.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/user-management.json new file mode 100644 index 0000000000..30c125b6d0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/en/user-management.json @@ -0,0 +1,30 @@ +{ + "userManagement": { + "home": { + "title": "Users", + "createLabel": "Create a new user", + "createOrEditLabel": "Create or edit a user" + }, + "created": "A new user is created with identifier {{ param }}", + "updated": "An user is updated with identifier {{ param }}", + "deleted": "An user is deleted with identifier {{ param }}", + "delete": { + "question": "Are you sure you want to delete user {{ login }}?" + }, + "detail": { + "title": "User" + }, + "login": "Login", + "firstName": "First name", + "lastName": "Last name", + "email": "Email", + "activated": "Activated", + "deactivated": "Deactivated", + "profiles": "Profiles", + "langKey": "Language", + "createdBy": "Created by", + "createdDate": "Created date", + "lastModifiedBy": "Modified by", + "lastModifiedDate": "Modified date" + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/activate.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/activate.json new file mode 100644 index 0000000000..d9a3de0b24 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/activate.json @@ -0,0 +1,9 @@ +{ + "activate": { + "title": "Activation", + "messages": { + "success": "Votre compte utilisateur a été activé. Merci de vous ", + "error": "Votre compte utilisateur n'a pas pu être activé. Utilisez le formulaire d'enregistrement pour en créer un nouveau." + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/audits.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/audits.json new file mode 100644 index 0000000000..d4c4e06ab7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/audits.json @@ -0,0 +1,27 @@ +{ + "audits": { + "title": "Audits", + "filter": { + "title": "Filtrer par date", + "from": "De", + "to": "à", + "button": { + "weeks": "Semaines", + "today": "Aujourd'hui", + "clear": "Effacer", + "close": "Fermer" + } + }, + "table": { + "header": { + "principal": "Utilisateur", + "date": "Date", + "status": "Status", + "data": "Autres données" + }, + "data": { + "remoteAddress": "Adresse Distante :" + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/configuration.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/configuration.json new file mode 100644 index 0000000000..2b2ae1297f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/configuration.json @@ -0,0 +1,10 @@ +{ + "configuration": { + "title": "Configuration", + "filter": "Filtrer (par préfixe)", + "table": { + "prefix": "Préfixe", + "properties": "Propriétés" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/error.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/error.json new file mode 100644 index 0000000000..71a601a381 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/error.json @@ -0,0 +1,13 @@ +{ + "error": { + "title": "Page d'erreur !", + "http": { + "400": "Mauvaise requête.", + "403": "Vous n'avez pas les droits pour accéder à cette page.", + "405": "Le verbe HTTP que vous avez utilisé n'est pas reconnu par cet URL.", + "500": "Erreur interne du serveur." + }, + "concurrencyFailure": "Un autre utilisateur a modifié ces données en même temps que vous. Vos changements n'ont pas été sauvegardés.", + "validation": "Erreur de validation côté serveur." + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/gateway.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/gateway.json new file mode 100644 index 0000000000..31abf02831 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/gateway.json @@ -0,0 +1,15 @@ +{ + "gateway": { + "title": "Gateway", + "routes": { + "title": "Routes actuelles", + "url": "URL", + "service": "Service", + "servers": "Serveurs disponibles", + "error": "Attention : aucun serveur disponible !" + }, + "refresh": { + "button": "Rafraîchir" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/global.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/global.json new file mode 100644 index 0000000000..2143410005 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/global.json @@ -0,0 +1,137 @@ +{ + "global": { + "title": "Gateway", + "browsehappy": "Vous utilisez un ancien navigateur. Veuillez mettre à jour votre navigateur pour une meilleure expérience.", + "menu": { + "home": "Accueil", + "jhipster-needle-menu-add-element": "JHipster will add additional menu entries here (do not translate!)", + "entities": { + "main": "Entités", + "quotesQuote": "Quote", + "jhipster-needle-menu-add-entry": "JHipster will add additional entities here (do not translate!)" + }, + "account": { + "main": "Compte", + "settings": "Profil", + "password": "Mot de passe", + "sessions": "Sessions", + "login": "S'authentifier", + "logout": "Déconnexion", + "register": "Créer un compte" + }, + "admin": { + "main": "Administration", + "gateway": "Gateway", + "userManagement": "Gestion des utilisateurs", + "tracker": "Suivi des utilisateurs", + "metrics": "Métriques", + "health": "Diagnostics", + "configuration": "Configuration", + "logs": "Logs", + "audits": "Audits", + "apidocs": "API", + "database": "Base de données", + "jhipster-needle-menu-add-admin-element": "JHipster will add additional menu entries here (do not translate!)" + }, + "language": "Langue" + }, + "form": { + "username": "Nom d'utilisateur", + "username.placeholder": "Votre nom d'utilisateur", + "currentpassword": "Current password", + "currentpassword.placeholder": "Current password", + "newpassword": "Nouveau mot de passe", + "newpassword.placeholder": "Nouveau mot de passe", + "confirmpassword": "Confirmation du nouveau mot de passe", + "confirmpassword.placeholder": "Confirmation du nouveau mot de passe", + "email": "Email", + "email.placeholder": "Votre email" + }, + "messages": { + "info": { + "authenticated": { + "prefix": "Si vous voulez vous ", + "link": "connecter", + "suffix": ", vous pouvez utiliser les comptes par défaut :
- Administrateur (nom d'utilisateur=\"admin\" et mot de passe =\"admin\")
- Utilisateur (nom d'utilisateur=\"user\" et mot de passe =\"user\")." + }, + "register": { + "noaccount": "Vous n'avez pas encore de compte ?", + "link": "Créer un compte" + } + }, + "error": { + "dontmatch": "Le nouveau mot de passe et sa confirmation ne sont pas égaux !" + }, + "validate": { + "newpassword": { + "required": "Votre mot de passe est requis.", + "minlength": "Votre mot de passe doit comporter au moins 5 caractères.", + "maxlength": "Votre mot de passe ne doit pas comporter plus de 50 caractères.", + "strength": "Robustesse du mot de passe :" + }, + "confirmpassword": { + "required": "Votre confirmation du mot de passe est requise.", + "minlength": "Votre confirmation du mot de passe doit comporter au moins 5 caractères.", + "maxlength": "Votre confirmation du mot de passe ne doit pas comporter plus de 50 caractères." + }, + "email": { + "required": "Votre email est requis.", + "minlength": "Votre email doit comporter au moins 5 caractères.", + "maxlength": "Votre email ne doit pas comporter plus de 50 caractères.", + "invalid": "Votre email n'est pas valide." + } + } + }, + "field": { + "id": "ID" + }, + "ribbon": { + "dev":"Développement" + }, + "item-count": "Affichage {{first}} - {{second}} de {{total}} items." + }, + "entity": { + "action": { + "addblob": "Ajouter blob", + "addimage": "Ajouter image", + "back": "Retour", + "cancel": "Annuler", + "edit": "Editer", + "delete": "Supprimer", + "open": "Ouvrir", + "save": "Sauvegarder", + "view": "Voir" + }, + "detail": { + "field": "Champs", + "value": "Valeur" + }, + "delete": { + "title": "Confirmation de suppression" + }, + "validation": { + "required": "Ce champ est obligatoire.", + "minlength": "Ce champ doit faire au minimum {{min}} caractères.", + "maxlength": "Ce champ doit faire moins de {{max}} caractères.", + "min": "Ce champ doit être supérieur à {{min}}.", + "max": "Ce champ doit être inférieur à {{max}}.", + "minbytes": "Ce champ doit être supérieur à {{min}} bytes.", + "maxbytes": "Ce champ doit être inférieur à {{max}} bytes.", + "pattern": "Ce champ doit suivre l'expression régulière {{pattern}}.", + "number": "Ce champ doit être un nombre.", + "datetimelocal": "Ce champ doit être une date et une heure." + } + }, + "error": { + "internalServerError": "Erreur interne du serveur", + "server.not.reachable": "Serveur inaccessible", + "url.not.found": "Non trouvé", + "NotNull": "Le champ {{fieldName}} ne peut pas être vide !", + "Size": "Le champ {{fieldName}} ne respecte pas les critères minimum et maximum !", + "userexists": "Login déjà utilisé !", + "emailexists": "Email déjà utilisé !", + "idexists": "Une nouvelle entité {{entityName}} ne peut pas avoir d'ID !", + "idnull": "Invalid ID" + }, + "footer": "Ceci est votre pied de page" +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/health.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/health.json new file mode 100644 index 0000000000..ec52f4c421 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/health.json @@ -0,0 +1,32 @@ +{ + "health": { + "title": "Diagnostics", + "refresh.button": "Rafraichir", + "stacktrace": "Stacktrace", + "details": { + "details": "Détails", + "properties": "Propriétés", + "name": "Nom", + "value": "Valeur", + "error": "Erreur" + }, + "indicator": { + "discoveryComposite": "Discovery Composite", + "refreshScope": "Microservice Refresh Scope", + "configServer": "Microservice Config Server", + "hystrix": "Hystrix", + "diskSpace": "Espace disque", + "mail": "Email", + "db": "Base de données" + }, + "table": { + "service": "Nom du service", + "status": "Etat" + }, + "status": { + "UNKNOWN": "UNKNOWN", + "UP": "DISPONIBLE", + "DOWN": "HORS SERVICE" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/home.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/home.json new file mode 100644 index 0000000000..634a6e9816 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/home.json @@ -0,0 +1,19 @@ +{ + "home": { + "title": "Bienvenue, Java Hipster !", + "subtitle": "Ceci est votre page d'accueil", + "logged": { + "message": "Vous êtes connecté en tant que \"{{username}}\"." + }, + "question": "Si vous avez des questions à propos de JHipster :", + "link": { + "homepage": "Page d'accueil de JHipster", + "stackoverflow": "JHipster sur Stack Overflow", + "bugtracker": "JHipster bug tracker", + "chat": "JHipster public chat room", + "follow": "Suivez @java_hipster sur Twitter" + }, + "like": "Si vous aimez JHipster, donnez nous une étoile sur", + "github": "GitHub " + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/login.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/login.json new file mode 100644 index 0000000000..31e6138b66 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/login.json @@ -0,0 +1,19 @@ +{ + "login": { + "title": "Authentification", + "form": { + "password": "Mot de passe", + "password.placeholder": "Votre mot de passe", + "rememberme": "Garder la session ouverte", + "button": "Connexion" + }, + "messages": { + "error": { + "authentication": "Erreur d'authentification ! Veuillez vérifier vos identifiants de connexion." + } + }, + "password" : { + "forgot": "Avez-vous oublié votre mot de passe ?" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/logs.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/logs.json new file mode 100644 index 0000000000..c87c6e4b61 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/logs.json @@ -0,0 +1,11 @@ +{ + "logs": { + "title": "Logs", + "nbloggers": "Total de {{ total }} \"loggers\".", + "filter": "Filtrer", + "table": { + "name": "Nom", + "level": "Niveau" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/metrics.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/metrics.json new file mode 100644 index 0000000000..e2006488c4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/metrics.json @@ -0,0 +1,101 @@ +{ + "metrics": { + "title": "Métriques de l'application", + "refresh.button": "Rafraîchir", + "updating": "Mise à jour...", + "jvm": { + "title": "Métriques de la JVM", + "memory": { + "title": "Mémoire", + "total": "Mémoire totale", + "heap": "Mémoire \"Heap\"", + "nonheap": "Mémoire \"Non-Heap\"" + }, + "threads": { + "title": "Threads", + "all": "Tous", + "runnable": "Exécutable", + "timedwaiting": "Temps d'attente", + "waiting": "En attente", + "blocked": "Bloqué", + "dump": { + "title": "Threads dump", + "id": "Id :", + "blockedtime": "Temps bloqué", + "blockedcount": "Nb fois bloqué", + "waitedtime": "Temps d'attente", + "waitedcount": "Nb fois en attente", + "lockname": "Nom du process bloquant", + "stacktrace": "Stacktrace", + "show": "Afficher", + "hide": "Cacher" + } + }, + "gc": { + "title": "Garbage collections", + "marksweepcount": "Total de \"Mark Sweep\"", + "marksweeptime": "Temps \"Mark Sweep\"", + "scavengecount": "Total \"Scavenge\"", + "scavengetime": "Temps \"Scavenge\"" + }, + "http": { + "title": "Requêtes HTTP (évènements par seconde)", + "active": "Requêtes actives :", + "total": "Requêtes totales :", + "table": { + "code": "Code", + "count": "Total", + "mean": "Médian", + "average": "Moyenne" + }, + "code": { + "ok": "Ok", + "notfound": "Non trouvé", + "servererror": "Erreur serveur" + } + } + }, + "servicesstats": { + "title": "Statistiques des services (temps en millisecondes)", + "table": { + "name": "Nom du server", + "count": "Total", + "mean": "Médian", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + }, + "cache": { + "title": "Statistiques de cache", + "cachename": "Nom du cache", + "hits": "Données existantes", + "misses": "Données non existantes", + "gets": "Lectures", + "puts": "Écritures", + "removals": "Suppressions", + "evictions": "Évictions", + "hitPercent": "% données existantes", + "missPercent": "% données non existantes", + "averageGetTime": "Temps de lecture moyen (µs)", + "averagePutTime": "Temps d'écriture moyen (µs)", + "averageRemoveTime": "Temps de suppression moyen (µs)" + }, + "datasource": { + "usage": "Usage", + "title": "Statistiques du pool de connexions (temps en millisecondes)", + "name": "Utilisation du pool", + "count": "Total", + "mean": "Médian", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/password.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/password.json new file mode 100644 index 0000000000..755cc15173 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/password.json @@ -0,0 +1,12 @@ +{ + "password": { + "title": "Changer le mot de passe pour [{{username}}]", + "form": { + "button": "Sauvegarder" + }, + "messages": { + "error": "Une erreur est survenue ! Le mot de passe n'a pas pu être modifié.", + "success": "Le mot de passe a été modifié !" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/quotesQuote.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/quotesQuote.json new file mode 100644 index 0000000000..afe91e2686 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/quotesQuote.json @@ -0,0 +1,28 @@ + +{ + "gatewayApp": { + "quotesQuote" : { + "home": { + "title": "Quotes", + "createLabel": "Créer un nouveau Quote", + "createOrEditLabel": "Créer ou éditer un Quote" + }, + "delete": { + "question": "Etes-vous certain de vouloir supprimer le Quote {{ id }} ?" + }, + "detail": { + "title": "Quote" + }, + "symbol": "Symbol", + "price": "Price", + "lastTrade": "Last Trade" + } + }, + "quotesApp": { + "quotesQuote" : { + "created": "Un nouveau Quote a été créé avec l'identifiant {{ param }}", + "updated": "Le Quote avec l'identifiant {{ param }} a été mis à jour", + "deleted": "Le Quote avec l'identifiant {{ param }} a été supprimé" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/register.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/register.json new file mode 100644 index 0000000000..a8dd74684a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/register.json @@ -0,0 +1,24 @@ +{ + "register": { + "title": "Création de compte utilisateur", + "form": { + "button": "Enregistrement" + }, + "messages": { + "validate": { + "login": { + "required": "Votre nom d'utilisateur est obligatoire.", + "minlength": "Votre nom d'utilisateur doit contenir plus d'un caractère.", + "maxlength": "Votre nom d'utilisateur ne peut pas contenir plus de 50 caractères.", + "pattern": "Votre nom d'utilisateur ne peut contenir que des lettres minuscules ou des nombres." + } + }, + "success": "Compte enregistré ! Merci de vérifier votre email de confirmation.", + "error": { + "fail": "Compte non créé ! Merci d'essayer à nouveau plus tard.", + "userexists": "Ce compte utilisateur existe déjà ! Veuillez en choisir un autre.", + "emailexists": "Cet email est déjà utilisé ! Veuillez en choisir un autre." + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/reset.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/reset.json new file mode 100644 index 0000000000..d9376b836a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/reset.json @@ -0,0 +1,27 @@ +{ + "reset": { + "request": { + "title": "Réinitialiser son mot de passe", + "form": { + "button": "Réinitialiser le mot de passe" + }, + "messages": { + "info": "Veuillez renseigner l'adresse email utilisée pour vous enregistrer", + "success": "Veuillez vérifier vos nouveaux emails et suivre les instructions pour réinitialiser votre mot de passe.", + "notfound": "L'adresse email n'existe pas ! Merci de la vérifier et de réessayer." + } + }, + "finish" : { + "title": "Réinitialisation du mot de passe", + "form": { + "button": "Réinitialiser le mot de passe" + }, + "messages": { + "info": "Choisir un nouveau mot de passe", + "success": "Votre mot de passe a été réinitialisé. Merci de ", + "keymissing": "La clef de réinitilisation est manquante", + "error": "Votre mot de passe n'a pas pu être réinitialisé. La demande de réinitialisation n'est valable que 24 heures." + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/sessions.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/sessions.json new file mode 100644 index 0000000000..b2d45dcc48 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/sessions.json @@ -0,0 +1,15 @@ +{ + "sessions": { + "title": "Sessions actives de [{{username}}]", + "table": { + "ipaddress": "Adresse IP", + "useragent": "User Agent", + "date": "Date", + "button": "Invalider" + }, + "messages": { + "success": "La session a été invalidée !", + "error": "Une erreur est survenue ! La session ne peut pas être invalidée." + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/settings.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/settings.json new file mode 100644 index 0000000000..78e74c8b2c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/settings.json @@ -0,0 +1,32 @@ +{ + "settings": { + "title": "Profil de l'utilisateur [{{username}}]", + "form": { + "firstname": "Prénom", + "firstname.placeholder": "Votre prénom", + "lastname": "Nom", + "lastname.placeholder": "Votre nom", + "language": "Langue", + "button": "Sauvegarder" + }, + "messages": { + "error": { + "fail": "Une erreur est survenue ! Votre profil n'a pas été sauvegardé.", + "emailexists": "Cet email est déjà utilisé ! Veuillez en choisir un autre." + }, + "success": "Votre profil a été sauvegardé !", + "validate": { + "firstname": { + "required": "Votre prénom est requis.", + "minlength": "Votre prénom doit comporter au moins un caractère.", + "maxlength": "Votre prénom ne doit pas comporter plus de 50 caractères." + }, + "lastname": { + "required": "Votre nom est requis.", + "minlength": "Votre nom doit comporter au moins un caractère.", + "maxlength": "Votre nom ne doit pas comporter plus de 50 caractères." + } + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/user-management.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/user-management.json new file mode 100644 index 0000000000..03fb1632c4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/fr/user-management.json @@ -0,0 +1,30 @@ +{ + "userManagement": { + "home": { + "title": "Utilisateurs", + "createLabel": "Créer un nouvel utilisateur", + "createOrEditLabel": "Créer ou éditer un utilisateur" + }, + "created": "L'utilisateur {{ param }} a été créé.", + "updated": "L'utilisateur {{ param }} a été mis à jour.", + "deleted": "L'utilisateur {{ param }} a été supprimé.", + "delete": { + "question": "Etes-vous certain de vouloir supprimer l'utilisateur {{ login }} ?" + }, + "detail": { + "title": "Utilisateur" + }, + "login": "Login", + "firstName": "Prénom", + "lastName": "Nom", + "email": "Email", + "activated": "Activé", + "deactivated": "Désactivé", + "profiles": "Droits", + "langKey": "Langue", + "createdBy": "Créé par", + "createdDate": "Créé le", + "lastModifiedBy": "Modifié par", + "lastModifiedDate": "Modifié le" + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/activate.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/activate.json new file mode 100644 index 0000000000..b526a9e3cf --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/activate.json @@ -0,0 +1,9 @@ +{ + "activate": { + "title": "Ativação", + "messages": { + "success": "Usuário ativado com sucesso. Favor ", + "error": "O usuário não pode ser ativado. Favor utilizar o formulário de cadastro para criar uma nova conta." + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/audits.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/audits.json new file mode 100644 index 0000000000..845dcbb437 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/audits.json @@ -0,0 +1,27 @@ +{ + "audits": { + "title": "Auditorias", + "filter": { + "title": "Filtro por data", + "from": "de", + "to": "até", + "button": { + "weeks": "Semanas", + "today": "hoje", + "clear": "limpar", + "close": "fechar" + } + }, + "table": { + "header": { + "principal": "Usuário", + "date": "Data", + "status": "Estado", + "data": "Informações extras" + }, + "data": { + "remoteAddress": "Endereço remoto:" + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/configuration.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/configuration.json new file mode 100644 index 0000000000..6f80c59028 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/configuration.json @@ -0,0 +1,10 @@ +{ + "configuration": { + "title": "Configuração", + "filter": "Filtro", + "table": { + "prefix": "Prefixo", + "properties": "Propriedades" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/error.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/error.json new file mode 100644 index 0000000000..92fdff4f11 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/error.json @@ -0,0 +1,13 @@ +{ + "error": { + "title": "Página de erro!", + "http": { + "400": "Bad request.", + "403": "Você não tem autorização para acessar esta página.", + "405": "The HTTP verb you used is not supported for this URL.", + "500": "Internal server error." + }, + "concurrencyFailure": "Another user modified this data at the same time as you. Your changes were rejected.", + "validation": "Validation error on the server." + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/gateway.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/gateway.json new file mode 100644 index 0000000000..8c8bbd7e98 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/gateway.json @@ -0,0 +1,15 @@ +{ + "gateway": { + "title": "Gateway", + "routes": { + "title": "Current routes", + "url": "URL", + "service": "service", + "servers": "Available servers", + "error": "Warning: no server available!" + }, + "refresh": { + "button": "Refresh" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/global.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/global.json new file mode 100644 index 0000000000..e40f936589 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/global.json @@ -0,0 +1,137 @@ +{ + "global": { + "title": "Gateway", + "browsehappy": "Você está usando um navegador desatualizado. Favor atualizar o seu navegador para ter uma experiência melhor.", + "menu": { + "home": "Início", + "jhipster-needle-menu-add-element": "JHipster will add additional menu entries here (do not translate!)", + "entities": { + "main": "Entidades", + "quotesQuote": "Quote", + "jhipster-needle-menu-add-entry": "JHipster will add additional entities here (do not translate!)" + }, + "account": { + "main": "Conta", + "settings": "Configuração", + "password": "Senha", + "sessions": "Sessões", + "login": "Entrar", + "logout": "Sair", + "register": "Registrar" + }, + "admin": { + "main": "Administração", + "gateway": "Gateway", + "userManagement": "Gerenciamento de usuário", + "tracker": "Rastreamento de usuário", + "metrics": "Métricas", + "health": "Estado do Sistema", + "configuration": "Configuração", + "logs": "Logs", + "audits": "Auditorias", + "apidocs": "API", + "database": "Banco de dados", + "jhipster-needle-menu-add-admin-element": "JHipster will add additional menu entries here (do not translate!)" + }, + "language": "Idioma" + }, + "form": { + "username": "Usuário", + "username.placeholder": "Seu usuário", + "currentpassword": "Current password", + "currentpassword.placeholder": "Current password", + "newpassword": "Nova senha", + "newpassword.placeholder": "Nova senha", + "confirmpassword": "Confirmação de nova senha", + "confirmpassword.placeholder": "Confirme a nova senha", + "email": "Email", + "email.placeholder": "Seu email" + }, + "messages": { + "info": { + "authenticated": { + "prefix": "Para ", + "link": "entrar", + "suffix": ", utilize as seguintes contas padrões:
- Administrador (usuário=\"admin\" and senha=\"admin\")
- Usuário (usuário=\"user\" and senha=\"user\")." + }, + "register": { + "noaccount": "Não possui uma conta ainda?", + "link": "Crie uma nova conta" + } + }, + "error": { + "dontmatch" : "A senha e sua confirmação devem ser iguais!" + }, + "validate": { + "newpassword": { + "required": "A senha é obrigatória.", + "minlength": "A senha deve ter pelo menos 5 caracteres", + "maxlength": "A senha não pode ter mais de 50 caracteres", + "strength": "Nível de dificuldade da senha:" + }, + "confirmpassword": { + "required": "A confirmação da senha é obrigatória.", + "minlength": "A confirmação da senha deve ter pelo menos 5 caracteres", + "maxlength": "A confirmação da senha não pode ter mais de 50 caracteres" + }, + "email": { + "required": "O email é obrigatório.", + "invalid": "Email inválido.", + "minlength": "O email deve ter pelo menos 5 caracteres", + "maxlength": "O email não pode ter mais de 50 caracteres" + } + } + }, + "field": { + "id" : "Código" + }, + "ribbon": { + "dev":"Development" + }, + "item-count": "Mostrando {{first}} - {{second}} de {{total}} resultados." + }, + "entity": { + "action": { + "addblob": "Adicionar blob", + "addimage": "Adicionar imagem", + "back": "Voltar", + "cancel": "Cancelar", + "delete": "Excluir", + "edit": "Editar", + "open": "Open", + "save": "Salvar", + "view": "Visualizar" + }, + "detail": { + "field": "Campo", + "value": "Valor" + }, + "delete": { + "title": "Confirme a exclusão" + }, + "validation": { + "required": "O campo é obrigatório.", + "minlength": "Este campo deve ter ao menos {{min}} caracteres.", + "maxlength": "Este campo não pode ter mais que {{max}} caracteres.", + "min": "Este campo deve ser maior que {{min}}.", + "max": "Este campo não pode ser maior que {{max}}.", + "minbytes": "Este campo deve ter ao menos {{min}} bytes.", + "maxbytes": "Este campo não pode ter mais que {{max}} bytes.", + "pattern": "Este campo deve estar dentro do seguinte padrão {{pattern}}.", + "number": "Este campo é do tipo número.", + "datetimelocal": "Este campo é do tipo data/hora." + } + }, + "error": { + "internalServerError": "Internal server error", + "server.not.reachable": "Servidor indisponível", + "url.not.found": "Not found", + "NotNull": "O Campo {{fieldName}} não pode ser vazio!", + "Size": "O campo {{fieldName}} não obedece os requisitos de tamanho mínimo ou máximo!", + "userexists": "Usuário já existente!", + "emailexists": "Este email já está cadastrado!", + "idexists": "Novo(a) {{entityName}} não pode ter uma ID", + "idnull": "Invalid ID" + }, + "footer": "Este é o seu rodapé" +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/health.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/health.json new file mode 100644 index 0000000000..e74a4e87e2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/health.json @@ -0,0 +1,32 @@ +{ + "health": { + "title": "Estado do Sistema", + "refresh.button": "Atualizar", + "stacktrace": "Stacktrace", + "details": { + "details": "Details", + "properties": "Properties", + "name": "Name", + "value": "Value", + "error": "Error" + }, + "indicator": { + "discoveryComposite": "Discovery Composite", + "refreshScope": "Microservice Refresh Scope", + "configServer": "Microservice Config Server", + "hystrix": "Hystrix", + "diskSpace": "Espaço em disco", + "mail": "Email", + "db": "Banco de dados" + }, + "table": { + "service": "Nome do Serviço", + "status": "Estado" + }, + "status": { + "UNKNOWN": "UNKNOWN", + "UP": "UP", + "DOWN": "DOWN" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/home.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/home.json new file mode 100644 index 0000000000..efa2736361 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/home.json @@ -0,0 +1,19 @@ +{ + "home": { + "title": "Bem vindo, Java Hipster!", + "subtitle": "Esta é a página principal", + "logged": { + "message": "Você está logado como \"{{username}}\"." + }, + "question": "Em caso de dúvida sobre o JHipster:", + "link": { + "homepage": "JHipster homepage", + "stackoverflow": "JHipster no Stack Overflow", + "bugtracker": "JHipster bug tracker", + "chat": "JHipster public chat room", + "follow": "contate @java_hipster on Twitter" + }, + "like": "Se você gosta do JHipster, não se esqueça de avaliar no", + "github": "GitHub" + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/login.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/login.json new file mode 100644 index 0000000000..4453845af2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/login.json @@ -0,0 +1,19 @@ +{ + "login": { + "title": "Autenticação", + "form": { + "password": "Senha", + "password.placeholder": "Sua senha", + "rememberme": "Manter-me logado", + "button": "Entrar" + }, + "messages": { + "error": { + "authentication": "Erro de autenticação! Por favor verifique suas credenciais e tente novamente." + } + }, + "password" : { + "forgot": "Esqueceu sua senha?" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/logs.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/logs.json new file mode 100644 index 0000000000..50a07fa996 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/logs.json @@ -0,0 +1,11 @@ +{ + "logs": { + "title": "Logs", + "nbloggers": "Existem {{ total }} loggers.", + "filter": "Filtro", + "table": { + "name": "Nome", + "level": "Nível" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/metrics.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/metrics.json new file mode 100644 index 0000000000..a00bc96cd7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/metrics.json @@ -0,0 +1,93 @@ +{ + "metrics": { + "title": "Métricas da aplicação", + "refresh.button": "Atualizar", + "updating": "Atualização...", + "jvm": { + "title": "Métricas da JVM", + "memory": { + "title": "Memória", + "total": "Memória Total", + "heap": "Memória Heap", + "nonheap": "Memória não Heap" + }, + "threads": { + "title": "Threads", + "all": "Tudo", + "runnable": "Runnable", + "timedwaiting": "Tempo de espera", + "waiting": "Aguardando", + "blocked": "Bloqueado", + "dump": { + "title": "Threads dump", + "id": "Id: ", + "blockedtime": "Tempo bloqueado", + "blockedcount": "Número de bloqueios", + "waitedtime": "Tempo de espera", + "waitedcount": "Número de esperas", + "lockname": "Nome do Lock", + "stacktrace": "Stacktrace", + "show": "Mostrar", + "hide": "Esconder" + } + }, + "gc": { + "title": "Coletas de lixo", + "marksweepcount": "Número de marcados para coleta", + "marksweeptime": "Tempo de marcação para coleta", + "scavengecount": "Número de varreduras", + "scavengetime": "Tempo de varreduras" + }, + "http": { + "title": "Requisições HTTP (eventos por segundo)", + "active": "Requisições ativas:", + "total": "Total de requisições:", + "table": { + "code": "Código", + "count": "Contagem", + "mean": "Mediana", + "average": "Média" + }, + "code": { + "ok": "Ok", + "notfound": "Não encontrado", + "servererror": "Erro do servidor" + } + } + }, + "servicesstats": { + "title": "Estatísticas dos serviços (tempo em milisegundos)", + "table": { + "name": "Nome do serviço", + "count": "Contagem", + "mean": "Mediana", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + }, + "cache": { + "title": "Estatísticas da cache", + "cachename": "Nome da cache", + "hits": "Hits", + "misses": "Misses", + "evictions": "Número de despejos" + }, + "datasource": { + "usage": "Utilização", + "title": "Estatísticas do datasource (tempo em milisegundos)", + "name": "Utilização do pool", + "count": "Contagem", + "mean": "Mediana", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/password.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/password.json new file mode 100644 index 0000000000..4ecdcc136f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/password.json @@ -0,0 +1,12 @@ +{ + "password": { + "title": "Senha para [{{username}}]", + "form": { + "button": "Salvar" + }, + "messages": { + "error": "Ocorreu um erro! A senha não pode ser alterada.", + "success": "Senha alterada com sucesso!" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/quotesQuote.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/quotesQuote.json new file mode 100644 index 0000000000..6f89dfa411 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/quotesQuote.json @@ -0,0 +1,28 @@ + +{ + "gatewayApp": { + "quotesQuote" : { + "home": { + "title": "Quotes", + "createLabel": "Criar novo Quote", + "createOrEditLabel": "Criar ou editar Quote" + }, + "delete": { + "question": "Tem certeza de que deseja excluir Quote {{ id }}?" + }, + "detail": { + "title": "Quote" + }, + "symbol": "Symbol", + "price": "Price", + "lastTrade": "Last Trade" + } + }, + "quotesApp": { + "quotesQuote" : { + "created": "Um novo Quote foi criado com o identificador {{ param }}", + "updated": "Um Quote foi atualizado com o identificador {{ param }}", + "deleted": "Um Quote foi deletado com o identificador {{ param }}" + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/register.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/register.json new file mode 100644 index 0000000000..a19994c09f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/register.json @@ -0,0 +1,24 @@ +{ + "register": { + "title": "Cadastro", + "form": { + "button": "Cadastre" + }, + "messages": { + "validate": { + "login": { + "required": "O usuário é obrigatório.", + "minlength": "O usuário deve ter pelo menos 1 caractere", + "maxlength": "O usuário não pode ter mais de 50 caracteres", + "pattern": "Your login can only contain lower-case letters and digits" + } + }, + "success": "Cadstro salvo com sucesso! Favor verificar seu email para confirmar a conta.", + "error": { + "fail": "Erro ao realizar o cadastro! Favor tentar novamente mais tarde.", + "userexists": "Usuário já registrado! Favor escolher outro.", + "emailexists": "Email já está em uso! Por favor informe outro." + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/reset.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/reset.json new file mode 100644 index 0000000000..56bba46692 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/reset.json @@ -0,0 +1,30 @@ +{ + "reset": { + "request": { + "title": "Nova senha", + "form": { + "button": "Criar nova senha" + }, + "messages": { + "info": "Informe endereço de email utilizado no cadastro.", + "success": "Verifique seu email para detalhes sobre a criação de uma nova senha.", + "notfound": "Endereço de email não cadastrado! Por favor verifique e tente novamente" + + } + + }, + "finish" : { + "title": "Criar nova senha", + "form": { + "button": "Validar nova senha" + }, + "messages": { + "info": "Escolha uma nova senha", + "success": "Sua senha foi alterada com sucesso! Por favor ", + "keymissing": "Chave de reestabelecimento não encontrada.", + "error": "Sua senha não pôde ser trocada. Lembre-se, requisição de troca de senha é válida apenas por 24h." + } + } + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/sessions.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/sessions.json new file mode 100644 index 0000000000..007a4dd93b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/sessions.json @@ -0,0 +1,15 @@ +{ + "sessions": { + "title": "Sessões ativas para [{{username}}]", + "table": { + "ipaddress": "IP", + "useragent": "Agente", + "date": "Data", + "button": "Invalidar" + }, + "messages": { + "success": "Sessão invalidada com sucesso!", + "error": "Ocorreu um erro! A sessão não pode ser invalidada." + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/settings.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/settings.json new file mode 100644 index 0000000000..7e01c2b829 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/settings.json @@ -0,0 +1,32 @@ +{ + "settings": { + "title": "Configurações para o usuário [{{username}}]", + "form": { + "firstname": "Primeiro nome", + "firstname.placeholder": "Seu primeiro nome", + "lastname": "Sobrenome", + "lastname.placeholder": "Seu sobrenome", + "language": "Idioma", + "button": "Salvar" + }, + "messages": { + "error": { + "fail": "Ocorreu um erro! As configurações não foram salvas.", + "emailexists": "Email is already in use! Please choose another one." + }, + "success": "Configurações salvas com sucesso!", + "validate": { + "firstname": { + "required": "O primeiro nome é obrigatório.", + "minlength": "O primeiro nome deve ter pelo menos 1 caractere", + "maxlength": "O primeiro nome não pode ter mais de 50 caracteres" + }, + "lastname": { + "required": "O sobrenome é obrigatório.", + "minlength": "O sobrenome deve ter pelo menos 1 caractere", + "maxlength": "O sobrenome não pode ter mais de 50 caracteres" + } + } + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/user-management.json b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/user-management.json new file mode 100644 index 0000000000..59cc4b89f2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/i18n/pt-br/user-management.json @@ -0,0 +1,30 @@ +{ + "userManagement": { + "home": { + "title": "Usuários", + "createLabel": "Adicionar", + "createOrEditLabel": "Criar ou editar usuário" + }, + "created": "Novo usuário foi criado com a identificação {{ param }}", + "updated": "Usuário com a identificação {{ param }} foi atualizado ", + "deleted": "Usuário com a identificação {{ param }} foi removido", + "delete": { + "question": "Você tem certeza que deseja excluir o usuário {{ login }}?" + }, + "detail": { + "title": "Usuário" + }, + "login": "Login", + "firstName": "Primeiro nome", + "lastName": "Último nome", + "email": "Email", + "activated": "Ativo", + "deactivated": "Inativo", + "profiles": "Perfis", + "langKey": "Idioma", + "createdBy": "Criado por", + "createdDate": "Criado em", + "lastModifiedBy": "Alterado por", + "lastModifiedDate": "Alterado em" + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/index.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/index.html new file mode 100644 index 0000000000..30f3a81557 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/index.html @@ -0,0 +1,46 @@ + + + + + + + gateway + + + + + + + + + + + +

You must enable javascript to view this page.

+ + + + + diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/manifest.webapp b/jhipster/jhipster-uaa/gateway/src/main/webapp/manifest.webapp new file mode 100644 index 0000000000..e448079a5c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/manifest.webapp @@ -0,0 +1,31 @@ +{ + "name": "Gateway", + "short_name": "Gateway", + "icons": [ + { + "src": "./content/images/hipster192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "./content/images/hipster256.png", + "sizes": "256x256", + "type": "image/png" + }, + { + "src": "./content/images/hipster384.png", + "sizes": "384x384", + "type": "image/png" + }, + { + "src": "./content/images/hipster512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#000000", + "background_color": "#e0e0e0", + "start_url": "/index.html", + "display": "standalone", + "orientation": "portrait" +} diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/robots.txt b/jhipster/jhipster-uaa/gateway/src/main/webapp/robots.txt new file mode 100644 index 0000000000..7cda27477d --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/robots.txt @@ -0,0 +1,11 @@ +# robotstxt.org/ + +User-agent: * +Disallow: /api/account +Disallow: /api/account/change-password +Disallow: /api/account/sessions +Disallow: /api/audits/ +Disallow: /api/logs/ +Disallow: /api/users/ +Disallow: /management/ +Disallow: /v2/api-docs/ diff --git a/jhipster/jhipster-uaa/gateway/src/main/webapp/swagger-ui/index.html b/jhipster/jhipster-uaa/gateway/src/main/webapp/swagger-ui/index.html new file mode 100644 index 0000000000..7bdc777eb3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/main/webapp/swagger-ui/index.html @@ -0,0 +1,175 @@ + + + + + Swagger UI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+
+ + diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/SecurityBeanOverrideConfiguration.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/SecurityBeanOverrideConfiguration.java new file mode 100644 index 0000000000..c5925cde03 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/SecurityBeanOverrideConfiguration.java @@ -0,0 +1,35 @@ +package com.baeldung.jhipster.gateway.config; + +import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.web.client.RestTemplate; + +/** + * Overrides UAA specific beans, so they do not interfere the testing + * This configuration must be included in @SpringBootTest in order to take effect. + */ +@Configuration +public class SecurityBeanOverrideConfiguration { + + @Bean + @Primary + public TokenStore tokenStore() { + return null; + } + + @Bean + @Primary + public JwtAccessTokenConverter jwtAccessTokenConverter() { + return null; + } + + @Bean + @Primary + public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) { + return null; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTest.java new file mode 100644 index 0000000000..c1f6062c51 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTest.java @@ -0,0 +1,204 @@ +package com.baeldung.jhipster.gateway.config; + +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.servlet.InstrumentedFilter; +import com.codahale.metrics.servlets.MetricsServlet; +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; +import io.github.jhipster.web.filter.CachingHttpHeadersFilter; +import io.undertow.Undertow; +import io.undertow.Undertow.Builder; +import io.undertow.UndertowOptions; +import org.apache.commons.io.FilenameUtils; + +import org.h2.server.web.WebServlet; +import org.junit.Before; +import org.junit.Test; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.mock.env.MockEnvironment; +import org.springframework.mock.web.MockServletContext; +import org.springframework.test.util.ReflectionTestUtils; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.xnio.OptionMap; + +import javax.servlet.*; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Unit tests for the WebConfigurer class. + * + * @see WebConfigurer + */ +public class WebConfigurerTest { + + private WebConfigurer webConfigurer; + + private MockServletContext servletContext; + + private MockEnvironment env; + + private JHipsterProperties props; + + private MetricRegistry metricRegistry; + + @Before + public void setup() { + servletContext = spy(new MockServletContext()); + doReturn(mock(FilterRegistration.Dynamic.class)) + .when(servletContext).addFilter(anyString(), any(Filter.class)); + doReturn(mock(ServletRegistration.Dynamic.class)) + .when(servletContext).addServlet(anyString(), any(Servlet.class)); + + env = new MockEnvironment(); + props = new JHipsterProperties(); + + webConfigurer = new WebConfigurer(env, props); + metricRegistry = new MetricRegistry(); + webConfigurer.setMetricRegistry(metricRegistry); + } + + @Test + public void testStartUpProdServletContext() throws ServletException { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); + webConfigurer.onStartup(servletContext); + + assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); + assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry); + verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class)); + verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class)); + verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class)); + verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class)); + } + + @Test + public void testStartUpDevServletContext() throws ServletException { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); + webConfigurer.onStartup(servletContext); + + assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); + assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry); + verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class)); + verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class)); + verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class)); + verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class)); + } + + @Test + public void testCustomizeServletContainer() { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); + UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); + webConfigurer.customize(container); + assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg"); + assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8"); + assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8"); + if (container.getDocumentRoot() != null) { + assertThat(container.getDocumentRoot().getPath()).isEqualTo(FilenameUtils.separatorsToSystem("target/www")); + } + + Builder builder = Undertow.builder(); + container.getBuilderCustomizers().forEach(c -> c.customize(builder)); + OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions"); + assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isNull(); + } + + @Test + public void testUndertowHttp2Enabled() { + props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0); + UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); + webConfigurer.customize(container); + Builder builder = Undertow.builder(); + container.getBuilderCustomizers().forEach(c -> c.customize(builder)); + OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions"); + assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isTrue(); + } + + @Test + public void testCorsFilterOnApiPath() throws Exception { + props.getCors().setAllowedOrigins(Collections.singletonList("*")); + props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); + props.getCors().setAllowedHeaders(Collections.singletonList("*")); + props.getCors().setMaxAge(1800L); + props.getCors().setAllowCredentials(true); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + options("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com") + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")) + .andExpect(header().string(HttpHeaders.VARY, "Origin")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800")); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")); + } + + @Test + public void testCorsFilterOnOtherPath() throws Exception { + props.getCors().setAllowedOrigins(Collections.singletonList("*")); + props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); + props.getCors().setAllowedHeaders(Collections.singletonList("*")); + props.getCors().setMaxAge(1800L); + props.getCors().setAllowCredentials(true); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/test/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } + + @Test + public void testCorsFilterDeactivated() throws Exception { + props.getCors().setAllowedOrigins(null); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } + + @Test + public void testCorsFilterDeactivated2() throws Exception { + props.getCors().setAllowedOrigins(new ArrayList<>()); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTestController.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTestController.java new file mode 100644 index 0000000000..87d997afb1 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/config/WebConfigurerTestController.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.gateway.config; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class WebConfigurerTestController { + + @GetMapping("/api/test-cors") + public void testCorsOnApiPath() { + } + + @GetMapping("/test/test-cors") + public void testCorsOnOtherPath() { + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java new file mode 100644 index 0000000000..893c446922 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java @@ -0,0 +1,95 @@ +package com.baeldung.jhipster.gateway.gateway.responserewriting; + +import com.netflix.zuul.context.RequestContext; +import org.apache.commons.io.IOUtils; +import org.junit.Test; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.zip.GZIPInputStream; + +import static com.baeldung.jhipster.gateway.gateway.responserewriting.SwaggerBasePathRewritingFilter.gzipData; +import static org.junit.Assert.*; +import static springfox.documentation.swagger2.web.Swagger2Controller.DEFAULT_URL; + +/** + * Tests SwaggerBasePathRewritingFilter class. + */ +public class SwaggerBasePathRewritingFilterTest { + + private SwaggerBasePathRewritingFilter filter = new SwaggerBasePathRewritingFilter(); + + @Test + public void shouldFilter_on_default_swagger_url() { + + MockHttpServletRequest request = new MockHttpServletRequest("GET", DEFAULT_URL); + RequestContext.getCurrentContext().setRequest(request); + + assertTrue(filter.shouldFilter()); + } + + /** + * Zuul DebugFilter can be triggered by "deug" parameter. + */ + @Test + public void shouldFilter_on_default_swagger_url_with_param() { + + MockHttpServletRequest request = new MockHttpServletRequest("GET", DEFAULT_URL); + request.setParameter("debug", "true"); + RequestContext.getCurrentContext().setRequest(request); + + assertTrue(filter.shouldFilter()); + } + + @Test + public void shouldNotFilter_on_wrong_url() { + + MockHttpServletRequest request = new MockHttpServletRequest("GET", "/management/info"); + RequestContext.getCurrentContext().setRequest(request); + + assertFalse(filter.shouldFilter()); + } + + @Test + public void run_on_valid_response() throws Exception { + MockHttpServletRequest request = new MockHttpServletRequest("GET", "/service1" + DEFAULT_URL); + RequestContext context = RequestContext.getCurrentContext(); + context.setRequest(request); + + MockHttpServletResponse response = new MockHttpServletResponse(); + context.setResponseGZipped(false); + context.setResponse(response); + + InputStream in = IOUtils.toInputStream("{\"basePath\":\"/\"}", StandardCharsets.UTF_8); + context.setResponseDataStream(in); + + filter.run(); + + assertEquals("UTF-8", response.getCharacterEncoding()); + assertEquals("{\"basePath\":\"/service1\"}", context.getResponseBody()); + } + + @Test + public void run_on_valid_response_gzip() throws Exception { + MockHttpServletRequest request = new MockHttpServletRequest("GET", "/service1" + DEFAULT_URL); + RequestContext context = RequestContext.getCurrentContext(); + context.setRequest(request); + + MockHttpServletResponse response = new MockHttpServletResponse(); + context.setResponseGZipped(true); + context.setResponse(response); + + context.setResponseDataStream(new ByteArrayInputStream(gzipData("{\"basePath\":\"/\"}"))); + + filter.run(); + + assertEquals("UTF-8", response.getCharacterEncoding()); + + InputStream responseDataStream = new GZIPInputStream(context.getResponseDataStream()); + String responseBody = IOUtils.toString(responseDataStream, StandardCharsets.UTF_8); + assertEquals("{\"basePath\":\"/service1\"}", responseBody); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/OAuth2TokenMockUtil.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/OAuth2TokenMockUtil.java new file mode 100644 index 0000000000..2a3d103d45 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/OAuth2TokenMockUtil.java @@ -0,0 +1,83 @@ +package com.baeldung.jhipster.gateway.security; + +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.security.oauth2.provider.OAuth2Request; +import org.springframework.security.oauth2.provider.token.ResourceServerTokenServices; +import org.springframework.stereotype.Component; +import org.springframework.test.web.servlet.request.RequestPostProcessor; + +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; + +import static org.mockito.BDDMockito.given; + +/** + * A bean providing simple mocking of OAuth2 access tokens for security integration tests. + */ +@Component +public class OAuth2TokenMockUtil { + + @MockBean + private ResourceServerTokenServices tokenServices; + + private OAuth2Authentication createAuthentication(String username, Set scopes, Set roles) { + List authorities = roles.stream() + .map(SimpleGrantedAuthority::new) + .collect(Collectors.toList()); + + User principal = new User(username, "test", true, true, true, true, authorities); + Authentication authentication = new UsernamePasswordAuthenticationToken(principal, principal.getPassword(), + principal.getAuthorities()); + + // Create the authorization request and OAuth2Authentication object + OAuth2Request authRequest = new OAuth2Request(null, "testClient", null, true, scopes, null, null, null, + null); + return new OAuth2Authentication(authRequest, authentication); + } + + public RequestPostProcessor oauth2Authentication(String username, Set scopes, Set roles) { + String uuid = String.valueOf(UUID.randomUUID()); + + given(tokenServices.loadAuthentication(uuid)) + .willReturn(createAuthentication(username, scopes, roles)); + + given(tokenServices.readAccessToken(uuid)).willReturn(new DefaultOAuth2AccessToken(uuid)); + + return new OAuth2PostProcessor(uuid); + } + + public RequestPostProcessor oauth2Authentication(String username, Set scopes) { + return oauth2Authentication(username, scopes, Collections.emptySet()); + } + + public RequestPostProcessor oauth2Authentication(String username) { + return oauth2Authentication(username, Collections.emptySet()); + } + + public static class OAuth2PostProcessor implements RequestPostProcessor { + + private String token; + + public OAuth2PostProcessor(String token) { + this.token = token; + } + + @Override + public MockHttpServletRequest postProcessRequest(MockHttpServletRequest mockHttpServletRequest) { + mockHttpServletRequest.addHeader("Authorization", "Bearer " + token); + + return mockHttpServletRequest; + } + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollectionTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollectionTest.java new file mode 100644 index 0000000000..1b2a22dd90 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieCollectionTest.java @@ -0,0 +1,191 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import javax.servlet.http.Cookie; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +/** + * Test the CookieCollection. + * + * @see CookieCollection + */ +public class CookieCollectionTest { + public static final String COOKIE_NAME = "chocolate"; + public static final String COOKIE_VALUE = "yummy"; + public static final String BROWNIE_NAME = "brownie"; + private Cookie cookie; + private Cookie cupsCookie; + private Cookie brownieCookie; + + @Before + public void setUp() throws Exception { + cookie = new Cookie(COOKIE_NAME, COOKIE_VALUE); + cupsCookie = new Cookie("cups", "delicious"); + brownieCookie = new Cookie(BROWNIE_NAME, "mmh"); + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void size() throws Exception { + CookieCollection cookies = new CookieCollection(); + Assert.assertEquals(0, cookies.size()); + cookies.add(cookie); + Assert.assertEquals(1, cookies.size()); + } + + @Test + public void isEmpty() throws Exception { + CookieCollection cookies = new CookieCollection(); + Assert.assertTrue(cookies.isEmpty()); + cookies.add(cookie); + Assert.assertFalse(cookies.isEmpty()); + } + + @Test + public void contains() throws Exception { + CookieCollection cookies = new CookieCollection(cookie); + Assert.assertTrue(cookies.contains(cookie)); + Assert.assertTrue(cookies.contains(COOKIE_NAME)); + Assert.assertFalse(cookies.contains("yuck")); + } + + @Test + public void iterator() throws Exception { + CookieCollection cookies = new CookieCollection(cookie); + Iterator it = cookies.iterator(); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals(cookie, it.next()); + Assert.assertFalse(it.hasNext()); + } + + @Test + public void toArray() throws Exception { + CookieCollection cookies = new CookieCollection(cookie); + Cookie[] array = cookies.toArray(); + Assert.assertEquals(cookies.size(), array.length); + Assert.assertEquals(cookie, array[0]); + } + + @Test + public void toArray1() throws Exception { + CookieCollection cookies = new CookieCollection(cookie); + Cookie[] array = new Cookie[cookies.size()]; + cookies.toArray(array); + Assert.assertEquals(cookies.size(), array.length); + Assert.assertEquals(cookie, array[0]); + } + + @Test + public void add() throws Exception { + CookieCollection cookies = new CookieCollection(cookie); + Cookie newCookie = new Cookie(BROWNIE_NAME, "mmh"); + cookies.add(newCookie); + Assert.assertEquals(2, cookies.size()); + Assert.assertTrue(cookies.contains(newCookie)); + Assert.assertTrue(cookies.contains(BROWNIE_NAME)); + } + + @Test + public void addAgain() { + CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie); + Cookie white = new Cookie(COOKIE_NAME, "white"); + boolean modified = cookies.add(white); + Assert.assertTrue(modified); + Assert.assertEquals(white, cookies.get(COOKIE_NAME)); + Assert.assertTrue(cookies.contains(white)); + Assert.assertFalse(cookies.contains(cookie)); + Assert.assertTrue(cookies.contains(COOKIE_NAME)); + } + + @Test + public void get() { + CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie); + Cookie c = cookies.get(COOKIE_NAME); + Assert.assertNotNull(c); + Assert.assertEquals(cookie, c); + } + + @Test + public void remove() throws Exception { + CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie); + cookies.remove(cookie); + Assert.assertEquals(2, cookies.size()); + Assert.assertFalse(cookies.contains(cookie)); + Assert.assertFalse(cookies.contains(COOKIE_NAME)); + Assert.assertTrue(cookies.contains(brownieCookie)); + Assert.assertTrue(cookies.contains(BROWNIE_NAME)); + } + + @Test + public void containsAll() throws Exception { + List content = Arrays.asList(cookie, brownieCookie); + CookieCollection cookies = new CookieCollection(content); + Assert.assertTrue(cookies.containsAll(content)); + Assert.assertTrue(cookies.containsAll(Collections.singletonList(cookie))); + Assert.assertFalse(cookies.containsAll(Arrays.asList(cookie, brownieCookie, cupsCookie))); + Assert.assertTrue(cookies.containsAll(Arrays.asList(COOKIE_NAME, BROWNIE_NAME))); + } + + @Test + @SuppressWarnings("unchecked") + public void addAll() throws Exception { + CookieCollection cookies = new CookieCollection(); + List content = Arrays.asList(cookie, brownieCookie, cupsCookie); + boolean modified = cookies.addAll(content); + Assert.assertTrue(modified); + Assert.assertEquals(3, cookies.size()); + Assert.assertTrue(cookies.containsAll(content)); + Assert.assertFalse(cookies.addAll(Collections.EMPTY_LIST)); + } + + @Test + public void removeAll() throws Exception { + CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie); + boolean modified = cookies.removeAll(Arrays.asList(brownieCookie, cupsCookie)); + Assert.assertTrue(modified); + Assert.assertEquals(1, cookies.size()); + Assert.assertFalse(cookies.contains(brownieCookie)); + Assert.assertFalse(cookies.contains(cupsCookie)); + Assert.assertFalse(cookies.removeAll(Collections.EMPTY_LIST)); + } + + @Test + public void removeAllByName() throws Exception { + CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie); + boolean modified = cookies.removeAll(Arrays.asList(COOKIE_NAME, BROWNIE_NAME)); + Assert.assertTrue(modified); + Assert.assertEquals(1, cookies.size()); + Assert.assertFalse(cookies.contains(brownieCookie)); + Assert.assertFalse(cookies.contains(cookie)); + Assert.assertFalse(cookies.removeAll(Collections.EMPTY_LIST)); + } + + @Test + public void retainAll() throws Exception { + CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie); + List content = Arrays.asList(cookie, brownieCookie); + boolean modified = cookies.retainAll(content); + Assert.assertTrue(modified); + Assert.assertEquals(2, cookies.size()); + Assert.assertTrue(cookies.containsAll(content)); + Assert.assertFalse(cookies.contains(cupsCookie)); + Assert.assertFalse(cookies.retainAll(content)); + } + + @Test + public void clear() throws Exception { + CookieCollection cookies = new CookieCollection(cookie); + cookies.clear(); + Assert.assertTrue(cookies.isEmpty()); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractorTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractorTest.java new file mode 100644 index 0000000000..af7dec99c4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/CookieTokenExtractorTest.java @@ -0,0 +1,45 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.springframework.http.HttpMethod; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.security.core.Authentication; +import org.springframework.security.oauth2.common.OAuth2AccessToken; + +/** + * Test whether the CookieTokenExtractor can properly extract access tokens from + * Cookies and Headers. + */ +public class CookieTokenExtractorTest { + private CookieTokenExtractor cookieTokenExtractor; + + @Before + public void init() { + cookieTokenExtractor = new CookieTokenExtractor(); + } + + @Test + public void testExtractTokenCookie() { + MockHttpServletRequest request = OAuth2AuthenticationServiceTest.createMockHttpServletRequest(); + Authentication authentication = cookieTokenExtractor.extract(request); + Assert.assertEquals(OAuth2AuthenticationServiceTest.ACCESS_TOKEN_VALUE, authentication.getPrincipal().toString()); + } + + @Test + public void testExtractTokenHeader() { + MockHttpServletRequest request = new MockHttpServletRequest(HttpMethod.GET.name(), "http://www.test.com"); + request.addHeader("Authorization", OAuth2AccessToken.BEARER_TYPE + " " + OAuth2AuthenticationServiceTest.ACCESS_TOKEN_VALUE); + Authentication authentication = cookieTokenExtractor.extract(request); + Assert.assertEquals(OAuth2AuthenticationServiceTest.ACCESS_TOKEN_VALUE, authentication.getPrincipal().toString()); + } + + @Test + public void testExtractTokenParam() { + MockHttpServletRequest request = new MockHttpServletRequest(HttpMethod.GET.name(), "http://www.test.com"); + request.addParameter(OAuth2AccessToken.ACCESS_TOKEN, OAuth2AuthenticationServiceTest.ACCESS_TOKEN_VALUE); + Authentication authentication = cookieTokenExtractor.extract(request); + Assert.assertEquals(OAuth2AuthenticationServiceTest.ACCESS_TOKEN_VALUE, authentication.getPrincipal().toString()); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationServiceTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationServiceTest.java new file mode 100644 index 0000000000..4902b5306e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2AuthenticationServiceTest.java @@ -0,0 +1,252 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2Properties; +import com.baeldung.jhipster.gateway.web.filter.RefreshTokenFilter; +import com.baeldung.jhipster.gateway.web.rest.errors.InvalidPasswordException; +import io.github.jhipster.config.JHipsterProperties; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.http.*; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; +import org.springframework.security.oauth2.common.DefaultOAuth2RefreshToken; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import static org.mockito.Mockito.when; + +/** + * Test password and refresh token grants. + * + * @see OAuth2AuthenticationService + */ +@RunWith(MockitoJUnitRunner.class) +public class OAuth2AuthenticationServiceTest { + public static final String CLIENT_AUTHORIZATION = "Basic d2ViX2FwcDpjaGFuZ2VpdA=="; + public static final String ACCESS_TOKEN_VALUE = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0OTQyNzI4NDQsInVzZXJfbmFtZSI6InVzZXIiLCJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwianRpIjoiNzc1ZTJkYWUtYWYzZi00YTdhLWExOTktNzNiZTU1MmIxZDVkIiwiY2xpZW50X2lkIjoid2ViX2FwcCIsInNjb3BlIjpbIm9wZW5pZCJdfQ.gEK0YcX2IpkpxnkxXXHQ4I0xzTjcy7edqb89ukYE0LPe7xUcZVwkkCJF_nBxsGJh2jtA6NzNLfY5zuL6nP7uoAq3fmvsyrcyR2qPk8JuuNzGtSkICx3kPDRjAT4ST8SZdeh7XCbPVbySJ7ZmPlRWHyedzLA1wXN0NUf8yZYS4ELdUwVBYIXSjkNoKqfWm88cwuNr0g0teypjPtjDqCnXFt1pibwdfIXn479Y1neNAdvSpHcI4Ost-c7APCNxW2gqX-0BItZQearxRgKDdBQ7CGPAIky7dA0gPuKUpp_VCoqowKCXqkE9yKtRQGIISewtj2UkDRZePmzmYrUBXRzfYw"; + public static final String REFRESH_TOKEN_VALUE = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJ1c2VyIiwic2NvcGUiOlsib3BlbmlkIl0sImF0aSI6Ijc3NWUyZGFlLWFmM2YtNGE3YS1hMTk5LTczYmU1NTJiMWQ1ZCIsImV4cCI6MTQ5Njg2NDc0MywiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIl0sImp0aSI6IjhmYjI2YTllLTdjYzQtNDFlMi1hNzBjLTk4MDc0N2U2YWFiOSIsImNsaWVudF9pZCI6IndlYl9hcHAifQ.q1-Df9_AFO6TJNiLKV2YwTjRbnd7qcXv52skXYnog5siHYRoR6cPtm6TNQ04iDAoIHljTSTNnD6DS3bHk41mV55gsSVxGReL8VCb_R8ZmhVL4-5yr90sfms0wFp6lgD2bPmZ-TXiS2Oe9wcbNWagy5RsEplZ-sbXu3tjmDao4FN35ojPsXmUs84XnNQH3Y_-PY9GjZG0JEfLQIvE0J5BkXS18Z015GKyA6GBIoLhAGBQQYyG9m10ld_a9fD5SmCyCF72Jad_pfP1u8Z_WyvO-wrlBvm2x-zBthreVrXU5mOb9795wJEP-xaw3dXYGjht_grcW4vKUFtj61JgZk98CQ"; + public static final String EXPIRED_SESSION_TOKEN_VALUE = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJ1c2VyIiwic2NvcGUiOlsib3BlbmlkIl0sImF0aSI6IjE0NTkwYzdkLTQ5M2YtNDU0NS05MzlmLTg1ODM4ZjRmNzNmNSIsImV4cCI6MTQ5NTU3Mjg5MywiaWF0IjoxNDk1MzIwODkzLCJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwianRpIjoiNzVhYTIxNzEtMzFmNi00MWJmLWExZGUtYWU0YTg1ZjZiMjEyIiwiY2xpZW50X2lkIjoid2ViX2FwcCJ9.gAH-yly7WAslQUeGhyHmjYXwQN3dluvoT84iOJ2mVWYGVlnDRsoxN3_d1ozqtiso9UM7dWpAr80o3gK7AyK-cO1GGBXa3lg0ETsbucFoqHLivgGZA2qVOsFlDq8E7DZENAbOWmywmhFUOogCfZ-BqsuFSi8waMLL-1qlhehBPuK1KzGxIZbjSVUFFFYTxoWPKi2NNTBzYSwwCV0ixj-gHyFC6Gl5ByA4EvYygGUZF2pACxs4tIRkmT90pXWCjWeKS9k9MlxZ7C4UHqyTRW-IYzqAm8OHdwsnXeu0GkFYc08gxoUuPcjMby8ziYLG5uWj0Ua0msmiSjoafzs-5xfH-Q"; + public static final String NEW_ACCESS_TOKEN_VALUE = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0OTQyNzY2NDEsInVzZXJfbmFtZSI6InVzZXIiLCJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwianRpIjoiYzIyY2YzMDgtZTIyYi00YzNjLWI5MjctOTYwYzA2YmY1ZmU0IiwiY2xpZW50X2lkIjoid2ViX2FwcCIsInNjb3BlIjpbIm9wZW5pZCJdfQ.IAhE39GCqWRUuXdWy-raOcE9NYXRhGiqkeJH649501LeqNPH5HtRUNWmudVRgwT52Bj7HcbJapMLGetKIMEASqC1-WARfcZ_PR0r7Kfg3OlFALWOH_oVT5kvi2H-QCoSAF9mRYK6abCh_tPk5KryVB5c7YxTMIXDT2nTsSexD8eNQOMBWRCg0RaLHZ9bKfeyVgncQJsu7-vTo1xJyh-keYpdNZ0TA2SjYJgezmB7gwW1Kmc7_83htr8VycG7XA_PuD9--yRNlrN0LtNHEBqNypZsOe6NvpKiNlodFYHlsU1CaumzcF9U7dpVanjIUKJ5VRWVUlSFY6JJ755W29VCTw"; + public static final String NEW_REFRESH_TOKEN_VALUE = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJ1c2VyIiwic2NvcGUiOlsib3BlbmlkIl0sImF0aSI6ImMyMmNmMzA4LWUyMmItNGMzYy1iOTI3LTk2MGMwNmJmNWZlNCIsImV4cCI6MTQ5Njg2ODU4MSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIl0sImp0aSI6ImU4YmZhZWJlLWYzMDItNGNjZS1hZGY1LWQ4MzE5OWM1MjBlOSIsImNsaWVudF9pZCI6IndlYl9hcHAifQ.OemWBUfc-2rl4t4VVqolYxul3L527PbSbX2Xvo7oyy3Vy5nmmblqp4hVGdTEjivrlldGVQX03ERbrA-oFkpmfWbBzLvnKS6AUq1MGjut6dXZJeiEqNYmiAABn6jSgK26S0k6b2ADgmf7mxJO8EBypb5sT1DMAbY5cbOe7r4ZG7zMTVSvlvjHTXp_FM8Y9i6nehLD4XDYY57cb_ZA89vAXNzvTAjoopDliExgR0bApG6nvvDEhEYgTS65lccEQocoev6bISJ3RvNYNPJxWcNPftKDp4HrEt2E2WP28K5IivRtQgDQNlQeormf1tp6AG-Oj__NXyAPM7yhAKXNy2zWdQ"; + @Mock + private RestTemplate restTemplate; + @Mock + private TokenStore tokenStore; + private OAuth2TokenEndpointClient authorizationClient; + private OAuth2AuthenticationService authenticationService; + private RefreshTokenFilter refreshTokenFilter; + @Rule + public ExpectedException expectedException = ExpectedException.none(); + private OAuth2Properties oAuth2Properties; + private JHipsterProperties jHipsterProperties; + + @Before + public void init() { + oAuth2Properties = new OAuth2Properties(); + jHipsterProperties = new JHipsterProperties(); + jHipsterProperties.getSecurity().getClientAuthorization().setAccessTokenUri("http://uaa/oauth/token"); + OAuth2CookieHelper cookieHelper = new OAuth2CookieHelper(oAuth2Properties); + OAuth2AccessToken accessToken = createAccessToken(ACCESS_TOKEN_VALUE, REFRESH_TOKEN_VALUE); + + mockInvalidPassword(); + mockPasswordGrant(accessToken); + mockRefreshGrant(); + + authorizationClient = new UaaTokenEndpointClient(restTemplate, jHipsterProperties, oAuth2Properties); + authenticationService = new OAuth2AuthenticationService(authorizationClient, cookieHelper); + when(tokenStore.readAccessToken(ACCESS_TOKEN_VALUE)).thenReturn(accessToken); + refreshTokenFilter = new RefreshTokenFilter(authenticationService, tokenStore); + } + + public static OAuth2AccessToken createAccessToken(String accessTokenValue, String refreshTokenValue) { + DefaultOAuth2AccessToken accessToken = new DefaultOAuth2AccessToken(accessTokenValue); + accessToken.setExpiration(new Date()); //token expires now + DefaultOAuth2RefreshToken refreshToken = new DefaultOAuth2RefreshToken(refreshTokenValue); + accessToken.setRefreshToken(refreshToken); + return accessToken; + } + + public static MockHttpServletRequest createMockHttpServletRequest() { + MockHttpServletRequest request = new MockHttpServletRequest(HttpMethod.GET.name(), "http://www.test.com"); + Cookie accessTokenCookie = new Cookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE, ACCESS_TOKEN_VALUE); + Cookie refreshTokenCookie = new Cookie(OAuth2CookieHelper.REFRESH_TOKEN_COOKIE, REFRESH_TOKEN_VALUE); + request.setCookies(accessTokenCookie, refreshTokenCookie); + return request; + } + + private void mockInvalidPassword() { + HttpHeaders reqHeaders = new HttpHeaders(); + reqHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + reqHeaders.add("Authorization", CLIENT_AUTHORIZATION); //take over Authorization header from client request to UAA request + MultiValueMap formParams = new LinkedMultiValueMap<>(); + formParams.set("username", "user"); + formParams.set("password", "user2"); + formParams.add("grant_type", "password"); + HttpEntity> entity = new HttpEntity<>(formParams, reqHeaders); + when(restTemplate.postForEntity("http://uaa/oauth/token", entity, OAuth2AccessToken.class)) + .thenThrow(new HttpClientErrorException(HttpStatus.BAD_REQUEST)); + } + + private void mockPasswordGrant(OAuth2AccessToken accessToken) { + HttpHeaders reqHeaders = new HttpHeaders(); + reqHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + reqHeaders.add("Authorization", CLIENT_AUTHORIZATION); //take over Authorization header from client request to UAA request + MultiValueMap formParams = new LinkedMultiValueMap<>(); + formParams.set("username", "user"); + formParams.set("password", "user"); + formParams.add("grant_type", "password"); + HttpEntity> entity = new HttpEntity<>(formParams, reqHeaders); + when(restTemplate.postForEntity("http://uaa/oauth/token", entity, OAuth2AccessToken.class)) + .thenReturn(new ResponseEntity(accessToken, HttpStatus.OK)); + } + + private void mockRefreshGrant() { + MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("grant_type", "refresh_token"); + params.add("refresh_token", REFRESH_TOKEN_VALUE); + //we must authenticate with the UAA server via HTTP basic authentication using the browser's client_id with no client secret + HttpHeaders headers = new HttpHeaders(); + headers.add("Authorization", CLIENT_AUTHORIZATION); + HttpEntity> entity = new HttpEntity<>(params, headers); + OAuth2AccessToken newAccessToken = createAccessToken(NEW_ACCESS_TOKEN_VALUE, NEW_REFRESH_TOKEN_VALUE); + when(restTemplate.postForEntity("http://uaa/oauth/token", entity, OAuth2AccessToken.class)) + .thenReturn(new ResponseEntity(newAccessToken, HttpStatus.OK)); + } + + @Test + public void testAuthenticationCookies() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("www.test.com"); + request.addHeader("Authorization", CLIENT_AUTHORIZATION); + Map params = new HashMap<>(); + params.put("username", "user"); + params.put("password", "user"); + params.put("rememberMe", "true"); + MockHttpServletResponse response = new MockHttpServletResponse(); + authenticationService.authenticate(request, response, params); + //check that cookies are set correctly + Cookie accessTokenCookie = response.getCookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE); + Assert.assertEquals(ACCESS_TOKEN_VALUE, accessTokenCookie.getValue()); + Cookie refreshTokenCookie = response.getCookie(OAuth2CookieHelper.REFRESH_TOKEN_COOKIE); + Assert.assertEquals(REFRESH_TOKEN_VALUE, OAuth2CookieHelper.getRefreshTokenValue(refreshTokenCookie)); + Assert.assertTrue(OAuth2CookieHelper.isRememberMe(refreshTokenCookie)); + } + + @Test + public void testAuthenticationNoRememberMe() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("www.test.com"); + Map params = new HashMap<>(); + params.put("username", "user"); + params.put("password", "user"); + params.put("rememberMe", "false"); + MockHttpServletResponse response = new MockHttpServletResponse(); + authenticationService.authenticate(request, response, params); + //check that cookies are set correctly + Cookie accessTokenCookie = response.getCookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE); + Assert.assertEquals(ACCESS_TOKEN_VALUE, accessTokenCookie.getValue()); + Cookie refreshTokenCookie = response.getCookie(OAuth2CookieHelper.SESSION_TOKEN_COOKIE); + Assert.assertEquals(REFRESH_TOKEN_VALUE, OAuth2CookieHelper.getRefreshTokenValue(refreshTokenCookie)); + Assert.assertFalse(OAuth2CookieHelper.isRememberMe(refreshTokenCookie)); + } + + @Test + public void testInvalidPassword() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("www.test.com"); + Map params = new HashMap<>(); + params.put("username", "user"); + params.put("password", "user2"); + params.put("rememberMe", "false"); + MockHttpServletResponse response = new MockHttpServletResponse(); + expectedException.expect(InvalidPasswordException.class); + authenticationService.authenticate(request, response, params); + } + + @Test + public void testRefreshGrant() { + MockHttpServletRequest request = createMockHttpServletRequest(); + MockHttpServletResponse response = new MockHttpServletResponse(); + HttpServletRequest newRequest = refreshTokenFilter.refreshTokensIfExpiring(request, response); + Cookie newAccessTokenCookie = response.getCookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE); + Assert.assertEquals(NEW_ACCESS_TOKEN_VALUE, newAccessTokenCookie.getValue()); + Cookie newRefreshTokenCookie = response.getCookie(OAuth2CookieHelper.REFRESH_TOKEN_COOKIE); + Assert.assertEquals(NEW_REFRESH_TOKEN_VALUE, newRefreshTokenCookie.getValue()); + Cookie requestAccessTokenCookie = OAuth2CookieHelper.getAccessTokenCookie(newRequest); + Assert.assertEquals(NEW_ACCESS_TOKEN_VALUE, requestAccessTokenCookie.getValue()); + } + + @Test + public void testSessionExpired() { + MockHttpServletRequest request = new MockHttpServletRequest(HttpMethod.GET.name(), "http://www.test.com"); + Cookie accessTokenCookie = new Cookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE, ACCESS_TOKEN_VALUE); + Cookie refreshTokenCookie = new Cookie(OAuth2CookieHelper.SESSION_TOKEN_COOKIE, EXPIRED_SESSION_TOKEN_VALUE); + request.setCookies(accessTokenCookie, refreshTokenCookie); + MockHttpServletResponse response = new MockHttpServletResponse(); + HttpServletRequest newRequest = refreshTokenFilter.refreshTokensIfExpiring(request, response); + //cookies in response are deleted + Cookie newAccessTokenCookie = response.getCookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE); + Assert.assertEquals(0, newAccessTokenCookie.getMaxAge()); + Cookie newRefreshTokenCookie = response.getCookie(OAuth2CookieHelper.REFRESH_TOKEN_COOKIE); + Assert.assertEquals(0, newRefreshTokenCookie.getMaxAge()); + //request no longer contains cookies + Cookie requestAccessTokenCookie = OAuth2CookieHelper.getAccessTokenCookie(newRequest); + Assert.assertNull(requestAccessTokenCookie); + Cookie requestRefreshTokenCookie = OAuth2CookieHelper.getRefreshTokenCookie(newRequest); + Assert.assertNull(requestRefreshTokenCookie); + } + + /** + * If no refresh token is found and the access token has expired, then expect an exception. + */ + @Test + public void testRefreshGrantNoRefreshToken() { + MockHttpServletRequest request = new MockHttpServletRequest(HttpMethod.GET.name(), "http://www.test.com"); + Cookie accessTokenCookie = new Cookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE, ACCESS_TOKEN_VALUE); + request.setCookies(accessTokenCookie); + MockHttpServletResponse response = new MockHttpServletResponse(); + expectedException.expect(InvalidTokenException.class); + refreshTokenFilter.refreshTokensIfExpiring(request, response); + } + + @Test + public void testLogout() { + MockHttpServletRequest request = new MockHttpServletRequest(); + Cookie accessTokenCookie = new Cookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE, ACCESS_TOKEN_VALUE); + Cookie refreshTokenCookie = new Cookie(OAuth2CookieHelper.REFRESH_TOKEN_COOKIE, REFRESH_TOKEN_VALUE); + request.setCookies(accessTokenCookie, refreshTokenCookie); + MockHttpServletResponse response = new MockHttpServletResponse(); + authenticationService.logout(request, response); + Cookie newAccessTokenCookie = response.getCookie(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE); + Assert.assertEquals(0, newAccessTokenCookie.getMaxAge()); + Cookie newRefreshTokenCookie = response.getCookie(OAuth2CookieHelper.REFRESH_TOKEN_COOKIE); + Assert.assertEquals(0, newRefreshTokenCookie.getMaxAge()); + } + + @Test + public void testStripTokens() { + MockHttpServletRequest request = createMockHttpServletRequest(); + HttpServletRequest newRequest = authenticationService.stripTokens(request); + CookieCollection cookies = new CookieCollection(newRequest.getCookies()); + Assert.assertFalse(cookies.contains(OAuth2CookieHelper.ACCESS_TOKEN_COOKIE)); + Assert.assertFalse(cookies.contains(OAuth2CookieHelper.REFRESH_TOKEN_COOKIE)); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelperTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelperTest.java new file mode 100644 index 0000000000..d36a67bf66 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/security/oauth2/OAuth2CookieHelperTest.java @@ -0,0 +1,98 @@ +package com.baeldung.jhipster.gateway.security.oauth2; + +import com.baeldung.jhipster.gateway.config.oauth2.OAuth2Properties; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.test.util.ReflectionTestUtils; + +/** + * Tests helper functions around OAuth2 Cookies. + * + * @see OAuth2CookieHelper + */ +public class OAuth2CookieHelperTest { + public static final String GET_COOKIE_DOMAIN_METHOD = "getCookieDomain"; + private OAuth2Properties oAuth2Properties; + private OAuth2CookieHelper cookieHelper; + + @Before + public void setUp() throws NoSuchMethodException { + oAuth2Properties = new OAuth2Properties(); + cookieHelper = new OAuth2CookieHelper(oAuth2Properties); + } + + @Test + public void testLocalhostDomain() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("localhost"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertNull(name); + } + + @Test + public void testComDomain() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("test.com"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertNull(name); //already top-level domain + } + + @Test + public void testWwwDomainCom() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("www.test.com"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertNull(name); + } + + @Test + public void testComSubDomain() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("abc.test.com"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertEquals(".test.com", name); + } + + @Test + public void testWwwSubDomainCom() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("www.abc.test.com"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertEquals(".test.com", name); + } + + + @Test + public void testCoUkDomain() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("test.co.uk"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertNull(name); //already top-level domain + } + + @Test + public void testCoUkSubDomain() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("abc.test.co.uk"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertEquals(".test.co.uk", name); + } + + @Test + public void testNestedDomain() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("abc.xyu.test.co.uk"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertEquals(".test.co.uk", name); + } + + @Test + public void testIpAddress() { + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setServerName("127.0.0.1"); + String name = ReflectionTestUtils.invokeMethod(cookieHelper, GET_COOKIE_DOMAIN_METHOD, request); + Assert.assertNull(name); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/LogsResourceIntTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/LogsResourceIntTest.java new file mode 100644 index 0000000000..2e52eabbca --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/LogsResourceIntTest.java @@ -0,0 +1,67 @@ +package com.baeldung.jhipster.gateway.web.rest; + +import com.baeldung.jhipster.gateway.GatewayApp; +import com.baeldung.jhipster.gateway.config.SecurityBeanOverrideConfiguration; +import com.baeldung.jhipster.gateway.web.rest.vm.LoggerVM; +import ch.qos.logback.classic.AsyncAppender; +import ch.qos.logback.classic.LoggerContext; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.LoggerFactory; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Test class for the LogsResource REST controller. + * + * @see LogsResource + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, GatewayApp.class}) +public class LogsResourceIntTest { + + private MockMvc restLogsMockMvc; + + @Before + public void setup() { + LogsResource logsResource = new LogsResource(); + this.restLogsMockMvc = MockMvcBuilders + .standaloneSetup(logsResource) + .build(); + } + + @Test + public void getAllLogs() throws Exception { + restLogsMockMvc.perform(get("/management/logs")) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)); + } + + @Test + public void changeLogs() throws Exception { + LoggerVM logger = new LoggerVM(); + logger.setLevel("INFO"); + logger.setName("ROOT"); + + restLogsMockMvc.perform(put("/management/logs") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(logger))) + .andExpect(status().isNoContent()); + } + + @Test + public void testLogstashAppender() { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + assertThat(context.getLogger("ROOT").getAppender("ASYNC_LOGSTASH")).isInstanceOf(AsyncAppender.class); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/TestUtil.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/TestUtil.java new file mode 100644 index 0000000000..88795b3f2c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/TestUtil.java @@ -0,0 +1,135 @@ +package com.baeldung.jhipster.gateway.web.rest; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.hamcrest.Description; +import org.hamcrest.TypeSafeDiagnosingMatcher; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.format.support.DefaultFormattingConversionService; +import org.springframework.format.support.FormattingConversionService; +import org.springframework.http.MediaType; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Utility class for testing REST controllers. + */ +public class TestUtil { + + /** MediaType for JSON UTF8 */ + public static final MediaType APPLICATION_JSON_UTF8 = new MediaType( + MediaType.APPLICATION_JSON.getType(), + MediaType.APPLICATION_JSON.getSubtype(), StandardCharsets.UTF_8); + + /** + * Convert an object to JSON byte array. + * + * @param object + * the object to convert + * @return the JSON byte array + * @throws IOException + */ + public static byte[] convertObjectToJsonBytes(Object object) + throws IOException { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); + + JavaTimeModule module = new JavaTimeModule(); + mapper.registerModule(module); + + return mapper.writeValueAsBytes(object); + } + + /** + * Create a byte array with a specific size filled with specified data. + * + * @param size the size of the byte array + * @param data the data to put in the byte array + * @return the JSON byte array + */ + public static byte[] createByteArray(int size, String data) { + byte[] byteArray = new byte[size]; + for (int i = 0; i < size; i++) { + byteArray[i] = Byte.parseByte(data, 2); + } + return byteArray; + } + + /** + * A matcher that tests that the examined string represents the same instant as the reference datetime. + */ + public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher { + + private final ZonedDateTime date; + + public ZonedDateTimeMatcher(ZonedDateTime date) { + this.date = date; + } + + @Override + protected boolean matchesSafely(String item, Description mismatchDescription) { + try { + if (!date.isEqual(ZonedDateTime.parse(item))) { + mismatchDescription.appendText("was ").appendValue(item); + return false; + } + return true; + } catch (DateTimeParseException e) { + mismatchDescription.appendText("was ").appendValue(item) + .appendText(", which could not be parsed as a ZonedDateTime"); + return false; + } + + } + + @Override + public void describeTo(Description description) { + description.appendText("a String representing the same Instant as ").appendValue(date); + } + } + + /** + * Creates a matcher that matches when the examined string reprensents the same instant as the reference datetime + * @param date the reference datetime against which the examined string is checked + */ + public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) { + return new ZonedDateTimeMatcher(date); + } + + /** + * Verifies the equals/hashcode contract on the domain object. + */ + public static void equalsVerifier(Class clazz) throws Exception { + T domainObject1 = clazz.getConstructor().newInstance(); + assertThat(domainObject1.toString()).isNotNull(); + assertThat(domainObject1).isEqualTo(domainObject1); + assertThat(domainObject1.hashCode()).isEqualTo(domainObject1.hashCode()); + // Test with an instance of another class + Object testOtherObject = new Object(); + assertThat(domainObject1).isNotEqualTo(testOtherObject); + assertThat(domainObject1).isNotEqualTo(null); + // Test with an instance of the same class + T domainObject2 = clazz.getConstructor().newInstance(); + assertThat(domainObject1).isNotEqualTo(domainObject2); + // HashCodes are equals because the objects are not persisted yet + assertThat(domainObject1.hashCode()).isEqualTo(domainObject2.hashCode()); + } + + /** + * Create a FormattingConversionService which use ISO date format, instead of the localized one. + * @return the FormattingConversionService + */ + public static FormattingConversionService createFormattingConversionService() { + DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService (); + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setUseIsoFormat(true); + registrar.registerFormatters(dfcs); + return dfcs; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorIntTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorIntTest.java new file mode 100644 index 0000000000..3a453b1179 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorIntTest.java @@ -0,0 +1,151 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import com.baeldung.jhipster.gateway.GatewayApp; +import com.baeldung.jhipster.gateway.config.SecurityBeanOverrideConfiguration; +import org.junit.Before; +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.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Test class for the ExceptionTranslator controller advice. + * + * @see ExceptionTranslator + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, GatewayApp.class}) +public class ExceptionTranslatorIntTest { + + @Autowired + private ExceptionTranslatorTestController controller; + + @Autowired + private ExceptionTranslator exceptionTranslator; + + @Autowired + private MappingJackson2HttpMessageConverter jacksonMessageConverter; + + private MockMvc mockMvc; + + @Before + public void setup() { + mockMvc = MockMvcBuilders.standaloneSetup(controller) + .setControllerAdvice(exceptionTranslator) + .setMessageConverters(jacksonMessageConverter) + .build(); + } + + @Test + public void testConcurrencyFailure() throws Exception { + mockMvc.perform(get("/test/concurrency-failure")) + .andExpect(status().isConflict()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); + } + + @Test + public void testMethodArgumentNotValid() throws Exception { + mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) + .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) + .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) + .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); + } + + @Test + public void testParameterizedError() throws Exception { + mockMvc.perform(get("/test/parameterized-error")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("test parameterized error")) + .andExpect(jsonPath("$.params.param0").value("param0_value")) + .andExpect(jsonPath("$.params.param1").value("param1_value")); + } + + @Test + public void testParameterizedError2() throws Exception { + mockMvc.perform(get("/test/parameterized-error2")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("test parameterized error")) + .andExpect(jsonPath("$.params.foo").value("foo_value")) + .andExpect(jsonPath("$.params.bar").value("bar_value")); + } + + @Test + public void testMissingServletRequestPartException() throws Exception { + mockMvc.perform(get("/test/missing-servlet-request-part")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")); + } + + @Test + public void testMissingServletRequestParameterException() throws Exception { + mockMvc.perform(get("/test/missing-servlet-request-parameter")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")); + } + + @Test + public void testAccessDenied() throws Exception { + mockMvc.perform(get("/test/access-denied")) + .andExpect(status().isForbidden()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.403")) + .andExpect(jsonPath("$.detail").value("test access denied!")); + } + + @Test + public void testUnauthorized() throws Exception { + mockMvc.perform(get("/test/unauthorized")) + .andExpect(status().isUnauthorized()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.401")) + .andExpect(jsonPath("$.path").value("/test/unauthorized")) + .andExpect(jsonPath("$.detail").value("test authentication failed!")); + } + + @Test + public void testMethodNotSupported() throws Exception { + mockMvc.perform(post("/test/access-denied")) + .andExpect(status().isMethodNotAllowed()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.405")) + .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); + } + + @Test + public void testExceptionWithResponseStatus() throws Exception { + mockMvc.perform(get("/test/response-status")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")) + .andExpect(jsonPath("$.title").value("test response status")); + } + + @Test + public void testInternalServerError() throws Exception { + mockMvc.perform(get("/test/internal-server-error")) + .andExpect(status().isInternalServerError()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.500")) + .andExpect(jsonPath("$.title").value("Internal Server Error")); + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorTestController.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorTestController.java new file mode 100644 index 0000000000..dfad64b0d6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/errors/ExceptionTranslatorTestController.java @@ -0,0 +1,86 @@ +package com.baeldung.jhipster.gateway.web.rest.errors; + +import org.springframework.dao.ConcurrencyFailureException; +import org.springframework.http.HttpStatus; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.HashMap; +import java.util.Map; + +@RestController +public class ExceptionTranslatorTestController { + + @GetMapping("/test/concurrency-failure") + public void concurrencyFailure() { + throw new ConcurrencyFailureException("test concurrency failure"); + } + + @PostMapping("/test/method-argument") + public void methodArgument(@Valid @RequestBody TestDTO testDTO) { + } + + @GetMapping("/test/parameterized-error") + public void parameterizedError() { + throw new CustomParameterizedException("test parameterized error", "param0_value", "param1_value"); + } + + @GetMapping("/test/parameterized-error2") + public void parameterizedError2() { + Map params = new HashMap<>(); + params.put("foo", "foo_value"); + params.put("bar", "bar_value"); + throw new CustomParameterizedException("test parameterized error", params); + } + + @GetMapping("/test/missing-servlet-request-part") + public void missingServletRequestPartException(@RequestPart String part) { + } + + @GetMapping("/test/missing-servlet-request-parameter") + public void missingServletRequestParameterException(@RequestParam String param) { + } + + @GetMapping("/test/access-denied") + public void accessdenied() { + throw new AccessDeniedException("test access denied!"); + } + + @GetMapping("/test/unauthorized") + public void unauthorized() { + throw new BadCredentialsException("test authentication failed!"); + } + + @GetMapping("/test/response-status") + public void exceptionWithReponseStatus() { + throw new TestResponseStatusException(); + } + + @GetMapping("/test/internal-server-error") + public void internalServerError() { + throw new RuntimeException(); + } + + public static class TestDTO { + + @NotNull + private String test; + + public String getTest() { + return test; + } + + public void setTest(String test) { + this.test = test; + } + } + + @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "test response status") + @SuppressWarnings("serial") + public static class TestResponseStatusException extends RuntimeException { + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtilUnitTest.java b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtilUnitTest.java new file mode 100644 index 0000000000..07b343403a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/java/com/baeldung/jhipster/gateway/web/rest/util/PaginationUtilUnitTest.java @@ -0,0 +1,44 @@ +package com.baeldung.jhipster.gateway.web.rest.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.HttpHeaders; + +/** + * Tests based on parsing algorithm in app/components/util/pagination-util.service.js + * + * @see PaginationUtil + */ +public class PaginationUtilUnitTest { + + @Test + public void generatePaginationHttpHeadersTest() { + String baseUrl = "/api/_search/example"; + List content = new ArrayList<>(); + Page page = new PageImpl<>(content, PageRequest.of(6, 50), 400L); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, baseUrl); + List strHeaders = headers.get(HttpHeaders.LINK); + assertNotNull(strHeaders); + assertTrue(strHeaders.size() == 1); + String headerData = strHeaders.get(0); + assertTrue(headerData.split(",").length == 4); + String expectedData = "; rel=\"next\"," + + "; rel=\"prev\"," + + "; rel=\"last\"," + + "; rel=\"first\""; + assertEquals(expectedData, headerData); + List xTotalCountHeaders = headers.get("X-Total-Count"); + assertTrue(xTotalCountHeaders.size() == 1); + assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L)); + } + +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/jest-global-mocks.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/jest-global-mocks.ts new file mode 100644 index 0000000000..a998259857 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/jest-global-mocks.ts @@ -0,0 +1,15 @@ +const mock = () => { + let storage = {}; + return { + getItem: key => (key in storage ? storage[key] : null), + setItem: (key, value) => (storage[key] = value || ''), + removeItem: key => delete storage[key], + clear: () => (storage = {}) + }; +}; + +Object.defineProperty(window, 'localStorage', { value: mock() }); +Object.defineProperty(window, 'sessionStorage', { value: mock() }); +Object.defineProperty(window, 'getComputedStyle', { + value: () => ['-webkit-appearance'] +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/jest.conf.js b/jhipster/jhipster-uaa/gateway/src/test/javascript/jest.conf.js new file mode 100644 index 0000000000..80948154fd --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/jest.conf.js @@ -0,0 +1,23 @@ +module.exports = { + preset: 'jest-preset-angular', + setupTestFrameworkScriptFile: '/src/test/javascript/jest.ts', + coverageDirectory: '/target/test-results/', + globals: { + 'ts-jest': { + tsConfigFile: 'tsconfig.json' + }, + __TRANSFORM_HTML__: true + }, + moduleNameMapper: { + 'app/(.*)': '/src/main/webapp/app/$1' + }, + reporters: [ + 'default', + [ 'jest-junit', { output: './target/test-results/jest/TESTS-results.xml' } ] + ], + testResultsProcessor: 'jest-sonar-reporter', + transformIgnorePatterns: ['node_modules/(?!@angular/common/locales)'], + testMatch: ['/src/test/javascript/spec/**/+(*.)+(spec.ts)'], + rootDir: '../../../', + testURL: "http://localhost/" +}; diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/jest.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/jest.ts new file mode 100644 index 0000000000..904329f538 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/jest.ts @@ -0,0 +1,2 @@ +import 'jest-preset-angular'; +import './jest-global-mocks'; diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/activate/activate.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/activate/activate.component.spec.ts new file mode 100644 index 0000000000..a67e03db43 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/activate/activate.component.spec.ts @@ -0,0 +1,83 @@ +import { TestBed, async, tick, fakeAsync, inject } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { Observable, of, throwError } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { MockActivatedRoute } from '../../../helpers/mock-route.service'; +import { ActivateService } from 'app/account/activate/activate.service'; +import { ActivateComponent } from 'app/account/activate/activate.component'; + +describe('Component Tests', () => { + describe('ActivateComponent', () => { + let comp: ActivateComponent; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [ActivateComponent], + providers: [ + { + provide: ActivatedRoute, + useValue: new MockActivatedRoute({ key: 'ABC123' }) + } + ] + }) + .overrideTemplate(ActivateComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + const fixture = TestBed.createComponent(ActivateComponent); + comp = fixture.componentInstance; + }); + + it( + 'calls activate.get with the key from params', + inject( + [ActivateService], + fakeAsync((service: ActivateService) => { + spyOn(service, 'get').and.returnValue(of()); + + comp.ngOnInit(); + tick(); + + expect(service.get).toHaveBeenCalledWith('ABC123'); + }) + ) + ); + + it( + 'should set set success to OK upon successful activation', + inject( + [ActivateService], + fakeAsync((service: ActivateService) => { + spyOn(service, 'get').and.returnValue(of({})); + + comp.ngOnInit(); + tick(); + + expect(comp.error).toBe(null); + expect(comp.success).toEqual('OK'); + }) + ) + ); + + it( + 'should set set error to ERROR upon activation failure', + inject( + [ActivateService], + fakeAsync((service: ActivateService) => { + spyOn(service, 'get').and.returnValue(throwError('ERROR')); + + comp.ngOnInit(); + tick(); + + expect(comp.error).toBe('ERROR'); + expect(comp.success).toEqual(null); + }) + ) + ); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/finish/password-reset-finish.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/finish/password-reset-finish.component.spec.ts new file mode 100644 index 0000000000..cc17dcd3e0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/finish/password-reset-finish.component.spec.ts @@ -0,0 +1,128 @@ +import { ComponentFixture, TestBed, inject, tick, fakeAsync } from '@angular/core/testing'; +import { Observable, of, throwError } from 'rxjs'; +import { Renderer, ElementRef } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { GatewayTestModule } from '../../../../test.module'; +import { PasswordResetFinishComponent } from 'app/account/password-reset/finish/password-reset-finish.component'; +import { PasswordResetFinishService } from 'app/account/password-reset/finish/password-reset-finish.service'; +import { MockActivatedRoute } from '../../../../helpers/mock-route.service'; + +describe('Component Tests', () => { + describe('PasswordResetFinishComponent', () => { + let fixture: ComponentFixture; + let comp: PasswordResetFinishComponent; + + beforeEach(() => { + fixture = TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [PasswordResetFinishComponent], + providers: [ + { + provide: ActivatedRoute, + useValue: new MockActivatedRoute({ key: 'XYZPDQ' }) + }, + { + provide: Renderer, + useValue: { + invokeElementMethod(renderElement: any, methodName: string, args?: any[]) {} + } + }, + { + provide: ElementRef, + useValue: new ElementRef(null) + } + ] + }) + .overrideTemplate(PasswordResetFinishComponent, '') + .createComponent(PasswordResetFinishComponent); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PasswordResetFinishComponent); + comp = fixture.componentInstance; + comp.ngOnInit(); + }); + + it('should define its initial state', () => { + comp.ngOnInit(); + + expect(comp.keyMissing).toBeFalsy(); + expect(comp.key).toEqual('XYZPDQ'); + expect(comp.resetAccount).toEqual({}); + }); + + it( + 'sets focus after the view has been initialized', + inject([ElementRef], (elementRef: ElementRef) => { + const element = fixture.nativeElement; + const node = { + focus() {} + }; + + elementRef.nativeElement = element; + spyOn(element, 'querySelector').and.returnValue(node); + spyOn(node, 'focus'); + + comp.ngAfterViewInit(); + + expect(element.querySelector).toHaveBeenCalledWith('#password'); + expect(node.focus).toHaveBeenCalled(); + }) + ); + + it('should ensure the two passwords entered match', () => { + comp.resetAccount.password = 'password'; + comp.confirmPassword = 'non-matching'; + + comp.finishReset(); + + expect(comp.doNotMatch).toEqual('ERROR'); + }); + + it( + 'should update success to OK after resetting password', + inject( + [PasswordResetFinishService], + fakeAsync((service: PasswordResetFinishService) => { + spyOn(service, 'save').and.returnValue(of({})); + + comp.resetAccount.password = 'password'; + comp.confirmPassword = 'password'; + + comp.finishReset(); + tick(); + + expect(service.save).toHaveBeenCalledWith({ + key: 'XYZPDQ', + newPassword: 'password' + }); + expect(comp.success).toEqual('OK'); + }) + ) + ); + + it( + 'should notify of generic error', + inject( + [PasswordResetFinishService], + fakeAsync((service: PasswordResetFinishService) => { + spyOn(service, 'save').and.returnValue(throwError('ERROR')); + + comp.resetAccount.password = 'password'; + comp.confirmPassword = 'password'; + + comp.finishReset(); + tick(); + + expect(service.save).toHaveBeenCalledWith({ + key: 'XYZPDQ', + newPassword: 'password' + }); + expect(comp.success).toBeNull(); + expect(comp.error).toEqual('ERROR'); + }) + ) + ); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/init/password-reset-init.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/init/password-reset-init.component.spec.ts new file mode 100644 index 0000000000..9a4300ae9a --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password-reset/init/password-reset-init.component.spec.ts @@ -0,0 +1,119 @@ +import { ComponentFixture, TestBed, inject } from '@angular/core/testing'; +import { Renderer, ElementRef } from '@angular/core'; +import { Observable, of, throwError } from 'rxjs'; + +import { GatewayTestModule } from '../../../../test.module'; +import { PasswordResetInitComponent } from 'app/account/password-reset/init/password-reset-init.component'; +import { PasswordResetInitService } from 'app/account/password-reset/init/password-reset-init.service'; +import { EMAIL_NOT_FOUND_TYPE } from 'app/shared'; + +describe('Component Tests', () => { + describe('PasswordResetInitComponent', () => { + let fixture: ComponentFixture; + let comp: PasswordResetInitComponent; + + beforeEach(() => { + fixture = TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [PasswordResetInitComponent], + providers: [ + { + provide: Renderer, + useValue: { + invokeElementMethod(renderElement: any, methodName: string, args?: any[]) {} + } + }, + { + provide: ElementRef, + useValue: new ElementRef(null) + } + ] + }) + .overrideTemplate(PasswordResetInitComponent, '') + .createComponent(PasswordResetInitComponent); + comp = fixture.componentInstance; + comp.ngOnInit(); + }); + + it('should define its initial state', () => { + expect(comp.success).toBeUndefined(); + expect(comp.error).toBeUndefined(); + expect(comp.errorEmailNotExists).toBeUndefined(); + expect(comp.resetAccount).toEqual({}); + }); + + it( + 'sets focus after the view has been initialized', + inject([ElementRef], (elementRef: ElementRef) => { + const element = fixture.nativeElement; + const node = { + focus() {} + }; + + elementRef.nativeElement = element; + spyOn(element, 'querySelector').and.returnValue(node); + spyOn(node, 'focus'); + + comp.ngAfterViewInit(); + + expect(element.querySelector).toHaveBeenCalledWith('#email'); + expect(node.focus).toHaveBeenCalled(); + }) + ); + + it( + 'notifies of success upon successful requestReset', + inject([PasswordResetInitService], (service: PasswordResetInitService) => { + spyOn(service, 'save').and.returnValue(of({})); + comp.resetAccount.email = 'user@domain.com'; + + comp.requestReset(); + + expect(service.save).toHaveBeenCalledWith('user@domain.com'); + expect(comp.success).toEqual('OK'); + expect(comp.error).toBeNull(); + expect(comp.errorEmailNotExists).toBeNull(); + }) + ); + + it( + 'notifies of unknown email upon email address not registered/400', + inject([PasswordResetInitService], (service: PasswordResetInitService) => { + spyOn(service, 'save').and.returnValue( + throwError({ + status: 400, + error: { type: EMAIL_NOT_FOUND_TYPE } + }) + ); + comp.resetAccount.email = 'user@domain.com'; + + comp.requestReset(); + + expect(service.save).toHaveBeenCalledWith('user@domain.com'); + expect(comp.success).toBeNull(); + expect(comp.error).toBeNull(); + expect(comp.errorEmailNotExists).toEqual('ERROR'); + }) + ); + + it( + 'notifies of error upon error response', + inject([PasswordResetInitService], (service: PasswordResetInitService) => { + spyOn(service, 'save').and.returnValue( + throwError({ + status: 503, + data: 'something else' + }) + ); + comp.resetAccount.email = 'user@domain.com'; + + comp.requestReset(); + + expect(service.save).toHaveBeenCalledWith('user@domain.com'); + expect(comp.success).toBeNull(); + expect(comp.errorEmailNotExists).toBeNull(); + expect(comp.error).toEqual('ERROR'); + }) + ); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password-strength-bar.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password-strength-bar.component.spec.ts new file mode 100644 index 0000000000..b856cf4fd7 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password-strength-bar.component.spec.ts @@ -0,0 +1,50 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; + +import { PasswordStrengthBarComponent } from 'app/account/password/password-strength-bar.component'; + +describe('Component Tests', () => { + describe('PasswordStrengthBarComponent', () => { + let comp: PasswordStrengthBarComponent; + let fixture: ComponentFixture; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + declarations: [PasswordStrengthBarComponent] + }) + .overrideTemplate(PasswordStrengthBarComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(PasswordStrengthBarComponent); + comp = fixture.componentInstance; + }); + + describe('PasswordStrengthBarComponents', () => { + it('should initialize with default values', () => { + expect(comp.measureStrength('')).toBe(0); + expect(comp.colors).toEqual(['#F00', '#F90', '#FF0', '#9F0', '#0F0']); + expect(comp.getColor(0).idx).toBe(1); + expect(comp.getColor(0).col).toBe(comp.colors[0]); + }); + + it('should increase strength upon password value change', () => { + expect(comp.measureStrength('')).toBe(0); + expect(comp.measureStrength('aa')).toBeGreaterThanOrEqual(comp.measureStrength('')); + expect(comp.measureStrength('aa^6')).toBeGreaterThanOrEqual(comp.measureStrength('aa')); + expect(comp.measureStrength('Aa090(**)')).toBeGreaterThanOrEqual(comp.measureStrength('aa^6')); + expect(comp.measureStrength('Aa090(**)+-07365')).toBeGreaterThanOrEqual(comp.measureStrength('Aa090(**)')); + }); + + it('should change the color based on strength', () => { + expect(comp.getColor(0).col).toBe(comp.colors[0]); + expect(comp.getColor(11).col).toBe(comp.colors[1]); + expect(comp.getColor(22).col).toBe(comp.colors[2]); + expect(comp.getColor(33).col).toBe(comp.colors[3]); + expect(comp.getColor(44).col).toBe(comp.colors[4]); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password.component.spec.ts new file mode 100644 index 0000000000..7665cc3a12 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/password/password.component.spec.ts @@ -0,0 +1,91 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { HttpResponse } from '@angular/common/http'; +import { Observable, of, throwError } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { PasswordComponent } from 'app/account/password/password.component'; +import { PasswordService } from 'app/account/password/password.service'; + +describe('Component Tests', () => { + describe('PasswordComponent', () => { + let comp: PasswordComponent; + let fixture: ComponentFixture; + let service: PasswordService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [PasswordComponent], + providers: [] + }) + .overrideTemplate(PasswordComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(PasswordComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(PasswordService); + }); + + it('should show error if passwords do not match', () => { + // GIVEN + comp.newPassword = 'password1'; + comp.confirmPassword = 'password2'; + // WHEN + comp.changePassword(); + // THEN + expect(comp.doNotMatch).toBe('ERROR'); + expect(comp.error).toBeNull(); + expect(comp.success).toBeNull(); + }); + + it('should call Auth.changePassword when passwords match', () => { + // GIVEN + const passwordValues = { + currentPassword: 'oldPassword', + newPassword: 'myPassword' + }; + + spyOn(service, 'save').and.returnValue(of(new HttpResponse({ body: true }))); + comp.currentPassword = passwordValues.currentPassword; + comp.newPassword = comp.confirmPassword = passwordValues.newPassword; + + // WHEN + comp.changePassword(); + + // THEN + expect(service.save).toHaveBeenCalledWith(passwordValues.newPassword, passwordValues.currentPassword); + }); + + it('should set success to OK upon success', function() { + // GIVEN + spyOn(service, 'save').and.returnValue(of(new HttpResponse({ body: true }))); + comp.newPassword = comp.confirmPassword = 'myPassword'; + + // WHEN + comp.changePassword(); + + // THEN + expect(comp.doNotMatch).toBeNull(); + expect(comp.error).toBeNull(); + expect(comp.success).toBe('OK'); + }); + + it('should notify of error if change password fails', function() { + // GIVEN + spyOn(service, 'save').and.returnValue(throwError('ERROR')); + comp.newPassword = comp.confirmPassword = 'myPassword'; + + // WHEN + comp.changePassword(); + + // THEN + expect(comp.doNotMatch).toBeNull(); + expect(comp.success).toBeNull(); + expect(comp.error).toBe('ERROR'); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/register/register.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/register/register.component.spec.ts new file mode 100644 index 0000000000..89793ae6b3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/register/register.component.spec.ts @@ -0,0 +1,135 @@ +import { ComponentFixture, TestBed, async, inject, tick, fakeAsync } from '@angular/core/testing'; +import { Observable, of, throwError } from 'rxjs'; + +import { JhiLanguageService } from 'ng-jhipster'; +import { MockLanguageService } from '../../../helpers/mock-language.service'; +import { GatewayTestModule } from '../../../test.module'; +import { EMAIL_ALREADY_USED_TYPE, LOGIN_ALREADY_USED_TYPE } from 'app/shared'; +import { Register } from 'app/account/register/register.service'; +import { RegisterComponent } from 'app/account/register/register.component'; + +describe('Component Tests', () => { + describe('RegisterComponent', () => { + let fixture: ComponentFixture; + let comp: RegisterComponent; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [RegisterComponent] + }) + .overrideTemplate(RegisterComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(RegisterComponent); + comp = fixture.componentInstance; + comp.ngOnInit(); + }); + + it('should ensure the two passwords entered match', () => { + comp.registerAccount.password = 'password'; + comp.confirmPassword = 'non-matching'; + + comp.register(); + + expect(comp.doNotMatch).toEqual('ERROR'); + }); + + it( + 'should update success to OK after creating an account', + inject( + [Register, JhiLanguageService], + fakeAsync((service: Register, mockTranslate: MockLanguageService) => { + spyOn(service, 'save').and.returnValue(of({})); + comp.registerAccount.password = comp.confirmPassword = 'password'; + + comp.register(); + tick(); + + expect(service.save).toHaveBeenCalledWith({ + password: 'password', + langKey: 'en' + }); + expect(comp.success).toEqual(true); + expect(comp.registerAccount.langKey).toEqual('en'); + expect(mockTranslate.getCurrentSpy).toHaveBeenCalled(); + expect(comp.errorUserExists).toBeNull(); + expect(comp.errorEmailExists).toBeNull(); + expect(comp.error).toBeNull(); + }) + ) + ); + + it( + 'should notify of user existence upon 400/login already in use', + inject( + [Register], + fakeAsync((service: Register) => { + spyOn(service, 'save').and.returnValue( + throwError({ + status: 400, + error: { type: LOGIN_ALREADY_USED_TYPE } + }) + ); + comp.registerAccount.password = comp.confirmPassword = 'password'; + + comp.register(); + tick(); + + expect(comp.errorUserExists).toEqual('ERROR'); + expect(comp.errorEmailExists).toBeNull(); + expect(comp.error).toBeNull(); + }) + ) + ); + + it( + 'should notify of email existence upon 400/email address already in use', + inject( + [Register], + fakeAsync((service: Register) => { + spyOn(service, 'save').and.returnValue( + throwError({ + status: 400, + error: { type: EMAIL_ALREADY_USED_TYPE } + }) + ); + comp.registerAccount.password = comp.confirmPassword = 'password'; + + comp.register(); + tick(); + + expect(comp.errorEmailExists).toEqual('ERROR'); + expect(comp.errorUserExists).toBeNull(); + expect(comp.error).toBeNull(); + }) + ) + ); + + it( + 'should notify of generic error', + inject( + [Register], + fakeAsync((service: Register) => { + spyOn(service, 'save').and.returnValue( + throwError({ + status: 503 + }) + ); + comp.registerAccount.password = comp.confirmPassword = 'password'; + + comp.register(); + tick(); + + expect(comp.errorUserExists).toBeNull(); + expect(comp.errorEmailExists).toBeNull(); + expect(comp.error).toEqual('ERROR'); + }) + ) + ); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/settings/settings.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/settings/settings.component.spec.ts new file mode 100644 index 0000000000..253c2dd555 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/account/settings/settings.component.spec.ts @@ -0,0 +1,85 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { Observable, throwError } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { Principal, AccountService } from 'app/core'; +import { SettingsComponent } from 'app/account/settings/settings.component'; + +describe('Component Tests', () => { + describe('SettingsComponent', () => { + let comp: SettingsComponent; + let fixture: ComponentFixture; + let mockAuth: any; + let mockPrincipal: any; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [SettingsComponent], + providers: [] + }) + .overrideTemplate(SettingsComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(SettingsComponent); + comp = fixture.componentInstance; + mockAuth = fixture.debugElement.injector.get(AccountService); + mockPrincipal = fixture.debugElement.injector.get(Principal); + }); + + it('should send the current identity upon save', () => { + // GIVEN + const accountValues = { + firstName: 'John', + lastName: 'Doe', + + activated: true, + email: 'john.doe@mail.com', + langKey: 'en', + login: 'john' + }; + mockPrincipal.setResponse(accountValues); + + // WHEN + comp.settingsAccount = accountValues; + comp.save(); + + // THEN + expect(mockPrincipal.identitySpy).toHaveBeenCalled(); + expect(mockAuth.saveSpy).toHaveBeenCalledWith(accountValues); + expect(comp.settingsAccount).toEqual(accountValues); + }); + + it('should notify of success upon successful save', () => { + // GIVEN + const accountValues = { + firstName: 'John', + lastName: 'Doe' + }; + mockPrincipal.setResponse(accountValues); + + // WHEN + comp.save(); + + // THEN + expect(comp.error).toBeNull(); + expect(comp.success).toBe('OK'); + }); + + it('should notify of error upon failed save', () => { + // GIVEN + mockAuth.saveSpy.and.returnValue(throwError('ERROR')); + + // WHEN + comp.save(); + + // THEN + expect(comp.error).toEqual('ERROR'); + expect(comp.success).toBeNull(); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.component.spec.ts new file mode 100644 index 0000000000..0a53aeddb3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.component.spec.ts @@ -0,0 +1,135 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { Observable, of } from 'rxjs'; +import { HttpHeaders, HttpResponse } from '@angular/common/http'; + +import { GatewayTestModule } from '../../../test.module'; +import { AuditsComponent } from 'app/admin/audits/audits.component'; +import { AuditsService } from 'app/admin/audits/audits.service'; +import { Audit } from 'app/admin/audits/audit.model'; +import { ITEMS_PER_PAGE } from 'app/shared'; + +function build2DigitsDatePart(datePart: number) { + return `0${datePart}`.slice(-2); +} + +function getDate(isToday = true) { + let date: Date = new Date(); + if (isToday) { + // Today + 1 day - needed if the current day must be included + date.setDate(date.getDate() + 1); + } else { + // get last month + if (date.getMonth() === 0) { + date = new Date(date.getFullYear() - 1, 11, date.getDate()); + } else { + date = new Date(date.getFullYear(), date.getMonth() - 1, date.getDate()); + } + } + const monthString = build2DigitsDatePart(date.getMonth() + 1); + const dateString = build2DigitsDatePart(date.getDate()); + return `${date.getFullYear()}-${monthString}-${dateString}`; +} + +describe('Component Tests', () => { + describe('AuditsComponent', () => { + let comp: AuditsComponent; + let fixture: ComponentFixture; + let service: AuditsService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [AuditsComponent], + providers: [AuditsService] + }) + .overrideTemplate(AuditsComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(AuditsComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(AuditsService); + }); + + describe('today function ', () => { + it('should set toDate to current date', () => { + comp.today(); + expect(comp.toDate).toBe(getDate()); + }); + }); + + describe('previousMonth function ', () => { + it('should set fromDate to current date', () => { + comp.previousMonth(); + expect(comp.fromDate).toBe(getDate(false)); + }); + }); + + describe('By default, on init', () => { + it('should set all default values correctly', () => { + fixture.detectChanges(); + expect(comp.toDate).toBe(getDate()); + expect(comp.fromDate).toBe(getDate(false)); + expect(comp.itemsPerPage).toBe(ITEMS_PER_PAGE); + expect(comp.page).toBe(10); + expect(comp.reverse).toBeFalsy(); + expect(comp.predicate).toBe('id'); + }); + }); + + describe('OnInit', () => { + it('Should call load all on init', () => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + const audit = new Audit({ remoteAddress: '127.0.0.1', sessionId: '123' }, 'user', '20140101', 'AUTHENTICATION_SUCCESS'); + spyOn(service, 'query').and.returnValue( + of( + new HttpResponse({ + body: [audit], + headers + }) + ) + ); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.query).toHaveBeenCalled(); + expect(comp.audits[0]).toEqual(jasmine.objectContaining(audit)); + }); + }); + + describe('Create sort object', () => { + it('Should sort only by id asc', () => { + // GIVEN + comp.predicate = 'id'; + comp.reverse = false; + + // WHEN + const sort = comp.sort(); + + // THEN + expect(sort.length).toEqual(1); + expect(sort[0]).toEqual('id,desc'); + }); + + it('Should sort by timestamp asc then by id', () => { + // GIVEN + comp.predicate = 'timestamp'; + comp.reverse = true; + + // WHEN + const sort = comp.sort(); + + // THEN + expect(sort.length).toEqual(2); + expect(sort[0]).toEqual('timestamp,asc'); + expect(sort[1]).toEqual('id'); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.service.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.service.spec.ts new file mode 100644 index 0000000000..d03559108b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/audits/audits.service.spec.ts @@ -0,0 +1,59 @@ +import { TestBed } from '@angular/core/testing'; + +import { AuditsService } from 'app/admin/audits/audits.service'; +import { Audit } from 'app/admin/audits/audit.model'; +import { SERVER_API_URL } from 'app/app.constants'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; + +describe('Service Tests', () => { + describe('Audits Service', () => { + let service: AuditsService; + let httpMock; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule] + }); + + service = TestBed.get(AuditsService); + httpMock = TestBed.get(HttpTestingController); + }); + + afterEach(() => { + httpMock.verify(); + }); + + describe('Service methods', () => { + it('should call correct URL', () => { + service.query({}).subscribe(() => {}); + + const req = httpMock.expectOne({ method: 'GET' }); + const resourceUrl = SERVER_API_URL + 'uaa/management/audits'; + expect(req.request.url).toEqual(resourceUrl); + }); + + it('should return Audits', () => { + const audit = new Audit({ remoteAddress: '127.0.0.1', sessionId: '123' }, 'user', '20140101', 'AUTHENTICATION_SUCCESS'); + + service.query({}).subscribe(received => { + expect(received.body[0]).toEqual(audit); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush([audit]); + }); + + it('should propagate not found response', () => { + service.query({}).subscribe(null, (_error: any) => { + expect(_error.status).toEqual(404); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush('Invalid request parameters', { + status: 404, + statusText: 'Bad Request' + }); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.component.spec.ts new file mode 100644 index 0000000000..463c9373a9 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.component.spec.ts @@ -0,0 +1,73 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { of } from 'rxjs'; +import { HttpHeaders, HttpResponse } from '@angular/common/http'; + +import { GatewayTestModule } from '../../../test.module'; +import { JhiConfigurationComponent } from 'app/admin/configuration/configuration.component'; +import { JhiConfigurationService } from 'app/admin/configuration/configuration.service'; +import { ITEMS_PER_PAGE } from 'app/shared'; +import { Log } from 'app/admin'; + +describe('Component Tests', () => { + describe('JhiConfigurationComponent', () => { + let comp: JhiConfigurationComponent; + let fixture: ComponentFixture; + let service: JhiConfigurationService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [JhiConfigurationComponent], + providers: [JhiConfigurationService] + }) + .overrideTemplate(JhiConfigurationComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(JhiConfigurationComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(JhiConfigurationService); + }); + + describe('OnInit', () => { + it('should set all default values correctly', () => { + expect(comp.configKeys).toEqual([]); + expect(comp.filter).toBe(''); + expect(comp.orderProp).toBe('prefix'); + expect(comp.reverse).toBe(false); + }); + it('Should call load all on init', () => { + // GIVEN + const body = [{ config: 'test', properties: 'test' }, { config: 'test2' }]; + const envConfig = { envConfig: 'test' }; + spyOn(service, 'get').and.returnValue(of(body)); + spyOn(service, 'getEnv').and.returnValue(of(envConfig)); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.get).toHaveBeenCalled(); + expect(service.getEnv).toHaveBeenCalled(); + expect(comp.configKeys).toEqual([['0', '1', '2', '3']]); + expect(comp.allConfiguration).toEqual(envConfig); + }); + }); + describe('keys method', () => { + it('should return the keys of an Object', () => { + // GIVEN + const data = { + key1: 'test', + key2: 'test2' + }; + + // THEN + expect(comp.keys(data)).toEqual(['key1', 'key2']); + expect(comp.keys(undefined)).toEqual([]); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.service.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.service.spec.ts new file mode 100644 index 0000000000..6039044b7f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/configuration/configuration.service.spec.ts @@ -0,0 +1,64 @@ +import { TestBed } from '@angular/core/testing'; + +import { JhiConfigurationService } from 'app/admin/configuration/configuration.service'; +import { SERVER_API_URL } from 'app/app.constants'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { HttpResponse } from '@angular/common/http'; + +describe('Service Tests', () => { + describe('Logs Service', () => { + let service: JhiConfigurationService; + let httpMock; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule] + }); + + service = TestBed.get(JhiConfigurationService); + httpMock = TestBed.get(HttpTestingController); + }); + + afterEach(() => { + httpMock.verify(); + }); + + describe('Service methods', () => { + it('should call correct URL', () => { + service.get().subscribe(() => {}); + + const req = httpMock.expectOne({ method: 'GET' }); + const resourceUrl = SERVER_API_URL + 'management/configprops'; + expect(req.request.url).toEqual(resourceUrl); + }); + + it('should get the config', () => { + const angularConfig = { + contexts: { + angular: { + beans: ['test2'] + } + } + }; + service.get().subscribe(received => { + expect(received.body[0]).toEqual(angularConfig); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush(angularConfig); + }); + + it('should get the env', () => { + const propertySources = new HttpResponse({ + body: [{ name: 'test1', properties: 'test1' }, { name: 'test2', properties: 'test2' }] + }); + service.get().subscribe(received => { + expect(received.body[0]).toEqual(propertySources); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush(propertySources); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/health/health.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/health/health.component.spec.ts new file mode 100644 index 0000000000..1ffe425fd5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/health/health.component.spec.ts @@ -0,0 +1,323 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { of, throwError } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { JhiHealthCheckComponent } from 'app/admin/health/health.component'; +import { JhiHealthService } from 'app/admin/health/health.service'; + +describe('Component Tests', () => { + describe('JhiHealthCheckComponent', () => { + let comp: JhiHealthCheckComponent; + let fixture: ComponentFixture; + let service: JhiHealthService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [JhiHealthCheckComponent] + }) + .overrideTemplate(JhiHealthCheckComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(JhiHealthCheckComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(JhiHealthService); + }); + + describe('baseName and subSystemName', () => { + it('should return the basename when it has no sub system', () => { + expect(comp.baseName('base')).toBe('base'); + }); + + it('should return the basename when it has sub systems', () => { + expect(comp.baseName('base.subsystem.system')).toBe('base'); + }); + + it('should return the sub system name', () => { + expect(comp.subSystemName('subsystem')).toBe(''); + }); + + it('should return the subsystem when it has multiple keys', () => { + expect(comp.subSystemName('subsystem.subsystem.system')).toBe(' - subsystem.system'); + }); + }); + + describe('transformHealthData', () => { + it('should flatten empty health data', () => { + const data = {}; + const expected = []; + expect(service.transformHealthData(data)).toEqual(expected); + }); + + it('should flatten health data with no subsystems', () => { + const data = { + details: { + status: 'UP', + db: { + status: 'UP', + database: 'H2', + hello: '1' + }, + mail: { + status: 'UP', + error: 'mail.a.b.c' + } + } + }; + const expected = [ + { + name: 'db', + status: 'UP', + details: { + database: 'H2', + hello: '1' + } + }, + { + name: 'mail', + error: 'mail.a.b.c', + status: 'UP' + } + ]; + expect(service.transformHealthData(data)).toEqual(expected); + }); + + it('should flatten health data with subsystems at level 1, main system has no additional information', () => { + const data = { + details: { + status: 'UP', + db: { + status: 'UP', + database: 'H2', + hello: '1' + }, + mail: { + status: 'UP', + error: 'mail.a.b.c' + }, + system: { + status: 'DOWN', + subsystem1: { + status: 'UP', + property1: 'system.subsystem1.property1' + }, + subsystem2: { + status: 'DOWN', + error: 'system.subsystem1.error', + property2: 'system.subsystem2.property2' + } + } + } + }; + const expected = [ + { + name: 'db', + status: 'UP', + details: { + database: 'H2', + hello: '1' + } + }, + { + name: 'mail', + error: 'mail.a.b.c', + status: 'UP' + }, + { + name: 'system.subsystem1', + status: 'UP', + details: { + property1: 'system.subsystem1.property1' + } + }, + { + name: 'system.subsystem2', + error: 'system.subsystem1.error', + status: 'DOWN', + details: { + property2: 'system.subsystem2.property2' + } + } + ]; + expect(service.transformHealthData(data)).toEqual(expected); + }); + + it('should flatten health data with subsystems at level 1, main system has additional information', () => { + const data = { + details: { + status: 'UP', + db: { + status: 'UP', + database: 'H2', + hello: '1' + }, + mail: { + status: 'UP', + error: 'mail.a.b.c' + }, + system: { + status: 'DOWN', + property1: 'system.property1', + subsystem1: { + status: 'UP', + property1: 'system.subsystem1.property1' + }, + subsystem2: { + status: 'DOWN', + error: 'system.subsystem1.error', + property2: 'system.subsystem2.property2' + } + } + } + }; + const expected = [ + { + name: 'db', + status: 'UP', + details: { + database: 'H2', + hello: '1' + } + }, + { + name: 'mail', + error: 'mail.a.b.c', + status: 'UP' + }, + { + name: 'system', + status: 'DOWN', + details: { + property1: 'system.property1' + } + }, + { + name: 'system.subsystem1', + status: 'UP', + details: { + property1: 'system.subsystem1.property1' + } + }, + { + name: 'system.subsystem2', + error: 'system.subsystem1.error', + status: 'DOWN', + details: { + property2: 'system.subsystem2.property2' + } + } + ]; + expect(service.transformHealthData(data)).toEqual(expected); + }); + + it('should flatten health data with subsystems at level 1, main system has additional error', () => { + const data = { + details: { + status: 'UP', + db: { + status: 'UP', + database: 'H2', + hello: '1' + }, + mail: { + status: 'UP', + error: 'mail.a.b.c' + }, + system: { + status: 'DOWN', + error: 'show me', + subsystem1: { + status: 'UP', + property1: 'system.subsystem1.property1' + }, + subsystem2: { + status: 'DOWN', + error: 'system.subsystem1.error', + property2: 'system.subsystem2.property2' + } + } + } + }; + const expected = [ + { + name: 'db', + status: 'UP', + details: { + database: 'H2', + hello: '1' + } + }, + { + name: 'mail', + error: 'mail.a.b.c', + status: 'UP' + }, + { + name: 'system', + error: 'show me', + status: 'DOWN' + }, + { + name: 'system.subsystem1', + status: 'UP', + details: { + property1: 'system.subsystem1.property1' + } + }, + { + name: 'system.subsystem2', + error: 'system.subsystem1.error', + status: 'DOWN', + details: { + property2: 'system.subsystem2.property2' + } + } + ]; + expect(service.transformHealthData(data)).toEqual(expected); + }); + }); + + describe('getBadgeClass', () => { + it('should get badge class', () => { + const upBadgeClass = comp.getBadgeClass('UP'); + const downBadgeClass = comp.getBadgeClass('DOWN'); + expect(upBadgeClass).toEqual('badge-success'); + expect(downBadgeClass).toEqual('badge-danger'); + }); + }); + + describe('refresh', () => { + it('should call refresh on init', () => { + // GIVEN + spyOn(service, 'checkHealth').and.returnValue(of(new HttpResponse())); + spyOn(service, 'transformHealthData').and.returnValue(of({ data: 'test' })); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.checkHealth).toHaveBeenCalled(); + expect(service.transformHealthData).toHaveBeenCalled(); + expect(comp.healthData.value).toEqual({ data: 'test' }); + }); + it('should handle a 503 on refreshing health data', () => { + // GIVEN + spyOn(service, 'checkHealth').and.returnValue(throwError(new HttpErrorResponse({ status: 503, error: 'Mail down' }))); + spyOn(service, 'transformHealthData').and.returnValue(of({ health: 'down' })); + + // WHEN + comp.refresh(); + + // THEN + expect(service.checkHealth).toHaveBeenCalled(); + expect(service.transformHealthData).toHaveBeenCalled(); + expect(comp.healthData.value).toEqual({ health: 'down' }); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.component.spec.ts new file mode 100644 index 0000000000..77587271c9 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.component.spec.ts @@ -0,0 +1,79 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { of } from 'rxjs'; +import { HttpHeaders, HttpResponse } from '@angular/common/http'; + +import { GatewayTestModule } from '../../../test.module'; +import { LogsComponent } from 'app/admin/logs/logs.component'; +import { LogsService } from 'app/admin/logs/logs.service'; +import { ITEMS_PER_PAGE } from 'app/shared'; +import { Log } from 'app/admin'; + +describe('Component Tests', () => { + describe('LogsComponent', () => { + let comp: LogsComponent; + let fixture: ComponentFixture; + let service: LogsService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [LogsComponent], + providers: [LogsService] + }) + .overrideTemplate(LogsComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(LogsComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(LogsService); + }); + + describe('OnInit', () => { + it('should set all default values correctly', () => { + expect(comp.filter).toBe(''); + expect(comp.orderProp).toBe('name'); + expect(comp.reverse).toBe(false); + }); + it('Should call load all on init', () => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + const log = new Log('main', 'WARN'); + spyOn(service, 'findAll').and.returnValue( + of( + new HttpResponse({ + body: [log], + headers + }) + ) + ); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.findAll).toHaveBeenCalled(); + expect(comp.loggers[0]).toEqual(jasmine.objectContaining(log)); + }); + }); + describe('change log level', () => { + it('should change log level correctly', () => { + // GIVEN + const log = new Log('main', 'ERROR'); + spyOn(service, 'changeLevel').and.returnValue(of(new HttpResponse())); + spyOn(service, 'findAll').and.returnValue(of(new HttpResponse({ body: [log] }))); + + // WHEN + comp.changeLevel('main', 'ERROR'); + + // THEN + expect(service.changeLevel).toHaveBeenCalled(); + expect(service.findAll).toHaveBeenCalled(); + expect(comp.loggers[0]).toEqual(jasmine.objectContaining(log)); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.service.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.service.spec.ts new file mode 100644 index 0000000000..c34833922e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/logs/logs.service.spec.ts @@ -0,0 +1,58 @@ +import { TestBed } from '@angular/core/testing'; + +import { LogsService } from 'app/admin/logs/logs.service'; +import { Log } from 'app/admin/logs/log.model'; +import { SERVER_API_URL } from 'app/app.constants'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; + +describe('Service Tests', () => { + describe('Logs Service', () => { + let service: LogsService; + let httpMock; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule] + }); + + service = TestBed.get(LogsService); + httpMock = TestBed.get(HttpTestingController); + }); + + afterEach(() => { + httpMock.verify(); + }); + + describe('Service methods', () => { + it('should call correct URL', () => { + service.findAll().subscribe(() => {}); + + const req = httpMock.expectOne({ method: 'GET' }); + const resourceUrl = SERVER_API_URL + 'management/logs'; + expect(req.request.url).toEqual(resourceUrl); + }); + + it('should return Logs', () => { + const log = new Log('main', 'ERROR'); + + service.findAll().subscribe(received => { + expect(received.body[0]).toEqual(log); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush([log]); + }); + + it('should change log level', () => { + const log = new Log('main', 'ERROR'); + + service.changeLevel(log).subscribe(received => { + expect(received.body[0]).toEqual(log); + }); + + const req = httpMock.expectOne({ method: 'PUT' }); + req.flush([log]); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics-modal.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics-modal.component.spec.ts new file mode 100644 index 0000000000..917d3e4f74 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics-modal.component.spec.ts @@ -0,0 +1,90 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { of, throwError } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { JhiMetricsMonitoringModalComponent } from 'app/admin/metrics/metrics-modal.component'; +import { JhiMetricsService } from 'app/admin/metrics/metrics.service'; + +describe('Component Tests', () => { + describe('JhiMetricsMonitoringModalComponent', () => { + let comp: JhiMetricsMonitoringModalComponent; + let fixture: ComponentFixture; + let service: JhiMetricsService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [JhiMetricsMonitoringModalComponent] + }) + .overrideTemplate(JhiMetricsMonitoringModalComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(JhiMetricsMonitoringModalComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(JhiMetricsService); + }); + + describe('ngOnInit', () => { + it('should count the numbers of each thread type', () => { + comp.threadDump = [ + { name: 'test1', threadState: 'RUNNABLE' }, + { name: 'test2', threadState: 'WAITING' }, + { name: 'test3', threadState: 'TIMED_WAITING' }, + { name: 'test4', threadState: 'BLOCKED' }, + { name: 'test5', threadState: 'BLOCKED' }, + { name: 'test5', threadState: 'NONE' } + ]; + fixture.detectChanges(); + + expect(comp.threadDumpRunnable).toBe(1); + expect(comp.threadDumpWaiting).toBe(1); + expect(comp.threadDumpTimedWaiting).toBe(1); + expect(comp.threadDumpBlocked).toBe(2); + expect(comp.threadDumpAll).toBe(5); + }); + + it('should return badge-info for WAITING', () => { + expect(comp.getBadgeClass('WAITING')).toBe('badge-info'); + }); + + it('should return badge-warning for TIMED_WAITING', () => { + expect(comp.getBadgeClass('TIMED_WAITING')).toBe('badge-warning'); + }); + + it('should return badge-danger for BLOCKED', () => { + expect(comp.getBadgeClass('BLOCKED')).toBe('badge-danger'); + }); + + it('should return undefined for anything else', () => { + expect(comp.getBadgeClass('')).toBe(undefined); + }); + }); + + describe('getBadgeClass', () => { + it('should return badge-success for RUNNABLE', () => { + expect(comp.getBadgeClass('RUNNABLE')).toBe('badge-success'); + }); + + it('should return badge-info for WAITING', () => { + expect(comp.getBadgeClass('WAITING')).toBe('badge-info'); + }); + + it('should return badge-warning for TIMED_WAITING', () => { + expect(comp.getBadgeClass('TIMED_WAITING')).toBe('badge-warning'); + }); + + it('should return badge-danger for BLOCKED', () => { + expect(comp.getBadgeClass('BLOCKED')).toBe('badge-danger'); + }); + + it('should return undefined for anything else', () => { + expect(comp.getBadgeClass('')).toBe(undefined); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.component.spec.ts new file mode 100644 index 0000000000..6acc877aa3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.component.spec.ts @@ -0,0 +1,66 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { HttpResponse, HttpErrorResponse } from '@angular/common/http'; +import { of, throwError } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { JhiMetricsMonitoringComponent } from 'app/admin/metrics/metrics.component'; +import { JhiMetricsService } from 'app/admin/metrics/metrics.service'; + +describe('Component Tests', () => { + describe('JhiMetricsMonitoringComponent', () => { + let comp: JhiMetricsMonitoringComponent; + let fixture: ComponentFixture; + let service: JhiMetricsService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [JhiMetricsMonitoringComponent] + }) + .overrideTemplate(JhiMetricsMonitoringComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(JhiMetricsMonitoringComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(JhiMetricsService); + }); + + describe('refresh', () => { + it('should call refresh on init', () => { + // GIVEN + const response = { + timers: { + service: 'test', + unrelatedKey: 'test' + }, + gauges: { + 'jcache.statistics': { + value: 2 + }, + unrelatedKey: 'test' + } + }; + spyOn(service, 'getMetrics').and.returnValue(of(response)); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.getMetrics).toHaveBeenCalled(); + expect(comp.servicesStats).toEqual({ service: 'test' }); + expect(comp.cachesStats).toEqual({ jcache: { name: 17, value: 2 } }); + }); + }); + + describe('isNan', () => { + it('should return if a variable is NaN', () => { + expect(comp.filterNaN(1)).toBe(1); + expect(comp.filterNaN('test')).toBe(0); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.service.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.service.spec.ts new file mode 100644 index 0000000000..62fab44ba8 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/metrics/metrics.service.spec.ts @@ -0,0 +1,57 @@ +import { TestBed } from '@angular/core/testing'; + +import { JhiMetricsService } from 'app/admin/metrics/metrics.service'; +import { SERVER_API_URL } from 'app/app.constants'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; + +describe('Service Tests', () => { + describe('Logs Service', () => { + let service: JhiMetricsService; + let httpMock; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule] + }); + + service = TestBed.get(JhiMetricsService); + httpMock = TestBed.get(HttpTestingController); + }); + + afterEach(() => { + httpMock.verify(); + }); + + describe('Service methods', () => { + it('should call correct URL', () => { + service.getMetrics().subscribe(() => {}); + + const req = httpMock.expectOne({ method: 'GET' }); + const resourceUrl = SERVER_API_URL + 'management/metrics'; + expect(req.request.url).toEqual(resourceUrl); + }); + + it('should return Metrics', () => { + const metrics = []; + + service.getMetrics().subscribe(received => { + expect(received.body[0]).toEqual(metrics); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush([metrics]); + }); + + it('should return Thread Dump', () => { + const dump = [{ name: 'test1', threadState: 'RUNNABLE' }]; + + service.threadDump().subscribe(received => { + expect(received.body[0]).toEqual(dump); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush([dump]); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-delete-dialog.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-delete-dialog.component.spec.ts new file mode 100644 index 0000000000..72406e4a93 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-delete-dialog.component.spec.ts @@ -0,0 +1,59 @@ +import { ComponentFixture, TestBed, async, inject, fakeAsync, tick } from '@angular/core/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { Observable, of } from 'rxjs'; +import { JhiEventManager } from 'ng-jhipster'; + +import { GatewayTestModule } from '../../../test.module'; +import { UserMgmtDeleteDialogComponent } from 'app/admin/user-management/user-management-delete-dialog.component'; +import { UserService } from 'app/core'; + +describe('Component Tests', () => { + describe('User Management Delete Component', () => { + let comp: UserMgmtDeleteDialogComponent; + let fixture: ComponentFixture; + let service: UserService; + let mockEventManager: any; + let mockActiveModal: any; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [UserMgmtDeleteDialogComponent] + }) + .overrideTemplate(UserMgmtDeleteDialogComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(UserMgmtDeleteDialogComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(UserService); + mockEventManager = fixture.debugElement.injector.get(JhiEventManager); + mockActiveModal = fixture.debugElement.injector.get(NgbActiveModal); + }); + + describe('confirmDelete', () => { + it( + 'Should call delete service on confirmDelete', + inject( + [], + fakeAsync(() => { + // GIVEN + spyOn(service, 'delete').and.returnValue(of({})); + + // WHEN + comp.confirmDelete('user'); + tick(); + + // THEN + expect(service.delete).toHaveBeenCalledWith('user'); + expect(mockActiveModal.dismissSpy).toHaveBeenCalled(); + expect(mockEventManager.broadcastSpy).toHaveBeenCalled(); + }) + ) + ); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-detail.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-detail.component.spec.ts new file mode 100644 index 0000000000..c535523fe3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-detail.component.spec.ts @@ -0,0 +1,67 @@ +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { of } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { UserMgmtDetailComponent } from 'app/admin/user-management/user-management-detail.component'; +import { User } from 'app/core'; + +describe('Component Tests', () => { + describe('User Management Detail Component', () => { + let comp: UserMgmtDetailComponent; + let fixture: ComponentFixture; + const route = ({ + data: of({ user: new User(1, 'user', 'first', 'last', 'first@last.com', true, 'en', ['ROLE_USER'], 'admin', null, null, null) }) + } as any) as ActivatedRoute; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [UserMgmtDetailComponent], + providers: [ + { + provide: ActivatedRoute, + useValue: route + } + ] + }) + .overrideTemplate(UserMgmtDetailComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(UserMgmtDetailComponent); + comp = fixture.componentInstance; + }); + + describe('OnInit', () => { + it('Should call load all on init', () => { + // GIVEN + + // WHEN + comp.ngOnInit(); + + // THEN + expect(comp.user).toEqual( + jasmine.objectContaining({ + id: 1, + login: 'user', + firstName: 'first', + lastName: 'last', + email: 'first@last.com', + activated: true, + langKey: 'en', + authorities: ['ROLE_USER'], + createdBy: 'admin', + createdDate: null, + lastModifiedBy: null, + lastModifiedDate: null, + password: null + }) + ); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts new file mode 100644 index 0000000000..80c40f7b29 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts @@ -0,0 +1,113 @@ +import { ComponentFixture, TestBed, async, inject, fakeAsync, tick } from '@angular/core/testing'; +import { HttpResponse } from '@angular/common/http'; +import { ActivatedRoute } from '@angular/router'; +import { Observable, of } from 'rxjs'; + +import { GatewayTestModule } from '../../../test.module'; +import { UserMgmtUpdateComponent } from 'app/admin/user-management/user-management-update.component'; +import { UserService, User, JhiLanguageHelper } from 'app/core'; + +describe('Component Tests', () => { + describe('User Management Update Component', () => { + let comp: UserMgmtUpdateComponent; + let fixture: ComponentFixture; + let service: UserService; + let mockLanguageHelper: any; + const route = ({ + data: of({ user: new User(1, 'user', 'first', 'last', 'first@last.com', true, 'en', ['ROLE_USER'], 'admin', null, null, null) }) + } as any) as ActivatedRoute; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [UserMgmtUpdateComponent], + providers: [ + { + provide: ActivatedRoute, + useValue: route + } + ] + }) + .overrideTemplate(UserMgmtUpdateComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(UserMgmtUpdateComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(UserService); + mockLanguageHelper = fixture.debugElement.injector.get(JhiLanguageHelper); + }); + + describe('OnInit', () => { + it( + 'Should load authorities and language on init', + inject( + [], + fakeAsync(() => { + // GIVEN + spyOn(service, 'authorities').and.returnValue(of(['USER'])); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.authorities).toHaveBeenCalled(); + expect(comp.authorities).toEqual(['USER']); + expect(mockLanguageHelper.getAllSpy).toHaveBeenCalled(); + }) + ) + ); + }); + + describe('save', () => { + it( + 'Should call update service on save for existing user', + inject( + [], + fakeAsync(() => { + // GIVEN + const entity = new User(123); + spyOn(service, 'update').and.returnValue( + of( + new HttpResponse({ + body: entity + }) + ) + ); + comp.user = entity; + // WHEN + comp.save(); + tick(); // simulate async + + // THEN + expect(service.update).toHaveBeenCalledWith(entity); + expect(comp.isSaving).toEqual(false); + }) + ) + ); + + it( + 'Should call create service on save for new user', + inject( + [], + fakeAsync(() => { + // GIVEN + const entity = new User(); + spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity }))); + comp.user = entity; + // WHEN + comp.save(); + tick(); // simulate async + + // THEN + expect(service.create).toHaveBeenCalledWith(entity); + expect(comp.isSaving).toEqual(false); + }) + ) + ); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts new file mode 100644 index 0000000000..1088b6102f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts @@ -0,0 +1,93 @@ +import { ComponentFixture, TestBed, async, inject, fakeAsync, tick } from '@angular/core/testing'; +import { Observable, of } from 'rxjs'; +import { HttpHeaders, HttpResponse } from '@angular/common/http'; + +import { GatewayTestModule } from '../../../test.module'; +import { UserMgmtComponent } from 'app/admin/user-management/user-management.component'; +import { UserService, User } from 'app/core'; + +describe('Component Tests', () => { + describe('User Management Component', () => { + let comp: UserMgmtComponent; + let fixture: ComponentFixture; + let service: UserService; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [UserMgmtComponent] + }) + .overrideTemplate(UserMgmtComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(UserMgmtComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(UserService); + }); + + describe('OnInit', () => { + it( + 'Should call load all on init', + inject( + [], + fakeAsync(() => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + spyOn(service, 'query').and.returnValue( + of( + new HttpResponse({ + body: [new User(123)], + headers + }) + ) + ); + + // WHEN + comp.ngOnInit(); + tick(); // simulate async + + // THEN + expect(service.query).toHaveBeenCalled(); + expect(comp.users[0]).toEqual(jasmine.objectContaining({ id: 123 })); + }) + ) + ); + }); + + describe('setActive', () => { + it( + 'Should update user and call load all', + inject( + [], + fakeAsync(() => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + const user = new User(123); + spyOn(service, 'query').and.returnValue( + of( + new HttpResponse({ + body: [user], + headers + }) + ) + ); + spyOn(service, 'update').and.returnValue(of(new HttpResponse({ status: 200 }))); + + // WHEN + comp.setActive(user, true); + tick(); // simulate async + + // THEN + expect(service.update).toHaveBeenCalledWith(user); + expect(service.query).toHaveBeenCalled(); + expect(comp.users[0]).toEqual(jasmine.objectContaining({ id: 123 })); + }) + ) + ); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/core/user/user.service.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/core/user/user.service.spec.ts new file mode 100644 index 0000000000..eeb97266d4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/core/user/user.service.spec.ts @@ -0,0 +1,66 @@ +import { TestBed } from '@angular/core/testing'; +import { JhiDateUtils } from 'ng-jhipster'; + +import { UserService, User } from 'app/core'; +import { SERVER_API_URL } from 'app/app.constants'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; + +describe('Service Tests', () => { + describe('User Service', () => { + let service: UserService; + let httpMock; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [JhiDateUtils] + }); + + service = TestBed.get(UserService); + httpMock = TestBed.get(HttpTestingController); + }); + + afterEach(() => { + httpMock.verify(); + }); + + describe('Service methods', () => { + it('should call correct URL', () => { + service.find('user').subscribe(() => {}); + + const req = httpMock.expectOne({ method: 'GET' }); + const resourceUrl = SERVER_API_URL + 'uaa/api/users'; + expect(req.request.url).toEqual(`${resourceUrl}/user`); + }); + it('should return User', () => { + service.find('user').subscribe(received => { + expect(received.body.login).toEqual('user'); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush(new User(1, 'user')); + }); + + it('should return Authorities', () => { + service.authorities().subscribe(_authorities => { + expect(_authorities).toEqual(['ROLE_USER', 'ROLE_ADMIN']); + }); + const req = httpMock.expectOne({ method: 'GET' }); + + req.flush(['ROLE_USER', 'ROLE_ADMIN']); + }); + + it('should propagate not found response', () => { + service.find('user').subscribe(null, (_error: any) => { + expect(_error.status).toEqual(404); + }); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush('Invalid request parameters', { + status: 404, + statusText: 'Bad Request' + }); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-delete-dialog.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-delete-dialog.component.spec.ts new file mode 100644 index 0000000000..3413992166 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-delete-dialog.component.spec.ts @@ -0,0 +1,55 @@ +/* tslint:disable max-line-length */ +import { ComponentFixture, TestBed, inject, fakeAsync, tick } from '@angular/core/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { Observable, of } from 'rxjs'; +import { JhiEventManager } from 'ng-jhipster'; + +import { GatewayTestModule } from '../../../../test.module'; +import { QuoteDeleteDialogComponent } from 'app/entities/quotes/quote/quote-delete-dialog.component'; +import { QuoteService } from 'app/entities/quotes/quote/quote.service'; + +describe('Component Tests', () => { + describe('Quote Management Delete Component', () => { + let comp: QuoteDeleteDialogComponent; + let fixture: ComponentFixture; + let service: QuoteService; + let mockEventManager: any; + let mockActiveModal: any; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [QuoteDeleteDialogComponent] + }) + .overrideTemplate(QuoteDeleteDialogComponent, '') + .compileComponents(); + fixture = TestBed.createComponent(QuoteDeleteDialogComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(QuoteService); + mockEventManager = fixture.debugElement.injector.get(JhiEventManager); + mockActiveModal = fixture.debugElement.injector.get(NgbActiveModal); + }); + + describe('confirmDelete', () => { + it( + 'Should call delete service on confirmDelete', + inject( + [], + fakeAsync(() => { + // GIVEN + spyOn(service, 'delete').and.returnValue(of({})); + + // WHEN + comp.confirmDelete(123); + tick(); + + // THEN + expect(service.delete).toHaveBeenCalledWith(123); + expect(mockActiveModal.dismissSpy).toHaveBeenCalled(); + expect(mockEventManager.broadcastSpy).toHaveBeenCalled(); + }) + ) + ); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-detail.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-detail.component.spec.ts new file mode 100644 index 0000000000..446e7bde8e --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-detail.component.spec.ts @@ -0,0 +1,40 @@ +/* tslint:disable max-line-length */ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { of } from 'rxjs'; + +import { GatewayTestModule } from '../../../../test.module'; +import { QuoteDetailComponent } from 'app/entities/quotes/quote/quote-detail.component'; +import { Quote } from 'app/shared/model/quotes/quote.model'; + +describe('Component Tests', () => { + describe('Quote Management Detail Component', () => { + let comp: QuoteDetailComponent; + let fixture: ComponentFixture; + const route = ({ data: of({ quote: new Quote(123) }) } as any) as ActivatedRoute; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [QuoteDetailComponent], + providers: [{ provide: ActivatedRoute, useValue: route }] + }) + .overrideTemplate(QuoteDetailComponent, '') + .compileComponents(); + fixture = TestBed.createComponent(QuoteDetailComponent); + comp = fixture.componentInstance; + }); + + describe('OnInit', () => { + it('Should call load all on init', () => { + // GIVEN + + // WHEN + comp.ngOnInit(); + + // THEN + expect(comp.quote).toEqual(jasmine.objectContaining({ id: 123 })); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-update.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-update.component.spec.ts new file mode 100644 index 0000000000..063d905ef6 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote-update.component.spec.ts @@ -0,0 +1,66 @@ +/* tslint:disable max-line-length */ +import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing'; +import { HttpResponse } from '@angular/common/http'; +import { Observable, of } from 'rxjs'; + +import { GatewayTestModule } from '../../../../test.module'; +import { QuoteUpdateComponent } from 'app/entities/quotes/quote/quote-update.component'; +import { QuoteService } from 'app/entities/quotes/quote/quote.service'; +import { Quote } from 'app/shared/model/quotes/quote.model'; + +describe('Component Tests', () => { + describe('Quote Management Update Component', () => { + let comp: QuoteUpdateComponent; + let fixture: ComponentFixture; + let service: QuoteService; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [QuoteUpdateComponent] + }) + .overrideTemplate(QuoteUpdateComponent, '') + .compileComponents(); + + fixture = TestBed.createComponent(QuoteUpdateComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(QuoteService); + }); + + describe('save', () => { + it( + 'Should call update service on save for existing entity', + fakeAsync(() => { + // GIVEN + const entity = new Quote(123); + spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity }))); + comp.quote = entity; + // WHEN + comp.save(); + tick(); // simulate async + + // THEN + expect(service.update).toHaveBeenCalledWith(entity); + expect(comp.isSaving).toEqual(false); + }) + ); + + it( + 'Should call create service on save for new entity', + fakeAsync(() => { + // GIVEN + const entity = new Quote(); + spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity }))); + comp.quote = entity; + // WHEN + comp.save(); + tick(); // simulate async + + // THEN + expect(service.create).toHaveBeenCalledWith(entity); + expect(comp.isSaving).toEqual(false); + }) + ); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.component.spec.ts new file mode 100644 index 0000000000..efadc7a22c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.component.spec.ts @@ -0,0 +1,138 @@ +/* tslint:disable max-line-length */ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { Observable, of } from 'rxjs'; +import { HttpHeaders, HttpResponse } from '@angular/common/http'; +import { ActivatedRoute, Data } from '@angular/router'; + +import { GatewayTestModule } from '../../../../test.module'; +import { QuoteComponent } from 'app/entities/quotes/quote/quote.component'; +import { QuoteService } from 'app/entities/quotes/quote/quote.service'; +import { Quote } from 'app/shared/model/quotes/quote.model'; + +describe('Component Tests', () => { + describe('Quote Management Component', () => { + let comp: QuoteComponent; + let fixture: ComponentFixture; + let service: QuoteService; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [QuoteComponent], + providers: [ + { + provide: ActivatedRoute, + useValue: { + data: { + subscribe: (fn: (value: Data) => void) => + fn({ + pagingParams: { + predicate: 'id', + reverse: false, + page: 0 + } + }) + } + } + } + ] + }) + .overrideTemplate(QuoteComponent, '') + .compileComponents(); + + fixture = TestBed.createComponent(QuoteComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(QuoteService); + }); + + it('Should call load all on init', () => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + spyOn(service, 'query').and.returnValue( + of( + new HttpResponse({ + body: [new Quote(123)], + headers + }) + ) + ); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.query).toHaveBeenCalled(); + expect(comp.quotes[0]).toEqual(jasmine.objectContaining({ id: 123 })); + }); + + it('should load a page', () => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + spyOn(service, 'query').and.returnValue( + of( + new HttpResponse({ + body: [new Quote(123)], + headers + }) + ) + ); + + // WHEN + comp.loadPage(1); + + // THEN + expect(service.query).toHaveBeenCalled(); + expect(comp.quotes[0]).toEqual(jasmine.objectContaining({ id: 123 })); + }); + + it('should not load a page is the page is the same as the previous page', () => { + spyOn(service, 'query').and.callThrough(); + + // WHEN + comp.loadPage(0); + + // THEN + expect(service.query).toHaveBeenCalledTimes(0); + }); + + it('should re-initialize the page', () => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + spyOn(service, 'query').and.returnValue( + of( + new HttpResponse({ + body: [new Quote(123)], + headers + }) + ) + ); + + // WHEN + comp.loadPage(1); + comp.clear(); + + // THEN + expect(comp.page).toEqual(0); + expect(service.query).toHaveBeenCalledTimes(2); + expect(comp.quotes[0]).toEqual(jasmine.objectContaining({ id: 123 })); + }); + it('should calculate the sort attribute for an id', () => { + // WHEN + const result = comp.sort(); + + // THEN + expect(result).toEqual(['id,desc']); + }); + + it('should calculate the sort attribute for a non-id attribute', () => { + // GIVEN + comp.predicate = 'name'; + + // WHEN + const result = comp.sort(); + + // THEN + expect(result).toEqual(['name,desc', 'id']); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.service.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.service.spec.ts new file mode 100644 index 0000000000..5cb5a57b98 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/entities/quotes/quote/quote.service.spec.ts @@ -0,0 +1,130 @@ +/* tslint:disable max-line-length */ +import { TestBed, getTestBed } from '@angular/core/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { of } from 'rxjs'; +import { take, map } from 'rxjs/operators'; +import * as moment from 'moment'; +import { DATE_TIME_FORMAT } from 'app/shared/constants/input.constants'; +import { QuoteService } from 'app/entities/quotes/quote/quote.service'; +import { IQuote, Quote } from 'app/shared/model/quotes/quote.model'; + +describe('Service Tests', () => { + describe('Quote Service', () => { + let injector: TestBed; + let service: QuoteService; + let httpMock: HttpTestingController; + let elemDefault: IQuote; + let currentDate: moment.Moment; + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule] + }); + injector = getTestBed(); + service = injector.get(QuoteService); + httpMock = injector.get(HttpTestingController); + currentDate = moment(); + + elemDefault = new Quote(0, 'AAAAAAA', 0, currentDate); + }); + + describe('Service methods', async () => { + it('should find an element', async () => { + const returnedFromService = Object.assign( + { + lastTrade: currentDate.format(DATE_TIME_FORMAT) + }, + elemDefault + ); + service + .find(123) + .pipe(take(1)) + .subscribe(resp => expect(resp).toMatchObject({ body: elemDefault })); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush(JSON.stringify(returnedFromService)); + }); + + it('should create a Quote', async () => { + const returnedFromService = Object.assign( + { + id: 0, + lastTrade: currentDate.format(DATE_TIME_FORMAT) + }, + elemDefault + ); + const expected = Object.assign( + { + lastTrade: currentDate + }, + returnedFromService + ); + service + .create(new Quote(null)) + .pipe(take(1)) + .subscribe(resp => expect(resp).toMatchObject({ body: expected })); + const req = httpMock.expectOne({ method: 'POST' }); + req.flush(JSON.stringify(returnedFromService)); + }); + + it('should update a Quote', async () => { + const returnedFromService = Object.assign( + { + symbol: 'BBBBBB', + price: 1, + lastTrade: currentDate.format(DATE_TIME_FORMAT) + }, + elemDefault + ); + + const expected = Object.assign( + { + lastTrade: currentDate + }, + returnedFromService + ); + service + .update(expected) + .pipe(take(1)) + .subscribe(resp => expect(resp).toMatchObject({ body: expected })); + const req = httpMock.expectOne({ method: 'PUT' }); + req.flush(JSON.stringify(returnedFromService)); + }); + + it('should return a list of Quote', async () => { + const returnedFromService = Object.assign( + { + symbol: 'BBBBBB', + price: 1, + lastTrade: currentDate.format(DATE_TIME_FORMAT) + }, + elemDefault + ); + const expected = Object.assign( + { + lastTrade: currentDate + }, + returnedFromService + ); + service + .query(expected) + .pipe(take(1), map(resp => resp.body)) + .subscribe(body => expect(body).toContainEqual(expected)); + const req = httpMock.expectOne({ method: 'GET' }); + req.flush(JSON.stringify([returnedFromService])); + httpMock.verify(); + }); + + it('should delete a Quote', async () => { + const rxPromise = service.delete(123).subscribe(resp => expect(resp.ok)); + + const req = httpMock.expectOne({ method: 'DELETE' }); + req.flush({ status: 200 }); + }); + }); + + afterEach(() => { + httpMock.verify(); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/alert/alert-error.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/alert/alert-error.component.spec.ts new file mode 100644 index 0000000000..9ffdd49165 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/alert/alert-error.component.spec.ts @@ -0,0 +1,137 @@ +import { ComponentFixture, TestBed, async, inject, fakeAsync, tick } from '@angular/core/testing'; +import { HttpErrorResponse, HttpHeaders } from '@angular/common/http'; +import { JhiAlertService, JhiEventManager } from 'ng-jhipster'; +import { TranslateModule } from '@ngx-translate/core'; + +import { GatewayTestModule } from '../../../test.module'; +import { JhiAlertErrorComponent } from 'app/shared/alert/alert-error.component'; +import { MockAlertService } from '../../../helpers/mock-alert.service'; + +describe('Component Tests', () => { + describe('Alert Error Component', () => { + let comp: JhiAlertErrorComponent; + let fixture: ComponentFixture; + let eventManager: JhiEventManager; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule, TranslateModule.forRoot()], + declarations: [JhiAlertErrorComponent], + providers: [ + JhiEventManager, + { + provide: JhiAlertService, + useClass: MockAlertService + } + ] + }) + .overrideTemplate(JhiAlertErrorComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(JhiAlertErrorComponent); + comp = fixture.componentInstance; + eventManager = fixture.debugElement.injector.get(JhiEventManager); + }); + + describe('Error Handling', () => { + it('Should display an alert on status 0', () => { + // GIVEN + eventManager.broadcast({ name: 'gatewayApp.httpError', content: { status: 0 } }); + // THEN + expect(comp.alerts.length).toBe(1); + expect(comp.alerts[0].msg).toBe('error.server.not.reachable'); + }); + it('Should display an alert on status 404', () => { + // GIVEN + eventManager.broadcast({ name: 'gatewayApp.httpError', content: { status: 404 } }); + // THEN + expect(comp.alerts.length).toBe(1); + expect(comp.alerts[0].msg).toBe('error.url.not.found'); + }); + it('Should display an alert on generic error', () => { + // GIVEN + eventManager.broadcast({ name: 'gatewayApp.httpError', content: { error: { message: 'Error Message' } } }); + eventManager.broadcast({ name: 'gatewayApp.httpError', content: { error: 'Second Error Message' } }); + // THEN + expect(comp.alerts.length).toBe(2); + expect(comp.alerts[0].msg).toBe('Error Message'); + expect(comp.alerts[1].msg).toBe('Second Error Message'); + }); + it('Should display an alert on status 400 for generic error', () => { + // GIVEN + const response = new HttpErrorResponse({ + url: 'http://localhost:8080/api/foos', + headers: new HttpHeaders(), + status: 400, + statusText: 'Bad Request', + error: { + type: 'https://www.jhipster.tech/problem/constraint-violation', + title: 'Bad Request', + status: 400, + path: '/api/foos', + message: 'error.validation' + } + }); + eventManager.broadcast({ name: 'gatewayApp.httpError', content: response }); + // THEN + expect(comp.alerts.length).toBe(1); + expect(comp.alerts[0].msg).toBe('error.validation'); + }); + it('Should display an alert on status 400 for generic error without message', () => { + // GIVEN + const response = new HttpErrorResponse({ + url: 'http://localhost:8080/api/foos', + headers: new HttpHeaders(), + status: 400, + error: 'Bad Request' + }); + eventManager.broadcast({ name: 'gatewayApp.httpError', content: response }); + // THEN + expect(comp.alerts.length).toBe(1); + expect(comp.alerts[0].msg).toBe('Bad Request'); + }); + it('Should display an alert on status 400 for invalid parameters', () => { + // GIVEN + const response = new HttpErrorResponse({ + url: 'http://localhost:8080/api/foos', + headers: new HttpHeaders(), + status: 400, + statusText: 'Bad Request', + error: { + type: 'https://www.jhipster.tech/problem/constraint-violation', + title: 'Method argument not valid', + status: 400, + path: '/api/foos', + message: 'error.validation', + fieldErrors: [{ objectName: 'foo', field: 'minField', message: 'Min' }] + } + }); + eventManager.broadcast({ name: 'gatewayApp.httpError', content: response }); + // THEN + expect(comp.alerts.length).toBe(1); + expect(comp.alerts[0].msg).toBe('error.Size'); + }); + it('Should display an alert on status 400 for error headers', () => { + // GIVEN + const response = new HttpErrorResponse({ + url: 'http://localhost:8080/api/foos', + headers: new HttpHeaders().append('app-error', 'Error Message').append('app-params', 'foo'), + status: 400, + statusText: 'Bad Request', + error: { + status: 400, + message: 'error.validation' + } + }); + eventManager.broadcast({ name: 'gatewayApp.httpError', content: response }); + // THEN + expect(comp.alerts.length).toBe(1); + expect(comp.alerts[0].msg).toBe('Error Message'); + }); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/login/login.component.spec.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/login/login.component.spec.ts new file mode 100644 index 0000000000..1f4002563d --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/app/shared/login/login.component.spec.ts @@ -0,0 +1,165 @@ +import { ComponentFixture, TestBed, async, inject, fakeAsync, tick } from '@angular/core/testing'; +import { Router } from '@angular/router'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { JhiEventManager } from 'ng-jhipster'; + +import { LoginService } from 'app/core/login/login.service'; +import { JhiLoginModalComponent } from 'app/shared/login/login.component'; +import { StateStorageService } from 'app/core/auth/state-storage.service'; +import { GatewayTestModule } from '../../../test.module'; +import { MockLoginService } from '../../../helpers/mock-login.service'; +import { MockStateStorageService } from '../../../helpers/mock-state-storage.service'; + +describe('Component Tests', () => { + describe('LoginComponent', () => { + let comp: JhiLoginModalComponent; + let fixture: ComponentFixture; + let mockLoginService: any; + let mockStateStorageService: any; + let mockRouter: any; + let mockEventManager: any; + let mockActiveModal: any; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [GatewayTestModule], + declarations: [JhiLoginModalComponent], + providers: [ + { + provide: LoginService, + useClass: MockLoginService + }, + { + provide: StateStorageService, + useClass: MockStateStorageService + } + ] + }) + .overrideTemplate(JhiLoginModalComponent, '') + .compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(JhiLoginModalComponent); + comp = fixture.componentInstance; + mockLoginService = fixture.debugElement.injector.get(LoginService); + mockStateStorageService = fixture.debugElement.injector.get(StateStorageService); + mockRouter = fixture.debugElement.injector.get(Router); + mockEventManager = fixture.debugElement.injector.get(JhiEventManager); + mockActiveModal = fixture.debugElement.injector.get(NgbActiveModal); + }); + + it( + 'should authenticate the user upon login when previous state was set', + inject( + [], + fakeAsync(() => { + // GIVEN + const credentials = { + username: 'admin', + password: 'admin', + rememberMe: true + }; + comp.username = 'admin'; + comp.password = 'admin'; + comp.rememberMe = true; + comp.credentials = credentials; + mockLoginService.setResponse({}); + mockStateStorageService.setResponse({ redirect: 'dummy' }); + + // WHEN/ + comp.login(); + tick(); // simulate async + + // THEN + expect(comp.authenticationError).toEqual(false); + expect(mockActiveModal.dismissSpy).toHaveBeenCalledWith('login success'); + expect(mockEventManager.broadcastSpy).toHaveBeenCalledTimes(1); + expect(mockLoginService.loginSpy).toHaveBeenCalledWith(credentials); + expect(mockStateStorageService.getUrlSpy).toHaveBeenCalledTimes(1); + expect(mockStateStorageService.storeUrlSpy).toHaveBeenCalledWith(null); + expect(mockRouter.navigateSpy).toHaveBeenCalledWith([{ redirect: 'dummy' }]); + }) + ) + ); + + it( + 'should authenticate the user upon login when previous state was not set', + inject( + [], + fakeAsync(() => { + // GIVEN + const credentials = { + username: 'admin', + password: 'admin', + rememberMe: true + }; + comp.username = 'admin'; + comp.password = 'admin'; + comp.rememberMe = true; + comp.credentials = credentials; + mockLoginService.setResponse({}); + mockStateStorageService.setResponse(null); + + // WHEN + comp.login(); + tick(); // simulate async + + // THEN + expect(comp.authenticationError).toEqual(false); + expect(mockActiveModal.dismissSpy).toHaveBeenCalledWith('login success'); + expect(mockEventManager.broadcastSpy).toHaveBeenCalledTimes(1); + expect(mockLoginService.loginSpy).toHaveBeenCalledWith(credentials); + expect(mockStateStorageService.getUrlSpy).toHaveBeenCalledTimes(1); + expect(mockStateStorageService.storeUrlSpy).not.toHaveBeenCalled(); + expect(mockRouter.navigateSpy).not.toHaveBeenCalled(); + }) + ) + ); + + it('should empty the credentials upon cancel', () => { + // GIVEN + const credentials = { + username: 'admin', + password: 'admin', + rememberMe: true + }; + + const expected = { + username: null, + password: null, + rememberMe: true + }; + + comp.credentials = credentials; + + // WHEN + comp.cancel(); + + // THEN + expect(comp.authenticationError).toEqual(false); + expect(comp.credentials).toEqual(expected); + expect(mockActiveModal.dismissSpy).toHaveBeenCalledWith('cancel'); + }); + + it('should redirect user when register', () => { + // WHEN + comp.register(); + + // THEN + expect(mockActiveModal.dismissSpy).toHaveBeenCalledWith('to state register'); + expect(mockRouter.navigateSpy).toHaveBeenCalledWith(['/register']); + }); + + it('should redirect user when request password', () => { + // WHEN + comp.requestResetPassword(); + + // THEN + expect(mockActiveModal.dismissSpy).toHaveBeenCalledWith('to state requestReset'); + expect(mockRouter.navigateSpy).toHaveBeenCalledWith(['/reset', 'request']); + }); + }); +}); diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-account.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-account.service.ts new file mode 100644 index 0000000000..8b3965ff4c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-account.service.ts @@ -0,0 +1,25 @@ +import { SpyObject } from './spyobject'; +import { AccountService } from 'app/core/auth/account.service'; +import Spy = jasmine.Spy; + +export class MockAccountService extends SpyObject { + getSpy: Spy; + saveSpy: Spy; + fakeResponse: any; + + constructor() { + super(AccountService); + + this.fakeResponse = null; + this.getSpy = this.spy('get').andReturn(this); + this.saveSpy = this.spy('save').andReturn(this); + } + + subscribe(callback: any) { + callback(this.fakeResponse); + } + + setResponse(json: any): void { + this.fakeResponse = json; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-active-modal.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-active-modal.service.ts new file mode 100644 index 0000000000..8bf0cc966f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-active-modal.service.ts @@ -0,0 +1,12 @@ +import { SpyObject } from './spyobject'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import Spy = jasmine.Spy; + +export class MockActiveModal extends SpyObject { + dismissSpy: Spy; + + constructor() { + super(NgbActiveModal); + this.dismissSpy = this.spy('dismiss').andReturn(this); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-alert.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-alert.service.ts new file mode 100644 index 0000000000..87f36c71e2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-alert.service.ts @@ -0,0 +1,11 @@ +import { SpyObject } from './spyobject'; +import { JhiAlertService, JhiAlert } from 'ng-jhipster'; + +export class MockAlertService extends SpyObject { + constructor() { + super(JhiAlertService); + } + addAlert(alertOptions: JhiAlert) { + return alertOptions; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-event-manager.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-event-manager.service.ts new file mode 100644 index 0000000000..a71b5d9314 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-event-manager.service.ts @@ -0,0 +1,12 @@ +import { SpyObject } from './spyobject'; +import { JhiEventManager } from 'ng-jhipster'; +import Spy = jasmine.Spy; + +export class MockEventManager extends SpyObject { + broadcastSpy: Spy; + + constructor() { + super(JhiEventManager); + this.broadcastSpy = this.spy('broadcast').andReturn(this); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-language.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-language.service.ts new file mode 100644 index 0000000000..0dea7984d2 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-language.service.ts @@ -0,0 +1,36 @@ +import { SpyObject } from './spyobject'; +import { JhiLanguageService } from 'ng-jhipster'; +import { JhiLanguageHelper } from 'app/core/language/language.helper'; +import Spy = jasmine.Spy; + +export class MockLanguageService extends SpyObject { + getCurrentSpy: Spy; + fakeResponse: any; + + constructor() { + super(JhiLanguageService); + + this.fakeResponse = 'en'; + this.getCurrentSpy = this.spy('getCurrent').andReturn(Promise.resolve(this.fakeResponse)); + } + + init() {} + + changeLanguage(languageKey: string) {} + + setLocations(locations: string[]) {} + + addLocation(location: string) {} + + reload() {} +} + +export class MockLanguageHelper extends SpyObject { + getAllSpy: Spy; + + constructor() { + super(JhiLanguageHelper); + + this.getAllSpy = this.spy('getAll').andReturn(Promise.resolve(['en', 'fr'])); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-login.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-login.service.ts new file mode 100644 index 0000000000..93a8ca575f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-login.service.ts @@ -0,0 +1,29 @@ +import { SpyObject } from './spyobject'; +import { LoginService } from 'app/core/login/login.service'; +import Spy = jasmine.Spy; + +export class MockLoginService extends SpyObject { + loginSpy: Spy; + logoutSpy: Spy; + registerSpy: Spy; + requestResetPasswordSpy: Spy; + cancelSpy: Spy; + + constructor() { + super(LoginService); + + this.setLoginSpy({}); + this.logoutSpy = this.spy('logout').andReturn(this); + this.registerSpy = this.spy('register').andReturn(this); + this.requestResetPasswordSpy = this.spy('requestResetPassword').andReturn(this); + this.cancelSpy = this.spy('cancel').andReturn(this); + } + + setLoginSpy(json: any) { + this.loginSpy = this.spy('login').andReturn(Promise.resolve(json)); + } + + setResponse(json: any): void { + this.setLoginSpy(json); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-principal.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-principal.service.ts new file mode 100644 index 0000000000..cb1f175cd3 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-principal.service.ts @@ -0,0 +1,20 @@ +import { SpyObject } from './spyobject'; +import { Principal } from 'app/core/auth/principal.service'; +import Spy = jasmine.Spy; + +export class MockPrincipal extends SpyObject { + identitySpy: Spy; + + constructor() { + super(Principal); + + this.setIdentitySpy({}); + } + setIdentitySpy(json: any): any { + this.identitySpy = this.spy('identity').andReturn(Promise.resolve(json)); + } + + setResponse(json: any): void { + this.setIdentitySpy(json); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-route.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-route.service.ts new file mode 100644 index 0000000000..3465e05524 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-route.service.ts @@ -0,0 +1,29 @@ +import { ActivatedRoute, Router } from '@angular/router'; +import { SpyObject } from './spyobject'; +import { Observable, of } from 'rxjs'; +import Spy = jasmine.Spy; + +export class MockActivatedRoute extends ActivatedRoute { + constructor(parameters?: any) { + super(); + this.queryParams = of(parameters); + this.params = of(parameters); + this.data = of({ + ...parameters, + pagingParams: { + page: 10, + ascending: false, + predicate: 'id' + } + }); + } +} + +export class MockRouter extends SpyObject { + navigateSpy: Spy; + + constructor() { + super(Router); + this.navigateSpy = this.spy('navigate'); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-state-storage.service.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-state-storage.service.ts new file mode 100644 index 0000000000..1398c7b28b --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/mock-state-storage.service.ts @@ -0,0 +1,22 @@ +import { SpyObject } from './spyobject'; +import { StateStorageService } from 'app/core/auth/state-storage.service'; +import Spy = jasmine.Spy; + +export class MockStateStorageService extends SpyObject { + getUrlSpy: Spy; + storeUrlSpy: Spy; + + constructor() { + super(StateStorageService); + this.setUrlSpy({}); + this.storeUrlSpy = this.spy('storeUrl').andReturn(this); + } + + setUrlSpy(json) { + this.getUrlSpy = this.spy('getUrl').andReturn(json); + } + + setResponse(json: any): void { + this.setUrlSpy(json); + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/spyobject.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/spyobject.ts new file mode 100644 index 0000000000..949e067ef5 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/helpers/spyobject.ts @@ -0,0 +1,69 @@ +export interface GuinessCompatibleSpy extends jasmine.Spy { + /** By chaining the spy with and.returnValue, all calls to the function will return a specific + * value. */ + andReturn(val: any): void; + /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied + * function. */ + andCallFake(fn: Function): GuinessCompatibleSpy; + /** removes all recorded calls */ + reset(); +} + +export class SpyObject { + static stub(object = null, config = null, overrides = null) { + if (!(object instanceof SpyObject)) { + overrides = config; + config = object; + object = new SpyObject(); + } + + const m = {}; + Object.keys(config).forEach(key => (m[key] = config[key])); + Object.keys(overrides).forEach(key => (m[key] = overrides[key])); + Object.keys(m).forEach(key => { + object.spy(key).andReturn(m[key]); + }); + return object; + } + + constructor(type = null) { + if (type) { + Object.keys(type.prototype).forEach(prop => { + let m = null; + try { + m = type.prototype[prop]; + } catch (e) { + // As we are creating spys for abstract classes, + // these classes might have getters that throw when they are accessed. + // As we are only auto creating spys for methods, this + // should not matter. + } + if (typeof m === 'function') { + this.spy(prop); + } + }); + } + } + + spy(name) { + if (!this[name]) { + this[name] = this._createGuinnessCompatibleSpy(name); + } + return this[name]; + } + + prop(name, value) { + this[name] = value; + } + + /** @internal */ + _createGuinnessCompatibleSpy(name): GuinessCompatibleSpy { + const newSpy: GuinessCompatibleSpy = jasmine.createSpy(name); + newSpy.andCallFake = newSpy.and.callFake; + newSpy.andReturn = newSpy.and.returnValue; + newSpy.reset = newSpy.calls.reset; + // revisit return null here (previously needed for rtts_assert). + newSpy.and.returnValue(null); + return newSpy; + } +} diff --git a/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/test.module.ts b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/test.module.ts new file mode 100644 index 0000000000..0f5aa6ffb4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/javascript/spec/test.module.ts @@ -0,0 +1,77 @@ +import { DatePipe } from '@angular/common'; +import { ActivatedRoute, Router } from '@angular/router'; +import { NgModule, ElementRef, Renderer } from '@angular/core'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { JhiLanguageService, JhiDataUtils, JhiDateUtils, JhiEventManager, JhiAlertService, JhiParseLinks } from 'ng-jhipster'; + +import { MockLanguageService, MockLanguageHelper } from './helpers/mock-language.service'; +import { JhiLanguageHelper, Principal, AccountService, LoginModalService } from 'app/core'; +import { MockPrincipal } from './helpers/mock-principal.service'; +import { MockAccountService } from './helpers/mock-account.service'; +import { MockActivatedRoute, MockRouter } from './helpers/mock-route.service'; +import { MockActiveModal } from './helpers/mock-active-modal.service'; +import { MockEventManager } from './helpers/mock-event-manager.service'; + +@NgModule({ + providers: [ + DatePipe, + JhiDataUtils, + JhiDateUtils, + JhiParseLinks, + { + provide: JhiLanguageService, + useClass: MockLanguageService + }, + { + provide: JhiLanguageHelper, + useClass: MockLanguageHelper + }, + { + provide: JhiEventManager, + useClass: MockEventManager + }, + { + provide: NgbActiveModal, + useClass: MockActiveModal + }, + { + provide: ActivatedRoute, + useValue: new MockActivatedRoute({ id: 123 }) + }, + { + provide: Router, + useClass: MockRouter + }, + { + provide: Principal, + useClass: MockPrincipal + }, + { + provide: AccountService, + useClass: MockAccountService + }, + { + provide: LoginModalService, + useValue: null + }, + { + provide: ElementRef, + useValue: null + }, + { + provide: Renderer, + useValue: null + }, + { + provide: JhiAlertService, + useValue: null + }, + { + provide: NgbModal, + useValue: null + } + ], + imports: [HttpClientTestingModule] +}) +export class GatewayTestModule {} diff --git a/jhipster/jhipster-uaa/gateway/src/test/resources/config/application.yml b/jhipster/jhipster-uaa/gateway/src/test/resources/config/application.yml new file mode 100644 index 0000000000..a8aaef6e43 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/resources/config/application.yml @@ -0,0 +1,114 @@ +# =================================================================== +# Spring Boot configuration. +# +# This configuration is used for unit/integration tests. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +eureka: + client: + enabled: false + instance: + appname: gateway + instanceId: gateway:${spring.application.instance-id:${random.value}} + +spring: + application: + name: gateway + cache: + type: simple + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:h2:mem:gateway;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + name: + username: + password: + hikari: + auto-commit: false + jpa: + database-platform: io.github.jhipster.domain.util.FixedH2Dialect + database: H2 + open-in-view: false + show-sql: false + hibernate: + ddl-auto: none + naming: + physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: false + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: true + hibernate.hbm2ddl.auto: validate + liquibase: + contexts: test + mail: + host: localhost + messages: + basename: i18n/messages + mvc: + favicon: + enabled: false + thymeleaf: + mode: HTML + + +server: + port: 10344 + address: localhost + +info: + project: + version: #project.version# + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + async: + core-pool-size: 1 + max-pool-size: 50 + queue-capacity: 10000 + # To test logstash appender + logging: + logstash: + enabled: true + host: localhost + port: 5000 + queue-size: 512 + security: + authentication: + jwt: + # This token must be encoded using Base64 (you can type `echo 'secret-key'|base64` on your command line) + base64-secret: + # Token is valid 24 hours + token-validity-in-seconds: 86400 + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx.enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: true + report-frequency: 60 # in seconds + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/gateway/src/test/resources/config/bootstrap.yml b/jhipster/jhipster-uaa/gateway/src/test/resources/config/bootstrap.yml new file mode 100644 index 0000000000..11cd6af21c --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/resources/config/bootstrap.yml @@ -0,0 +1,4 @@ +spring: + cloud: + config: + enabled: false diff --git a/jhipster/jhipster-uaa/gateway/src/test/resources/logback.xml b/jhipster/jhipster-uaa/gateway/src/test/resources/logback.xml new file mode 100644 index 0000000000..266d1e88a4 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/src/test/resources/logback.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jhipster/jhipster-uaa/gateway/tsconfig-aot.json b/jhipster/jhipster-uaa/gateway/tsconfig-aot.json new file mode 100644 index 0000000000..16552d03a0 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/tsconfig-aot.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "es2015", + "moduleResolution": "node", + "sourceMap": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "skipLibCheck": true, + "outDir": "target/www/app", + "lib": ["es7", "dom"], + "typeRoots": [ + "node_modules/@types" + ], + "baseUrl": "./", + "paths": { + "app/*": ["src/main/webapp/app/*"] + }, + "importHelpers": true + }, + "angularCompilerOptions": { + "genDir": "target/aot", + "skipMetadataEmit" : true, + "fullTemplateTypeCheck": true, + "preserveWhitespaces": true + } +} diff --git a/jhipster/jhipster-uaa/gateway/tsconfig.json b/jhipster/jhipster-uaa/gateway/tsconfig.json new file mode 100644 index 0000000000..e9209830ee --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "removeComments": false, + "noImplicitAny": false, + "skipLibCheck": true, + "suppressImplicitAnyIndexErrors": true, + "outDir": "target/www/app", + "lib": ["es7", "dom"], + "typeRoots": [ + "node_modules/@types" + ], + "baseUrl": "./", + "paths": { + "app/*": ["src/main/webapp/app/*"] + }, + "importHelpers": true, + "allowJs": true + }, + "include": [ + "src/main/webapp/app", + "src/test/javascript/" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/jhipster/jhipster-uaa/gateway/tslint.json b/jhipster/jhipster-uaa/gateway/tslint.json new file mode 100644 index 0000000000..ece05c2c16 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/tslint.json @@ -0,0 +1,122 @@ +{ + "rulesDirectory": [ + "node_modules/codelyzer" + ], + "extends": [ + "tslint-config-prettier" + ], + "rules": { + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "label-position": true, + "max-line-length": [ + true, + 180 + ], + "member-access": false, + "member-ordering": [ + true, + "static-before-instance", + "variables-before-functions" + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-variable": true, + "no-empty": false, + "no-eval": true, + "no-inferrable-types": [true], + "no-shadowed-variable": true, + "no-string-literal": false, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unused-expression": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": true, + "semicolon": [ + true, + "always", + "ignore-bound-class-methods" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + "prefer-const": true, + "arrow-parens": [true, "ban-single-arg-parens"], + "arrow-return-shorthand": [true], + "import-spacing": true, + "no-consecutive-blank-lines": [true], + "object-literal-shorthand": true, + "space-before-function-paren": [true, { + "asyncArrow": "always", + "anonymous": "never", + "constructor": "never", + "method": "never", + "named": "never" + }], + + "directive-selector": [true, "attribute", "jhi", "camelCase"], + "component-selector": [true, "element", "jhi", "kebab-case"], + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": false, + "component-class-suffix": true, + "directive-class-suffix": true + } +} diff --git a/jhipster/jhipster-uaa/gateway/webpack/logo-jhipster.png b/jhipster/jhipster-uaa/gateway/webpack/logo-jhipster.png new file mode 100644 index 0000000000000000000000000000000000000000..d8eb48da05c157571eed9fd7303f8d9566f2ea12 GIT binary patch literal 4459 zcmX|E1yB@V)238FK~j(qNkODUIgmU;(gO(*P${JZ=?3XM8YCs8kB$SRLmH0mJmRPW zjygDwxc}z=zWHYM-FJ7N_u1LmnVoqzLJOo!LC!=@KtMpDs-mckzrWy*J1H?wbcBiIKI{l~?l|FQ8} zGHf6(+!t^B7X_K9f{bfoefMF_h_P-2VhbNfP4`Pj4&zy(j>UKvG2D*N^Cq~ z3ULNT!6=*t3j-a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R6XWKI%WT7KU6cp-*R z))-sFUI}hMaGi<1v`^3KwoTO_t8^(e3a7-hm!*xWFPbp+EwlW9yJpo7k#tVp&AMy; z#CbKRssTPPgTz{;cG&P;ks zCK=NTkv9~J{(jY(&vi7QzQQ9lx=r>(=q&3?vC>x^g}V9qA>|GH7n1e49$HhxbtU@g zurasC?2 zpSV+LOR8ry;d`rq(;nM7)zD9dFL{I_1L02;h}u;-T540Mdh%O!qAiX#0I033rG@sF zE2bjRr?i0+V&4KPU+*S)8gzLt2{=cb-f5fwSu!NL9kRsxyI5Wy{BH1S*SIUbnj7N5 z)z=`wLHg%o+dEN3XJZ3}XboI|; zw$wN=wz)#G?^5$Q!+%HHMa1(5bUTtD5l$oW;ld;pfXmx1N);-qi09(zj-6xLsoZy# zh|R~HP;R-_X$X7Y8n3}XK5k{?}!pLX)rY{_UUfu#VUb{(7$|a7K169Sg5ld|Up*q5gfl@ChTK{qZb-;uhx{ z%Le-;u|%5UOyw@?F@^HCuF24RY9Tl4+EJz0mxdoQbg^08G$ltWIH#SyQNI=xu5?;>Amv4PB-Q^XbyB^*O>oqurI-2z% z!jbbv%2#2{(TNFfSgsq^=P&*(*RFTQ_h$ra)tsTv`UZg2)!u%L7>I0ns=5mEd%93d z+8wSQITdztdd2Y6zgp|W%g~Pn%SlLH1E{=v;gI}il|Nejy>9U@njE5pAqF7{(B77$ zxCCgZNhcTgmMK(^Ebz7V3mGcw`>pP&!(XFjttWpDNu;5&E=Re+w3=^x{~)19f+~iOopzsOqPCO^+0B(Q-PVeg^emHYpY_2J|xyo{9yA9|~+- zJAJ6^(+%oCu?Z%sbAJ$nxYItG!)yi|5FAz-T-idyryDq%Y2fLrVX#vSEo4bEb=*@VxG&b#1g { + if (err) { + throw new Error('Failed to parse pom.xml: ' + err); + } + if (result.project.version && result.project.version[0]) { + version = result.project.version[0]; + } else if (result.project.parent && result.project.parent[0] && result.project.parent[0].version && result.project.parent[0].version[0]) { + version = result.project.parent[0].version[0]; + } + }); + if (version === null) { + throw new Error('pom.xml is malformed. No version is defined'); + } + return version; +} + +const _root = path.resolve(__dirname, '..'); + +function root(args) { + args = Array.prototype.slice.call(arguments, 0); + return path.join.apply(path, [_root].concat(args)); +} + +function isExternalLib(module, check = /node_modules/) { + const req = module.userRequest; + if (typeof req !== 'string') { + return false; + } + return req.search(check) >= 0; +} diff --git a/jhipster/jhipster-uaa/gateway/webpack/webpack.common.js b/jhipster/jhipster-uaa/gateway/webpack/webpack.common.js new file mode 100644 index 0000000000..701aff702f --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/webpack/webpack.common.js @@ -0,0 +1,97 @@ +const webpack = require('webpack'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const rxPaths = require('rxjs/_esm5/path-mapping'); +const MergeJsonWebpackPlugin = require("merge-jsons-webpack-plugin"); + +const utils = require('./utils.js'); + +module.exports = (options) => ({ + resolve: { + extensions: ['.ts', '.js'], + modules: ['node_modules'], + alias: { + app: utils.root('src/main/webapp/app/'), + ...rxPaths() + } + }, + stats: { + children: false + }, + module: { + rules: [ + { + test: /\.html$/, + loader: 'html-loader', + options: { + minimize: true, + caseSensitive: true, + removeAttributeQuotes:false, + minifyJS:false, + minifyCSS:false + }, + exclude: ['./src/main/webapp/index.html'] + }, + { + test: /\.(jpe?g|png|gif|svg|woff2?|ttf|eot)$/i, + loader: 'file-loader', + options: { + digest: 'hex', + hash: 'sha512', + name: 'content/[hash].[ext]' + } + }, + { + test: /manifest.webapp$/, + loader: 'file-loader', + options: { + name: 'manifest.webapp' + } + }, + // Ignore warnings about System.import in Angular + { test: /[\/\\]@angular[\/\\].+\.js$/, parser: { system: true } }, + ] + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: `'${options.env}'`, + BUILD_TIMESTAMP: `'${new Date().getTime()}'`, + VERSION: `'${utils.parseVersion()}'`, + DEBUG_INFO_ENABLED: options.env === 'development', + // The root URL for API calls, ending with a '/' - for example: `"https://www.jhipster.tech:8081/myservice/"`. + // If this URL is left empty (""), then it will be relative to the current context. + // If you use an API server, in `prod` mode, you will need to enable CORS + // (see the `jhipster.cors` common JHipster property in the `application-*.yml` configurations) + SERVER_API_URL: `''` + } + }), + new CopyWebpackPlugin([ + { from: './node_modules/swagger-ui/dist/css', to: 'swagger-ui/dist/css' }, + { from: './node_modules/swagger-ui/dist/lib', to: 'swagger-ui/dist/lib' }, + { from: './node_modules/swagger-ui/dist/swagger-ui.min.js', to: 'swagger-ui/dist/swagger-ui.min.js' }, + { from: './src/main/webapp/swagger-ui/', to: 'swagger-ui' }, + { from: './src/main/webapp/content/', to: 'content' }, + { from: './src/main/webapp/favicon.ico', to: 'favicon.ico' }, + { from: './src/main/webapp/manifest.webapp', to: 'manifest.webapp' }, + // jhipster-needle-add-assets-to-webpack - JHipster will add/remove third-party resources in this array + { from: './src/main/webapp/robots.txt', to: 'robots.txt' } + ]), + new MergeJsonWebpackPlugin({ + output: { + groupBy: [ + { pattern: "./src/main/webapp/i18n/en/*.json", fileName: "./i18n/en.json" }, + { pattern: "./src/main/webapp/i18n/fr/*.json", fileName: "./i18n/fr.json" }, + { pattern: "./src/main/webapp/i18n/pt-br/*.json", fileName: "./i18n/pt-br.json" } + // jhipster-needle-i18n-language-webpack - JHipster will add/remove languages in this array + ] + } + }), + new HtmlWebpackPlugin({ + template: './src/main/webapp/index.html', + chunks: ['vendors', 'polyfills', 'global', 'main'], + chunksSortMode: 'manual', + inject: 'body' + }) + ] +}); diff --git a/jhipster/jhipster-uaa/gateway/webpack/webpack.dev.js b/jhipster/jhipster-uaa/gateway/webpack/webpack.dev.js new file mode 100644 index 0000000000..ed3c981706 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/webpack/webpack.dev.js @@ -0,0 +1,150 @@ +const webpack = require('webpack'); +const writeFilePlugin = require('write-file-webpack-plugin'); +const webpackMerge = require('webpack-merge'); +const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); +const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin'); +const WebpackNotifierPlugin = require('webpack-notifier'); +const path = require('path'); +const sass = require('sass'); + +const utils = require('./utils.js'); +const commonConfig = require('./webpack.common.js'); + +const ENV = 'development'; + +module.exports = (options) => webpackMerge(commonConfig({ env: ENV }), { + devtool: 'eval-source-map', + devServer: { + contentBase: './target/www', + proxy: [{ + context: [ + '/uaa', + '/quotes', + /* jhipster-needle-add-entity-to-webpack - JHipster will add entity api paths here */ + '/api', + '/management', + '/swagger-resources', + '/v2/api-docs', + '/h2-console', + '/auth' + ], + target: `http${options.tls ? 's' : ''}://127.0.0.1:8080`, + secure: false, + changeOrigin: options.tls, + headers: { host: 'localhost:9000' } + }], + stats: options.stats, + watchOptions: { + ignored: /node_modules/ + } + }, + entry: { + polyfills: './src/main/webapp/app/polyfills', + global: './src/main/webapp/content/scss/global.scss', + main: './src/main/webapp/app/app.main' + }, + output: { + path: utils.root('target/www'), + filename: 'app/[name].bundle.js', + chunkFilename: 'app/[id].chunk.js' + }, + module: { + rules: [{ + test: /\.ts$/, + enforce: 'pre', + loader: 'tslint-loader', + exclude: ['node_modules', new RegExp('reflect-metadata\\' + path.sep + 'Reflect\\.ts')] + }, + { + test: /\.ts$/, + use: [ + 'angular2-template-loader', + { + loader: 'cache-loader', + options: { + cacheDirectory: path.resolve('target/cache-loader') + } + }, + { + loader: 'thread-loader', + options: { + // there should be 1 cpu for the fork-ts-checker-webpack-plugin + workers: require('os').cpus().length - 1 + } + }, + { + loader: 'ts-loader', + options: { + transpileOnly: true, + happyPackMode: true + } + }, + 'angular-router-loader' + ], + exclude: ['node_modules'] + }, + { + test: /\.scss$/, + use: ['to-string-loader', 'css-loader', { + loader: 'sass-loader', + options: { implementation: sass } + }], + exclude: /(vendor\.scss|global\.scss)/ + }, + { + test: /(vendor\.scss|global\.scss)/, + use: ['style-loader', 'css-loader', 'postcss-loader', { + loader: 'sass-loader', + options: { implementation: sass } + }] + }, + { + test: /\.css$/, + use: ['to-string-loader', 'css-loader'], + exclude: /(vendor\.css|global\.css)/ + }, + { + test: /(vendor\.css|global\.css)/, + use: ['style-loader', 'css-loader'] + }] + }, + stats: process.env.JHI_DISABLE_WEBPACK_LOGS ? 'none' : options.stats, + plugins: [ + process.env.JHI_DISABLE_WEBPACK_LOGS + ? null + : new SimpleProgressWebpackPlugin({ + format: options.stats === 'minimal' ? 'compact' : 'expanded' + }), + new FriendlyErrorsWebpackPlugin(), + new ForkTsCheckerWebpackPlugin(), + new BrowserSyncPlugin({ + host: 'localhost', + port: 9000, + proxy: { + target: 'http://localhost:9060' + }, + socket: { + clients: { + heartbeatTimeout: 60000 + } + } + }, { + reload: false + }), + new webpack.ContextReplacementPlugin( + /angular(\\|\/)core(\\|\/)/, + path.resolve(__dirname, './src/main/webapp') + ), + new writeFilePlugin(), + new webpack.WatchIgnorePlugin([ + utils.root('src/test'), + ]), + new WebpackNotifierPlugin({ + title: 'JHipster', + contentImage: path.join(__dirname, 'logo-jhipster.png') + }) + ].filter(Boolean), + mode: 'development' +}); diff --git a/jhipster/jhipster-uaa/gateway/webpack/webpack.prod.js b/jhipster/jhipster-uaa/gateway/webpack/webpack.prod.js new file mode 100644 index 0000000000..a9f9627772 --- /dev/null +++ b/jhipster/jhipster-uaa/gateway/webpack/webpack.prod.js @@ -0,0 +1,147 @@ +const webpack = require('webpack'); +const webpackMerge = require('webpack-merge'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); +const Visualizer = require('webpack-visualizer-plugin'); +const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); +const TerserPlugin = require('terser-webpack-plugin'); +const WorkboxPlugin = require('workbox-webpack-plugin'); +const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin; +const path = require('path'); + +const utils = require('./utils.js'); +const commonConfig = require('./webpack.common.js'); + +const ENV = 'production'; +const sass = require('sass'); + +module.exports = webpackMerge(commonConfig({ env: ENV }), { + // Enable source maps. Please note that this will slow down the build. + // You have to enable it in UglifyJSPlugin config below and in tsconfig-aot.json as well + // devtool: 'source-map', + entry: { + polyfills: './src/main/webapp/app/polyfills', + global: './src/main/webapp/content/scss/global.scss', + main: './src/main/webapp/app/app.main' + }, + output: { + path: utils.root('target/classes/public'), + filename: 'app/[name].[hash].bundle.js', + chunkFilename: 'app/[id].[hash].chunk.js' + }, + module: { + rules: [{ + test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, + loader: '@ngtools/webpack' + }, + { + test: /\.scss$/, + use: ['to-string-loader', 'css-loader', { + loader: 'sass-loader', + options: { implementation: sass } + }], + exclude: /(vendor\.scss|global\.scss)/ + }, + { + test: /(vendor\.scss|global\.scss)/, + use: [ + MiniCssExtractPlugin.loader, + 'css-loader', + 'postcss-loader', + { + loader: 'sass-loader', + options: { implementation: sass } + } + ] + }, + { + test: /\.css$/, + use: ['to-string-loader', 'css-loader'], + exclude: /(vendor\.css|global\.css)/ + }, + { + test: /(vendor\.css|global\.css)/, + use: [ + MiniCssExtractPlugin.loader, + 'css-loader', + 'postcss-loader' + ] + }] + }, + optimization: { + runtimeChunk: false, + splitChunks: { + cacheGroups: { + commons: { + test: /[\\/]node_modules[\\/]/, + name: 'vendors', + chunks: 'all' + } + } + }, + minimizer: [ + new TerserPlugin({ + parallel: true, + cache: true, + terserOptions: { + ie8: false, + // sourceMap: true, // Enable source maps. Please note that this will slow down the build + compress: { + dead_code: true, + warnings: false, + properties: true, + drop_debugger: true, + conditionals: true, + booleans: true, + loops: true, + unused: true, + toplevel: true, + if_return: true, + inline: true, + join_vars: true + }, + output: { + comments: false, + beautify: false, + indent_level: 2 + } + } + }), + new OptimizeCSSAssetsPlugin({}) + ] + }, + plugins: [ + new MiniCssExtractPlugin({ + // Options similar to the same options in webpackOptions.output + // both options are optional + filename: '[name].[contenthash].css', + chunkFilename: '[id].css' + }), + new MomentLocalesPlugin({ + localesToKeep: [ + 'en', + 'fr', + 'pt-br' + // jhipster-needle-i18n-language-moment-webpack - JHipster will add/remove languages in this array + ] + }), + new Visualizer({ + // Webpack statistics in target folder + filename: '../stats.html' + }), + new AngularCompilerPlugin({ + mainPath: utils.root('src/main/webapp/app/app.main.ts'), + tsConfigPath: utils.root('tsconfig-aot.json'), + sourceMap: true + }), + new webpack.LoaderOptionsPlugin({ + minimize: true, + debug: false + }), + new WorkboxPlugin.GenerateSW({ + clientsClaim: true, + skipWaiting: true, + }) + ], + mode: 'production' +}); diff --git a/jhipster/jhipster-uaa/quotes/.editorconfig b/jhipster/jhipster-uaa/quotes/.editorconfig new file mode 100644 index 0000000000..a03599dd04 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/.editorconfig @@ -0,0 +1,24 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 4 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[{package,bower}.json] +indent_style = space +indent_size = 2 diff --git a/jhipster/jhipster-uaa/quotes/.gitattributes b/jhipster/jhipster-uaa/quotes/.gitattributes new file mode 100644 index 0000000000..8ab72fe637 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/.gitattributes @@ -0,0 +1,149 @@ +# This file is inspired by https://github.com/alexkaratarakis/gitattributes +# +# Auto detect text files and perform LF normalization +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +# The above will handle all files NOT found below +# These files are text and should be normalized (Convert crlf => lf) + +*.bat text eol=crlf +*.coffee text +*.css text +*.cql text +*.df text +*.ejs text +*.html text +*.java text +*.js text +*.json text +*.less text +*.properties text +*.sass text +*.scss text +*.sh text eol=lf +*.sql text +*.txt text +*.ts text +*.xml text +*.yaml text +*.yml text + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.markdown text +*.md text +*.adoc text +*.textile text +*.mustache text +*.csv text +*.tab text +*.tsv text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +*COPYRIGHT* text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. If you want to treat it as text, +# comment-out the following line and uncomment the line after. +*.svg binary +#*.svg text +*.eps binary + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.class binary +*.jar binary +*.war binary + +## LINTERS +.csslintrc text +.eslintrc text +.jscsrc text +.jshintrc text +.jshintignore text +.stylelintrc text + +## CONFIGS +*.bowerrc text +*.conf text +*.config text +.editorconfig text +.gitattributes text +.gitconfig text +.gitignore text +.htaccess text +*.npmignore text + +## HEROKU +Procfile text +.slugignore text + +## AUDIO +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +## VIDEO +*.3gpp binary +*.3gp binary +*.as binary +*.asf binary +*.asx binary +*.fla binary +*.flv binary +*.m4v binary +*.mng binary +*.mov binary +*.mp4 binary +*.mpeg binary +*.mpg binary +*.swc binary +*.swf binary +*.webm binary + +## ARCHIVES +*.7z binary +*.gz binary +*.rar binary +*.tar binary +*.zip binary + +## FONTS +*.ttf binary +*.eot binary +*.otf binary +*.woff binary +*.woff2 binary diff --git a/jhipster/jhipster-uaa/quotes/.gitignore b/jhipster/jhipster-uaa/quotes/.gitignore new file mode 100644 index 0000000000..e746b25ae6 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/.gitignore @@ -0,0 +1,144 @@ +###################### +# Project Specific +###################### +/target/www/** +/src/test/javascript/coverage/ + +###################### +# Node +###################### +/node/ +node_tmp/ +node_modules/ +npm-debug.log.* +/.awcache/* +/.cache-loader/* + +###################### +# SASS +###################### +.sass-cache/ + +###################### +# Eclipse +###################### +*.pydevproject +.project +.metadata +tmp/ +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath +.factorypath +/src/main/resources/rebel.xml + +# External tool builders +.externalToolBuilders/** + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + +###################### +# Intellij +###################### +.idea/ +*.iml +*.iws +*.ipr +*.ids +*.orig +classes/ +out/ + +###################### +# Visual Studio Code +###################### +.vscode/ + +###################### +# Maven +###################### +/log/ +/target/ + +###################### +# Gradle +###################### +.gradle/ +/build/ + +###################### +# Package Files +###################### +*.jar +*.war +*.ear +*.db + +###################### +# Windows +###################### +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + +###################### +# Mac OSX +###################### +.DS_Store +.svn + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +###################### +# Directories +###################### +/bin/ +/deploy/ + +###################### +# Logs +###################### +*.log* + +###################### +# Others +###################### +*.class +*.*~ +*~ +.merge_file* + +###################### +# Gradle Wrapper +###################### +!gradle/wrapper/gradle-wrapper.jar + +###################### +# Maven Wrapper +###################### +!.mvn/wrapper/maven-wrapper.jar + +###################### +# ESLint +###################### +.eslintcache diff --git a/jhipster/jhipster-uaa/quotes/.jhipster/Quote.json b/jhipster/jhipster-uaa/quotes/.jhipster/Quote.json new file mode 100644 index 0000000000..a5305270a1 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/.jhipster/Quote.json @@ -0,0 +1,37 @@ +{ + "fluentMethods": true, + "clientRootFolder": "quotes", + "relationships": [], + "fields": [ + { + "fieldName": "symbol", + "fieldType": "String", + "fieldValidateRules": [ + "required", + "unique" + ] + }, + { + "fieldName": "price", + "fieldType": "BigDecimal", + "fieldValidateRules": [ + "required" + ] + }, + { + "fieldName": "lastTrade", + "fieldType": "ZonedDateTime", + "fieldValidateRules": [ + "required" + ] + } + ], + "changelogDate": "20181019033648", + "dto": "mapstruct", + "searchEngine": false, + "service": "serviceImpl", + "entityTableName": "quote", + "jpaMetamodelFiltering": true, + "pagination": "pagination", + "microserviceName": "quotes" +} diff --git a/jhipster/jhipster-uaa/quotes/.mvn/wrapper/MavenWrapperDownloader.java b/jhipster/jhipster-uaa/quotes/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..fa4f7b499f --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,110 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = + "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: : " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/jhipster/jhipster-uaa/quotes/.mvn/wrapper/maven-wrapper.jar b/jhipster/jhipster-uaa/quotes/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..01e67997377a393fd672c7dcde9dccbedf0cb1e9 GIT binary patch literal 48337 zcmbTe1CV9Qwl>;j+wQV$+qSXFw%KK)%eHN!%U!l@+x~l>b1vR}@9y}|TM-#CBjy|< zb7YRpp)Z$$Gzci_H%LgxZ{NNV{%Qa9gZlF*E2<($D=8;N5Asbx8se{Sz5)O13x)rc z5cR(k$_mO!iis+#(8-D=#R@|AF(8UQ`L7dVNSKQ%v^P|1A%aF~Lye$@HcO@sMYOb3 zl`5!ThJ1xSJwsg7hVYFtE5vS^5UE0$iDGCS{}RO;R#3y#{w-1hVSg*f1)7^vfkxrm!!N|oTR0Hj?N~IbVk+yC#NK} z5myv()UMzV^!zkX@O=Yf!(Z_bF7}W>k*U4@--&RH0tHiHY0IpeezqrF#@8{E$9d=- z7^kT=1Bl;(Q0k{*_vzz1Et{+*lbz%mkIOw(UA8)EE-Pkp{JtJhe@VXQ8sPNTn$Vkj zicVp)sV%0omhsj;NCmI0l8zzAipDV#tp(Jr7p_BlL$}Pys_SoljztS%G-Wg+t z&Q#=<03Hoga0R1&L!B);r{Cf~b$G5p#@?R-NNXMS8@cTWE^7V!?ixz(Ag>lld;>COenWc$RZ61W+pOW0wh>sN{~j; zCBj!2nn|4~COwSgXHFH?BDr8pK323zvmDK-84ESq25b;Tg%9(%NneBcs3;r znZpzntG%E^XsSh|md^r-k0Oen5qE@awGLfpg;8P@a-s<{Fwf?w3WapWe|b-CQkqlo z46GmTdPtkGYdI$e(d9Zl=?TU&uv94VR`g|=7xB2Ur%=6id&R2 z4e@fP7`y58O2sl;YBCQFu7>0(lVt-r$9|06Q5V>4=>ycnT}Fyz#9p;3?86`ZD23@7 z7n&`!LXzjxyg*P4Tz`>WVvpU9-<5MDSDcb1 zZaUyN@7mKLEPGS$^od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>>O#`+vsu*KR)te$adfTD*w( zAStXnZk<6N3V-Vs#GB%vXZat+(EFWbkbky#{yGY`rOvN)?{5qUuFv=r=dyYZrULf%MppWuNRUWc z8|YaIn}P0DGkwSZ(njAO$Zhr3Yw`3O1A+&F*2UjO{0`P%kK(qL;kEkfjRC=lxPRjL z{{4PO3-*5RZ_B3LUB&?ZpJ4nk1E4L&eT~HX0Jo(|uGQCW3utB@p)rF@W*n$==TlS zKiTfzhrLbAeRqru%D;fUwXOUcHud{pw@Ib1xxQ}<2)?KC&%y5PVef<7rcu2l!8dsy z?lvdaHJ#s$0m18y{x#fB$o=l)-sV?Qya5GWf#8Vd{~Grn@qgX#!EI`Y>++l%1A;eL z{_7t6jMeEr@a+oxyCL^+_}9Qc;i0&Xd%LXp?to*R|26LKHG(m0)*QF4*h;5%YG5<9)c> z1vq!7bIJSv1^27i-mcH!zX>ep3Iw0^{nx<1jOy)N_UoFD8v}x~2mEWapI3m~kMQkR z#&@4FuEGBn`mgtSx6jeY7vUQNf=^}sTZErIEpH!cy|@7Z zU4h_Oxxd2s=f{}$XXy4}%JqTSjRC \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + 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 + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/jhipster/jhipster-uaa/quotes/mvnw.cmd b/jhipster/jhipster-uaa/quotes/mvnw.cmd new file mode 100644 index 0000000000..e5cfb0ae9e --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/mvnw.cmd @@ -0,0 +1,161 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/jhipster/jhipster-uaa/quotes/package-lock.json b/jhipster/jhipster-uaa/quotes/package-lock.json new file mode 100644 index 0000000000..aea41979a7 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/package-lock.json @@ -0,0 +1,4409 @@ +{ + "name": "quotes", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz", + "integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ansi": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi/-/ansi-0.3.1.tgz", + "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=", + "dev": true + }, + "ansi-cyan": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-red": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "axios": { + "version": "0.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "dev": true, + "requires": { + "follow-redirects": "^1.3.0", + "is-buffer": "^1.1.5" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "binaryextensions": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/binaryextensions/-/binaryextensions-2.1.1.tgz", + "integrity": "sha512-XBaoWE9RW8pPdPQNibZsW2zh8TW6gcarXp1FZPwT8Uop8ScSNldJEWf2k9l3HeTqdrEwsOsFcq74RiJECW34yA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chevrotain": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chevrotain/-/chevrotain-4.1.0.tgz", + "integrity": "sha512-iwuK4FOV+vZlvKonoXVw6G+rXJm4jWk17aJFkm6FloVYcVSrAaJLdCdQo+IIyX98jm0WJVcdK9cllRZQpNBnBg==", + "dev": true, + "requires": { + "regexp-to-ast": "0.3.5" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "arr-union": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-table": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-table/-/cli-table-0.3.1.tgz", + "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=", + "dev": true, + "requires": { + "colors": "1.0.3" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + } + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "clone": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color/-/color-3.0.0.tgz", + "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", + "dev": true, + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-string": { + "version": "1.5.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "dev": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "colornames": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colornames/-/colornames-1.1.1.tgz", + "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=", + "dev": true + }, + "colors": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colors/-/colors-1.3.2.tgz", + "integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ==", + "dev": true + }, + "colorspace": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colorspace/-/colorspace-1.1.1.tgz", + "integrity": "sha512-pI3btWyiuz7Ken0BWh9Elzsmv2bM9AhA7psXib4anUXy/orfZ/E0MbQwhSOG/9L8hLlalqrU0UhOuqxW1YjmVw==", + "dev": true, + "requires": { + "color": "3.0.x", + "text-hex": "1.0.x" + } + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.16.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.16.0.tgz", + "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "conf": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/conf/-/conf-2.0.0.tgz", + "integrity": "sha512-iCLzBsGFi8S73EANsEJZz0JnJ/e5VZef/kSaxydYZLAvw0rFNAUx5R7K5leC/CXXR2mZfXWhUvcZOO/dM2D5xg==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "env-paths": "^1.0.0", + "make-dir": "^1.0.0", + "pkg-up": "^2.0.0", + "write-file-atomic": "^2.3.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "dargs": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dargs/-/dargs-6.0.0.tgz", + "integrity": "sha512-6lJauzNaI7MiM8EHQWmGj+s3rP5/i1nYs8GAvKrLAx/9dpc9xS/4seFb1ioR39A+kcfu4v3jnEa/EE5qWYnitQ==", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "detect-conflict": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/detect-conflict/-/detect-conflict-1.0.1.tgz", + "integrity": "sha1-CIZXpmqWHAUBnbfEIwiDsca0F24=", + "dev": true + }, + "diagnostics": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/diagnostics/-/diagnostics-1.1.1.tgz", + "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", + "dev": true, + "requires": { + "colorspace": "1.1.x", + "enabled": "1.0.x", + "kuler": "1.0.x" + } + }, + "didyoumean": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/didyoumean/-/didyoumean-1.2.1.tgz", + "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "drange": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/drange/-/drange-1.1.1.tgz", + "integrity": "sha512-pYxfDYpued//QpnLIm4Avk7rsNtAtQkUES2cwAYSvD/wd2pKD71gN2Ebj3e7klzXwjocvE8c5vx/1fxwpqmSxA==", + "dev": true + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "editions": { + "version": "1.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/editions/-/editions-1.3.4.tgz", + "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", + "dev": true + }, + "ejs": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ejs/-/ejs-2.6.1.tgz", + "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==", + "dev": true + }, + "enabled": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/enabled/-/enabled-1.0.2.tgz", + "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", + "dev": true, + "requires": { + "env-variable": "0.0.x" + } + }, + "env-paths": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/env-paths/-/env-paths-1.0.0.tgz", + "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=", + "dev": true + }, + "env-variable": { + "version": "0.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/env-variable/-/env-variable-0.0.5.tgz", + "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==", + "dev": true + }, + "error": { + "version": "7.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/error/-/error-7.0.2.tgz", + "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", + "dev": true, + "requires": { + "string-template": "~0.2.1", + "xtend": "~4.0.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "execa": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "1.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", + "dev": true, + "requires": { + "kind-of": "^1.1.0" + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-glob": { + "version": "2.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-glob/-/fast-glob-2.2.3.tgz", + "integrity": "sha512-NiX+JXjnx43RzvVFwRWfPKo4U+1BrK5pJPsHQdKMlLoFHrrGktXglQhHliSihWAq+m1z6fHk3uwGHrtRbS9vLA==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.0.1", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.1", + "micromatch": "^3.1.10" + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-safe-stringify": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", + "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==", + "dev": true + }, + "fecha": { + "version": "2.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fecha/-/fecha-2.3.3.tgz", + "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "first-chunk-stream": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", + "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "follow-redirects": { + "version": "1.5.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/follow-redirects/-/follow-redirects-1.5.9.tgz", + "integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==", + "dev": true, + "requires": { + "debug": "=3.1.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + } + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "7.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs-extra/-/fs-extra-7.0.0.tgz", + "integrity": "sha512-EglNDLRpmaTWiD/qraZn6HREAEAHJcJOmxNEYwq6xeMKnVMAy3GUcFB+wXt2C6k4CNvB/mP1y/U3dzvKKj5OtQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "gauge": { + "version": "1.2.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gauge/-/gauge-1.2.7.tgz", + "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", + "dev": true, + "requires": { + "ansi": "^0.3.0", + "has-unicode": "^2.0.0", + "lodash.pad": "^4.1.0", + "lodash.padend": "^4.1.0", + "lodash.padstart": "^4.1.0" + } + }, + "generator-jhipster": { + "version": "5.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/generator-jhipster/-/generator-jhipster-5.4.2.tgz", + "integrity": "sha512-iuTZGPonlMFWrabTC7x27UnCa8sckWFKD7HiwMp2JOYLlLU+BPt0WJWlQ9hJv5JHHx+pe0pUxwEHbi0fSu0Ljw==", + "dev": true, + "requires": { + "axios": "0.18.0", + "chalk": "2.4.1", + "commander": "2.16.0", + "conf": "2.0.0", + "didyoumean": "1.2.1", + "ejs": "2.6.1", + "glob": "7.1.2", + "gulp-filter": "5.1.0", + "insight": "0.10.1", + "jhipster-core": "3.4.0", + "js-object-pretty-print": "0.3.0", + "js-yaml": "3.12.0", + "lodash": "4.17.10", + "meow": "5.0.0", + "mkdirp": "0.5.1", + "os-locale": "2.1.0", + "parse-gitignore": "1.0.1", + "pluralize": "7.0.0", + "prettier": "1.13.7", + "randexp": "0.4.9", + "semver": "5.5.0", + "shelljs": "0.8.2", + "tabtab": "2.2.2", + "through2": "2.0.3", + "uuid": "3.3.2", + "yeoman-environment": "2.3.0", + "yeoman-generator": "3.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "gh-got": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gh-got/-/gh-got-6.0.0.tgz", + "integrity": "sha512-F/mS+fsWQMo1zfgG9MD8KWvTWPPzzhuVwY++fhQ5Ggd+0P+CAMHtzMZhNxG+TqGfHDChJKsbh6otfMGqO2AKBw==", + "dev": true, + "requires": { + "got": "^7.0.0", + "is-plain-obj": "^1.1.0" + } + }, + "github-username": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/github-username/-/github-username-4.1.0.tgz", + "integrity": "sha1-y+KABBiDIG2kISrp5LXxacML9Bc=", + "dev": true, + "requires": { + "gh-got": "^6.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "globby": { + "version": "8.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "grouped-queue": { + "version": "0.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/grouped-queue/-/grouped-queue-0.3.3.tgz", + "integrity": "sha1-wWfSpTGcWg4JZO9qJbfC34mWyFw=", + "dev": true, + "requires": { + "lodash": "^4.17.2" + } + }, + "gulp-filter": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gulp-filter/-/gulp-filter-5.1.0.tgz", + "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM=", + "dev": true, + "requires": { + "multimatch": "^2.0.0", + "plugin-error": "^0.1.2", + "streamfilter": "^1.0.5" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "5.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inquirer/-/inquirer-5.2.0.tgz", + "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.1.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^5.5.2", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "insight": { + "version": "0.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/insight/-/insight-0.10.1.tgz", + "integrity": "sha512-kLGeYQkh18f8KuC68QKdi0iwUcIaayJVB/STpX7x452/7pAUm1yfG4giJwcxbrTh0zNYtc8kBR+6maLMOzglOQ==", + "dev": true, + "requires": { + "async": "^2.1.4", + "chalk": "^2.3.0", + "conf": "^1.3.1", + "inquirer": "^5.0.0", + "lodash.debounce": "^4.0.8", + "os-name": "^2.0.1", + "request": "^2.74.0", + "tough-cookie": "^2.0.0", + "uuid": "^3.0.0" + }, + "dependencies": { + "conf": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/conf/-/conf-1.4.0.tgz", + "integrity": "sha512-bzlVWS2THbMetHqXKB8ypsXN4DQ/1qopGwNJi1eYbpwesJcd86FBjFciCQX/YwAhp9bM7NVnPFqZ5LpV7gP0Dg==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "env-paths": "^1.0.0", + "make-dir": "^1.0.0", + "pkg-up": "^2.0.0", + "write-file-atomic": "^2.3.0" + } + } + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true + }, + "is-scoped": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-scoped/-/is-scoped-1.0.0.tgz", + "integrity": "sha1-RJypgpnnEwOCViieyytUDcQ3yzA=", + "dev": true, + "requires": { + "scoped-regex": "^1.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isbinaryfile": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isbinaryfile/-/isbinaryfile-3.0.3.tgz", + "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", + "dev": true, + "requires": { + "buffer-alloc": "^1.2.0" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istextorbinary": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istextorbinary/-/istextorbinary-2.2.1.tgz", + "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", + "dev": true, + "requires": { + "binaryextensions": "2", + "editions": "^1.3.3", + "textextensions": "2" + } + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "jhipster-core": { + "version": "3.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jhipster-core/-/jhipster-core-3.4.0.tgz", + "integrity": "sha512-iVJ6MF4jlpvtVL5gbn9t4Jw27RodjY04SXYSGfTLAzHyQRMmehHLvNq/3DBjVwHgBrDn1u2k17oLGouJus9MhA==", + "dev": true, + "requires": { + "chevrotain": "4.1.0", + "fs-extra": "7.0.0", + "lodash": "4.17.11", + "winston": "3.1.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "js-object-pretty-print": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-object-pretty-print/-/js-object-pretty-print-0.3.0.tgz", + "integrity": "sha1-RnDkUAZu4ezPNRdMfRl/WqOLz3Q=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", + "dev": true + }, + "kuler": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kuler/-/kuler-1.0.1.tgz", + "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", + "dev": true, + "requires": { + "colornames": "^1.1.1" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true + }, + "lodash.pad": { + "version": "4.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.pad/-/lodash.pad-4.5.1.tgz", + "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA=", + "dev": true + }, + "lodash.padend": { + "version": "4.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", + "dev": true + }, + "lodash.padstart": { + "version": "4.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.padstart/-/lodash.padstart-4.6.1.tgz", + "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=", + "dev": true + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "logform": { + "version": "1.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/logform/-/logform-1.10.0.tgz", + "integrity": "sha512-em5ojIhU18fIMOw/333mD+ZLE2fis0EzXl1ZwHx4iQzmpQi6odNiY/t+ITNr33JZhT9/KEaH+UPIipr6a9EjWg==", + "dev": true, + "requires": { + "colors": "^1.2.1", + "fast-safe-stringify": "^2.0.4", + "fecha": "^2.3.3", + "ms": "^2.1.1", + "triple-beam": "^1.2.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "macos-release": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/macos-release/-/macos-release-1.1.0.tgz", + "integrity": "sha512-mmLbumEYMi5nXReB9js3WGsB8UE6cDBWyIO62Z4DNx6GbRhDxHNjA1MlzSpJ2S2KM1wyiPRA0d19uHWYYvMHjA==", + "dev": true + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "mem-fs": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem-fs/-/mem-fs-1.1.3.tgz", + "integrity": "sha1-uK6NLj/Lb10/kWXBLUVRoGXZicw=", + "dev": true, + "requires": { + "through2": "^2.0.0", + "vinyl": "^1.1.0", + "vinyl-file": "^2.0.0" + } + }, + "mem-fs-editor": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem-fs-editor/-/mem-fs-editor-5.1.0.tgz", + "integrity": "sha512-2Yt2GCYEbcotYbIJagmow4gEtHDqzpq5XN94+yAx/NT5+bGqIjkXnm3KCUQfE6kRfScGp9IZknScoGRKu8L78w==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "deep-extend": "^0.6.0", + "ejs": "^2.5.9", + "glob": "^7.0.3", + "globby": "^8.0.1", + "isbinaryfile": "^3.0.2", + "mkdirp": "^0.5.0", + "multimatch": "^2.0.0", + "rimraf": "^2.2.8", + "through2": "^2.0.0", + "vinyl": "^2.0.1" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "vinyl": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + } + } + }, + "meow": { + "version": "5.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + } + }, + "merge2": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/merge2/-/merge2-1.2.3.tgz", + "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "mime-db": { + "version": "1.36.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime-db/-/mime-db-1.36.0.tgz", + "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "dev": true + }, + "mime-types": { + "version": "2.1.20", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime-types/-/mime-types-2.1.20.tgz", + "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "dev": true, + "requires": { + "mime-db": "~1.36.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "npmlog": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npmlog/-/npmlog-2.0.4.tgz", + "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", + "dev": true, + "requires": { + "ansi": "~0.3.1", + "are-we-there-yet": "~1.1.2", + "gauge": "~1.2.5" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "one-time": { + "version": "0.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/one-time/-/one-time-0.0.4.tgz", + "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "os-name": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-name/-/os-name-2.0.1.tgz", + "integrity": "sha1-uaOGNhwXrjohc27wWZQFyajF3F4=", + "dev": true, + "requires": { + "macos-release": "^1.0.0", + "win-release": "^1.0.0" + } + }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-gitignore": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-gitignore/-/parse-gitignore-1.0.1.tgz", + "integrity": "sha512-UGyowyjtx26n65kdAMWhm6/3uy5uSrpcuH7tt+QEVudiBoVS+eqHxD5kbi9oWVRwj7sCzXqwuM+rUGw7earl6A==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "plugin-error": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", + "dev": true, + "requires": { + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "prettier": { + "version": "1.13.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prettier/-/prettier-1.13.7.tgz", + "integrity": "sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w==", + "dev": true + }, + "pretty-bytes": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-bytes/-/pretty-bytes-5.1.0.tgz", + "integrity": "sha512-wa5+qGVg9Yt7PB6rYm3kXlKzgzgivYTLRandezh43jjRqgyDyP+9YxfJpJiLs9yKD1WeU8/OvtToWpW7255FtA==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.1.29", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "randexp": { + "version": "0.4.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/randexp/-/randexp-0.4.9.tgz", + "integrity": "sha512-maAX1cnBkzIZ89O4tSQUOF098xjGMC8N+9vuY/WfHwg87THw6odD2Br35donlj5e6KnB1SB0QBHhTQhhDHuTPQ==", + "dev": true, + "requires": { + "drange": "^1.0.0", + "ret": "^0.2.0" + } + }, + "read-chunk": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-chunk/-/read-chunk-2.1.0.tgz", + "integrity": "sha1-agTAkoAF7Z1C4aasVgDhnLx/9lU=", + "dev": true, + "requires": { + "pify": "^3.0.0", + "safe-buffer": "^5.1.1" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "regexp-to-ast": { + "version": "0.3.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regexp-to-ast/-/regexp-to-ast-0.3.5.tgz", + "integrity": "sha512-1CJygtdvsfNFwiyjaMLBWtg2tfEqx/jSZ8S6TV+GlNL8kiH8rb4cm5Pb7A/C2BpyM/fA8ZJEudlCwi/jvAY+Ow==", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ret/-/ret-0.2.2.tgz", + "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rx": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rx/-/rx-4.1.0.tgz", + "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", + "dev": true + }, + "rxjs": { + "version": "5.5.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rxjs/-/rxjs-5.5.12.tgz", + "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "dev": true, + "requires": { + "symbol-observable": "1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + }, + "dependencies": { + "ret": { + "version": "0.1.15", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + } + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "scoped-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/scoped-regex/-/scoped-regex-1.0.0.tgz", + "integrity": "sha1-o0a7Gs1CB65wvXwMfKnlZra63bg=", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shelljs": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shelljs/-/shelljs-0.8.2.tgz", + "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "requires": { + "is-arrayish": "^0.3.1" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.15.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sshpk/-/sshpk-1.15.1.tgz", + "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "streamfilter": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/streamfilter/-/streamfilter-1.0.7.tgz", + "integrity": "sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ==", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "string-template": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-bom-stream": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz", + "integrity": "sha1-+H217yYT9paKpUWr/h7HKLaoKco=", + "dev": true, + "requires": { + "first-chunk-stream": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", + "dev": true + }, + "tabtab": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tabtab/-/tabtab-2.2.2.tgz", + "integrity": "sha1-egR/FDsBC0y9MfhX6ClhUSy/ThQ=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "inquirer": "^1.0.2", + "lodash.difference": "^4.5.0", + "lodash.uniq": "^4.5.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "npmlog": "^2.0.3", + "object-assign": "^4.1.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "external-editor": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/external-editor/-/external-editor-1.1.1.tgz", + "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "spawn-sync": "^1.0.15", + "tmp": "^0.0.29" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "inquirer": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inquirer/-/inquirer-1.2.3.tgz", + "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", + "dev": true, + "requires": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "external-editor": "^1.1.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "mute-stream": "0.0.6", + "pinkie-promise": "^2.0.0", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mute-stream": { + "version": "0.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mute-stream/-/mute-stream-0.0.6.tgz", + "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=", + "dev": true + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tmp": { + "version": "0.0.29", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, + "text-hex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "textextensions": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/textextensions/-/textextensions-2.2.0.tgz", + "integrity": "sha512-j5EMxnryTvKxwH2Cq+Pb43tsf6sdEgw6Pdwxk83mPaq0ToeFJt6WE4J3s5BqY7vmjlLgkgXvhtXUxo80FyBhCA==", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "triple-beam": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "arr-union": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "untildify": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-file": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl-file/-/vinyl-file-2.0.0.tgz", + "integrity": "sha1-p+v1/779obfRjRQPyweyI++2dRo=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.3.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0", + "strip-bom-stream": "^2.0.0", + "vinyl": "^1.1.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "win-release": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha1-X6VeAr58qTTt/BJmVjLoSbcuUgk=", + "dev": true, + "requires": { + "semver": "^5.0.1" + } + }, + "winston": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/winston/-/winston-3.1.0.tgz", + "integrity": "sha512-FsQfEE+8YIEeuZEYhHDk5cILo1HOcWkGwvoidLrDgPog0r4bser1lEIOco2dN9zpDJ1M88hfDgZvxe5z4xNcwg==", + "dev": true, + "requires": { + "async": "^2.6.0", + "diagnostics": "^1.1.1", + "is-stream": "^1.1.0", + "logform": "^1.9.1", + "one-time": "0.0.4", + "readable-stream": "^2.3.6", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.2.0" + } + }, + "winston-transport": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/winston-transport/-/winston-transport-4.2.0.tgz", + "integrity": "sha512-0R1bvFqxSlK/ZKTH86nymOuKv/cT1PQBMuDdA7k7f0S9fM44dNH6bXnuxwXPrN8lefJgtZq08BKdyZ0DZIy/rg==", + "dev": true, + "requires": { + "readable-stream": "^2.3.6", + "triple-beam": "^1.2.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + }, + "yeoman-environment": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeoman-environment/-/yeoman-environment-2.3.0.tgz", + "integrity": "sha512-PHSAkVOqYdcR+C+Uht1SGC4eVD/9OhygYFkYaI66xF8vKIeS1RNYay+umj2ZrQeJ50tF5Q/RSO6qGDz9y3Ifug==", + "dev": true, + "requires": { + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^3.1.0", + "diff": "^3.3.1", + "escape-string-regexp": "^1.0.2", + "globby": "^8.0.1", + "grouped-queue": "^0.3.3", + "inquirer": "^5.2.0", + "is-scoped": "^1.0.0", + "lodash": "^4.17.10", + "log-symbols": "^2.1.0", + "mem-fs": "^1.1.0", + "strip-ansi": "^4.0.0", + "text-table": "^0.2.0", + "untildify": "^3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "yeoman-generator": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeoman-generator/-/yeoman-generator-3.0.0.tgz", + "integrity": "sha512-aHsNXzkdgAoakZTZsDX7T56wYWYd1O5E/GBIFAVMJLH7TKRr+1MiEJszZQbbCSA+J+lpT743/8L88j35yNdTLQ==", + "dev": true, + "requires": { + "async": "^2.6.0", + "chalk": "^2.3.0", + "cli-table": "^0.3.1", + "cross-spawn": "^6.0.5", + "dargs": "^6.0.0", + "dateformat": "^3.0.3", + "debug": "^3.1.0", + "detect-conflict": "^1.0.0", + "error": "^7.0.2", + "find-up": "^3.0.0", + "github-username": "^4.0.0", + "istextorbinary": "^2.2.1", + "lodash": "^4.17.10", + "make-dir": "^1.1.0", + "mem-fs-editor": "^5.0.0", + "minimist": "^1.2.0", + "pretty-bytes": "^5.1.0", + "read-chunk": "^2.1.0", + "read-pkg-up": "^4.0.0", + "rimraf": "^2.6.2", + "run-async": "^2.0.0", + "shelljs": "^0.8.0", + "text-table": "^0.2.0", + "through2": "^2.0.0", + "yeoman-environment": "^2.0.5" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + } + } + } + } +} diff --git a/jhipster/jhipster-uaa/quotes/package.json b/jhipster/jhipster-uaa/quotes/package.json new file mode 100644 index 0000000000..797077d9d2 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/package.json @@ -0,0 +1,16 @@ +{ + "name": "quotes", + "version": "0.0.0", + "description": "Description for quotes", + "private": true, + "license": "UNLICENSED", + "cacheDirectories": [ + "node_modules" + ], + "devDependencies": { + "generator-jhipster": "5.4.2" + }, + "engines": { + "node": ">=8.9.0" + } +} diff --git a/jhipster/jhipster-uaa/quotes/pom.xml b/jhipster/jhipster-uaa/quotes/pom.xml new file mode 100644 index 0000000000..9984f009ff --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/pom.xml @@ -0,0 +1,915 @@ + + + 4.0.0 + + com.baeldung.jhipster.quotes + quotes + 0.0.1-SNAPSHOT + war + Quotes + + + + + + + + + + 3.0.0 + 1.8 + 2.12.6 + v8.12.0 + 6.4.1 + UTF-8 + UTF-8 + ${project.build.directory}/test-results + yyyyMMddHHmmss + ${java.version} + ${java.version} + -Djava.security.egd=file:/dev/./urandom -Xmx256m + jdt_apt + false + + + + + + + 2.0.25 + + 2.0.5.RELEASE + + 5.2.17.Final + + 3.22.0-GA + + 3.5.5 + 3.6 + 2.0.1.Final + 1.2.0.Final + + + 3.1.0 + 3.8.0 + 2.10 + 3.0.0-M2 + 3.1.0 + 2.22.0 + 3.2.2 + 0.9.11 + 0.8.2 + 3.4.2 + 3.5.0.1254 + 2.2.5 + + + http://localhost:9001 + src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/www/**/*.* + S3437,S4684,UndocumentedApi,BoldAndItalicTagsCheck + + src/main/webapp/app/**/*.* + Web:BoldAndItalicTagsCheck + + src/main/java/**/* + squid:S3437 + + src/main/java/**/* + squid:UndocumentedApi + + src/main/java/**/* + squid:S4684 + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + jacoco + ${project.testresult.directory}/lcov.info + ${project.basedir}/src/main/ + ${project.testresult.directory}/surefire-reports + ${project.basedir}/src/test/ + + + + + + + + io.github.jhipster + jhipster-dependencies + ${jhipster-dependencies.version} + pom + import + + + + + + + + io.github.jhipster + jhipster-framework + + + + org.springframework.boot + spring-boot-starter-cache + + + io.dropwizard.metrics + metrics-core + + + io.dropwizard.metrics + metrics-annotation + + + io.dropwizard.metrics + metrics-json + + + io.dropwizard.metrics + metrics-jvm + + + io.dropwizard.metrics + metrics-servlet + + + io.dropwizard.metrics + metrics-servlets + + + com.fasterxml.jackson.datatype + jackson-datatype-hibernate5 + + + com.fasterxml.jackson.datatype + jackson-datatype-hppc + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-afterburner + + + com.h2database + h2 + test + + + com.hazelcast + hazelcast + + + com.hazelcast + hazelcast-hibernate52 + + + com.hazelcast + hazelcast-spring + + + com.jayway.jsonpath + json-path + test + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-bean-validators + + + com.mattbertolini + liquibase-slf4j + + + com.ryantenney.metrics + metrics-spring + + + com.zaxxer + HikariCP + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + javax.cache + cache-api + + + mysql + mysql-connector-java + + + org.assertj + assertj-core + test + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + provided + + + org.hibernate + hibernate-envers + + + org.hibernate.validator + hibernate-validator + + + org.liquibase + liquibase-core + + + net.logstash.logback + logstash-logback-encoder + + + org.mapstruct + mapstruct-jdk8 + ${mapstruct.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + provided + + + org.springframework.boot + spring-boot-configuration-processor + provided + + + org.springframework.boot + spring-boot-loader-tools + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-logging + + + org.springframework.boot + spring-boot-starter-mail + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-test + test + + + org.springframework.security + spring-security-test + test + + + org.zalando + problem-spring-web + 0.24.0-RC.0 + + + org.springframework.security.oauth + spring-security-oauth2 + + + org.springframework.security + spring-security-jwt + + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.cloud + spring-cloud-starter-netflix-ribbon + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + org.springframework.retry + spring-retry + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.cloud + spring-cloud-security + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + org.springframework.cloud + spring-cloud-spring-service-connector + + + + org.springframework.security + spring-security-data + + + + + + spring-boot:run + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + ${maven-eclipse-plugin.version} + + true + true + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven-enforcer-plugin.version} + + + enforce-versions + + enforce + + + + + + + You are running an older version of Maven. JHipster requires at least Maven ${maven.version} + [${maven.version},) + + + + You are running an incompatible version of Java. JHipster requires JDK ${java.version} + [1.8,1.9) + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${maven-resources-plugin.version} + + + default-resources + validate + + copy-resources + + + target/classes + false + + # + + + + src/main/resources/ + true + + config/*.yml + + + + src/main/resources/ + false + + config/*.yml + + + + + + + docker-resources + verify + + copy-resources + + + target/classes/static/ + + + target/www + false + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + alphabetical + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + pre-unit-tests + + prepare-agent + + + + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + + + + + post-unit-test + test + + report + + + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + ${project.testresult.directory}/coverage/jacoco + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + org.liquibase + liquibase-maven-plugin + ${liquibase.version} + + src/main/resources/config/liquibase/master.xml + src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml + org.h2.Driver + jdbc:h2:file:./target/h2db/db/quotes + + quotes + + hibernate:spring:com.baeldung.jhipster.quotes.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + true + debug + + + + org.javassist + javassist + ${javassist.version} + + + org.liquibase.ext + liquibase-hibernate5 + ${liquibase-hibernate5.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring-boot.version} + + + javax.validation + validation-api + ${validation-api.version} + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + ${start-class} + true + true + + + + + com.google.cloud.tools + jib-maven-plugin + ${jib-maven-plugin.version} + + + openjdk:8-jre-alpine + + + quotes:latest + + + + sh + + chmod +x /entrypoint.sh && sync && /entrypoint.sh + + + 8081 + 5701/udp + + + ALWAYS + 0 + + true + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.jacoco + + jacoco-maven-plugin + + + ${jacoco-maven-plugin.version} + + + prepare-agent + + + + + + + + + + + + + + + + no-liquibase + + ,no-liquibase + + + + swagger + + ,swagger + + + + tls + + ,tls + + + + dev + + true + + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-devtools + true + + + com.h2database + h2 + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + + + + dev${profile.tls}${profile.no-liquibase} + + + + prod + + + org.springframework.boot + spring-boot-starter-undertow + + + + + + maven-clean-plugin + ${maven-clean-plugin.version} + + + + target/www/ + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${start-class} + true + + + + + build-info + + + + + + pl.project13.maven + git-commit-id-plugin + ${git-commit-id-plugin.version} + + + + revision + + + + + false + true + + ^git.commit.id.abbrev$ + ^git.commit.id.describe$ + ^git.branch$ + + + + + + + + prod${profile.swagger}${profile.no-liquibase} + + + + + cc + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-devtools + true + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + src/main/webapp/ + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${start-class} + true + true + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + default-compile + none + + + default-testCompile + none + + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin.version} + + + compile + compile + + add-source + compile + + + + test-compile + test-compile + + add-source + testCompile + + + + + incremental + true + ${scala.version} + + + + + + + dev,swagger + + + + + zipkin + + + org.springframework.cloud + spring-cloud-starter-zipkin + + + + + + IDE + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + + + + + + diff --git a/jhipster/jhipster-uaa/quotes/quotes.jh b/jhipster/jhipster-uaa/quotes/quotes.jh new file mode 100644 index 0000000000..daa5698fc4 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/quotes.jh @@ -0,0 +1,13 @@ +// JDL definition for application 'quotes' generated with command 'jhipster export-jdl' + +entity Quote { + symbol String required unique, + price BigDecimal required, + lastTrade ZonedDateTime required +} +dto Quote with mapstruct +paginate Quote with pagination +service Quote with serviceImpl +microservice Quote with quotes +filter Quote +clientRootFolder Quote with quotes diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/.dockerignore b/jhipster/jhipster-uaa/quotes/src/main/docker/.dockerignore new file mode 100644 index 0000000000..b03bdc71ee --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/.dockerignore @@ -0,0 +1,14 @@ +# https://docs.docker.com/engine/reference/builder/#dockerignore-file +classes/ +generated-sources/ +generated-test-sources/ +h2db/ +maven-archiver/ +maven-status/ +reports/ +surefire-reports/ +test-classes/ +test-results/ +www/ +!*.jar +!*.war diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/Dockerfile b/jhipster/jhipster-uaa/quotes/src/main/docker/Dockerfile new file mode 100644 index 0000000000..6c663a2919 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM openjdk:8-jre-alpine + +ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ + JHIPSTER_SLEEP=0 \ + JAVA_OPTS="" + +# Add a jhipster user to run our application so that it doesn't need to run as root +RUN adduser -D -s /bin/sh jhipster +WORKDIR /home/jhipster + +ADD entrypoint.sh entrypoint.sh +RUN chmod 755 entrypoint.sh && chown jhipster:jhipster entrypoint.sh +USER jhipster + +ENTRYPOINT ["./entrypoint.sh"] + +EXPOSE 8081 5701/udp + +ADD *.war app.war + diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/app.yml b/jhipster/jhipster-uaa/quotes/src/main/docker/app.yml new file mode 100644 index 0000000000..8c28c83011 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/app.yml @@ -0,0 +1,22 @@ +version: '2' +services: + quotes-app: + image: quotes + environment: + # - _JAVA_OPTIONS=-Xmx512m -Xms256m + - SPRING_PROFILES_ACTIVE=prod,swagger + - EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka + - SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config + - SPRING_DATASOURCE_URL=jdbc:mysql://quotes-mysql:3306/quotes?useUnicode=true&characterEncoding=utf8&useSSL=false + - JHIPSTER_SLEEP=30 # gives time for the JHipster Registry to boot before the application + quotes-mysql: + extends: + file: mysql.yml + service: quotes-mysql + jhipster-registry: + extends: + file: jhipster-registry.yml + service: jhipster-registry + environment: + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/docker-config/ diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/README.md b/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/README.md new file mode 100644 index 0000000000..6aab9ffdd5 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/README.md @@ -0,0 +1,7 @@ +# Central configuration sources details + +The JHipster-Registry will use the following directories as its configuration source : +- localhost-config : when running the registry in docker with the jhipster-registry.yml docker-compose file +- docker-config : when running the registry and the app both in docker with the app.yml docker-compose file + +For more info, refer to https://www.jhipster.tech/microservices-architecture/#registry_app_configuration diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/docker-config/application.yml b/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/docker-config/application.yml new file mode 100644 index 0000000000..8a973c0a35 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/docker-config/application.yml @@ -0,0 +1,15 @@ +# Common configuration shared between all applications +configserver: + name: Docker JHipster Registry + status: Connected to the JHipster Registry running in Docker + +jhipster: + security: + authentication: + jwt: + secret: my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded + +eureka: + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@jhipster-registry:8761/eureka/ diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/localhost-config/application.yml b/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/localhost-config/application.yml new file mode 100644 index 0000000000..db4602e419 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/central-server-config/localhost-config/application.yml @@ -0,0 +1,15 @@ +# Common configuration shared between all applications +configserver: + name: Docker JHipster Registry + status: Connected to the JHipster Registry running in Docker + +jhipster: + security: + authentication: + jwt: + secret: my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded + +eureka: + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/entrypoint.sh b/jhipster/jhipster-uaa/quotes/src/main/docker/entrypoint.sh new file mode 100644 index 0000000000..ccffafb5a4 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} +exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar "${HOME}/app.war" "$@" diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/hazelcast-management-center.yml b/jhipster/jhipster-uaa/quotes/src/main/docker/hazelcast-management-center.yml new file mode 100644 index 0000000000..c7e342303d --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/hazelcast-management-center.yml @@ -0,0 +1,6 @@ +version: '2' +services: + quotes-hazelcast-management-center: + image: hazelcast/management-center:3.9.3 + ports: + - 8180:8080 diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/jhipster-registry.yml b/jhipster/jhipster-uaa/quotes/src/main/docker/jhipster-registry.yml new file mode 100644 index 0000000000..512bc54be6 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/jhipster-registry.yml @@ -0,0 +1,22 @@ +version: '2' +services: + jhipster-registry: + image: jhipster/jhipster-registry:v4.0.4 + volumes: + - ./central-server-config:/central-config + # When run with the "dev" Spring profile, the JHipster Registry will + # read the config from the local filesystem (central-server-config directory) + # When run with the "prod" Spring profile, it will read the configuration from a Git repository + # See https://www.jhipster.tech/microservices-architecture/#registry_app_configuration + environment: + # - _JAVA_OPTIONS=-Xmx512m -Xms256m + - SPRING_PROFILES_ACTIVE=dev,swagger,uaa + - SPRING_SECURITY_USER_PASSWORD=admin + - JHIPSTER_REGISTRY_PASSWORD=admin + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/localhost-config/ + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=git + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_URI=https://github.com/jhipster/jhipster-registry/ + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_PATHS=central-config + ports: + - 8761:8761 diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/mysql.yml b/jhipster/jhipster-uaa/quotes/src/main/docker/mysql.yml new file mode 100644 index 0000000000..0c6cccdaba --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/mysql.yml @@ -0,0 +1,13 @@ +version: '2' +services: + quotes-mysql: + image: mysql:5.7.20 + # volumes: + # - ~/volumes/jhipster/quotes/mysql/:/var/lib/mysql/ + environment: + - MYSQL_USER=root + - MYSQL_ALLOW_EMPTY_PASSWORD=yes + - MYSQL_DATABASE=quotes + ports: + - 3306:3306 + command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp diff --git a/jhipster/jhipster-uaa/quotes/src/main/docker/sonar.yml b/jhipster/jhipster-uaa/quotes/src/main/docker/sonar.yml new file mode 100644 index 0000000000..075e5f17f6 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/docker/sonar.yml @@ -0,0 +1,7 @@ +version: '2' +services: + quotes-sonar: + image: sonarqube:7.1-alpine + ports: + - 9001:9000 + - 9092:9092 diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/ApplicationWebXml.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/ApplicationWebXml.java new file mode 100644 index 0000000000..24b9c098c7 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/ApplicationWebXml.java @@ -0,0 +1,21 @@ +package com.baeldung.jhipster.quotes; + +import com.baeldung.jhipster.quotes.config.DefaultProfileUtil; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * This is a helper Java class that provides an alternative to creating a web.xml. + * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc. + */ +public class ApplicationWebXml extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + /** + * set a default to use when no profile is configured. + */ + DefaultProfileUtil.addDefaultProfile(application.application()); + return application.sources(QuotesApp.class); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/QuotesApp.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/QuotesApp.java new file mode 100644 index 0000000000..7104bcd5fa --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/QuotesApp.java @@ -0,0 +1,113 @@ +package com.baeldung.jhipster.quotes; + +import com.baeldung.jhipster.quotes.client.OAuth2InterceptedFeignConfiguration; +import com.baeldung.jhipster.quotes.config.ApplicationProperties; +import com.baeldung.jhipster.quotes.config.DefaultProfileUtil; + +import io.github.jhipster.config.JHipsterConstants; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; +import org.springframework.core.env.Environment; + +import javax.annotation.PostConstruct; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Arrays; +import java.util.Collection; + +@ComponentScan( + excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = OAuth2InterceptedFeignConfiguration.class) +) +@SpringBootApplication +@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class}) +@EnableDiscoveryClient +public class QuotesApp { + + private static final Logger log = LoggerFactory.getLogger(QuotesApp.class); + + private final Environment env; + + public QuotesApp(Environment env) { + this.env = env; + } + + /** + * Initializes quotes. + *

+ * Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile + *

+ * You can find more information on how profiles work with JHipster on https://www.jhipster.tech/profiles/. + */ + @PostConstruct + public void initApplication() { + Collection activeProfiles = Arrays.asList(env.getActiveProfiles()); + if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { + log.error("You have misconfigured your application! It should not run " + + "with both the 'dev' and 'prod' profiles at the same time."); + } + if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)) { + log.error("You have misconfigured your application! It should not " + + "run with both the 'dev' and 'cloud' profiles at the same time."); + } + } + + /** + * Main method, used to run the application. + * + * @param args the command line arguments + */ + public static void main(String[] args) { + SpringApplication app = new SpringApplication(QuotesApp.class); + DefaultProfileUtil.addDefaultProfile(app); + Environment env = app.run(args).getEnvironment(); + logApplicationStartup(env); + } + + private static void logApplicationStartup(Environment env) { + String protocol = "http"; + if (env.getProperty("server.ssl.key-store") != null) { + protocol = "https"; + } + String serverPort = env.getProperty("server.port"); + String contextPath = env.getProperty("server.servlet.context-path"); + if (StringUtils.isBlank(contextPath)) { + contextPath = "/"; + } + String hostAddress = "localhost"; + try { + hostAddress = InetAddress.getLocalHost().getHostAddress(); + } catch (UnknownHostException e) { + log.warn("The host name could not be determined, using `localhost` as fallback"); + } + log.info("\n----------------------------------------------------------\n\t" + + "Application '{}' is running! Access URLs:\n\t" + + "Local: \t\t{}://localhost:{}{}\n\t" + + "External: \t{}://{}:{}{}\n\t" + + "Profile(s): \t{}\n----------------------------------------------------------", + env.getProperty("spring.application.name"), + protocol, + serverPort, + contextPath, + protocol, + hostAddress, + serverPort, + contextPath, + env.getActiveProfiles()); + + String configServerStatus = env.getProperty("configserver.status"); + if (configServerStatus == null) { + configServerStatus = "Not found or not setup for this application"; + } + log.info("\n----------------------------------------------------------\n\t" + + "Config Server: \t{}\n----------------------------------------------------------", configServerStatus); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/aop/logging/LoggingAspect.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/aop/logging/LoggingAspect.java new file mode 100644 index 0000000000..1649384bac --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/aop/logging/LoggingAspect.java @@ -0,0 +1,98 @@ +package com.baeldung.jhipster.quotes.aop.logging; + +import io.github.jhipster.config.JHipsterConstants; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.env.Environment; + +import java.util.Arrays; + +/** + * Aspect for logging execution of service and repository Spring components. + * + * By default, it only runs with the "dev" profile. + */ +@Aspect +public class LoggingAspect { + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + private final Environment env; + + public LoggingAspect(Environment env) { + this.env = env; + } + + /** + * Pointcut that matches all repositories, services and Web REST endpoints. + */ + @Pointcut("within(@org.springframework.stereotype.Repository *)" + + " || within(@org.springframework.stereotype.Service *)" + + " || within(@org.springframework.web.bind.annotation.RestController *)") + public void springBeanPointcut() { + // Method is empty as this is just a Pointcut, the implementations are in the advices. + } + + /** + * Pointcut that matches all Spring beans in the application's main packages. + */ + @Pointcut("within(com.baeldung.jhipster.quotes.repository..*)"+ + " || within(com.baeldung.jhipster.quotes.service..*)"+ + " || within(com.baeldung.jhipster.quotes.web.rest..*)") + public void applicationPackagePointcut() { + // Method is empty as this is just a Pointcut, the implementations are in the advices. + } + + /** + * Advice that logs methods throwing exceptions. + * + * @param joinPoint join point for advice + * @param e exception + */ + @AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e") + public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e); + + } else { + log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL"); + } + } + + /** + * Advice that logs when a method is entered and exited. + * + * @param joinPoint join point for advice + * @return result + * @throws Throwable throws IllegalArgumentException + */ + @Around("applicationPackagePointcut() && springBeanPointcut()") + public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { + if (log.isDebugEnabled()) { + log.debug("Enter: {}.{}() with argument[s] = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs())); + } + try { + Object result = joinPoint.proceed(); + if (log.isDebugEnabled()) { + log.debug("Exit: {}.{}() with result = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), result); + } + return result; + } catch (IllegalArgumentException e) { + log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), + joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName()); + + throw e; + } + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedFeignClient.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedFeignClient.java new file mode 100644 index 0000000000..3fad4533a8 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedFeignClient.java @@ -0,0 +1,51 @@ +package com.baeldung.jhipster.quotes.client; + +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.FeignClientsConfiguration; +import org.springframework.core.annotation.AliasFor; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented +@FeignClient +public @interface AuthorizedFeignClient { + + @AliasFor(annotation = FeignClient.class, attribute = "name") + String name() default ""; + + /** + * A custom @Configuration for the feign client. + * + * Can contain override @Bean definition for the pieces that + * make up the client, for instance {@link feign.codec.Decoder}, + * {@link feign.codec.Encoder}, {@link feign.Contract}. + * + * @see FeignClientsConfiguration for the defaults + */ + @AliasFor(annotation = FeignClient.class, attribute = "configuration") + Class[] configuration() default OAuth2InterceptedFeignConfiguration.class; + + /** + * An absolute URL or resolvable hostname (the protocol is optional). + */ + String url() default ""; + + /** + * Whether 404s should be decoded instead of throwing FeignExceptions. + */ + boolean decode404() default false; + + /** + * Fallback class for the specified Feign client interface. The fallback class must + * implement the interface annotated by this annotation and be a valid Spring bean. + */ + Class fallback() default void.class; + + /** + * Path prefix to be used by all method-level mappings. Can be used with or without + * @RibbonClient. + */ + String path() default ""; +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedUserFeignClient.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedUserFeignClient.java new file mode 100644 index 0000000000..5f40c2257d --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/AuthorizedUserFeignClient.java @@ -0,0 +1,49 @@ +package com.baeldung.jhipster.quotes.client; + +import java.lang.annotation.*; + +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.FeignClientsConfiguration; +import org.springframework.core.annotation.AliasFor; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented +@FeignClient +public @interface AuthorizedUserFeignClient { + + @AliasFor(annotation = FeignClient.class, attribute = "name") + String name() default ""; + + /** + * A custom @Configuration for the feign client. + * + * Can contain override @Bean definition for the pieces that make up the client, for instance {@link + * feign.codec.Decoder}, {@link feign.codec.Encoder}, {@link feign.Contract}. + * + * @see FeignClientsConfiguration for the defaults + */ + @AliasFor(annotation = FeignClient.class, attribute = "configuration") + Class[] configuration() default OAuth2UserClientFeignConfiguration.class; + + /** + * An absolute URL or resolvable hostname (the protocol is optional). + */ + String url() default ""; + + /** + * Whether 404s should be decoded instead of throwing FeignExceptions. + */ + boolean decode404() default false; + + /** + * Fallback class for the specified Feign client interface. The fallback class must implement the interface + * annotated by this annotation and be a valid Spring bean. + */ + Class fallback() default void.class; + + /** + * Path prefix to be used by all method-level mappings. Can be used with or without @RibbonClient. + */ + String path() default ""; +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2InterceptedFeignConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2InterceptedFeignConfiguration.java new file mode 100644 index 0000000000..4f60051e3d --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2InterceptedFeignConfiguration.java @@ -0,0 +1,24 @@ +package com.baeldung.jhipster.quotes.client; + +import java.io.IOException; + +import org.springframework.cloud.security.oauth2.client.feign.OAuth2FeignRequestInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext; + +import feign.RequestInterceptor; +import io.github.jhipster.security.uaa.LoadBalancedResourceDetails; + +public class OAuth2InterceptedFeignConfiguration { + + private final LoadBalancedResourceDetails loadBalancedResourceDetails; + + public OAuth2InterceptedFeignConfiguration(LoadBalancedResourceDetails loadBalancedResourceDetails) { + this.loadBalancedResourceDetails = loadBalancedResourceDetails; + } + + @Bean(name = "oauth2RequestInterceptor") + public RequestInterceptor getOAuth2RequestInterceptor() throws IOException { + return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), loadBalancedResourceDetails); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2UserClientFeignConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2UserClientFeignConfiguration.java new file mode 100644 index 0000000000..1b828ac4d2 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/OAuth2UserClientFeignConfiguration.java @@ -0,0 +1,15 @@ +package com.baeldung.jhipster.quotes.client; + +import java.io.IOException; + +import org.springframework.context.annotation.Bean; + +import feign.RequestInterceptor; + +public class OAuth2UserClientFeignConfiguration { + + @Bean(name = "userFeignClientInterceptor") + public RequestInterceptor getUserFeignClientInterceptor() throws IOException { + return new UserFeignClientInterceptor(); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/UserFeignClientInterceptor.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/UserFeignClientInterceptor.java new file mode 100644 index 0000000000..541d1ebfd8 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/client/UserFeignClientInterceptor.java @@ -0,0 +1,29 @@ +package com.baeldung.jhipster.quotes.client; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationDetails; + +import feign.RequestInterceptor; +import feign.RequestTemplate; + +public class UserFeignClientInterceptor implements RequestInterceptor{ + + private static final String AUTHORIZATION_HEADER = "Authorization"; + + private static final String BEARER_TOKEN_TYPE = "Bearer"; + + @Override + public void apply(RequestTemplate template) { + + SecurityContext securityContext = SecurityContextHolder.getContext(); + Authentication authentication = securityContext.getAuthentication(); + + if (authentication != null && authentication.getDetails() instanceof OAuth2AuthenticationDetails) { + + OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) authentication.getDetails(); + template.header(AUTHORIZATION_HEADER, String.format("%s %s", BEARER_TOKEN_TYPE, details.getTokenValue())); + } + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/ApplicationProperties.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/ApplicationProperties.java new file mode 100644 index 0000000000..fe6d0291ce --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/ApplicationProperties.java @@ -0,0 +1,14 @@ +package com.baeldung.jhipster.quotes.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Properties specific to Quotes. + *

+ * Properties are configured in the application.yml file. + * See {@link io.github.jhipster.config.JHipsterProperties} for a good example. + */ +@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) +public class ApplicationProperties { + +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/AsyncConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/AsyncConfiguration.java new file mode 100644 index 0000000000..8ab3139915 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/AsyncConfiguration.java @@ -0,0 +1,59 @@ +package com.baeldung.jhipster.quotes.config; + +import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; +import io.github.jhipster.config.JHipsterProperties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.*; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.annotation.SchedulingConfigurer; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; + +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; + +@Configuration +@EnableAsync +@EnableScheduling +public class AsyncConfiguration implements AsyncConfigurer, SchedulingConfigurer { + + private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); + + private final JHipsterProperties jHipsterProperties; + + public AsyncConfiguration(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + } + + @Override + @Bean(name = "taskExecutor") + public Executor getAsyncExecutor() { + log.debug("Creating Async Task Executor"); + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); + executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); + executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); + executor.setThreadNamePrefix("quotes-Executor-"); + return new ExceptionHandlingAsyncTaskExecutor(executor); + } + + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return new SimpleAsyncUncaughtExceptionHandler(); + } + + @Override + public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { + taskRegistrar.setScheduler(scheduledTaskExecutor()); + } + + @Bean + public Executor scheduledTaskExecutor() { + return Executors.newScheduledThreadPool(jHipsterProperties.getAsync().getCorePoolSize()); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CacheConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CacheConfiguration.java new file mode 100644 index 0000000000..c8afb491c1 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CacheConfiguration.java @@ -0,0 +1,155 @@ +package com.baeldung.jhipster.quotes.config; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; + +import com.hazelcast.config.*; +import com.hazelcast.core.HazelcastInstance; +import com.hazelcast.core.Hazelcast; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.web.ServerProperties; + +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.cloud.client.serviceregistry.Registration; +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; + +import javax.annotation.PreDestroy; + +@Configuration +@EnableCaching +public class CacheConfiguration { + + private final Logger log = LoggerFactory.getLogger(CacheConfiguration.class); + + private final Environment env; + + private final ServerProperties serverProperties; + + private final DiscoveryClient discoveryClient; + + private Registration registration; + + public CacheConfiguration(Environment env, ServerProperties serverProperties, DiscoveryClient discoveryClient) { + this.env = env; + this.serverProperties = serverProperties; + this.discoveryClient = discoveryClient; + } + + @Autowired(required = false) + public void setRegistration(Registration registration) { + this.registration = registration; + } + + @PreDestroy + public void destroy() { + log.info("Closing Cache Manager"); + Hazelcast.shutdownAll(); + } + + @Bean + public CacheManager cacheManager(HazelcastInstance hazelcastInstance) { + log.debug("Starting HazelcastCacheManager"); + CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance); + return cacheManager; + } + + @Bean + public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties) { + log.debug("Configuring Hazelcast"); + HazelcastInstance hazelCastInstance = Hazelcast.getHazelcastInstanceByName("quotes"); + if (hazelCastInstance != null) { + log.debug("Hazelcast already initialized"); + return hazelCastInstance; + } + Config config = new Config(); + config.setInstanceName("quotes"); + config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); + if (this.registration == null) { + log.warn("No discovery service is set up, Hazelcast cannot create a cluster."); + } else { + // The serviceId is by default the application's name, + // see the "spring.application.name" standard Spring property + String serviceId = registration.getServiceId(); + log.debug("Configuring Hazelcast clustering for instanceId: {}", serviceId); + // In development, everything goes through 127.0.0.1, with a different port + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + log.debug("Application is running with the \"dev\" profile, Hazelcast " + + "cluster will only work with localhost instances"); + + System.setProperty("hazelcast.local.localAddress", "127.0.0.1"); + config.getNetworkConfig().setPort(serverProperties.getPort() + 5701); + config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); + for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { + String clusterMember = "127.0.0.1:" + (instance.getPort() + 5701); + log.debug("Adding Hazelcast (dev) cluster member " + clusterMember); + config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); + } + } else { // Production configuration, one host per instance all using port 5701 + config.getNetworkConfig().setPort(5701); + config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); + for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { + String clusterMember = instance.getHost() + ":5701"; + log.debug("Adding Hazelcast (prod) cluster member " + clusterMember); + config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); + } + } + } + config.getMapConfigs().put("default", initializeDefaultMapConfig(jHipsterProperties)); + + // Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + config.setManagementCenterConfig(initializeDefaultManagementCenterConfig(jHipsterProperties)); + config.getMapConfigs().put("com.baeldung.jhipster.quotes.domain.*", initializeDomainMapConfig(jHipsterProperties)); + return Hazelcast.newHazelcastInstance(config); + } + + private ManagementCenterConfig initializeDefaultManagementCenterConfig(JHipsterProperties jHipsterProperties) { + ManagementCenterConfig managementCenterConfig = new ManagementCenterConfig(); + managementCenterConfig.setEnabled(jHipsterProperties.getCache().getHazelcast().getManagementCenter().isEnabled()); + managementCenterConfig.setUrl(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUrl()); + managementCenterConfig.setUpdateInterval(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUpdateInterval()); + return managementCenterConfig; + } + + private MapConfig initializeDefaultMapConfig(JHipsterProperties jHipsterProperties) { + MapConfig mapConfig = new MapConfig(); + + /* + Number of backups. If 1 is set as the backup-count for example, + then all entries of the map will be copied to another JVM for + fail-safety. Valid numbers are 0 (no backup), 1, 2, 3. + */ + mapConfig.setBackupCount(jHipsterProperties.getCache().getHazelcast().getBackupCount()); + + /* + Valid values are: + NONE (no eviction), + LRU (Least Recently Used), + LFU (Least Frequently Used). + NONE is the default. + */ + mapConfig.setEvictionPolicy(EvictionPolicy.LRU); + + /* + Maximum size of the map. When max size is reached, + map is evicted based on the policy defined. + Any integer between 0 and Integer.MAX_VALUE. 0 means + Integer.MAX_VALUE. Default is 0. + */ + mapConfig.setMaxSizeConfig(new MaxSizeConfig(0, MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE)); + + return mapConfig; + } + + private MapConfig initializeDomainMapConfig(JHipsterProperties jHipsterProperties) { + MapConfig mapConfig = new MapConfig(); + mapConfig.setTimeToLiveSeconds(jHipsterProperties.getCache().getHazelcast().getTimeToLiveSeconds()); + return mapConfig; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CloudDatabaseConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CloudDatabaseConfiguration.java new file mode 100644 index 0000000000..32044187ab --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/CloudDatabaseConfiguration.java @@ -0,0 +1,24 @@ +package com.baeldung.jhipster.quotes.config; + +import io.github.jhipster.config.JHipsterConstants; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.CacheManager; +import org.springframework.cloud.config.java.AbstractCloudConfig; +import org.springframework.context.annotation.*; + +import javax.sql.DataSource; + +@Configuration +@Profile(JHipsterConstants.SPRING_PROFILE_CLOUD) +public class CloudDatabaseConfiguration extends AbstractCloudConfig { + + private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class); + + @Bean + public DataSource dataSource(CacheManager cacheManager) { + log.info("Configuring JDBC datasource from a cloud provider"); + return connectionFactory().dataSource(); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/Constants.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/Constants.java new file mode 100644 index 0000000000..6be8ffcf95 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/Constants.java @@ -0,0 +1,17 @@ +package com.baeldung.jhipster.quotes.config; + +/** + * Application constants. + */ +public final class Constants { + + // Regex for acceptable logins + public static final String LOGIN_REGEX = "^[_.@A-Za-z0-9-]*$"; + + public static final String SYSTEM_ACCOUNT = "system"; + public static final String ANONYMOUS_USER = "anonymoususer"; + public static final String DEFAULT_LANGUAGE = "en"; + + private Constants() { + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DatabaseConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DatabaseConfiguration.java new file mode 100644 index 0000000000..cb7012cfc8 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DatabaseConfiguration.java @@ -0,0 +1,39 @@ +package com.baeldung.jhipster.quotes.config; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.h2.H2ConfigurationHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import java.sql.SQLException; + +@Configuration +@EnableJpaRepositories("com.baeldung.jhipster.quotes.repository") +@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") +@EnableTransactionManagement +public class DatabaseConfiguration { + + private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); + + + /** + * Open the TCP port for the H2 database, so it is available remotely. + * + * @return the H2 database TCP server + * @throws SQLException if the server failed to start + */ + @Bean(initMethod = "start", destroyMethod = "stop") + @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) + public Object h2TCPServer() throws SQLException { + log.debug("Starting H2 database"); + return H2ConfigurationHelper.createServer(); + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DateTimeFormatConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DateTimeFormatConfiguration.java new file mode 100644 index 0000000000..1205fdf593 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DateTimeFormatConfiguration.java @@ -0,0 +1,20 @@ +package com.baeldung.jhipster.quotes.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * Configure the converters to use the ISO format for dates by default. + */ +@Configuration +public class DateTimeFormatConfiguration implements WebMvcConfigurer { + + @Override + public void addFormatters(FormatterRegistry registry) { + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setUseIsoFormat(true); + registrar.registerFormatters(registry); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DefaultProfileUtil.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DefaultProfileUtil.java new file mode 100644 index 0000000000..b029b31b67 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/DefaultProfileUtil.java @@ -0,0 +1,51 @@ +package com.baeldung.jhipster.quotes.config; + +import io.github.jhipster.config.JHipsterConstants; + +import org.springframework.boot.SpringApplication; +import org.springframework.core.env.Environment; + +import java.util.*; + +/** + * Utility class to load a Spring profile to be used as default + * when there is no spring.profiles.active set in the environment or as command line argument. + * If the value is not available in application.yml then dev profile will be used as default. + */ +public final class DefaultProfileUtil { + + private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default"; + + private DefaultProfileUtil() { + } + + /** + * Set a default to use when no profile is configured. + * + * @param app the Spring application + */ + public static void addDefaultProfile(SpringApplication app) { + Map defProperties = new HashMap<>(); + /* + * The default profile to use when no other profiles are defined + * This cannot be set in the application.yml file. + * See https://github.com/spring-projects/spring-boot/issues/1219 + */ + defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); + app.setDefaultProperties(defProperties); + } + + /** + * Get the profiles that are applied else get default profiles. + * + * @param env spring environment + * @return profiles + */ + public static String[] getActiveProfiles(Environment env) { + String[] profiles = env.getActiveProfiles(); + if (profiles.length == 0) { + return env.getDefaultProfiles(); + } + return profiles; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/FeignConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/FeignConfiguration.java new file mode 100644 index 0000000000..85c4784a00 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/FeignConfiguration.java @@ -0,0 +1,18 @@ +package com.baeldung.jhipster.quotes.config; + +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableFeignClients(basePackages = "com.baeldung.jhipster.quotes") +public class FeignConfiguration { + + /** + * Set the Feign specific log level to log client REST requests + */ + @Bean + feign.Logger.Level feignLoggerLevel() { + return feign.Logger.Level.BASIC; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/JacksonConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/JacksonConfiguration.java new file mode 100644 index 0000000000..03747296a2 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/JacksonConfiguration.java @@ -0,0 +1,63 @@ +package com.baeldung.jhipster.quotes.config; + +import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.module.afterburner.AfterburnerModule; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.zalando.problem.ProblemModule; +import org.zalando.problem.violations.ConstraintViolationProblemModule; + +@Configuration +public class JacksonConfiguration { + + /** + * Support for Java date and time API. + * @return the corresponding Jackson module. + */ + @Bean + public JavaTimeModule javaTimeModule() { + return new JavaTimeModule(); + } + + @Bean + public Jdk8Module jdk8TimeModule() { + return new Jdk8Module(); + } + + + /* + * Support for Hibernate types in Jackson. + */ + @Bean + public Hibernate5Module hibernate5Module() { + return new Hibernate5Module(); + } + + /* + * Jackson Afterburner module to speed up serialization/deserialization. + */ + @Bean + public AfterburnerModule afterburnerModule() { + return new AfterburnerModule(); + } + + /* + * Module for serialization/deserialization of RFC7807 Problem. + */ + @Bean + ProblemModule problemModule() { + return new ProblemModule(); + } + + /* + * Module for serialization/deserialization of ConstraintViolationProblem. + */ + @Bean + ConstraintViolationProblemModule constraintViolationProblemModule() { + return new ConstraintViolationProblemModule(); + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LiquibaseConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LiquibaseConfiguration.java new file mode 100644 index 0000000000..686d6a221e --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LiquibaseConfiguration.java @@ -0,0 +1,53 @@ +package com.baeldung.jhipster.quotes.config; + +import javax.sql.DataSource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.core.task.TaskExecutor; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.liquibase.AsyncSpringLiquibase; +import liquibase.integration.spring.SpringLiquibase; + +@Configuration +public class LiquibaseConfiguration { + + private final Logger log = LoggerFactory.getLogger(LiquibaseConfiguration.class); + + private final Environment env; + + private final CacheManager cacheManager; + + public LiquibaseConfiguration(Environment env, CacheManager cacheManager) { + this.env = env; + this.cacheManager = cacheManager; + } + + @Bean + public SpringLiquibase liquibase(@Qualifier("taskExecutor") TaskExecutor taskExecutor, + DataSource dataSource, LiquibaseProperties liquibaseProperties) { + + // Use liquibase.integration.spring.SpringLiquibase if you don't want Liquibase to start asynchronously + SpringLiquibase liquibase = new AsyncSpringLiquibase(taskExecutor, env); + liquibase.setDataSource(dataSource); + liquibase.setChangeLog("classpath:config/liquibase/master.xml"); + liquibase.setContexts(liquibaseProperties.getContexts()); + liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema()); + liquibase.setDropFirst(liquibaseProperties.isDropFirst()); + liquibase.setChangeLogParameters(liquibaseProperties.getParameters()); + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE)) { + liquibase.setShouldRun(false); + } else { + liquibase.setShouldRun(liquibaseProperties.isEnabled()); + log.debug("Configuring Liquibase"); + } + return liquibase; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LocaleConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LocaleConfiguration.java new file mode 100644 index 0000000000..46ab99a3ea --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LocaleConfiguration.java @@ -0,0 +1,27 @@ +package com.baeldung.jhipster.quotes.config; + +import io.github.jhipster.config.locale.AngularCookieLocaleResolver; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.LocaleResolver; +import org.springframework.web.servlet.config.annotation.*; +import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; + +@Configuration +public class LocaleConfiguration implements WebMvcConfigurer { + + @Bean(name = "localeResolver") + public LocaleResolver localeResolver() { + AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); + cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); + return cookieLocaleResolver; + } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); + localeChangeInterceptor.setParamName("language"); + registry.addInterceptor(localeChangeInterceptor); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingAspectConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingAspectConfiguration.java new file mode 100644 index 0000000000..1a1eb93eeb --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingAspectConfiguration.java @@ -0,0 +1,19 @@ +package com.baeldung.jhipster.quotes.config; + +import com.baeldung.jhipster.quotes.aop.logging.LoggingAspect; + +import io.github.jhipster.config.JHipsterConstants; + +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; + +@Configuration +@EnableAspectJAutoProxy +public class LoggingAspectConfiguration { + + @Bean + @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) + public LoggingAspect loggingAspect(Environment env) { + return new LoggingAspect(env); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingConfiguration.java new file mode 100644 index 0000000000..2739133ffe --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/LoggingConfiguration.java @@ -0,0 +1,163 @@ +package com.baeldung.jhipster.quotes.config; + +import java.net.InetSocketAddress; +import java.util.Iterator; + +import io.github.jhipster.config.JHipsterProperties; + +import ch.qos.logback.classic.AsyncAppender; +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.boolex.OnMarkerEvaluator; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.LoggerContextListener; +import ch.qos.logback.core.Appender; +import ch.qos.logback.core.filter.EvaluatorFilter; +import ch.qos.logback.core.spi.ContextAwareBase; +import ch.qos.logback.core.spi.FilterReply; +import net.logstash.logback.appender.LogstashTcpSocketAppender; +import net.logstash.logback.encoder.LogstashEncoder; +import net.logstash.logback.stacktrace.ShortenedThrowableConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.context.annotation.Configuration; + +@Configuration +@RefreshScope +public class LoggingConfiguration { + + private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH"; + + private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH"; + + private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class); + + private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + + private final String appName; + + private final String serverPort; + + private final String version; + + private final JHipsterProperties jHipsterProperties; + + public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, + @Value("${info.project.version:}") String version, JHipsterProperties jHipsterProperties) { + this.appName = appName; + this.serverPort = serverPort; + this.version = version; + this.jHipsterProperties = jHipsterProperties; + if (jHipsterProperties.getLogging().getLogstash().isEnabled()) { + addLogstashAppender(context); + addContextListener(context); + } + if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { + setMetricsMarkerLogbackFilter(context); + } + } + + private void addContextListener(LoggerContext context) { + LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener(); + loggerContextListener.setContext(context); + context.addListener(loggerContextListener); + } + + private void addLogstashAppender(LoggerContext context) { + log.info("Initializing Logstash logging"); + + LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender(); + logstashAppender.setName(LOGSTASH_APPENDER_NAME); + logstashAppender.setContext(context); + String optionalFields = ""; + String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"," + + optionalFields + "\"version\":\"" + version + "\"}"; + + // More documentation is available at: https://github.com/logstash/logstash-logback-encoder + LogstashEncoder logstashEncoder = new LogstashEncoder(); + // Set the Logstash appender config from JHipster properties + logstashEncoder.setCustomFields(customFields); + // Set the Logstash appender config from JHipster properties + logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(), jHipsterProperties.getLogging().getLogstash().getPort())); + + ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter(); + throwableConverter.setRootCauseFirst(true); + logstashEncoder.setThrowableConverter(throwableConverter); + logstashEncoder.setCustomFields(customFields); + + logstashAppender.setEncoder(logstashEncoder); + logstashAppender.start(); + + // Wrap the appender in an Async appender for performance + AsyncAppender asyncLogstashAppender = new AsyncAppender(); + asyncLogstashAppender.setContext(context); + asyncLogstashAppender.setName(ASYNC_LOGSTASH_APPENDER_NAME); + asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize()); + asyncLogstashAppender.addAppender(logstashAppender); + asyncLogstashAppender.start(); + + context.getLogger("ROOT").addAppender(asyncLogstashAppender); + } + + // Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender + private void setMetricsMarkerLogbackFilter(LoggerContext context) { + log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME); + OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator(); + onMarkerMetricsEvaluator.setContext(context); + onMarkerMetricsEvaluator.addMarker("metrics"); + onMarkerMetricsEvaluator.start(); + EvaluatorFilter metricsFilter = new EvaluatorFilter<>(); + metricsFilter.setContext(context); + metricsFilter.setEvaluator(onMarkerMetricsEvaluator); + metricsFilter.setOnMatch(FilterReply.DENY); + metricsFilter.start(); + + for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) { + for (Iterator> it = logger.iteratorForAppenders(); it.hasNext();) { + Appender appender = it.next(); + if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) { + log.debug("Filter metrics logs from the {} appender", appender.getName()); + appender.setContext(context); + appender.addFilter(metricsFilter); + appender.start(); + } + } + } + } + + /** + * Logback configuration is achieved by configuration file and API. + * When configuration file change is detected, the configuration is reset. + * This listener ensures that the programmatic configuration is also re-applied after reset. + */ + class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener { + + @Override + public boolean isResetResistant() { + return true; + } + + @Override + public void onStart(LoggerContext context) { + addLogstashAppender(context); + } + + @Override + public void onReset(LoggerContext context) { + addLogstashAppender(context); + } + + @Override + public void onStop(LoggerContext context) { + // Nothing to do. + } + + @Override + public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) { + // Nothing to do. + } + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/MetricsConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/MetricsConfiguration.java new file mode 100644 index 0000000000..8a83d5c31d --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/MetricsConfiguration.java @@ -0,0 +1,99 @@ +package com.baeldung.jhipster.quotes.config; + +import io.github.jhipster.config.JHipsterProperties; + +import com.codahale.metrics.JmxReporter; +import com.codahale.metrics.JvmAttributeGaugeSet; +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.Slf4jReporter; +import com.codahale.metrics.health.HealthCheckRegistry; +import com.codahale.metrics.jvm.*; +import com.ryantenney.metrics.spring.config.annotation.EnableMetrics; +import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter; +import com.zaxxer.hikari.HikariDataSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.*; + +import javax.annotation.PostConstruct; +import java.lang.management.ManagementFactory; +import java.util.concurrent.TimeUnit; + +@Configuration +@EnableMetrics(proxyTargetClass = true) +public class MetricsConfiguration extends MetricsConfigurerAdapter { + + private static final String PROP_METRIC_REG_JVM_MEMORY = "jvm.memory"; + private static final String PROP_METRIC_REG_JVM_GARBAGE = "jvm.garbage"; + private static final String PROP_METRIC_REG_JVM_THREADS = "jvm.threads"; + private static final String PROP_METRIC_REG_JVM_FILES = "jvm.files"; + private static final String PROP_METRIC_REG_JVM_BUFFERS = "jvm.buffers"; + private static final String PROP_METRIC_REG_JVM_ATTRIBUTE_SET = "jvm.attributes"; + + private final Logger log = LoggerFactory.getLogger(MetricsConfiguration.class); + + private MetricRegistry metricRegistry = new MetricRegistry(); + + private HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); + + private final JHipsterProperties jHipsterProperties; + + private HikariDataSource hikariDataSource; + + public MetricsConfiguration(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + } + + @Autowired(required = false) + public void setHikariDataSource(HikariDataSource hikariDataSource) { + this.hikariDataSource = hikariDataSource; + } + + @Override + @Bean + public MetricRegistry getMetricRegistry() { + return metricRegistry; + } + + @Override + @Bean + public HealthCheckRegistry getHealthCheckRegistry() { + return healthCheckRegistry; + } + + @PostConstruct + public void init() { + log.debug("Registering JVM gauges"); + metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge()); + metricRegistry.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); + metricRegistry.register(PROP_METRIC_REG_JVM_ATTRIBUTE_SET, new JvmAttributeGaugeSet()); + if (hikariDataSource != null) { + log.debug("Monitoring the datasource"); + // remove the factory created by HikariDataSourceMetricsPostProcessor until JHipster migrate to Micrometer + hikariDataSource.setMetricsTrackerFactory(null); + hikariDataSource.setMetricRegistry(metricRegistry); + } + if (jHipsterProperties.getMetrics().getJmx().isEnabled()) { + log.debug("Initializing Metrics JMX reporting"); + JmxReporter jmxReporter = JmxReporter.forRegistry(metricRegistry).build(); + jmxReporter.start(); + } + if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { + log.info("Initializing Metrics Log reporting"); + Marker metricsMarker = MarkerFactory.getMarker("metrics"); + final Slf4jReporter reporter = Slf4jReporter.forRegistry(metricRegistry) + .outputTo(LoggerFactory.getLogger("metrics")) + .markWith(metricsMarker) + .convertRatesTo(TimeUnit.SECONDS) + .convertDurationsTo(TimeUnit.MILLISECONDS) + .build(); + reporter.start(jHipsterProperties.getMetrics().getLogs().getReportFrequency(), TimeUnit.SECONDS); + } + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/SecurityConfiguration.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/SecurityConfiguration.java new file mode 100644 index 0000000000..8c95001dcc --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/SecurityConfiguration.java @@ -0,0 +1,75 @@ +package com.baeldung.jhipster.quotes.config; + +import com.baeldung.jhipster.quotes.config.oauth2.OAuth2JwtAccessTokenConverter; +import com.baeldung.jhipster.quotes.config.oauth2.OAuth2Properties; +import com.baeldung.jhipster.quotes.security.oauth2.OAuth2SignatureVerifierClient; +import com.baeldung.jhipster.quotes.security.AuthoritiesConstants; + +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; +import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; +import org.springframework.security.web.csrf.CookieCsrfTokenRepository; +import org.springframework.web.client.RestTemplate; + +@Configuration +@EnableResourceServer +@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) +public class SecurityConfiguration extends ResourceServerConfigurerAdapter { + private final OAuth2Properties oAuth2Properties; + + public SecurityConfiguration(OAuth2Properties oAuth2Properties) { + this.oAuth2Properties = oAuth2Properties; + } + + @Override + public void configure(HttpSecurity http) throws Exception { + http + .csrf() + .disable() + .headers() + .frameOptions() + .disable() + .and() + .sessionManagement() + .sessionCreationPolicy(SessionCreationPolicy.STATELESS) + .and() + .authorizeRequests() + .antMatchers("/api/**").authenticated() + .antMatchers("/management/health").permitAll() + .antMatchers("/management/info").permitAll() + .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN); + } + + @Bean + public TokenStore tokenStore(JwtAccessTokenConverter jwtAccessTokenConverter) { + return new JwtTokenStore(jwtAccessTokenConverter); + } + + @Bean + public JwtAccessTokenConverter jwtAccessTokenConverter(OAuth2SignatureVerifierClient signatureVerifierClient) { + return new OAuth2JwtAccessTokenConverter(oAuth2Properties, signatureVerifierClient); + } + + @Bean + @Qualifier("loadBalancedRestTemplate") + public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) { + RestTemplate restTemplate = new RestTemplate(); + customizer.customize(restTemplate); + return restTemplate; + } + + @Bean + @Qualifier("vanillaRestTemplate") + public RestTemplate vanillaRestTemplate() { + return new RestTemplate(); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/WebConfigurer.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/WebConfigurer.java new file mode 100644 index 0000000000..4c2d0e4adc --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/WebConfigurer.java @@ -0,0 +1,148 @@ +package com.baeldung.jhipster.quotes.config; + +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.servlet.InstrumentedFilter; +import com.codahale.metrics.servlets.MetricsServlet; +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; +import io.github.jhipster.config.h2.H2ConfigurationHelper; +import io.undertow.UndertowOptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.*; +import org.springframework.boot.web.servlet.ServletContextInitializer; +import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.http.MediaType; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import javax.servlet.*; +import java.nio.charset.StandardCharsets; +import java.util.*; + + +/** + * Configuration of web application with Servlet 3.0 APIs. + */ +@Configuration +public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer { + + private final Logger log = LoggerFactory.getLogger(WebConfigurer.class); + + private final Environment env; + + private final JHipsterProperties jHipsterProperties; + + private MetricRegistry metricRegistry; + + public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) { + + this.env = env; + this.jHipsterProperties = jHipsterProperties; + } + + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + if (env.getActiveProfiles().length != 0) { + log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); + } + EnumSet disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC); + initMetrics(servletContext, disps); + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + initH2Console(servletContext); + } + log.info("Web application fully configured"); + } + + /** + * Customize the Servlet engine: Mime types, the document root, the cache. + */ + @Override + public void customize(WebServerFactory server) { + setMimeMappings(server); + + /* + * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288 + * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1. + * See the JHipsterProperties class and your application-*.yml configuration files + * for more information. + */ + if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && + server instanceof UndertowServletWebServerFactory) { + + ((UndertowServletWebServerFactory) server) + .addBuilderCustomizers(builder -> + builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)); + } + } + + private void setMimeMappings(WebServerFactory server) { + if (server instanceof ConfigurableServletWebServerFactory) { + MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); + // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711 + mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); + // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64 + mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); + ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; + servletWebServer.setMimeMappings(mappings); + } + } + + /** + * Initializes Metrics. + */ + private void initMetrics(ServletContext servletContext, EnumSet disps) { + log.debug("Initializing Metrics registries"); + servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, + metricRegistry); + servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, + metricRegistry); + + log.debug("Registering Metrics Filter"); + FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter", + new InstrumentedFilter()); + + metricsFilter.addMappingForUrlPatterns(disps, true, "/*"); + metricsFilter.setAsyncSupported(true); + + log.debug("Registering Metrics Servlet"); + ServletRegistration.Dynamic metricsAdminServlet = + servletContext.addServlet("metricsServlet", new MetricsServlet()); + + metricsAdminServlet.addMapping("/management/metrics/*"); + metricsAdminServlet.setAsyncSupported(true); + metricsAdminServlet.setLoadOnStartup(2); + } + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = jHipsterProperties.getCors(); + if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { + log.debug("Registering CORS filter"); + source.registerCorsConfiguration("/api/**", config); + source.registerCorsConfiguration("/management/**", config); + source.registerCorsConfiguration("/v2/api-docs", config); + } + return new CorsFilter(source); + } + + /** + * Initializes H2 console. + */ + private void initH2Console(ServletContext servletContext) { + log.debug("Initialize H2 console"); + H2ConfigurationHelper.initH2Console(servletContext); + } + + @Autowired(required = false) + public void setMetricRegistry(MetricRegistry metricRegistry) { + this.metricRegistry = metricRegistry; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/AuditEventConverter.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/AuditEventConverter.java new file mode 100644 index 0000000000..4b5f60595f --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/AuditEventConverter.java @@ -0,0 +1,86 @@ +package com.baeldung.jhipster.quotes.config.audit; + +import com.baeldung.jhipster.quotes.domain.PersistentAuditEvent; + +import org.springframework.boot.actuate.audit.AuditEvent; +import org.springframework.security.web.authentication.WebAuthenticationDetails; +import org.springframework.stereotype.Component; + +import java.util.*; + +@Component +public class AuditEventConverter { + + /** + * Convert a list of PersistentAuditEvent to a list of AuditEvent + * + * @param persistentAuditEvents the list to convert + * @return the converted list. + */ + public List convertToAuditEvent(Iterable persistentAuditEvents) { + if (persistentAuditEvents == null) { + return Collections.emptyList(); + } + List auditEvents = new ArrayList<>(); + for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) { + auditEvents.add(convertToAuditEvent(persistentAuditEvent)); + } + return auditEvents; + } + + /** + * Convert a PersistentAuditEvent to an AuditEvent + * + * @param persistentAuditEvent the event to convert + * @return the converted list. + */ + public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) { + if (persistentAuditEvent == null) { + return null; + } + return new AuditEvent(persistentAuditEvent.getAuditEventDate(), persistentAuditEvent.getPrincipal(), + persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData())); + } + + /** + * Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface + * + * @param data the data to convert + * @return a map of String, Object + */ + public Map convertDataToObjects(Map data) { + Map results = new HashMap<>(); + + if (data != null) { + for (Map.Entry entry : data.entrySet()) { + results.put(entry.getKey(), entry.getValue()); + } + } + return results; + } + + /** + * Internal conversion. This method will allow to save additional data. + * By default, it will save the object as string + * + * @param data the data to convert + * @return a map of String, String + */ + public Map convertDataToStrings(Map data) { + Map results = new HashMap<>(); + + if (data != null) { + for (Map.Entry entry : data.entrySet()) { + // Extract the data that will be saved. + if (entry.getValue() instanceof WebAuthenticationDetails) { + WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) entry.getValue(); + results.put("remoteAddress", authenticationDetails.getRemoteAddress()); + results.put("sessionId", authenticationDetails.getSessionId()); + } else { + results.put(entry.getKey(), Objects.toString(entry.getValue())); + } + } + } + return results; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/package-info.java new file mode 100644 index 0000000000..20cbbd0eb0 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/audit/package-info.java @@ -0,0 +1,4 @@ +/** + * Audit specific code. + */ +package com.baeldung.jhipster.quotes.config.audit; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2JwtAccessTokenConverter.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2JwtAccessTokenConverter.java new file mode 100644 index 0000000000..6450e83034 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2JwtAccessTokenConverter.java @@ -0,0 +1,109 @@ +package com.baeldung.jhipster.quotes.config.oauth2; + +import com.baeldung.jhipster.quotes.security.oauth2.OAuth2SignatureVerifierClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.jwt.crypto.sign.SignatureVerifier; +import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.security.oauth2.provider.OAuth2Authentication; + +import java.util.Map; + +/** + * Improved JwtAccessTokenConverter that can handle lazy fetching of public verifier keys. + */ +public class OAuth2JwtAccessTokenConverter extends JwtAccessTokenConverter { + private final Logger log = LoggerFactory.getLogger(OAuth2JwtAccessTokenConverter.class); + + private final OAuth2Properties oAuth2Properties; + private final OAuth2SignatureVerifierClient signatureVerifierClient; + /** + * When did we last fetch the public key? + */ + private long lastKeyFetchTimestamp; + + public OAuth2JwtAccessTokenConverter(OAuth2Properties oAuth2Properties, OAuth2SignatureVerifierClient signatureVerifierClient) { + this.oAuth2Properties = oAuth2Properties; + this.signatureVerifierClient = signatureVerifierClient; + tryCreateSignatureVerifier(); + } + + /** + * Try to decode the token with the current public key. + * If it fails, contact the OAuth2 server to get a new public key, then try again. + * We might not have fetched it in the first place or it might have changed. + * + * @param token the JWT token to decode. + * @return the resulting claims. + * @throws InvalidTokenException if we cannot decode the token. + */ + @Override + protected Map decode(String token) { + try { + //check if our public key and thus SignatureVerifier have expired + long ttl = oAuth2Properties.getSignatureVerification().getTtl(); + if (ttl > 0 && System.currentTimeMillis() - lastKeyFetchTimestamp > ttl) { + throw new InvalidTokenException("public key expired"); + } + return super.decode(token); + } catch (InvalidTokenException ex) { + if (tryCreateSignatureVerifier()) { + return super.decode(token); + } + throw ex; + } + } + + /** + * Fetch a new public key from the AuthorizationServer. + * + * @return true, if we could fetch it; false, if we could not. + */ + private boolean tryCreateSignatureVerifier() { + long t = System.currentTimeMillis(); + if (t - lastKeyFetchTimestamp < oAuth2Properties.getSignatureVerification().getPublicKeyRefreshRateLimit()) { + return false; + } + try { + SignatureVerifier verifier = signatureVerifierClient.getSignatureVerifier(); + if (verifier != null) { + setVerifier(verifier); + lastKeyFetchTimestamp = t; + log.debug("Public key retrieved from OAuth2 server to create SignatureVerifier"); + return true; + } + } catch (Throwable ex) { + log.error("could not get public key from OAuth2 server to create SignatureVerifier", ex); + } + return false; + } + /** + * Extract JWT claims and set it to OAuth2Authentication decoded details. + * Here is how to get details: + * + *

+     * 
+     *  SecurityContext securityContext = SecurityContextHolder.getContext();
+     *  Authentication authentication = securityContext.getAuthentication();
+     *  if (authentication != null) {
+     *      Object details = authentication.getDetails();
+     *      if(details instanceof OAuth2AuthenticationDetails) {
+     *          Object decodedDetails = ((OAuth2AuthenticationDetails) details).getDecodedDetails();
+     *          if(decodedDetails != null && decodedDetails instanceof Map) {
+     *             String detailFoo = ((Map) decodedDetails).get("foo");
+     *          }
+     *      }
+     *  }
+     * 
+     *  
+ * @param claims OAuth2JWTToken claims + * @return OAuth2Authentication + */ + @Override + public OAuth2Authentication extractAuthentication(Map claims) { + OAuth2Authentication authentication = super.extractAuthentication(claims); + authentication.setDetails(claims); + return authentication; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2Properties.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2Properties.java new file mode 100644 index 0000000000..32a76d4a21 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/oauth2/OAuth2Properties.java @@ -0,0 +1,118 @@ +package com.baeldung.jhipster.quotes.config.oauth2; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * OAuth2 properties define properties for OAuth2-based microservices. + */ +@Component +@ConfigurationProperties(prefix = "oauth2", ignoreUnknownFields = false) +public class OAuth2Properties { + private WebClientConfiguration webClientConfiguration = new WebClientConfiguration(); + + private SignatureVerification signatureVerification = new SignatureVerification(); + + public WebClientConfiguration getWebClientConfiguration() { + return webClientConfiguration; + } + + public SignatureVerification getSignatureVerification() { + return signatureVerification; + } + + public static class WebClientConfiguration { + private String clientId = "web_app"; + private String secret = "changeit"; + /** + * Holds the session timeout in seconds for non-remember-me sessions. + * After so many seconds of inactivity, the session will be terminated. + * Only checked during token refresh, so long access token validity may + * delay the session timeout accordingly. + */ + private int sessionTimeoutInSeconds = 1800; + /** + * Defines the cookie domain. If specified, cookies will be set on this domain. + * If not configured, then cookies will be set on the top-level domain of the + * request you sent, i.e. if you send a request to app1.your-domain.com, + * then cookies will be set on .your-domain.com, such that they + * are also valid for app2.your-domain.com. + */ + private String cookieDomain; + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public int getSessionTimeoutInSeconds() { + return sessionTimeoutInSeconds; + } + + public void setSessionTimeoutInSeconds(int sessionTimeoutInSeconds) { + this.sessionTimeoutInSeconds = sessionTimeoutInSeconds; + } + + public String getCookieDomain() { + return cookieDomain; + } + + public void setCookieDomain(String cookieDomain) { + this.cookieDomain = cookieDomain; + } + } + + public static class SignatureVerification { + /** + * Maximum refresh rate for public keys in ms. + * We won't fetch new public keys any faster than that to avoid spamming UAA in case + * we receive a lot of "illegal" tokens. + */ + private long publicKeyRefreshRateLimit = 10 * 1000L; + /** + * Maximum TTL for the public key in ms. + * The public key will be fetched again from UAA if it gets older than that. + * That way, we make sure that we get the newest keys always in case they are updated there. + */ + private long ttl = 24 * 60 * 60 * 1000L; + /** + * Endpoint where to retrieve the public key used to verify token signatures. + */ + private String publicKeyEndpointUri = "http://uaa/oauth/token_key"; + + public long getPublicKeyRefreshRateLimit() { + return publicKeyRefreshRateLimit; + } + + public void setPublicKeyRefreshRateLimit(long publicKeyRefreshRateLimit) { + this.publicKeyRefreshRateLimit = publicKeyRefreshRateLimit; + } + + public long getTtl() { + return ttl; + } + + public void setTtl(long ttl) { + this.ttl = ttl; + } + + public String getPublicKeyEndpointUri() { + return publicKeyEndpointUri; + } + + public void setPublicKeyEndpointUri(String publicKeyEndpointUri) { + this.publicKeyEndpointUri = publicKeyEndpointUri; + } + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/package-info.java new file mode 100644 index 0000000000..210bf685fb --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/config/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Framework configuration files. + */ +package com.baeldung.jhipster.quotes.config; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/AbstractAuditingEntity.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/AbstractAuditingEntity.java new file mode 100644 index 0000000000..c6e2635f98 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/AbstractAuditingEntity.java @@ -0,0 +1,79 @@ +package com.baeldung.jhipster.quotes.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.hibernate.envers.Audited; +import org.springframework.data.annotation.CreatedBy; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedBy; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import java.io.Serializable; +import java.time.Instant; +import javax.persistence.Column; +import javax.persistence.EntityListeners; +import javax.persistence.MappedSuperclass; + +/** + * Base abstract class for entities which will hold definitions for created, last modified by and created, + * last modified by date. + */ +@MappedSuperclass +@Audited +@EntityListeners(AuditingEntityListener.class) +public abstract class AbstractAuditingEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @CreatedBy + @Column(name = "created_by", nullable = false, length = 50, updatable = false) + @JsonIgnore + private String createdBy; + + @CreatedDate + @Column(name = "created_date", nullable = false, updatable = false) + @JsonIgnore + private Instant createdDate = Instant.now(); + + @LastModifiedBy + @Column(name = "last_modified_by", length = 50) + @JsonIgnore + private String lastModifiedBy; + + @LastModifiedDate + @Column(name = "last_modified_date") + @JsonIgnore + private Instant lastModifiedDate = Instant.now(); + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Instant getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Instant createdDate) { + this.createdDate = createdDate; + } + + public String getLastModifiedBy() { + return lastModifiedBy; + } + + public void setLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + public Instant getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Instant lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/PersistentAuditEvent.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/PersistentAuditEvent.java new file mode 100644 index 0000000000..c4ead3a122 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/PersistentAuditEvent.java @@ -0,0 +1,81 @@ +package com.baeldung.jhipster.quotes.domain; + +import javax.persistence.*; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; + +/** + * Persist AuditEvent managed by the Spring Boot actuator. + * + * @see org.springframework.boot.actuate.audit.AuditEvent + */ +@Entity +@Table(name = "jhi_persistent_audit_event") +public class PersistentAuditEvent implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "event_id") + private Long id; + + @NotNull + @Column(nullable = false) + private String principal; + + @Column(name = "event_date") + private Instant auditEventDate; + + @Column(name = "event_type") + private String auditEventType; + + @ElementCollection + @MapKeyColumn(name = "name") + @Column(name = "value") + @CollectionTable(name = "jhi_persistent_audit_evt_data", joinColumns=@JoinColumn(name="event_id")) + private Map data = new HashMap<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPrincipal() { + return principal; + } + + public void setPrincipal(String principal) { + this.principal = principal; + } + + public Instant getAuditEventDate() { + return auditEventDate; + } + + public void setAuditEventDate(Instant auditEventDate) { + this.auditEventDate = auditEventDate; + } + + public String getAuditEventType() { + return auditEventType; + } + + public void setAuditEventType(String auditEventType) { + this.auditEventType = auditEventType; + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/Quote.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/Quote.java new file mode 100644 index 0000000000..7d9d0aa93e --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/Quote.java @@ -0,0 +1,118 @@ +package com.baeldung.jhipster.quotes.domain; + +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; + +import javax.persistence.*; +import javax.validation.constraints.*; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.ZonedDateTime; +import java.util.Objects; + +/** + * A Quote. + */ +@Entity +@Table(name = "quote") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +public class Quote implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @NotNull + @Column(name = "symbol", nullable = false) + private String symbol; + + @NotNull + @Column(name = "price", precision = 10, scale = 2, nullable = false) + private BigDecimal price; + + @NotNull + @Column(name = "last_trade", nullable = false) + private ZonedDateTime lastTrade; + + // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSymbol() { + return symbol; + } + + public Quote symbol(String symbol) { + this.symbol = symbol; + return this; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public BigDecimal getPrice() { + return price; + } + + public Quote price(BigDecimal price) { + this.price = price; + return this; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public ZonedDateTime getLastTrade() { + return lastTrade; + } + + public Quote lastTrade(ZonedDateTime lastTrade) { + this.lastTrade = lastTrade; + return this; + } + + public void setLastTrade(ZonedDateTime lastTrade) { + this.lastTrade = lastTrade; + } + // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Quote quote = (Quote) o; + if (quote.getId() == null || getId() == null) { + return false; + } + return Objects.equals(getId(), quote.getId()); + } + + @Override + public int hashCode() { + return Objects.hashCode(getId()); + } + + @Override + public String toString() { + return "Quote{" + + "id=" + getId() + + ", symbol='" + getSymbol() + "'" + + ", price=" + getPrice() + + ", lastTrade='" + getLastTrade() + "'" + + "}"; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/package-info.java new file mode 100644 index 0000000000..03404faf86 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/domain/package-info.java @@ -0,0 +1,4 @@ +/** + * JPA domain objects. + */ +package com.baeldung.jhipster.quotes.domain; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/QuoteRepository.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/QuoteRepository.java new file mode 100644 index 0000000000..714c57d0d6 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/QuoteRepository.java @@ -0,0 +1,15 @@ +package com.baeldung.jhipster.quotes.repository; + +import com.baeldung.jhipster.quotes.domain.Quote; +import org.springframework.data.jpa.repository.*; +import org.springframework.stereotype.Repository; + + +/** + * Spring Data repository for the Quote entity. + */ +@SuppressWarnings("unused") +@Repository +public interface QuoteRepository extends JpaRepository, JpaSpecificationExecutor { + +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/package-info.java new file mode 100644 index 0000000000..c7edddfb4b --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/repository/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Data JPA repositories. + */ +package com.baeldung.jhipster.quotes.repository; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/AuthoritiesConstants.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/AuthoritiesConstants.java new file mode 100644 index 0000000000..e33affbb10 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/AuthoritiesConstants.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.quotes.security; + +/** + * Constants for Spring Security authorities. + */ +public final class AuthoritiesConstants { + + public static final String ADMIN = "ROLE_ADMIN"; + + public static final String USER = "ROLE_USER"; + + public static final String ANONYMOUS = "ROLE_ANONYMOUS"; + + private AuthoritiesConstants() { + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SecurityUtils.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SecurityUtils.java new file mode 100644 index 0000000000..613099ff45 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SecurityUtils.java @@ -0,0 +1,64 @@ +package com.baeldung.jhipster.quotes.security; + +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Optional; + +/** + * Utility class for Spring Security. + */ +public final class SecurityUtils { + + private SecurityUtils() { + } + + /** + * Get the login of the current user. + * + * @return the login of the current user + */ + public static Optional getCurrentUserLogin() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> { + if (authentication.getPrincipal() instanceof UserDetails) { + UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); + return springSecurityUser.getUsername(); + } else if (authentication.getPrincipal() instanceof String) { + return (String) authentication.getPrincipal(); + } + return null; + }); + } + + /** + * Check if a user is authenticated. + * + * @return true if the user is authenticated, false otherwise + */ + public static boolean isAuthenticated() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> authentication.getAuthorities().stream() + .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS))) + .orElse(false); + } + + /** + * If the current user has a specific authority (security role). + *

+ * The name of this method comes from the isUserInRole() method in the Servlet API + * + * @param authority the authority to check + * @return true if the current user has the authority, false otherwise + */ + public static boolean isCurrentUserInRole(String authority) { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> authentication.getAuthorities().stream() + .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority))) + .orElse(false); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SpringSecurityAuditorAware.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SpringSecurityAuditorAware.java new file mode 100644 index 0000000000..12464f25f0 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/SpringSecurityAuditorAware.java @@ -0,0 +1,20 @@ +package com.baeldung.jhipster.quotes.security; + +import com.baeldung.jhipster.quotes.config.Constants; + +import java.util.Optional; + +import org.springframework.data.domain.AuditorAware; +import org.springframework.stereotype.Component; + +/** + * Implementation of AuditorAware based on Spring Security. + */ +@Component +public class SpringSecurityAuditorAware implements AuditorAware { + + @Override + public Optional getCurrentAuditor() { + return Optional.of(SecurityUtils.getCurrentUserLogin().orElse(Constants.SYSTEM_ACCOUNT)); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/OAuth2SignatureVerifierClient.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/OAuth2SignatureVerifierClient.java new file mode 100644 index 0000000000..9f495f45ee --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/OAuth2SignatureVerifierClient.java @@ -0,0 +1,23 @@ +package com.baeldung.jhipster.quotes.security.oauth2; + +import org.springframework.security.jwt.crypto.sign.SignatureVerifier; + +/** + * Abstracts how to create a SignatureVerifier to verify JWT tokens with a public key. + * Implementations will have to contact the OAuth2 authorization server to fetch the public key + * and use it to build a SignatureVerifier in a server specific way. + * + * @see UaaSignatureVerifierClient + */ +public interface OAuth2SignatureVerifierClient { + /** + * Returns the SignatureVerifier used to verify JWT tokens. + * Fetches the public key from the Authorization server to create + * this verifier. + * + * @return the new verifier used to verify JWT signatures. + * Will be null if we cannot contact the token endpoint. + * @throws Exception if we could not create a SignatureVerifier or contact the token endpoint. + */ + SignatureVerifier getSignatureVerifier() throws Exception; +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/UaaSignatureVerifierClient.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/UaaSignatureVerifierClient.java new file mode 100644 index 0000000000..49568ff71b --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/oauth2/UaaSignatureVerifierClient.java @@ -0,0 +1,63 @@ +package com.baeldung.jhipster.quotes.security.oauth2; + +import com.baeldung.jhipster.quotes.config.oauth2.OAuth2Properties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.security.jwt.crypto.sign.RsaVerifier; +import org.springframework.security.jwt.crypto.sign.SignatureVerifier; +import org.springframework.security.oauth2.common.exceptions.InvalidClientException; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.util.Map; + +/** + * Client fetching the public key from UAA to create a SignatureVerifier. + */ +@Component +public class UaaSignatureVerifierClient implements OAuth2SignatureVerifierClient { + private final Logger log = LoggerFactory.getLogger(UaaSignatureVerifierClient.class); + private final RestTemplate restTemplate; + protected final OAuth2Properties oAuth2Properties; + + public UaaSignatureVerifierClient(DiscoveryClient discoveryClient, @Qualifier("loadBalancedRestTemplate") RestTemplate restTemplate, + OAuth2Properties oAuth2Properties) { + this.restTemplate = restTemplate; + this.oAuth2Properties = oAuth2Properties; + // Load available UAA servers + discoveryClient.getServices(); + } + + /** + * Fetches the public key from the UAA. + * + * @return the public key used to verify JWT tokens; or null. + */ + @Override + public SignatureVerifier getSignatureVerifier() throws Exception { + try { + HttpEntity request = new HttpEntity(new HttpHeaders()); + String key = (String) restTemplate + .exchange(getPublicKeyEndpoint(), HttpMethod.GET, request, Map.class).getBody() + .get("value"); + return new RsaVerifier(key); + } catch (IllegalStateException ex) { + log.warn("could not contact UAA to get public key"); + return null; + } + } + + /** Returns the configured endpoint URI to retrieve the public key. */ + private String getPublicKeyEndpoint() { + String tokenEndpointUrl = oAuth2Properties.getSignatureVerification().getPublicKeyEndpointUri(); + if (tokenEndpointUrl == null) { + throw new InvalidClientException("no token endpoint configured in application properties"); + } + return tokenEndpointUrl; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/package-info.java new file mode 100644 index 0000000000..b598b92ff3 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/security/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Security configuration. + */ +package com.baeldung.jhipster.quotes.security; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteQueryService.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteQueryService.java new file mode 100644 index 0000000000..bec9b9b218 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteQueryService.java @@ -0,0 +1,104 @@ +package com.baeldung.jhipster.quotes.service; + +import java.util.List; + +import javax.persistence.criteria.JoinType; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import io.github.jhipster.service.QueryService; + +import com.baeldung.jhipster.quotes.domain.Quote; +import com.baeldung.jhipster.quotes.domain.*; // for static metamodels +import com.baeldung.jhipster.quotes.repository.QuoteRepository; +import com.baeldung.jhipster.quotes.service.dto.QuoteCriteria; +import com.baeldung.jhipster.quotes.service.dto.QuoteDTO; +import com.baeldung.jhipster.quotes.service.mapper.QuoteMapper; + +/** + * Service for executing complex queries for Quote entities in the database. + * The main input is a {@link QuoteCriteria} which gets converted to {@link Specification}, + * in a way that all the filters must apply. + * It returns a {@link List} of {@link QuoteDTO} or a {@link Page} of {@link QuoteDTO} which fulfills the criteria. + */ +@Service +@Transactional(readOnly = true) +public class QuoteQueryService extends QueryService { + + private final Logger log = LoggerFactory.getLogger(QuoteQueryService.class); + + private final QuoteRepository quoteRepository; + + private final QuoteMapper quoteMapper; + + public QuoteQueryService(QuoteRepository quoteRepository, QuoteMapper quoteMapper) { + this.quoteRepository = quoteRepository; + this.quoteMapper = quoteMapper; + } + + /** + * Return a {@link List} of {@link QuoteDTO} which matches the criteria from the database + * @param criteria The object which holds all the filters, which the entities should match. + * @return the matching entities. + */ + @Transactional(readOnly = true) + public List findByCriteria(QuoteCriteria criteria) { + log.debug("find by criteria : {}", criteria); + final Specification specification = createSpecification(criteria); + return quoteMapper.toDto(quoteRepository.findAll(specification)); + } + + /** + * Return a {@link Page} of {@link QuoteDTO} which matches the criteria from the database + * @param criteria The object which holds all the filters, which the entities should match. + * @param page The page, which should be returned. + * @return the matching entities. + */ + @Transactional(readOnly = true) + public Page findByCriteria(QuoteCriteria criteria, Pageable page) { + log.debug("find by criteria : {}, page: {}", criteria, page); + final Specification specification = createSpecification(criteria); + return quoteRepository.findAll(specification, page) + .map(quoteMapper::toDto); + } + + /** + * Return the number of matching entities in the database + * @param criteria The object which holds all the filters, which the entities should match. + * @return the number of matching entities. + */ + @Transactional(readOnly = true) + public long countByCriteria(QuoteCriteria criteria) { + log.debug("count by criteria : {}", criteria); + final Specification specification = createSpecification(criteria); + return quoteRepository.count(specification); + } + + /** + * Function to convert QuoteCriteria to a {@link Specification} + */ + private Specification createSpecification(QuoteCriteria criteria) { + Specification specification = Specification.where(null); + if (criteria != null) { + if (criteria.getId() != null) { + specification = specification.and(buildSpecification(criteria.getId(), Quote_.id)); + } + if (criteria.getSymbol() != null) { + specification = specification.and(buildStringSpecification(criteria.getSymbol(), Quote_.symbol)); + } + if (criteria.getPrice() != null) { + specification = specification.and(buildRangeSpecification(criteria.getPrice(), Quote_.price)); + } + if (criteria.getLastTrade() != null) { + specification = specification.and(buildRangeSpecification(criteria.getLastTrade(), Quote_.lastTrade)); + } + } + return specification; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteService.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteService.java new file mode 100644 index 0000000000..f99c3e25db --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/QuoteService.java @@ -0,0 +1,46 @@ +package com.baeldung.jhipster.quotes.service; + +import com.baeldung.jhipster.quotes.service.dto.QuoteDTO; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +import java.util.Optional; + +/** + * Service Interface for managing Quote. + */ +public interface QuoteService { + + /** + * Save a quote. + * + * @param quoteDTO the entity to save + * @return the persisted entity + */ + QuoteDTO save(QuoteDTO quoteDTO); + + /** + * Get all the quotes. + * + * @param pageable the pagination information + * @return the list of entities + */ + Page findAll(Pageable pageable); + + + /** + * Get the "id" quote. + * + * @param id the id of the entity + * @return the entity + */ + Optional findOne(Long id); + + /** + * Delete the "id" quote. + * + * @param id the id of the entity + */ + void delete(Long id); +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteCriteria.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteCriteria.java new file mode 100644 index 0000000000..0400c1e5d4 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteCriteria.java @@ -0,0 +1,107 @@ +package com.baeldung.jhipster.quotes.service.dto; + +import java.io.Serializable; +import java.util.Objects; +import io.github.jhipster.service.filter.BooleanFilter; +import io.github.jhipster.service.filter.DoubleFilter; +import io.github.jhipster.service.filter.Filter; +import io.github.jhipster.service.filter.FloatFilter; +import io.github.jhipster.service.filter.IntegerFilter; +import io.github.jhipster.service.filter.LongFilter; +import io.github.jhipster.service.filter.StringFilter; +import io.github.jhipster.service.filter.BigDecimalFilter; +import io.github.jhipster.service.filter.ZonedDateTimeFilter; + +/** + * Criteria class for the Quote entity. This class is used in QuoteResource to + * receive all the possible filtering options from the Http GET request parameters. + * For example the following could be a valid requests: + * /quotes?id.greaterThan=5&attr1.contains=something&attr2.specified=false + * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use + * fix type specific filters. + */ +public class QuoteCriteria implements Serializable { + + private static final long serialVersionUID = 1L; + + private LongFilter id; + + private StringFilter symbol; + + private BigDecimalFilter price; + + private ZonedDateTimeFilter lastTrade; + + public QuoteCriteria() { + } + + public LongFilter getId() { + return id; + } + + public void setId(LongFilter id) { + this.id = id; + } + + public StringFilter getSymbol() { + return symbol; + } + + public void setSymbol(StringFilter symbol) { + this.symbol = symbol; + } + + public BigDecimalFilter getPrice() { + return price; + } + + public void setPrice(BigDecimalFilter price) { + this.price = price; + } + + public ZonedDateTimeFilter getLastTrade() { + return lastTrade; + } + + public void setLastTrade(ZonedDateTimeFilter lastTrade) { + this.lastTrade = lastTrade; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final QuoteCriteria that = (QuoteCriteria) o; + return + Objects.equals(id, that.id) && + Objects.equals(symbol, that.symbol) && + Objects.equals(price, that.price) && + Objects.equals(lastTrade, that.lastTrade); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + symbol, + price, + lastTrade + ); + } + + @Override + public String toString() { + return "QuoteCriteria{" + + (id != null ? "id=" + id + ", " : "") + + (symbol != null ? "symbol=" + symbol + ", " : "") + + (price != null ? "price=" + price + ", " : "") + + (lastTrade != null ? "lastTrade=" + lastTrade + ", " : "") + + "}"; + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteDTO.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteDTO.java new file mode 100644 index 0000000000..44042afe07 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/dto/QuoteDTO.java @@ -0,0 +1,87 @@ +package com.baeldung.jhipster.quotes.service.dto; + +import java.time.ZonedDateTime; +import javax.validation.constraints.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Objects; + +/** + * A DTO for the Quote entity. + */ +public class QuoteDTO implements Serializable { + + private Long id; + + @NotNull + private String symbol; + + @NotNull + private BigDecimal price; + + @NotNull + private ZonedDateTime lastTrade; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public ZonedDateTime getLastTrade() { + return lastTrade; + } + + public void setLastTrade(ZonedDateTime lastTrade) { + this.lastTrade = lastTrade; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + QuoteDTO quoteDTO = (QuoteDTO) o; + if (quoteDTO.getId() == null || getId() == null) { + return false; + } + return Objects.equals(getId(), quoteDTO.getId()); + } + + @Override + public int hashCode() { + return Objects.hashCode(getId()); + } + + @Override + public String toString() { + return "QuoteDTO{" + + "id=" + getId() + + ", symbol='" + getSymbol() + "'" + + ", price=" + getPrice() + + ", lastTrade='" + getLastTrade() + "'" + + "}"; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/impl/QuoteServiceImpl.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/impl/QuoteServiceImpl.java new file mode 100644 index 0000000000..91a868d0db --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/impl/QuoteServiceImpl.java @@ -0,0 +1,90 @@ +package com.baeldung.jhipster.quotes.service.impl; + +import com.baeldung.jhipster.quotes.service.QuoteService; +import com.baeldung.jhipster.quotes.domain.Quote; +import com.baeldung.jhipster.quotes.repository.QuoteRepository; +import com.baeldung.jhipster.quotes.service.dto.QuoteDTO; +import com.baeldung.jhipster.quotes.service.mapper.QuoteMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Optional; + +/** + * Service Implementation for managing Quote. + */ +@Service +@Transactional +public class QuoteServiceImpl implements QuoteService { + + private final Logger log = LoggerFactory.getLogger(QuoteServiceImpl.class); + + private final QuoteRepository quoteRepository; + + private final QuoteMapper quoteMapper; + + public QuoteServiceImpl(QuoteRepository quoteRepository, QuoteMapper quoteMapper) { + this.quoteRepository = quoteRepository; + this.quoteMapper = quoteMapper; + } + + /** + * Save a quote. + * + * @param quoteDTO the entity to save + * @return the persisted entity + */ + @Override + public QuoteDTO save(QuoteDTO quoteDTO) { + log.debug("Request to save Quote : {}", quoteDTO); + + Quote quote = quoteMapper.toEntity(quoteDTO); + quote = quoteRepository.save(quote); + return quoteMapper.toDto(quote); + } + + /** + * Get all the quotes. + * + * @param pageable the pagination information + * @return the list of entities + */ + @Override + @Transactional(readOnly = true) + public Page findAll(Pageable pageable) { + log.debug("Request to get all Quotes"); + return quoteRepository.findAll(pageable) + .map(quoteMapper::toDto); + } + + + /** + * Get one quote by id. + * + * @param id the id of the entity + * @return the entity + */ + @Override + @Transactional(readOnly = true) + public Optional findOne(Long id) { + log.debug("Request to get Quote : {}", id); + return quoteRepository.findById(id) + .map(quoteMapper::toDto); + } + + /** + * Delete the quote by id. + * + * @param id the id of the entity + */ + @Override + public void delete(Long id) { + log.debug("Request to delete Quote : {}", id); + quoteRepository.deleteById(id); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/EntityMapper.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/EntityMapper.java new file mode 100644 index 0000000000..219254a776 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/EntityMapper.java @@ -0,0 +1,21 @@ +package com.baeldung.jhipster.quotes.service.mapper; + +import java.util.List; + +/** + * Contract for a generic dto to entity mapper. + * + * @param - DTO type parameter. + * @param - Entity type parameter. + */ + +public interface EntityMapper { + + E toEntity(D dto); + + D toDto(E entity); + + List toEntity(List dtoList); + + List toDto(List entityList); +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/QuoteMapper.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/QuoteMapper.java new file mode 100644 index 0000000000..b8bb71d870 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/mapper/QuoteMapper.java @@ -0,0 +1,24 @@ +package com.baeldung.jhipster.quotes.service.mapper; + +import com.baeldung.jhipster.quotes.domain.*; +import com.baeldung.jhipster.quotes.service.dto.QuoteDTO; + +import org.mapstruct.*; + +/** + * Mapper for the entity Quote and its DTO QuoteDTO. + */ +@Mapper(componentModel = "spring", uses = {}) +public interface QuoteMapper extends EntityMapper { + + + + default Quote fromId(Long id) { + if (id == null) { + return null; + } + Quote quote = new Quote(); + quote.setId(id); + return quote; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/package-info.java new file mode 100644 index 0000000000..082757bde9 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/service/package-info.java @@ -0,0 +1,4 @@ +/** + * Service layer beans. + */ +package com.baeldung.jhipster.quotes.service; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/LogsResource.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/LogsResource.java new file mode 100644 index 0000000000..633bc9edf9 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/LogsResource.java @@ -0,0 +1,39 @@ +package com.baeldung.jhipster.quotes.web.rest; + +import com.baeldung.jhipster.quotes.web.rest.vm.LoggerVM; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; +import com.codahale.metrics.annotation.Timed; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * Controller for view and managing Log Level at runtime. + */ +@RestController +@RequestMapping("/management") +public class LogsResource { + + @GetMapping("/logs") + @Timed + public List getList() { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + return context.getLoggerList() + .stream() + .map(LoggerVM::new) + .collect(Collectors.toList()); + } + + @PutMapping("/logs") + @ResponseStatus(HttpStatus.NO_CONTENT) + @Timed + public void changeLevel(@RequestBody LoggerVM jsonLogger) { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + context.getLogger(jsonLogger.getName()).setLevel(Level.valueOf(jsonLogger.getLevel())); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/QuoteResource.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/QuoteResource.java new file mode 100644 index 0000000000..0fdcf518ae --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/QuoteResource.java @@ -0,0 +1,146 @@ +package com.baeldung.jhipster.quotes.web.rest; + +import com.codahale.metrics.annotation.Timed; +import com.baeldung.jhipster.quotes.service.QuoteService; +import com.baeldung.jhipster.quotes.web.rest.errors.BadRequestAlertException; +import com.baeldung.jhipster.quotes.web.rest.util.HeaderUtil; +import com.baeldung.jhipster.quotes.web.rest.util.PaginationUtil; +import com.baeldung.jhipster.quotes.service.dto.QuoteDTO; +import com.baeldung.jhipster.quotes.service.dto.QuoteCriteria; +import com.baeldung.jhipster.quotes.service.QuoteQueryService; +import io.github.jhipster.web.util.ResponseUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.net.URI; +import java.net.URISyntaxException; + +import java.util.List; +import java.util.Optional; + +/** + * REST controller for managing Quote. + */ +@RestController +@RequestMapping("/api") +public class QuoteResource { + + private final Logger log = LoggerFactory.getLogger(QuoteResource.class); + + private static final String ENTITY_NAME = "quotesQuote"; + + private final QuoteService quoteService; + + private final QuoteQueryService quoteQueryService; + + public QuoteResource(QuoteService quoteService, QuoteQueryService quoteQueryService) { + this.quoteService = quoteService; + this.quoteQueryService = quoteQueryService; + } + + /** + * POST /quotes : Create a new quote. + * + * @param quoteDTO the quoteDTO to create + * @return the ResponseEntity with status 201 (Created) and with body the new quoteDTO, or with status 400 (Bad Request) if the quote has already an ID + * @throws URISyntaxException if the Location URI syntax is incorrect + */ + @PostMapping("/quotes") + @Timed + public ResponseEntity createQuote(@Valid @RequestBody QuoteDTO quoteDTO) throws URISyntaxException { + log.debug("REST request to save Quote : {}", quoteDTO); + if (quoteDTO.getId() != null) { + throw new BadRequestAlertException("A new quote cannot already have an ID", ENTITY_NAME, "idexists"); + } + QuoteDTO result = quoteService.save(quoteDTO); + return ResponseEntity.created(new URI("/api/quotes/" + result.getId())) + .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) + .body(result); + } + + /** + * PUT /quotes : Updates an existing quote. + * + * @param quoteDTO the quoteDTO to update + * @return the ResponseEntity with status 200 (OK) and with body the updated quoteDTO, + * or with status 400 (Bad Request) if the quoteDTO is not valid, + * or with status 500 (Internal Server Error) if the quoteDTO couldn't be updated + * @throws URISyntaxException if the Location URI syntax is incorrect + */ + @PutMapping("/quotes") + @Timed + public ResponseEntity updateQuote(@Valid @RequestBody QuoteDTO quoteDTO) throws URISyntaxException { + log.debug("REST request to update Quote : {}", quoteDTO); + if (quoteDTO.getId() == null) { + throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); + } + QuoteDTO result = quoteService.save(quoteDTO); + return ResponseEntity.ok() + .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, quoteDTO.getId().toString())) + .body(result); + } + + /** + * GET /quotes : get all the quotes. + * + * @param pageable the pagination information + * @param criteria the criterias which the requested entities should match + * @return the ResponseEntity with status 200 (OK) and the list of quotes in body + */ + @GetMapping("/quotes") + @Timed + public ResponseEntity> getAllQuotes(QuoteCriteria criteria, Pageable pageable) { + log.debug("REST request to get Quotes by criteria: {}", criteria); + Page page = quoteQueryService.findByCriteria(criteria, pageable); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/quotes"); + return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); + } + + /** + * GET /quotes/count : count all the quotes. + * + * @param criteria the criterias which the requested entities should match + * @return the ResponseEntity with status 200 (OK) and the count in body + */ + @GetMapping("/quotes/count") + @Timed + public ResponseEntity countQuotes (QuoteCriteria criteria) { + log.debug("REST request to count Quotes by criteria: {}", criteria); + return ResponseEntity.ok().body(quoteQueryService.countByCriteria(criteria)); + } + + /** + * GET /quotes/:id : get the "id" quote. + * + * @param id the id of the quoteDTO to retrieve + * @return the ResponseEntity with status 200 (OK) and with body the quoteDTO, or with status 404 (Not Found) + */ + @GetMapping("/quotes/{id}") + @Timed + public ResponseEntity getQuote(@PathVariable Long id) { + log.debug("REST request to get Quote : {}", id); + Optional quoteDTO = quoteService.findOne(id); + return ResponseUtil.wrapOrNotFound(quoteDTO); + } + + /** + * DELETE /quotes/:id : delete the "id" quote. + * + * @param id the id of the quoteDTO to delete + * @return the ResponseEntity with status 200 (OK) + */ + @DeleteMapping("/quotes/{id}") + @Timed + public ResponseEntity deleteQuote(@PathVariable Long id) { + log.debug("REST request to delete Quote : {}", id); + quoteService.delete(id); + return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/BadRequestAlertException.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/BadRequestAlertException.java new file mode 100644 index 0000000000..9a8574bddc --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/BadRequestAlertException.java @@ -0,0 +1,42 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +public class BadRequestAlertException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + private final String entityName; + + private final String errorKey; + + public BadRequestAlertException(String defaultMessage, String entityName, String errorKey) { + this(ErrorConstants.DEFAULT_TYPE, defaultMessage, entityName, errorKey); + } + + public BadRequestAlertException(URI type, String defaultMessage, String entityName, String errorKey) { + super(type, defaultMessage, Status.BAD_REQUEST, null, null, null, getAlertParameters(entityName, errorKey)); + this.entityName = entityName; + this.errorKey = errorKey; + } + + public String getEntityName() { + return entityName; + } + + public String getErrorKey() { + return errorKey; + } + + private static Map getAlertParameters(String entityName, String errorKey) { + Map parameters = new HashMap<>(); + parameters.put("message", "error." + errorKey); + parameters.put("params", entityName); + return parameters; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/CustomParameterizedException.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/CustomParameterizedException.java new file mode 100644 index 0000000000..47b7d16247 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/CustomParameterizedException.java @@ -0,0 +1,54 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; + +import java.util.HashMap; +import java.util.Map; + +import static org.zalando.problem.Status.BAD_REQUEST; + +/** + * Custom, parameterized exception, which can be translated on the client side. + * For example: + * + *

+ * throw new CustomParameterizedException("myCustomError", "hello", "world");
+ * 
+ * + * Can be translated with: + * + *
+ * "error.myCustomError" :  "The server says {{param0}} to {{param1}}"
+ * 
+ */ +public class CustomParameterizedException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + private static final String PARAM = "param"; + + public CustomParameterizedException(String message, String... params) { + this(message, toParamMap(params)); + } + + public CustomParameterizedException(String message, Map paramMap) { + super(ErrorConstants.PARAMETERIZED_TYPE, "Parameterized Exception", BAD_REQUEST, null, null, null, toProblemParameters(message, paramMap)); + } + + public static Map toParamMap(String... params) { + Map paramMap = new HashMap<>(); + if (params != null && params.length > 0) { + for (int i = 0; i < params.length; i++) { + paramMap.put(PARAM + i, params[i]); + } + } + return paramMap; + } + + public static Map toProblemParameters(String message, Map paramMap) { + Map parameters = new HashMap<>(); + parameters.put("message", message); + parameters.put("params", paramMap); + return parameters; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailAlreadyUsedException.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailAlreadyUsedException.java new file mode 100644 index 0000000000..5d5a9103e3 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailAlreadyUsedException.java @@ -0,0 +1,10 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +public class EmailAlreadyUsedException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public EmailAlreadyUsedException() { + super(ErrorConstants.EMAIL_ALREADY_USED_TYPE, "Email is already in use!", "userManagement", "emailexists"); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailNotFoundException.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailNotFoundException.java new file mode 100644 index 0000000000..f92e7dd013 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/EmailNotFoundException.java @@ -0,0 +1,13 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +public class EmailNotFoundException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public EmailNotFoundException() { + super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ErrorConstants.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ErrorConstants.java new file mode 100644 index 0000000000..c07bdbdb00 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ErrorConstants.java @@ -0,0 +1,21 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import java.net.URI; + +public final class ErrorConstants { + + public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; + public static final String ERR_VALIDATION = "error.validation"; + public static final String PROBLEM_BASE_URL = "https://www.jhipster.tech/problem"; + public static final URI DEFAULT_TYPE = URI.create(PROBLEM_BASE_URL + "/problem-with-message"); + public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create(PROBLEM_BASE_URL + "/constraint-violation"); + public static final URI PARAMETERIZED_TYPE = URI.create(PROBLEM_BASE_URL + "/parameterized"); + public static final URI ENTITY_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/entity-not-found"); + public static final URI INVALID_PASSWORD_TYPE = URI.create(PROBLEM_BASE_URL + "/invalid-password"); + public static final URI EMAIL_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/email-already-used"); + public static final URI LOGIN_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/login-already-used"); + public static final URI EMAIL_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/email-not-found"); + + private ErrorConstants() { + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslator.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslator.java new file mode 100644 index 0000000000..18baa42736 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslator.java @@ -0,0 +1,107 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import com.baeldung.jhipster.quotes.web.rest.util.HeaderUtil; + +import org.springframework.dao.ConcurrencyFailureException; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.context.request.NativeWebRequest; +import org.zalando.problem.DefaultProblem; +import org.zalando.problem.Problem; +import org.zalando.problem.ProblemBuilder; +import org.zalando.problem.Status; +import org.zalando.problem.spring.web.advice.ProblemHandling; +import org.zalando.problem.violations.ConstraintViolationProblem; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.stream.Collectors; + +/** + * Controller advice to translate the server side exceptions to client-friendly json structures. + * The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807) + */ +@ControllerAdvice +public class ExceptionTranslator implements ProblemHandling { + + /** + * Post-process the Problem payload to add the message key for the front-end if needed + */ + @Override + public ResponseEntity process(@Nullable ResponseEntity entity, NativeWebRequest request) { + if (entity == null) { + return entity; + } + Problem problem = entity.getBody(); + if (!(problem instanceof ConstraintViolationProblem || problem instanceof DefaultProblem)) { + return entity; + } + ProblemBuilder builder = Problem.builder() + .withType(Problem.DEFAULT_TYPE.equals(problem.getType()) ? ErrorConstants.DEFAULT_TYPE : problem.getType()) + .withStatus(problem.getStatus()) + .withTitle(problem.getTitle()) + .with("path", request.getNativeRequest(HttpServletRequest.class).getRequestURI()); + + if (problem instanceof ConstraintViolationProblem) { + builder + .with("violations", ((ConstraintViolationProblem) problem).getViolations()) + .with("message", ErrorConstants.ERR_VALIDATION); + } else { + builder + .withCause(((DefaultProblem) problem).getCause()) + .withDetail(problem.getDetail()) + .withInstance(problem.getInstance()); + problem.getParameters().forEach(builder::with); + if (!problem.getParameters().containsKey("message") && problem.getStatus() != null) { + builder.with("message", "error.http." + problem.getStatus().getStatusCode()); + } + } + return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode()); + } + + @Override + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex, @Nonnull NativeWebRequest request) { + BindingResult result = ex.getBindingResult(); + List fieldErrors = result.getFieldErrors().stream() + .map(f -> new FieldErrorVM(f.getObjectName(), f.getField(), f.getCode())) + .collect(Collectors.toList()); + + Problem problem = Problem.builder() + .withType(ErrorConstants.CONSTRAINT_VIOLATION_TYPE) + .withTitle("Method argument not valid") + .withStatus(defaultConstraintViolationStatus()) + .with("message", ErrorConstants.ERR_VALIDATION) + .with("fieldErrors", fieldErrors) + .build(); + return create(ex, problem, request); + } + + @ExceptionHandler + public ResponseEntity handleNoSuchElementException(NoSuchElementException ex, NativeWebRequest request) { + Problem problem = Problem.builder() + .withStatus(Status.NOT_FOUND) + .with("message", ErrorConstants.ENTITY_NOT_FOUND_TYPE) + .build(); + return create(ex, problem, request); + } + + @ExceptionHandler + public ResponseEntity handleBadRequestAlertException(BadRequestAlertException ex, NativeWebRequest request) { + return create(ex, request, HeaderUtil.createFailureAlert(ex.getEntityName(), ex.getErrorKey(), ex.getMessage())); + } + + @ExceptionHandler + public ResponseEntity handleConcurrencyFailure(ConcurrencyFailureException ex, NativeWebRequest request) { + Problem problem = Problem.builder() + .withStatus(Status.CONFLICT) + .with("message", ErrorConstants.ERR_CONCURRENCY_FAILURE) + .build(); + return create(ex, problem, request); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/FieldErrorVM.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/FieldErrorVM.java new file mode 100644 index 0000000000..4e14b33d09 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/FieldErrorVM.java @@ -0,0 +1,33 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import java.io.Serializable; + +public class FieldErrorVM implements Serializable { + + private static final long serialVersionUID = 1L; + + private final String objectName; + + private final String field; + + private final String message; + + public FieldErrorVM(String dto, String field, String message) { + this.objectName = dto; + this.field = field; + this.message = message; + } + + public String getObjectName() { + return objectName; + } + + public String getField() { + return field; + } + + public String getMessage() { + return message; + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InternalServerErrorException.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InternalServerErrorException.java new file mode 100644 index 0000000000..4744eee829 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InternalServerErrorException.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +/** + * Simple exception with a message, that returns an Internal Server Error code. + */ +public class InternalServerErrorException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public InternalServerErrorException(String message) { + super(ErrorConstants.DEFAULT_TYPE, message, Status.INTERNAL_SERVER_ERROR); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InvalidPasswordException.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InvalidPasswordException.java new file mode 100644 index 0000000000..fa258a1430 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/InvalidPasswordException.java @@ -0,0 +1,13 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +public class InvalidPasswordException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public InvalidPasswordException() { + super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/LoginAlreadyUsedException.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/LoginAlreadyUsedException.java new file mode 100644 index 0000000000..d52fcd4477 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/LoginAlreadyUsedException.java @@ -0,0 +1,10 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +public class LoginAlreadyUsedException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public LoginAlreadyUsedException() { + super(ErrorConstants.LOGIN_ALREADY_USED_TYPE, "Login name already used!", "userManagement", "userexists"); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/package-info.java new file mode 100644 index 0000000000..bb1e69db80 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/errors/package-info.java @@ -0,0 +1,6 @@ +/** + * Specific errors used with Zalando's "problem-spring-web" library. + * + * More information on https://github.com/zalando/problem-spring-web + */ +package com.baeldung.jhipster.quotes.web.rest.errors; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/package-info.java new file mode 100644 index 0000000000..a7f972195b --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring MVC REST controllers. + */ +package com.baeldung.jhipster.quotes.web.rest; diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/HeaderUtil.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/HeaderUtil.java new file mode 100644 index 0000000000..ef7baf0687 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/HeaderUtil.java @@ -0,0 +1,45 @@ +package com.baeldung.jhipster.quotes.web.rest.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; + +/** + * Utility class for HTTP headers creation. + */ +public final class HeaderUtil { + + private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class); + + private static final String APPLICATION_NAME = "quotesApp"; + + private HeaderUtil() { + } + + public static HttpHeaders createAlert(String message, String param) { + HttpHeaders headers = new HttpHeaders(); + headers.add("X-" + APPLICATION_NAME + "-alert", message); + headers.add("X-" + APPLICATION_NAME + "-params", param); + return headers; + } + + public static HttpHeaders createEntityCreationAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".created", param); + } + + public static HttpHeaders createEntityUpdateAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".updated", param); + } + + public static HttpHeaders createEntityDeletionAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".deleted", param); + } + + public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) { + log.error("Entity processing failed, {}", defaultMessage); + HttpHeaders headers = new HttpHeaders(); + headers.add("X-" + APPLICATION_NAME + "-error", "error." + errorKey); + headers.add("X-" + APPLICATION_NAME + "-params", entityName); + return headers; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtil.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtil.java new file mode 100644 index 0000000000..fb74b16ab8 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtil.java @@ -0,0 +1,45 @@ +package com.baeldung.jhipster.quotes.web.rest.util; + +import org.springframework.data.domain.Page; +import org.springframework.http.HttpHeaders; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Utility class for handling pagination. + * + *

+ * Pagination uses the same principles as the GitHub API, + * and follow RFC 5988 (Link header). + */ +public final class PaginationUtil { + + private PaginationUtil() { + } + + public static HttpHeaders generatePaginationHttpHeaders(Page page, String baseUrl) { + + HttpHeaders headers = new HttpHeaders(); + headers.add("X-Total-Count", Long.toString(page.getTotalElements())); + String link = ""; + if ((page.getNumber() + 1) < page.getTotalPages()) { + link = "<" + generateUri(baseUrl, page.getNumber() + 1, page.getSize()) + ">; rel=\"next\","; + } + // prev link + if ((page.getNumber()) > 0) { + link += "<" + generateUri(baseUrl, page.getNumber() - 1, page.getSize()) + ">; rel=\"prev\","; + } + // last and first link + int lastPage = 0; + if (page.getTotalPages() > 0) { + lastPage = page.getTotalPages() - 1; + } + link += "<" + generateUri(baseUrl, lastPage, page.getSize()) + ">; rel=\"last\","; + link += "<" + generateUri(baseUrl, 0, page.getSize()) + ">; rel=\"first\""; + headers.add(HttpHeaders.LINK, link); + return headers; + } + + private static String generateUri(String baseUrl, int page, int size) { + return UriComponentsBuilder.fromUriString(baseUrl).queryParam("page", page).queryParam("size", size).toUriString(); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/LoggerVM.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/LoggerVM.java new file mode 100644 index 0000000000..6e6e8a7f99 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/LoggerVM.java @@ -0,0 +1,46 @@ +package com.baeldung.jhipster.quotes.web.rest.vm; + +import ch.qos.logback.classic.Logger; + +/** + * View Model object for storing a Logback logger. + */ +public class LoggerVM { + + private String name; + + private String level; + + public LoggerVM(Logger logger) { + this.name = logger.getName(); + this.level = logger.getEffectiveLevel().toString(); + } + + public LoggerVM() { + // Empty public constructor used by Jackson. + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + @Override + public String toString() { + return "LoggerVM{" + + "name='" + name + '\'' + + ", level='" + level + '\'' + + '}'; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/package-info.java b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/package-info.java new file mode 100644 index 0000000000..64bc8f241c --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/java/com/baeldung/jhipster/quotes/web/rest/vm/package-info.java @@ -0,0 +1,4 @@ +/** + * View Models used by Spring MVC REST controllers. + */ +package com.baeldung.jhipster.quotes.web.rest.vm; diff --git a/jhipster/jhipster-uaa/quotes/src/main/jib/entrypoint.sh b/jhipster/jhipster-uaa/quotes/src/main/jib/entrypoint.sh new file mode 100644 index 0000000000..9a369e8cf8 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/jib/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} +exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "com.baeldung.jhipster.quotes.QuotesApp" "$@" diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/.h2.server.properties b/jhipster/jhipster-uaa/quotes/src/main/resources/.h2.server.properties new file mode 100644 index 0000000000..c13694dfe9 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/.h2.server.properties @@ -0,0 +1,5 @@ +#H2 Server Properties +0=JHipster H2 (Disk)|org.h2.Driver|jdbc\:h2\:file\:./target/h2db/db/quotes|quotes +webAllowOthers=true +webPort=8082 +webSSL=false diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/banner.txt b/jhipster/jhipster-uaa/quotes/src/main/resources/banner.txt new file mode 100644 index 0000000000..e0bc55aaff --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/banner.txt @@ -0,0 +1,10 @@ + + ${AnsiColor.GREEN} ██╗${AnsiColor.RED} ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗ + ${AnsiColor.GREEN} ██║${AnsiColor.RED} ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗ + ${AnsiColor.GREEN} ██║${AnsiColor.RED} ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝ + ${AnsiColor.GREEN}██╗ ██║${AnsiColor.RED} ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ + ${AnsiColor.GREEN}╚██████╔╝${AnsiColor.RED} ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ + ${AnsiColor.GREEN} ╚═════╝ ${AnsiColor.RED} ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ + +${AnsiColor.BRIGHT_BLUE}:: JHipster 🤓 :: Running Spring Boot ${spring-boot.version} :: +:: https://www.jhipster.tech ::${AnsiColor.DEFAULT} diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-dev.yml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-dev.yml new file mode 100644 index 0000000000..19a3192ef9 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-dev.yml @@ -0,0 +1,159 @@ +# =================================================================== +# Spring Boot configuration for the "dev" profile. +# +# This configuration overrides the application.yml file. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +logging: + level: + ROOT: DEBUG + io.github.jhipster: DEBUG + com.baeldung.jhipster.quotes: DEBUG + +eureka: + instance: + prefer-ip-address: true + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ + +spring: + profiles: + active: dev + include: + - swagger + # Uncomment to activate TLS for the dev profile + #- tls + devtools: + restart: + enabled: true + livereload: + enabled: false # we use Webpack dev server + BrowserSync for livereload + jackson: + serialization.indent_output: true + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:h2:file:./target/h2db/db/quotes;DB_CLOSE_DELAY=-1 + username: quotes + password: + hikari: + auto-commit: false + h2: + console: + enabled: false + jpa: + database-platform: io.github.jhipster.domain.util.FixedH2Dialect + database: H2 + show-sql: true + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: true + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: true + hibernate.cache.region.factory_class: com.hazelcast.hibernate.HazelcastCacheRegionFactory + hibernate.cache.hazelcast.instance_name: quotes + hibernate.cache.use_minimal_puts: true + hibernate.cache.hazelcast.use_lite_member: true + liquibase: + contexts: dev + mail: + host: localhost + port: 25 + username: + password: + messages: + cache-duration: PT1S # 1 second, see the ISO 8601 standard + thymeleaf: + cache: false + sleuth: + sampler: + percentage: 1 # report 100% of traces + zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies + base-url: http://localhost:9411 + enabled: false + locator: + discovery: + enabled: true + +server: + port: 8081 + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + http: + version: V_1_1 # To use HTTP/2 you will need to activate TLS (see application-tls.yml) + cache: # Cache configuration + hazelcast: # Hazelcast distributed cache + time-to-live-seconds: 3600 + backup-count: 1 + management-center: # Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + enabled: false + update-interval: 3 + url: http://localhost:8180/mancenter + # CORS is disabled by default on microservices, as you should access them through a gateway. + # If you want to enable it, please uncomment the configuration below. + # cors: + # allowed-origins: "*" + # allowed-methods: "*" + # allowed-headers: "*" + # exposed-headers: "Authorization,Link,X-Total-Count" + # allow-credentials: true + # max-age: 1800 + security: + client-authorization: + access-token-uri: http://uaa/oauth/token + token-service-id: uaa + client-id: internal + client-secret: internal + mail: # specific JHipster mail property, for standard properties see MailProperties + from: quotes@localhost + base-url: http://127.0.0.1:8081 + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx: + enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: false + report-frequency: 60 # in seconds + logging: + logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration + enabled: false + host: localhost + port: 5000 + queue-size: 512 +oauth2: + signature-verification: + public-key-endpoint-uri: http://uaa/oauth/token_key + #ttl for public keys to verify JWT tokens (in ms) + ttl: 3600000 + #max. rate at which public keys will be fetched (in ms) + public-key-refresh-rate-limit: 10000 + web-client-configuration: + #keep in sync with UAA configuration + client-id: web_app + secret: changeit + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-prod.yml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-prod.yml new file mode 100644 index 0000000000..b9cd66ece3 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-prod.yml @@ -0,0 +1,167 @@ +# =================================================================== +# Spring Boot configuration for the "prod" profile. +# +# This configuration overrides the application.yml file. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +logging: + level: + ROOT: INFO + com.baeldung.jhipster.quotes: INFO + io.github.jhipster: INFO + +eureka: + instance: + prefer-ip-address: true + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ + +spring: + devtools: + restart: + enabled: false + livereload: + enabled: false + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:mysql://localhost:3306/quotes?useUnicode=true&characterEncoding=utf8&useSSL=false + username: root + password: + hikari: + auto-commit: false + data-source-properties: + cachePrepStmts: true + prepStmtCacheSize: 250 + prepStmtCacheSqlLimit: 2048 + useServerPrepStmts: true + jpa: + database-platform: org.hibernate.dialect.MySQL5InnoDBDialect + database: MYSQL + show-sql: false + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: true + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: false + hibernate.cache.region.factory_class: com.hazelcast.hibernate.HazelcastCacheRegionFactory + hibernate.cache.hazelcast.instance_name: quotes + hibernate.cache.use_minimal_puts: true + hibernate.cache.hazelcast.use_lite_member: true + liquibase: + contexts: prod + mail: + host: localhost + port: 25 + username: + password: + thymeleaf: + cache: true + sleuth: + sampler: + percentage: 1 # report 100% of traces + zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies + base-url: http://localhost:9411 + enabled: false + locator: + discovery: + enabled: true + +# =================================================================== +# To enable TLS in production, generate a certificate using: +# keytool -genkey -alias quotes -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650 +# +# You can also use Let's Encrypt: +# https://maximilian-boehm.com/hp2121/Create-a-Java-Keystore-JKS-from-Let-s-Encrypt-Certificates.htm +# +# Then, modify the server.ssl properties so your "server" configuration looks like: +# +# server: +# port: 443 +# ssl: +# key-store: classpath:config/tls/keystore.p12 +# key-store-password: password +# key-store-type: PKCS12 +# key-alias: quotes +# # The ciphers suite enforce the security by deactivating some old and deprecated SSL cipher, this list was tested against SSL Labs (https://www.ssllabs.com/ssltest/) +# ciphers: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 ,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,TLS_RSA_WITH_CAMELLIA_128_CBC_SHA +# =================================================================== +server: + port: 8081 + compression: + enabled: true + mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json + min-response-size: 1024 + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + http: + version: V_1_1 # To use HTTP/2 you will need SSL support (see above the "server.ssl" configuration) + cache: # Used by the CachingHttpHeadersFilter + timeToLiveInDays: 1461 + cache: # Cache configuration + hazelcast: # Hazelcast distributed cache + time-to-live-seconds: 3600 + backup-count: 1 + management-center: # Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + enabled: false + update-interval: 3 + url: + security: + client-authorization: + access-token-uri: http://uaa/oauth/token + token-service-id: uaa + client-id: internal + client-secret: internal + mail: # specific JHipster mail property, for standard properties see MailProperties + from: quotes@localhost + base-url: http://my-server-url-to-change # Modify according to your server's URL + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx: + enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: false + report-frequency: 60 # in seconds + logging: + logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration + enabled: false + host: localhost + port: 5000 + queue-size: 512 +oauth2: + signature-verification: + public-key-endpoint-uri: http://uaa/oauth/token_key + #ttl for public keys to verify JWT tokens (in ms) + ttl: 3600000 + #max. rate at which public keys will be fetched (in ms) + public-key-refresh-rate-limit: 10000 + web-client-configuration: + #change client secret in production, keep in sync with UAA configuration + client-id: web_app + secret: changeit + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-tls.yml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-tls.yml new file mode 100644 index 0000000000..e082c8f455 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application-tls.yml @@ -0,0 +1,18 @@ +# =================================================================== +# Activate this profile to enable TLS and HTTP/2. +# +# JHipster has generated a self-signed certificate, which will be used to encrypt traffic. +# As your browser will not understand this certificate, you will need to import it. +# +# Another (easiest) solution with Chrome is to enable the "allow-insecure-localhost" flag +# at chrome://flags/#allow-insecure-localhost +# =================================================================== +server: + ssl: + key-store: classpath:config/tls/keystore.p12 + key-store-password: password + key-store-type: PKCS12 + key-alias: selfsigned +jhipster: + http: + version: V_2_0 diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/application.yml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application.yml new file mode 100644 index 0000000000..66c52a622a --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/application.yml @@ -0,0 +1,160 @@ +# =================================================================== +# Spring Boot configuration. +# +# This configuration will be overridden by the Spring profile you use, +# for example application-dev.yml if you use the "dev" profile. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +eureka: + client: + enabled: true + healthcheck: + enabled: true + fetch-registry: true + register-with-eureka: true + instance-info-replication-interval-seconds: 10 + registry-fetch-interval-seconds: 10 + instance: + appname: quotes + instanceId: quotes:${spring.application.instance-id:${random.value}} + lease-renewal-interval-in-seconds: 5 + lease-expiration-duration-in-seconds: 10 + status-page-url-path: ${management.endpoints.web.base-path}/info + health-check-url-path: ${management.endpoints.web.base-path}/health + metadata-map: + zone: primary # This is needed for the load balancer + profile: ${spring.profiles.active} + version: ${info.project.version:} + git-version: ${git.commit.id.describe:} + git-commit: ${git.commit.id.abbrev:} + git-branch: ${git.branch:} +ribbon: + eureka: + enabled: true +feign: + hystrix: + enabled: true +# client: +# config: +# default: +# connectTimeout: 5000 +# readTimeout: 5000 + +# See https://github.com/Netflix/Hystrix/wiki/Configuration +hystrix: + command: + default: + execution: + isolation: + strategy: SEMAPHORE +# See https://github.com/spring-cloud/spring-cloud-netflix/issues/1330 +# thread: +# timeoutInMilliseconds: 10000 + shareSecurityContext: true + +management: + endpoints: + web: + base-path: /management + exposure: + include: ["configprops", "env", "health", "info", "threaddump", "logfile" ] + endpoint: + health: + show-details: when_authorized + info: + git: + mode: full + health: + mail: + enabled: false # When using the MailService, configure an SMTP server and set this to true + metrics: + enabled: false # http://micrometer.io/ is disabled by default, as we use http://metrics.dropwizard.io/ instead + +spring: + application: + name: quotes + jpa: + open-in-view: false + hibernate: + ddl-auto: none + naming: + physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + messages: + basename: i18n/messages + mvc: + favicon: + enabled: false + thymeleaf: + mode: HTML +security: + oauth2: + resource: + filter-order: 3 + +server: + servlet: + session: + cookie: + http-only: true + +# Properties to be exposed on the /info management endpoint +info: + # Comma separated list of profiles that will trigger the ribbon to show + display-ribbon-on-profiles: "dev" + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + async: + core-pool-size: 2 + max-pool-size: 50 + queue-capacity: 10000 + # By default CORS is disabled. Uncomment to enable. + #cors: + #allowed-origins: "*" + #allowed-methods: "*" + #allowed-headers: "*" + #exposed-headers: "Authorization,Link,X-Total-Count" + #allow-credentials: true + #max-age: 1800 + mail: + from: quotes@localhost + swagger: + default-include-pattern: /api/.* + title: quotes API + description: quotes API documentation + version: 0.0.1 + terms-of-service-url: + contact-name: + contact-url: + contact-email: + license: + license-url: + +logging: + file: target/quotes.log + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap-prod.yml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap-prod.yml new file mode 100644 index 0000000000..3a262f4f66 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap-prod.yml @@ -0,0 +1,22 @@ +# =================================================================== +# Spring Cloud Config bootstrap configuration for the "prod" profile +# =================================================================== + +spring: + cloud: + config: + fail-fast: true + retry: + initial-interval: 1000 + max-interval: 2000 + max-attempts: 100 + uri: http://admin:${jhipster.registry.password}@localhost:8761/config + # name of the config server's property source (file.yml) that we want to use + name: quotes + profile: prod # profile(s) of the property source + label: master # toggle to switch to a different version of the configuration as stored in git + # it can be set to any label, branch or commit of the configuration source Git repository + +jhipster: + registry: + password: admin diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap.yml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap.yml new file mode 100644 index 0000000000..e981125e34 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/bootstrap.yml @@ -0,0 +1,26 @@ +# =================================================================== +# Spring Cloud Config bootstrap configuration for the "dev" profile +# In prod profile, properties will be overwriten by the ones defined in bootstrap-prod.yml +# =================================================================== + +jhipster: + registry: + password: admin + +spring: + application: + name: quotes + profiles: + # The commented value for `active` can be replaced with valid Spring profiles to load. + # Otherwise, it will be filled in by maven when building the WAR file + # Either way, it can be overridden by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS` + active: #spring.profiles.active# + cloud: + config: + fail-fast: false # if not in "prod" profile, do not force to use Spring Cloud Config + uri: http://admin:${jhipster.registry.password}@localhost:8761/config + # name of the config server's property source (file.yml) that we want to use + name: quotes + profile: dev # profile(s) of the property source + label: master # toggle to switch to a different version of the configuration as stored in git + # it can be set to any label, branch or commit of the configuration source Git repository diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml new file mode 100644 index 0000000000..d75921613c --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/20181019033648_added_entity_Quote.xml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/20181019033648_added_entity_Quote.xml new file mode 100644 index 0000000000..d5b8fecc0d --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/changelog/20181019033648_added_entity_Quote.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/master.xml b/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/master.xml new file mode 100644 index 0000000000..e260e927a4 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/config/liquibase/master.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/config/tls/keystore.p12 b/jhipster/jhipster-uaa/quotes/src/main/resources/config/tls/keystore.p12 new file mode 100644 index 0000000000000000000000000000000000000000..92ec1f93f04d6fb7071ea867584206e35a42ed38 GIT binary patch literal 2620 zcmY+EcQhLc8^(=@Cibcstx-DA*tB-kCX{H=xQP{eZ!r?JRbADh2(fo+R6~uTwW$@m zC|VT#6m6AfC!X%Sc;@2dx3{ zpyhLW0g7kv{a3_*2H+Wx=eEuHAb?E&yJ7~@(iP$Xzo2-)59n1O`2Y6#a{&N%OMCYN zZu3KAzD1swdkR-Kd}W79M+cw*-~s(=uswSLdscUq#9@9I*bJLS*}9OUP(*a~)!8gp z(Uy7cmx}Y|LVUqRK5pKy0XhiTtW4}SHH6$8`*m+4IoI)E7*ZKRhuv%Mn*U4+>(tuM zvS$sroBU$876ISPZ;TGMVFh>Qw)h<5*_3`Bi0mTs;St^bRp0}?56LUviz(VVEfquC zbKy5p`3l~>{Zbj8`Mqdr1l4=VE6G0xCKPRT zD=3xM;>^uX`vx!uX#M7v_`Wq`Y+Jbgf5cT*a7eR*`*x3jbR_o0lS>Ao5v1hs8ihFNWVEB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iT0%Bb5Cx|i2_h8g5>?B#)3X}!Bohra*;Ttn-ZU;rWSevuGYU$ zvzhC&gNx_!8F^JOcDaHYme!d^F_wB*M{U4MLYd8c_?VyD>=9&_2J%b3ljq|=*|?;g zy;RZ+g*D!!tnC1-iA}VC&m5>b{mkX*l|=CnaN>7;zil=%0@R1j-ZE|5hJHjDkIC95 zSmehjrKQ4oCSuVK^{1^ktBDOdTd8Rh3=c@XTxUFCVXS@p{ZPJ`Map8Gr$OxC^o6mt z5e=7Xo)4#;*Ba=l)!`bV2aaog=IAJ=M)m^V{s*^&Rq_KmWXCin{`m34)_HC@xK5oy zT7EKH-P%F#N#OMNhethX*m)p-0o9sY-$PCA1YPN)bjTZG=xv}I!i{p`a`CQ`K4Pm5 z(L_T&S2o=?e%7y1SGt9*ga2%;yEq&%bw)uH6a^aS~baheYN_j(qFmiLwzg=P*UTI2EsTgBc`%5 z)6t8hRub}dFF66^?KwE!E?F8#;j`=x0twQIvD_r>`guyW=7p|pv4>9?`kG&VCth_@ z*@)CB44f%AZ1?^1)1QLsei)HO1}~S)6>rhGj!0$X47>ZBf~?ZBFtyBe8` ztU6M7W;(Ha-udKKNgy<)N|*cfc3WW1V>Wyuu0Hw4D9}x)&H^ z7MW-0)I0vD=j55j&!c9#ww=J(_nzn<-4V5RyBs|0fdg*iZLH@nr2H2S|IkeU literal 0 HcmV?d00001 diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages.properties b/jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000000..eb71dfa8e3 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Your request cannot be processed +error.subtitle=Sorry, an error has occurred. +error.status=Status: +error.message=Message: + +# Activation email +email.activation.title=quotes account activation +email.activation.greeting=Dear {0} +email.activation.text1=Your quotes account has been created, please click on the URL below to activate it: +email.activation.text2=Regards, +email.signature=quotes Team. + +# Creation email +email.creation.text1=Your quotes account has been created, please click on the URL below to access it: + +# Reset email +email.reset.title=quotes password reset +email.reset.greeting=Dear {0} +email.reset.text1=For your quotes account a password reset was requested, please click on the URL below to reset it: +email.reset.text2=Regards, diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages_en.properties b/jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages_en.properties new file mode 100644 index 0000000000..eb71dfa8e3 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/i18n/messages_en.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Your request cannot be processed +error.subtitle=Sorry, an error has occurred. +error.status=Status: +error.message=Message: + +# Activation email +email.activation.title=quotes account activation +email.activation.greeting=Dear {0} +email.activation.text1=Your quotes account has been created, please click on the URL below to activate it: +email.activation.text2=Regards, +email.signature=quotes Team. + +# Creation email +email.creation.text1=Your quotes account has been created, please click on the URL below to access it: + +# Reset email +email.reset.title=quotes password reset +email.reset.greeting=Dear {0} +email.reset.text1=For your quotes account a password reset was requested, please click on the URL below to reset it: +email.reset.text2=Regards, diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/logback-spring.xml b/jhipster/jhipster-uaa/quotes/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..a30ab8c1d2 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/logback-spring.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/static/index.html b/jhipster/jhipster-uaa/quotes/src/main/resources/static/index.html new file mode 100644 index 0000000000..46c264463c --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/static/index.html @@ -0,0 +1,103 @@ + + + + + JHipster microservice homepage + + + +

+

Welcome, Java Hipster!

+ +

This application is a microservice, which has been generated using JHipster.

+ +
    +
  • It does not have a front-end. The front-end should be generated on a JHipster gateway
  • +
  • It is serving REST APIs, under the '/api' URLs.
  • +
  • Swagger documentation endpoint for those APIs is at /v2/api-docs, but if you want access to the full Swagger UI, you should use a JHipster gateway, which will serve as an API developer portal
  • +
+ +

+ If you have any question on JHipster: +

+ + + +

+ If you like JHipster, don't forget to give us a star on GitHub! +

+ +
+ + diff --git a/jhipster/jhipster-uaa/quotes/src/main/resources/templates/error.html b/jhipster/jhipster-uaa/quotes/src/main/resources/templates/error.html new file mode 100644 index 0000000000..08616bcf1e --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/main/resources/templates/error.html @@ -0,0 +1,163 @@ + + + + + + Your request cannot be processed + + + +
+

Your request cannot be processed :(

+ +

Sorry, an error has occurred.

+ + Status:  ()
+ + Message: 
+
+ + + +
+ + diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/SecurityBeanOverrideConfiguration.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/SecurityBeanOverrideConfiguration.java new file mode 100644 index 0000000000..f82b7fafe6 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/SecurityBeanOverrideConfiguration.java @@ -0,0 +1,35 @@ +package com.baeldung.jhipster.quotes.config; + +import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.web.client.RestTemplate; + +/** + * Overrides UAA specific beans, so they do not interfere the testing + * This configuration must be included in @SpringBootTest in order to take effect. + */ +@Configuration +public class SecurityBeanOverrideConfiguration { + + @Bean + @Primary + public TokenStore tokenStore() { + return null; + } + + @Bean + @Primary + public JwtAccessTokenConverter jwtAccessTokenConverter() { + return null; + } + + @Bean + @Primary + public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) { + return null; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTest.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTest.java new file mode 100644 index 0000000000..5a80d9befb --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTest.java @@ -0,0 +1,197 @@ +package com.baeldung.jhipster.quotes.config; + +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.servlet.InstrumentedFilter; +import com.codahale.metrics.servlets.MetricsServlet; +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; +import io.undertow.Undertow; +import io.undertow.Undertow.Builder; +import io.undertow.UndertowOptions; + +import org.h2.server.web.WebServlet; +import org.junit.Before; +import org.junit.Test; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.mock.env.MockEnvironment; +import org.springframework.mock.web.MockServletContext; +import org.springframework.test.util.ReflectionTestUtils; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.xnio.OptionMap; + +import javax.servlet.*; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Unit tests for the WebConfigurer class. + * + * @see WebConfigurer + */ +public class WebConfigurerTest { + + private WebConfigurer webConfigurer; + + private MockServletContext servletContext; + + private MockEnvironment env; + + private JHipsterProperties props; + + private MetricRegistry metricRegistry; + + @Before + public void setup() { + servletContext = spy(new MockServletContext()); + doReturn(mock(FilterRegistration.Dynamic.class)) + .when(servletContext).addFilter(anyString(), any(Filter.class)); + doReturn(mock(ServletRegistration.Dynamic.class)) + .when(servletContext).addServlet(anyString(), any(Servlet.class)); + + env = new MockEnvironment(); + props = new JHipsterProperties(); + + webConfigurer = new WebConfigurer(env, props); + metricRegistry = new MetricRegistry(); + webConfigurer.setMetricRegistry(metricRegistry); + } + + @Test + public void testStartUpProdServletContext() throws ServletException { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); + webConfigurer.onStartup(servletContext); + + assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); + assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry); + verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class)); + verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class)); + verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class)); + } + + @Test + public void testStartUpDevServletContext() throws ServletException { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); + webConfigurer.onStartup(servletContext); + + assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); + assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry); + verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class)); + verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class)); + verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class)); + } + + @Test + public void testCustomizeServletContainer() { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); + UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); + webConfigurer.customize(container); + assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg"); + assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8"); + assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8"); + + Builder builder = Undertow.builder(); + container.getBuilderCustomizers().forEach(c -> c.customize(builder)); + OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions"); + assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isNull(); + } + + @Test + public void testUndertowHttp2Enabled() { + props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0); + UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); + webConfigurer.customize(container); + Builder builder = Undertow.builder(); + container.getBuilderCustomizers().forEach(c -> c.customize(builder)); + OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions"); + assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isTrue(); + } + + @Test + public void testCorsFilterOnApiPath() throws Exception { + props.getCors().setAllowedOrigins(Collections.singletonList("*")); + props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); + props.getCors().setAllowedHeaders(Collections.singletonList("*")); + props.getCors().setMaxAge(1800L); + props.getCors().setAllowCredentials(true); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + options("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com") + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")) + .andExpect(header().string(HttpHeaders.VARY, "Origin")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800")); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")); + } + + @Test + public void testCorsFilterOnOtherPath() throws Exception { + props.getCors().setAllowedOrigins(Collections.singletonList("*")); + props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); + props.getCors().setAllowedHeaders(Collections.singletonList("*")); + props.getCors().setMaxAge(1800L); + props.getCors().setAllowCredentials(true); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/test/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } + + @Test + public void testCorsFilterDeactivated() throws Exception { + props.getCors().setAllowedOrigins(null); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } + + @Test + public void testCorsFilterDeactivated2() throws Exception { + props.getCors().setAllowedOrigins(new ArrayList<>()); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTestController.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTestController.java new file mode 100644 index 0000000000..957a616048 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/config/WebConfigurerTestController.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.quotes.config; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class WebConfigurerTestController { + + @GetMapping("/api/test-cors") + public void testCorsOnApiPath() { + } + + @GetMapping("/test/test-cors") + public void testCorsOnOtherPath() { + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/security/OAuth2TokenMockUtil.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/security/OAuth2TokenMockUtil.java new file mode 100644 index 0000000000..0c8e043678 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/security/OAuth2TokenMockUtil.java @@ -0,0 +1,83 @@ +package com.baeldung.jhipster.quotes.security; + +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.security.oauth2.provider.OAuth2Request; +import org.springframework.security.oauth2.provider.token.ResourceServerTokenServices; +import org.springframework.stereotype.Component; +import org.springframework.test.web.servlet.request.RequestPostProcessor; + +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; + +import static org.mockito.BDDMockito.given; + +/** + * A bean providing simple mocking of OAuth2 access tokens for security integration tests. + */ +@Component +public class OAuth2TokenMockUtil { + + @MockBean + private ResourceServerTokenServices tokenServices; + + private OAuth2Authentication createAuthentication(String username, Set scopes, Set roles) { + List authorities = roles.stream() + .map(SimpleGrantedAuthority::new) + .collect(Collectors.toList()); + + User principal = new User(username, "test", true, true, true, true, authorities); + Authentication authentication = new UsernamePasswordAuthenticationToken(principal, principal.getPassword(), + principal.getAuthorities()); + + // Create the authorization request and OAuth2Authentication object + OAuth2Request authRequest = new OAuth2Request(null, "testClient", null, true, scopes, null, null, null, + null); + return new OAuth2Authentication(authRequest, authentication); + } + + public RequestPostProcessor oauth2Authentication(String username, Set scopes, Set roles) { + String uuid = String.valueOf(UUID.randomUUID()); + + given(tokenServices.loadAuthentication(uuid)) + .willReturn(createAuthentication(username, scopes, roles)); + + given(tokenServices.readAccessToken(uuid)).willReturn(new DefaultOAuth2AccessToken(uuid)); + + return new OAuth2PostProcessor(uuid); + } + + public RequestPostProcessor oauth2Authentication(String username, Set scopes) { + return oauth2Authentication(username, scopes, Collections.emptySet()); + } + + public RequestPostProcessor oauth2Authentication(String username) { + return oauth2Authentication(username, Collections.emptySet()); + } + + public static class OAuth2PostProcessor implements RequestPostProcessor { + + private String token; + + public OAuth2PostProcessor(String token) { + this.token = token; + } + + @Override + public MockHttpServletRequest postProcessRequest(MockHttpServletRequest mockHttpServletRequest) { + mockHttpServletRequest.addHeader("Authorization", "Bearer " + token); + + return mockHttpServletRequest; + } + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/LogsResourceIntTest.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/LogsResourceIntTest.java new file mode 100644 index 0000000000..56cda7d3d5 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/LogsResourceIntTest.java @@ -0,0 +1,67 @@ +package com.baeldung.jhipster.quotes.web.rest; + +import com.baeldung.jhipster.quotes.QuotesApp; +import com.baeldung.jhipster.quotes.config.SecurityBeanOverrideConfiguration; +import com.baeldung.jhipster.quotes.web.rest.vm.LoggerVM; +import ch.qos.logback.classic.AsyncAppender; +import ch.qos.logback.classic.LoggerContext; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.LoggerFactory; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Test class for the LogsResource REST controller. + * + * @see LogsResource + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, QuotesApp.class}) +public class LogsResourceIntTest { + + private MockMvc restLogsMockMvc; + + @Before + public void setup() { + LogsResource logsResource = new LogsResource(); + this.restLogsMockMvc = MockMvcBuilders + .standaloneSetup(logsResource) + .build(); + } + + @Test + public void getAllLogs() throws Exception { + restLogsMockMvc.perform(get("/management/logs")) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)); + } + + @Test + public void changeLogs() throws Exception { + LoggerVM logger = new LoggerVM(); + logger.setLevel("INFO"); + logger.setName("ROOT"); + + restLogsMockMvc.perform(put("/management/logs") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(logger))) + .andExpect(status().isNoContent()); + } + + @Test + public void testLogstashAppender() { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + assertThat(context.getLogger("ROOT").getAppender("ASYNC_LOGSTASH")).isInstanceOf(AsyncAppender.class); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/QuoteResourceIntTest.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/QuoteResourceIntTest.java new file mode 100644 index 0000000000..587a273183 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/QuoteResourceIntTest.java @@ -0,0 +1,546 @@ +package com.baeldung.jhipster.quotes.web.rest; + +import com.baeldung.jhipster.quotes.QuotesApp; + +import com.baeldung.jhipster.quotes.config.SecurityBeanOverrideConfiguration; + +import com.baeldung.jhipster.quotes.domain.Quote; +import com.baeldung.jhipster.quotes.repository.QuoteRepository; +import com.baeldung.jhipster.quotes.service.QuoteService; +import com.baeldung.jhipster.quotes.service.dto.QuoteDTO; +import com.baeldung.jhipster.quotes.service.mapper.QuoteMapper; +import com.baeldung.jhipster.quotes.web.rest.errors.ExceptionTranslator; +import com.baeldung.jhipster.quotes.service.dto.QuoteCriteria; +import com.baeldung.jhipster.quotes.service.QuoteQueryService; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.MockitoAnnotations; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.web.PageableHandlerMethodArgumentResolver; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.transaction.annotation.Transactional; + +import javax.persistence.EntityManager; +import java.math.BigDecimal; +import java.time.Instant; +import java.time.ZonedDateTime; +import java.time.ZoneOffset; +import java.time.ZoneId; +import java.util.List; + + +import static com.baeldung.jhipster.quotes.web.rest.TestUtil.sameInstant; +import static com.baeldung.jhipster.quotes.web.rest.TestUtil.createFormattingConversionService; +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.Matchers.hasItem; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +/** + * Test class for the QuoteResource REST controller. + * + * @see QuoteResource + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, QuotesApp.class}) +public class QuoteResourceIntTest { + + private static final String DEFAULT_SYMBOL = "AAAAAAAAAA"; + private static final String UPDATED_SYMBOL = "BBBBBBBBBB"; + + private static final BigDecimal DEFAULT_PRICE = new BigDecimal(1); + private static final BigDecimal UPDATED_PRICE = new BigDecimal(2); + + private static final ZonedDateTime DEFAULT_LAST_TRADE = ZonedDateTime.ofInstant(Instant.ofEpochMilli(0L), ZoneOffset.UTC); + private static final ZonedDateTime UPDATED_LAST_TRADE = ZonedDateTime.now(ZoneId.systemDefault()).withNano(0); + + @Autowired + private QuoteRepository quoteRepository; + + @Autowired + private QuoteMapper quoteMapper; + + @Autowired + private QuoteService quoteService; + + @Autowired + private QuoteQueryService quoteQueryService; + + @Autowired + private MappingJackson2HttpMessageConverter jacksonMessageConverter; + + @Autowired + private PageableHandlerMethodArgumentResolver pageableArgumentResolver; + + @Autowired + private ExceptionTranslator exceptionTranslator; + + @Autowired + private EntityManager em; + + private MockMvc restQuoteMockMvc; + + private Quote quote; + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + final QuoteResource quoteResource = new QuoteResource(quoteService, quoteQueryService); + this.restQuoteMockMvc = MockMvcBuilders.standaloneSetup(quoteResource) + .setCustomArgumentResolvers(pageableArgumentResolver) + .setControllerAdvice(exceptionTranslator) + .setConversionService(createFormattingConversionService()) + .setMessageConverters(jacksonMessageConverter).build(); + } + + /** + * Create an entity for this test. + * + * This is a static method, as tests for other entities might also need it, + * if they test an entity which requires the current entity. + */ + public static Quote createEntity(EntityManager em) { + Quote quote = new Quote() + .symbol(DEFAULT_SYMBOL) + .price(DEFAULT_PRICE) + .lastTrade(DEFAULT_LAST_TRADE); + return quote; + } + + @Before + public void initTest() { + quote = createEntity(em); + } + + @Test + @Transactional + public void createQuote() throws Exception { + int databaseSizeBeforeCreate = quoteRepository.findAll().size(); + + // Create the Quote + QuoteDTO quoteDTO = quoteMapper.toDto(quote); + restQuoteMockMvc.perform(post("/api/quotes") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(quoteDTO))) + .andExpect(status().isCreated()); + + // Validate the Quote in the database + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeCreate + 1); + Quote testQuote = quoteList.get(quoteList.size() - 1); + assertThat(testQuote.getSymbol()).isEqualTo(DEFAULT_SYMBOL); + assertThat(testQuote.getPrice()).isEqualTo(DEFAULT_PRICE); + assertThat(testQuote.getLastTrade()).isEqualTo(DEFAULT_LAST_TRADE); + } + + @Test + @Transactional + public void createQuoteWithExistingId() throws Exception { + int databaseSizeBeforeCreate = quoteRepository.findAll().size(); + + // Create the Quote with an existing ID + quote.setId(1L); + QuoteDTO quoteDTO = quoteMapper.toDto(quote); + + // An entity with an existing ID cannot be created, so this API call must fail + restQuoteMockMvc.perform(post("/api/quotes") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(quoteDTO))) + .andExpect(status().isBadRequest()); + + // Validate the Quote in the database + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeCreate); + } + + @Test + @Transactional + public void checkSymbolIsRequired() throws Exception { + int databaseSizeBeforeTest = quoteRepository.findAll().size(); + // set the field null + quote.setSymbol(null); + + // Create the Quote, which fails. + QuoteDTO quoteDTO = quoteMapper.toDto(quote); + + restQuoteMockMvc.perform(post("/api/quotes") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(quoteDTO))) + .andExpect(status().isBadRequest()); + + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkPriceIsRequired() throws Exception { + int databaseSizeBeforeTest = quoteRepository.findAll().size(); + // set the field null + quote.setPrice(null); + + // Create the Quote, which fails. + QuoteDTO quoteDTO = quoteMapper.toDto(quote); + + restQuoteMockMvc.perform(post("/api/quotes") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(quoteDTO))) + .andExpect(status().isBadRequest()); + + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkLastTradeIsRequired() throws Exception { + int databaseSizeBeforeTest = quoteRepository.findAll().size(); + // set the field null + quote.setLastTrade(null); + + // Create the Quote, which fails. + QuoteDTO quoteDTO = quoteMapper.toDto(quote); + + restQuoteMockMvc.perform(post("/api/quotes") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(quoteDTO))) + .andExpect(status().isBadRequest()); + + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void getAllQuotes() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList + restQuoteMockMvc.perform(get("/api/quotes?sort=id,desc")) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.[*].id").value(hasItem(quote.getId().intValue()))) + .andExpect(jsonPath("$.[*].symbol").value(hasItem(DEFAULT_SYMBOL.toString()))) + .andExpect(jsonPath("$.[*].price").value(hasItem(DEFAULT_PRICE.intValue()))) + .andExpect(jsonPath("$.[*].lastTrade").value(hasItem(sameInstant(DEFAULT_LAST_TRADE)))); + } + + @Test + @Transactional + public void getQuote() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get the quote + restQuoteMockMvc.perform(get("/api/quotes/{id}", quote.getId())) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.id").value(quote.getId().intValue())) + .andExpect(jsonPath("$.symbol").value(DEFAULT_SYMBOL.toString())) + .andExpect(jsonPath("$.price").value(DEFAULT_PRICE.intValue())) + .andExpect(jsonPath("$.lastTrade").value(sameInstant(DEFAULT_LAST_TRADE))); + } + + @Test + @Transactional + public void getAllQuotesBySymbolIsEqualToSomething() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where symbol equals to DEFAULT_SYMBOL + defaultQuoteShouldBeFound("symbol.equals=" + DEFAULT_SYMBOL); + + // Get all the quoteList where symbol equals to UPDATED_SYMBOL + defaultQuoteShouldNotBeFound("symbol.equals=" + UPDATED_SYMBOL); + } + + @Test + @Transactional + public void getAllQuotesBySymbolIsInShouldWork() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where symbol in DEFAULT_SYMBOL or UPDATED_SYMBOL + defaultQuoteShouldBeFound("symbol.in=" + DEFAULT_SYMBOL + "," + UPDATED_SYMBOL); + + // Get all the quoteList where symbol equals to UPDATED_SYMBOL + defaultQuoteShouldNotBeFound("symbol.in=" + UPDATED_SYMBOL); + } + + @Test + @Transactional + public void getAllQuotesBySymbolIsNullOrNotNull() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where symbol is not null + defaultQuoteShouldBeFound("symbol.specified=true"); + + // Get all the quoteList where symbol is null + defaultQuoteShouldNotBeFound("symbol.specified=false"); + } + + @Test + @Transactional + public void getAllQuotesByPriceIsEqualToSomething() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where price equals to DEFAULT_PRICE + defaultQuoteShouldBeFound("price.equals=" + DEFAULT_PRICE); + + // Get all the quoteList where price equals to UPDATED_PRICE + defaultQuoteShouldNotBeFound("price.equals=" + UPDATED_PRICE); + } + + @Test + @Transactional + public void getAllQuotesByPriceIsInShouldWork() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where price in DEFAULT_PRICE or UPDATED_PRICE + defaultQuoteShouldBeFound("price.in=" + DEFAULT_PRICE + "," + UPDATED_PRICE); + + // Get all the quoteList where price equals to UPDATED_PRICE + defaultQuoteShouldNotBeFound("price.in=" + UPDATED_PRICE); + } + + @Test + @Transactional + public void getAllQuotesByPriceIsNullOrNotNull() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where price is not null + defaultQuoteShouldBeFound("price.specified=true"); + + // Get all the quoteList where price is null + defaultQuoteShouldNotBeFound("price.specified=false"); + } + + @Test + @Transactional + public void getAllQuotesByLastTradeIsEqualToSomething() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where lastTrade equals to DEFAULT_LAST_TRADE + defaultQuoteShouldBeFound("lastTrade.equals=" + DEFAULT_LAST_TRADE); + + // Get all the quoteList where lastTrade equals to UPDATED_LAST_TRADE + defaultQuoteShouldNotBeFound("lastTrade.equals=" + UPDATED_LAST_TRADE); + } + + @Test + @Transactional + public void getAllQuotesByLastTradeIsInShouldWork() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where lastTrade in DEFAULT_LAST_TRADE or UPDATED_LAST_TRADE + defaultQuoteShouldBeFound("lastTrade.in=" + DEFAULT_LAST_TRADE + "," + UPDATED_LAST_TRADE); + + // Get all the quoteList where lastTrade equals to UPDATED_LAST_TRADE + defaultQuoteShouldNotBeFound("lastTrade.in=" + UPDATED_LAST_TRADE); + } + + @Test + @Transactional + public void getAllQuotesByLastTradeIsNullOrNotNull() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where lastTrade is not null + defaultQuoteShouldBeFound("lastTrade.specified=true"); + + // Get all the quoteList where lastTrade is null + defaultQuoteShouldNotBeFound("lastTrade.specified=false"); + } + + @Test + @Transactional + public void getAllQuotesByLastTradeIsGreaterThanOrEqualToSomething() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where lastTrade greater than or equals to DEFAULT_LAST_TRADE + defaultQuoteShouldBeFound("lastTrade.greaterOrEqualThan=" + DEFAULT_LAST_TRADE); + + // Get all the quoteList where lastTrade greater than or equals to UPDATED_LAST_TRADE + defaultQuoteShouldNotBeFound("lastTrade.greaterOrEqualThan=" + UPDATED_LAST_TRADE); + } + + @Test + @Transactional + public void getAllQuotesByLastTradeIsLessThanSomething() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + // Get all the quoteList where lastTrade less than or equals to DEFAULT_LAST_TRADE + defaultQuoteShouldNotBeFound("lastTrade.lessThan=" + DEFAULT_LAST_TRADE); + + // Get all the quoteList where lastTrade less than or equals to UPDATED_LAST_TRADE + defaultQuoteShouldBeFound("lastTrade.lessThan=" + UPDATED_LAST_TRADE); + } + + /** + * Executes the search, and checks that the default entity is returned + */ + private void defaultQuoteShouldBeFound(String filter) throws Exception { + restQuoteMockMvc.perform(get("/api/quotes?sort=id,desc&" + filter)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.[*].id").value(hasItem(quote.getId().intValue()))) + .andExpect(jsonPath("$.[*].symbol").value(hasItem(DEFAULT_SYMBOL.toString()))) + .andExpect(jsonPath("$.[*].price").value(hasItem(DEFAULT_PRICE.intValue()))) + .andExpect(jsonPath("$.[*].lastTrade").value(hasItem(sameInstant(DEFAULT_LAST_TRADE)))); + + // Check, that the count call also returns 1 + restQuoteMockMvc.perform(get("/api/quotes/count?sort=id,desc&" + filter)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(content().string("1")); + } + + /** + * Executes the search, and checks that the default entity is not returned + */ + private void defaultQuoteShouldNotBeFound(String filter) throws Exception { + restQuoteMockMvc.perform(get("/api/quotes?sort=id,desc&" + filter)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$").isArray()) + .andExpect(jsonPath("$").isEmpty()); + + // Check, that the count call also returns 0 + restQuoteMockMvc.perform(get("/api/quotes/count?sort=id,desc&" + filter)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(content().string("0")); + } + + + @Test + @Transactional + public void getNonExistingQuote() throws Exception { + // Get the quote + restQuoteMockMvc.perform(get("/api/quotes/{id}", Long.MAX_VALUE)) + .andExpect(status().isNotFound()); + } + + @Test + @Transactional + public void updateQuote() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + int databaseSizeBeforeUpdate = quoteRepository.findAll().size(); + + // Update the quote + Quote updatedQuote = quoteRepository.findById(quote.getId()).get(); + // Disconnect from session so that the updates on updatedQuote are not directly saved in db + em.detach(updatedQuote); + updatedQuote + .symbol(UPDATED_SYMBOL) + .price(UPDATED_PRICE) + .lastTrade(UPDATED_LAST_TRADE); + QuoteDTO quoteDTO = quoteMapper.toDto(updatedQuote); + + restQuoteMockMvc.perform(put("/api/quotes") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(quoteDTO))) + .andExpect(status().isOk()); + + // Validate the Quote in the database + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeUpdate); + Quote testQuote = quoteList.get(quoteList.size() - 1); + assertThat(testQuote.getSymbol()).isEqualTo(UPDATED_SYMBOL); + assertThat(testQuote.getPrice()).isEqualTo(UPDATED_PRICE); + assertThat(testQuote.getLastTrade()).isEqualTo(UPDATED_LAST_TRADE); + } + + @Test + @Transactional + public void updateNonExistingQuote() throws Exception { + int databaseSizeBeforeUpdate = quoteRepository.findAll().size(); + + // Create the Quote + QuoteDTO quoteDTO = quoteMapper.toDto(quote); + + // If the entity doesn't have an ID, it will throw BadRequestAlertException + restQuoteMockMvc.perform(put("/api/quotes") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(quoteDTO))) + .andExpect(status().isBadRequest()); + + // Validate the Quote in the database + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeUpdate); + } + + @Test + @Transactional + public void deleteQuote() throws Exception { + // Initialize the database + quoteRepository.saveAndFlush(quote); + + int databaseSizeBeforeDelete = quoteRepository.findAll().size(); + + // Get the quote + restQuoteMockMvc.perform(delete("/api/quotes/{id}", quote.getId()) + .accept(TestUtil.APPLICATION_JSON_UTF8)) + .andExpect(status().isOk()); + + // Validate the database is empty + List quoteList = quoteRepository.findAll(); + assertThat(quoteList).hasSize(databaseSizeBeforeDelete - 1); + } + + @Test + @Transactional + public void equalsVerifier() throws Exception { + TestUtil.equalsVerifier(Quote.class); + Quote quote1 = new Quote(); + quote1.setId(1L); + Quote quote2 = new Quote(); + quote2.setId(quote1.getId()); + assertThat(quote1).isEqualTo(quote2); + quote2.setId(2L); + assertThat(quote1).isNotEqualTo(quote2); + quote1.setId(null); + assertThat(quote1).isNotEqualTo(quote2); + } + + @Test + @Transactional + public void dtoEqualsVerifier() throws Exception { + TestUtil.equalsVerifier(QuoteDTO.class); + QuoteDTO quoteDTO1 = new QuoteDTO(); + quoteDTO1.setId(1L); + QuoteDTO quoteDTO2 = new QuoteDTO(); + assertThat(quoteDTO1).isNotEqualTo(quoteDTO2); + quoteDTO2.setId(quoteDTO1.getId()); + assertThat(quoteDTO1).isEqualTo(quoteDTO2); + quoteDTO2.setId(2L); + assertThat(quoteDTO1).isNotEqualTo(quoteDTO2); + quoteDTO1.setId(null); + assertThat(quoteDTO1).isNotEqualTo(quoteDTO2); + } + + @Test + @Transactional + public void testEntityFromId() { + assertThat(quoteMapper.fromId(42L).getId()).isEqualTo(42); + assertThat(quoteMapper.fromId(null)).isNull(); + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/TestUtil.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/TestUtil.java new file mode 100644 index 0000000000..1fd2b1bd40 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/TestUtil.java @@ -0,0 +1,135 @@ +package com.baeldung.jhipster.quotes.web.rest; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.hamcrest.Description; +import org.hamcrest.TypeSafeDiagnosingMatcher; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.format.support.DefaultFormattingConversionService; +import org.springframework.format.support.FormattingConversionService; +import org.springframework.http.MediaType; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Utility class for testing REST controllers. + */ +public class TestUtil { + + /** MediaType for JSON UTF8 */ + public static final MediaType APPLICATION_JSON_UTF8 = new MediaType( + MediaType.APPLICATION_JSON.getType(), + MediaType.APPLICATION_JSON.getSubtype(), StandardCharsets.UTF_8); + + /** + * Convert an object to JSON byte array. + * + * @param object + * the object to convert + * @return the JSON byte array + * @throws IOException + */ + public static byte[] convertObjectToJsonBytes(Object object) + throws IOException { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); + + JavaTimeModule module = new JavaTimeModule(); + mapper.registerModule(module); + + return mapper.writeValueAsBytes(object); + } + + /** + * Create a byte array with a specific size filled with specified data. + * + * @param size the size of the byte array + * @param data the data to put in the byte array + * @return the JSON byte array + */ + public static byte[] createByteArray(int size, String data) { + byte[] byteArray = new byte[size]; + for (int i = 0; i < size; i++) { + byteArray[i] = Byte.parseByte(data, 2); + } + return byteArray; + } + + /** + * A matcher that tests that the examined string represents the same instant as the reference datetime. + */ + public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher { + + private final ZonedDateTime date; + + public ZonedDateTimeMatcher(ZonedDateTime date) { + this.date = date; + } + + @Override + protected boolean matchesSafely(String item, Description mismatchDescription) { + try { + if (!date.isEqual(ZonedDateTime.parse(item))) { + mismatchDescription.appendText("was ").appendValue(item); + return false; + } + return true; + } catch (DateTimeParseException e) { + mismatchDescription.appendText("was ").appendValue(item) + .appendText(", which could not be parsed as a ZonedDateTime"); + return false; + } + + } + + @Override + public void describeTo(Description description) { + description.appendText("a String representing the same Instant as ").appendValue(date); + } + } + + /** + * Creates a matcher that matches when the examined string reprensents the same instant as the reference datetime + * @param date the reference datetime against which the examined string is checked + */ + public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) { + return new ZonedDateTimeMatcher(date); + } + + /** + * Verifies the equals/hashcode contract on the domain object. + */ + public static void equalsVerifier(Class clazz) throws Exception { + T domainObject1 = clazz.getConstructor().newInstance(); + assertThat(domainObject1.toString()).isNotNull(); + assertThat(domainObject1).isEqualTo(domainObject1); + assertThat(domainObject1.hashCode()).isEqualTo(domainObject1.hashCode()); + // Test with an instance of another class + Object testOtherObject = new Object(); + assertThat(domainObject1).isNotEqualTo(testOtherObject); + assertThat(domainObject1).isNotEqualTo(null); + // Test with an instance of the same class + T domainObject2 = clazz.getConstructor().newInstance(); + assertThat(domainObject1).isNotEqualTo(domainObject2); + // HashCodes are equals because the objects are not persisted yet + assertThat(domainObject1.hashCode()).isEqualTo(domainObject2.hashCode()); + } + + /** + * Create a FormattingConversionService which use ISO date format, instead of the localized one. + * @return the FormattingConversionService + */ + public static FormattingConversionService createFormattingConversionService() { + DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService (); + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setUseIsoFormat(true); + registrar.registerFormatters(dfcs); + return dfcs; + } +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorIntTest.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorIntTest.java new file mode 100644 index 0000000000..f233293e35 --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorIntTest.java @@ -0,0 +1,151 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import com.baeldung.jhipster.quotes.QuotesApp; +import com.baeldung.jhipster.quotes.config.SecurityBeanOverrideConfiguration; +import org.junit.Before; +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.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Test class for the ExceptionTranslator controller advice. + * + * @see ExceptionTranslator + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, QuotesApp.class}) +public class ExceptionTranslatorIntTest { + + @Autowired + private ExceptionTranslatorTestController controller; + + @Autowired + private ExceptionTranslator exceptionTranslator; + + @Autowired + private MappingJackson2HttpMessageConverter jacksonMessageConverter; + + private MockMvc mockMvc; + + @Before + public void setup() { + mockMvc = MockMvcBuilders.standaloneSetup(controller) + .setControllerAdvice(exceptionTranslator) + .setMessageConverters(jacksonMessageConverter) + .build(); + } + + @Test + public void testConcurrencyFailure() throws Exception { + mockMvc.perform(get("/test/concurrency-failure")) + .andExpect(status().isConflict()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); + } + + @Test + public void testMethodArgumentNotValid() throws Exception { + mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) + .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) + .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) + .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); + } + + @Test + public void testParameterizedError() throws Exception { + mockMvc.perform(get("/test/parameterized-error")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("test parameterized error")) + .andExpect(jsonPath("$.params.param0").value("param0_value")) + .andExpect(jsonPath("$.params.param1").value("param1_value")); + } + + @Test + public void testParameterizedError2() throws Exception { + mockMvc.perform(get("/test/parameterized-error2")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("test parameterized error")) + .andExpect(jsonPath("$.params.foo").value("foo_value")) + .andExpect(jsonPath("$.params.bar").value("bar_value")); + } + + @Test + public void testMissingServletRequestPartException() throws Exception { + mockMvc.perform(get("/test/missing-servlet-request-part")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")); + } + + @Test + public void testMissingServletRequestParameterException() throws Exception { + mockMvc.perform(get("/test/missing-servlet-request-parameter")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")); + } + + @Test + public void testAccessDenied() throws Exception { + mockMvc.perform(get("/test/access-denied")) + .andExpect(status().isForbidden()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.403")) + .andExpect(jsonPath("$.detail").value("test access denied!")); + } + + @Test + public void testUnauthorized() throws Exception { + mockMvc.perform(get("/test/unauthorized")) + .andExpect(status().isUnauthorized()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.401")) + .andExpect(jsonPath("$.path").value("/test/unauthorized")) + .andExpect(jsonPath("$.detail").value("test authentication failed!")); + } + + @Test + public void testMethodNotSupported() throws Exception { + mockMvc.perform(post("/test/access-denied")) + .andExpect(status().isMethodNotAllowed()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.405")) + .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); + } + + @Test + public void testExceptionWithResponseStatus() throws Exception { + mockMvc.perform(get("/test/response-status")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")) + .andExpect(jsonPath("$.title").value("test response status")); + } + + @Test + public void testInternalServerError() throws Exception { + mockMvc.perform(get("/test/internal-server-error")) + .andExpect(status().isInternalServerError()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.500")) + .andExpect(jsonPath("$.title").value("Internal Server Error")); + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorTestController.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorTestController.java new file mode 100644 index 0000000000..b1937e5bec --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/errors/ExceptionTranslatorTestController.java @@ -0,0 +1,86 @@ +package com.baeldung.jhipster.quotes.web.rest.errors; + +import org.springframework.dao.ConcurrencyFailureException; +import org.springframework.http.HttpStatus; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.HashMap; +import java.util.Map; + +@RestController +public class ExceptionTranslatorTestController { + + @GetMapping("/test/concurrency-failure") + public void concurrencyFailure() { + throw new ConcurrencyFailureException("test concurrency failure"); + } + + @PostMapping("/test/method-argument") + public void methodArgument(@Valid @RequestBody TestDTO testDTO) { + } + + @GetMapping("/test/parameterized-error") + public void parameterizedError() { + throw new CustomParameterizedException("test parameterized error", "param0_value", "param1_value"); + } + + @GetMapping("/test/parameterized-error2") + public void parameterizedError2() { + Map params = new HashMap<>(); + params.put("foo", "foo_value"); + params.put("bar", "bar_value"); + throw new CustomParameterizedException("test parameterized error", params); + } + + @GetMapping("/test/missing-servlet-request-part") + public void missingServletRequestPartException(@RequestPart String part) { + } + + @GetMapping("/test/missing-servlet-request-parameter") + public void missingServletRequestParameterException(@RequestParam String param) { + } + + @GetMapping("/test/access-denied") + public void accessdenied() { + throw new AccessDeniedException("test access denied!"); + } + + @GetMapping("/test/unauthorized") + public void unauthorized() { + throw new BadCredentialsException("test authentication failed!"); + } + + @GetMapping("/test/response-status") + public void exceptionWithReponseStatus() { + throw new TestResponseStatusException(); + } + + @GetMapping("/test/internal-server-error") + public void internalServerError() { + throw new RuntimeException(); + } + + public static class TestDTO { + + @NotNull + private String test; + + public String getTest() { + return test; + } + + public void setTest(String test) { + this.test = test; + } + } + + @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "test response status") + @SuppressWarnings("serial") + public static class TestResponseStatusException extends RuntimeException { + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtilUnitTest.java b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtilUnitTest.java new file mode 100644 index 0000000000..a21851044d --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/java/com/baeldung/jhipster/quotes/web/rest/util/PaginationUtilUnitTest.java @@ -0,0 +1,44 @@ +package com.baeldung.jhipster.quotes.web.rest.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.HttpHeaders; + +/** + * Tests based on parsing algorithm in app/components/util/pagination-util.service.js + * + * @see PaginationUtil + */ +public class PaginationUtilUnitTest { + + @Test + public void generatePaginationHttpHeadersTest() { + String baseUrl = "/api/_search/example"; + List content = new ArrayList<>(); + Page page = new PageImpl<>(content, PageRequest.of(6, 50), 400L); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, baseUrl); + List strHeaders = headers.get(HttpHeaders.LINK); + assertNotNull(strHeaders); + assertTrue(strHeaders.size() == 1); + String headerData = strHeaders.get(0); + assertTrue(headerData.split(",").length == 4); + String expectedData = "; rel=\"next\"," + + "; rel=\"prev\"," + + "; rel=\"last\"," + + "; rel=\"first\""; + assertEquals(expectedData, headerData); + List xTotalCountHeaders = headers.get("X-Total-Count"); + assertTrue(xTotalCountHeaders.size() == 1); + assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L)); + } + +} diff --git a/jhipster/jhipster-uaa/quotes/src/test/resources/config/application.yml b/jhipster/jhipster-uaa/quotes/src/test/resources/config/application.yml new file mode 100644 index 0000000000..337bdbde1c --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/resources/config/application.yml @@ -0,0 +1,119 @@ +# =================================================================== +# Spring Boot configuration. +# +# This configuration is used for unit/integration tests. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +eureka: + client: + enabled: false + instance: + appname: quotes + instanceId: quotes:${spring.application.instance-id:${random.value}} + +spring: + application: + name: quotes + cache: + type: simple + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:h2:mem:quotes;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + name: + username: + password: + hikari: + auto-commit: false + jpa: + database-platform: io.github.jhipster.domain.util.FixedH2Dialect + database: H2 + open-in-view: false + show-sql: false + hibernate: + ddl-auto: none + naming: + physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: false + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: true + hibernate.hbm2ddl.auto: validate + liquibase: + contexts: test + mail: + host: localhost + messages: + basename: i18n/messages + mvc: + favicon: + enabled: false + thymeleaf: + mode: HTML + + +server: + port: 10344 + address: localhost + +info: + project: + version: #project.version# + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + async: + core-pool-size: 1 + max-pool-size: 50 + queue-capacity: 10000 + # To test logstash appender + logging: + logstash: + enabled: true + host: localhost + port: 5000 + queue-size: 512 + security: + authentication: + jwt: + # This token must be encoded using Base64 (you can type `echo 'secret-key'|base64` on your command line) + base64-secret: YTQzODg4YTM4NDU3YTJjMDZiZDczYTI5NThmNGU5Y2Y4ZDcxMjUxMzI1MmI4MmQwM2RmMzYxMzVjYzljN2MzNjcyYjhiNzk3NTVhN2M2NjY1YjVhZjk1YTkyMTI0MGJlODczZDZkNzA5YjAxZThhMDMyMDFkMTgyZjBhYjJkM2Y= + # Token is valid 24 hours + token-validity-in-seconds: 86400 + client-authorization: + access-token-uri: http://uaa/oauth/token + token-service-id: uaa + client-id: internal + client-secret: internal + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx.enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: true + report-frequency: 60 # in seconds + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/quotes/src/test/resources/config/bootstrap.yml b/jhipster/jhipster-uaa/quotes/src/test/resources/config/bootstrap.yml new file mode 100644 index 0000000000..11cd6af21c --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/resources/config/bootstrap.yml @@ -0,0 +1,4 @@ +spring: + cloud: + config: + enabled: false diff --git a/jhipster/jhipster-uaa/quotes/src/test/resources/logback.xml b/jhipster/jhipster-uaa/quotes/src/test/resources/logback.xml new file mode 100644 index 0000000000..2083a085ad --- /dev/null +++ b/jhipster/jhipster-uaa/quotes/src/test/resources/logback.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jhipster/jhipster-uaa/uaa/.editorconfig b/jhipster/jhipster-uaa/uaa/.editorconfig new file mode 100644 index 0000000000..a03599dd04 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/.editorconfig @@ -0,0 +1,24 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 4 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[{package,bower}.json] +indent_style = space +indent_size = 2 diff --git a/jhipster/jhipster-uaa/uaa/.gitattributes b/jhipster/jhipster-uaa/uaa/.gitattributes new file mode 100644 index 0000000000..8ab72fe637 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/.gitattributes @@ -0,0 +1,149 @@ +# This file is inspired by https://github.com/alexkaratarakis/gitattributes +# +# Auto detect text files and perform LF normalization +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +# The above will handle all files NOT found below +# These files are text and should be normalized (Convert crlf => lf) + +*.bat text eol=crlf +*.coffee text +*.css text +*.cql text +*.df text +*.ejs text +*.html text +*.java text +*.js text +*.json text +*.less text +*.properties text +*.sass text +*.scss text +*.sh text eol=lf +*.sql text +*.txt text +*.ts text +*.xml text +*.yaml text +*.yml text + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.markdown text +*.md text +*.adoc text +*.textile text +*.mustache text +*.csv text +*.tab text +*.tsv text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +*COPYRIGHT* text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. If you want to treat it as text, +# comment-out the following line and uncomment the line after. +*.svg binary +#*.svg text +*.eps binary + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.class binary +*.jar binary +*.war binary + +## LINTERS +.csslintrc text +.eslintrc text +.jscsrc text +.jshintrc text +.jshintignore text +.stylelintrc text + +## CONFIGS +*.bowerrc text +*.conf text +*.config text +.editorconfig text +.gitattributes text +.gitconfig text +.gitignore text +.htaccess text +*.npmignore text + +## HEROKU +Procfile text +.slugignore text + +## AUDIO +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +## VIDEO +*.3gpp binary +*.3gp binary +*.as binary +*.asf binary +*.asx binary +*.fla binary +*.flv binary +*.m4v binary +*.mng binary +*.mov binary +*.mp4 binary +*.mpeg binary +*.mpg binary +*.swc binary +*.swf binary +*.webm binary + +## ARCHIVES +*.7z binary +*.gz binary +*.rar binary +*.tar binary +*.zip binary + +## FONTS +*.ttf binary +*.eot binary +*.otf binary +*.woff binary +*.woff2 binary diff --git a/jhipster/jhipster-uaa/uaa/.gitignore b/jhipster/jhipster-uaa/uaa/.gitignore new file mode 100644 index 0000000000..e746b25ae6 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/.gitignore @@ -0,0 +1,144 @@ +###################### +# Project Specific +###################### +/target/www/** +/src/test/javascript/coverage/ + +###################### +# Node +###################### +/node/ +node_tmp/ +node_modules/ +npm-debug.log.* +/.awcache/* +/.cache-loader/* + +###################### +# SASS +###################### +.sass-cache/ + +###################### +# Eclipse +###################### +*.pydevproject +.project +.metadata +tmp/ +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath +.factorypath +/src/main/resources/rebel.xml + +# External tool builders +.externalToolBuilders/** + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + +###################### +# Intellij +###################### +.idea/ +*.iml +*.iws +*.ipr +*.ids +*.orig +classes/ +out/ + +###################### +# Visual Studio Code +###################### +.vscode/ + +###################### +# Maven +###################### +/log/ +/target/ + +###################### +# Gradle +###################### +.gradle/ +/build/ + +###################### +# Package Files +###################### +*.jar +*.war +*.ear +*.db + +###################### +# Windows +###################### +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + +###################### +# Mac OSX +###################### +.DS_Store +.svn + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +###################### +# Directories +###################### +/bin/ +/deploy/ + +###################### +# Logs +###################### +*.log* + +###################### +# Others +###################### +*.class +*.*~ +*~ +.merge_file* + +###################### +# Gradle Wrapper +###################### +!gradle/wrapper/gradle-wrapper.jar + +###################### +# Maven Wrapper +###################### +!.mvn/wrapper/maven-wrapper.jar + +###################### +# ESLint +###################### +.eslintcache diff --git a/jhipster/jhipster-uaa/uaa/.mvn/wrapper/MavenWrapperDownloader.java b/jhipster/jhipster-uaa/uaa/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000000..fa4f7b499f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,110 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = + "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: : " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/.mvn/wrapper/maven-wrapper.jar b/jhipster/jhipster-uaa/uaa/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..01e67997377a393fd672c7dcde9dccbedf0cb1e9 GIT binary patch literal 48337 zcmbTe1CV9Qwl>;j+wQV$+qSXFw%KK)%eHN!%U!l@+x~l>b1vR}@9y}|TM-#CBjy|< zb7YRpp)Z$$Gzci_H%LgxZ{NNV{%Qa9gZlF*E2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}<2)?KC&%y5PVef<7rcu2l!8dsy z?lvdaHJ#s$0m18y{x#fB$o=l)-sV?Qya5GWf#8Vd{~Grn@qgX#!EI`Y>++l%1A;eL z{_7t6jMeEr@a+oxyCL^+_}9Qc;i0&Xd%LXp?to*R|26LKHG(m0)*QF4*h;5%YG5<9)c> z1vq!7bIJSv1^27i-mcH!zX>ep3Iw0^{nx<1jOy)N_UoFD8v}x~2mEWapI3m~kMQkR z#&@4FuEGBn`mgtSx6jeY7vUQNf=^}sTZErIEpH!cy|@7Z zU4h_Oxxd2s=f{}$XXy4}%JqTSjRC \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + 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 + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/jhipster/jhipster-uaa/uaa/mvnw.cmd b/jhipster/jhipster-uaa/uaa/mvnw.cmd new file mode 100644 index 0000000000..e5cfb0ae9e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/mvnw.cmd @@ -0,0 +1,161 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/jhipster/jhipster-uaa/uaa/package-lock.json b/jhipster/jhipster-uaa/uaa/package-lock.json new file mode 100644 index 0000000000..4ef0a226b9 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/package-lock.json @@ -0,0 +1,4409 @@ +{ + "name": "uaa", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz", + "integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ansi": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi/-/ansi-0.3.1.tgz", + "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=", + "dev": true + }, + "ansi-cyan": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-red": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "axios": { + "version": "0.18.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "dev": true, + "requires": { + "follow-redirects": "^1.3.0", + "is-buffer": "^1.1.5" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "binaryextensions": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/binaryextensions/-/binaryextensions-2.1.1.tgz", + "integrity": "sha512-XBaoWE9RW8pPdPQNibZsW2zh8TW6gcarXp1FZPwT8Uop8ScSNldJEWf2k9l3HeTqdrEwsOsFcq74RiJECW34yA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chevrotain": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chevrotain/-/chevrotain-4.1.0.tgz", + "integrity": "sha512-iwuK4FOV+vZlvKonoXVw6G+rXJm4jWk17aJFkm6FloVYcVSrAaJLdCdQo+IIyX98jm0WJVcdK9cllRZQpNBnBg==", + "dev": true, + "requires": { + "regexp-to-ast": "0.3.5" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "arr-union": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-table": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-table/-/cli-table-0.3.1.tgz", + "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=", + "dev": true, + "requires": { + "colors": "1.0.3" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + } + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "clone": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color/-/color-3.0.0.tgz", + "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", + "dev": true, + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-string": { + "version": "1.5.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "dev": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "colornames": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colornames/-/colornames-1.1.1.tgz", + "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=", + "dev": true + }, + "colors": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colors/-/colors-1.3.2.tgz", + "integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ==", + "dev": true + }, + "colorspace": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/colorspace/-/colorspace-1.1.1.tgz", + "integrity": "sha512-pI3btWyiuz7Ken0BWh9Elzsmv2bM9AhA7psXib4anUXy/orfZ/E0MbQwhSOG/9L8hLlalqrU0UhOuqxW1YjmVw==", + "dev": true, + "requires": { + "color": "3.0.x", + "text-hex": "1.0.x" + } + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.16.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commander/-/commander-2.16.0.tgz", + "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "conf": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/conf/-/conf-2.0.0.tgz", + "integrity": "sha512-iCLzBsGFi8S73EANsEJZz0JnJ/e5VZef/kSaxydYZLAvw0rFNAUx5R7K5leC/CXXR2mZfXWhUvcZOO/dM2D5xg==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "env-paths": "^1.0.0", + "make-dir": "^1.0.0", + "pkg-up": "^2.0.0", + "write-file-atomic": "^2.3.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "dargs": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dargs/-/dargs-6.0.0.tgz", + "integrity": "sha512-6lJauzNaI7MiM8EHQWmGj+s3rP5/i1nYs8GAvKrLAx/9dpc9xS/4seFb1ioR39A+kcfu4v3jnEa/EE5qWYnitQ==", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "detect-conflict": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/detect-conflict/-/detect-conflict-1.0.1.tgz", + "integrity": "sha1-CIZXpmqWHAUBnbfEIwiDsca0F24=", + "dev": true + }, + "diagnostics": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/diagnostics/-/diagnostics-1.1.1.tgz", + "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", + "dev": true, + "requires": { + "colorspace": "1.1.x", + "enabled": "1.0.x", + "kuler": "1.0.x" + } + }, + "didyoumean": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/didyoumean/-/didyoumean-1.2.1.tgz", + "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "drange": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/drange/-/drange-1.1.1.tgz", + "integrity": "sha512-pYxfDYpued//QpnLIm4Avk7rsNtAtQkUES2cwAYSvD/wd2pKD71gN2Ebj3e7klzXwjocvE8c5vx/1fxwpqmSxA==", + "dev": true + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "editions": { + "version": "1.3.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/editions/-/editions-1.3.4.tgz", + "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", + "dev": true + }, + "ejs": { + "version": "2.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ejs/-/ejs-2.6.1.tgz", + "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==", + "dev": true + }, + "enabled": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/enabled/-/enabled-1.0.2.tgz", + "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", + "dev": true, + "requires": { + "env-variable": "0.0.x" + } + }, + "env-paths": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/env-paths/-/env-paths-1.0.0.tgz", + "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=", + "dev": true + }, + "env-variable": { + "version": "0.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/env-variable/-/env-variable-0.0.5.tgz", + "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==", + "dev": true + }, + "error": { + "version": "7.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/error/-/error-7.0.2.tgz", + "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", + "dev": true, + "requires": { + "string-template": "~0.2.1", + "xtend": "~4.0.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "execa": { + "version": "0.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "1.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", + "dev": true, + "requires": { + "kind-of": "^1.1.0" + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-glob": { + "version": "2.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-glob/-/fast-glob-2.2.3.tgz", + "integrity": "sha512-NiX+JXjnx43RzvVFwRWfPKo4U+1BrK5pJPsHQdKMlLoFHrrGktXglQhHliSihWAq+m1z6fHk3uwGHrtRbS9vLA==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.0.1", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.1", + "micromatch": "^3.1.10" + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-safe-stringify": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", + "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==", + "dev": true + }, + "fecha": { + "version": "2.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fecha/-/fecha-2.3.3.tgz", + "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "first-chunk-stream": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", + "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "follow-redirects": { + "version": "1.5.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/follow-redirects/-/follow-redirects-1.5.9.tgz", + "integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==", + "dev": true, + "requires": { + "debug": "=3.1.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + } + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "7.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs-extra/-/fs-extra-7.0.0.tgz", + "integrity": "sha512-EglNDLRpmaTWiD/qraZn6HREAEAHJcJOmxNEYwq6xeMKnVMAy3GUcFB+wXt2C6k4CNvB/mP1y/U3dzvKKj5OtQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "gauge": { + "version": "1.2.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gauge/-/gauge-1.2.7.tgz", + "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", + "dev": true, + "requires": { + "ansi": "^0.3.0", + "has-unicode": "^2.0.0", + "lodash.pad": "^4.1.0", + "lodash.padend": "^4.1.0", + "lodash.padstart": "^4.1.0" + } + }, + "generator-jhipster": { + "version": "5.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/generator-jhipster/-/generator-jhipster-5.4.2.tgz", + "integrity": "sha512-iuTZGPonlMFWrabTC7x27UnCa8sckWFKD7HiwMp2JOYLlLU+BPt0WJWlQ9hJv5JHHx+pe0pUxwEHbi0fSu0Ljw==", + "dev": true, + "requires": { + "axios": "0.18.0", + "chalk": "2.4.1", + "commander": "2.16.0", + "conf": "2.0.0", + "didyoumean": "1.2.1", + "ejs": "2.6.1", + "glob": "7.1.2", + "gulp-filter": "5.1.0", + "insight": "0.10.1", + "jhipster-core": "3.4.0", + "js-object-pretty-print": "0.3.0", + "js-yaml": "3.12.0", + "lodash": "4.17.10", + "meow": "5.0.0", + "mkdirp": "0.5.1", + "os-locale": "2.1.0", + "parse-gitignore": "1.0.1", + "pluralize": "7.0.0", + "prettier": "1.13.7", + "randexp": "0.4.9", + "semver": "5.5.0", + "shelljs": "0.8.2", + "tabtab": "2.2.2", + "through2": "2.0.3", + "uuid": "3.3.2", + "yeoman-environment": "2.3.0", + "yeoman-generator": "3.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "gh-got": { + "version": "6.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gh-got/-/gh-got-6.0.0.tgz", + "integrity": "sha512-F/mS+fsWQMo1zfgG9MD8KWvTWPPzzhuVwY++fhQ5Ggd+0P+CAMHtzMZhNxG+TqGfHDChJKsbh6otfMGqO2AKBw==", + "dev": true, + "requires": { + "got": "^7.0.0", + "is-plain-obj": "^1.1.0" + } + }, + "github-username": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/github-username/-/github-username-4.1.0.tgz", + "integrity": "sha1-y+KABBiDIG2kISrp5LXxacML9Bc=", + "dev": true, + "requires": { + "gh-got": "^6.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "globby": { + "version": "8.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "grouped-queue": { + "version": "0.3.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/grouped-queue/-/grouped-queue-0.3.3.tgz", + "integrity": "sha1-wWfSpTGcWg4JZO9qJbfC34mWyFw=", + "dev": true, + "requires": { + "lodash": "^4.17.2" + } + }, + "gulp-filter": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/gulp-filter/-/gulp-filter-5.1.0.tgz", + "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM=", + "dev": true, + "requires": { + "multimatch": "^2.0.0", + "plugin-error": "^0.1.2", + "streamfilter": "^1.0.5" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "5.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inquirer/-/inquirer-5.2.0.tgz", + "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.1.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^5.5.2", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "insight": { + "version": "0.10.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/insight/-/insight-0.10.1.tgz", + "integrity": "sha512-kLGeYQkh18f8KuC68QKdi0iwUcIaayJVB/STpX7x452/7pAUm1yfG4giJwcxbrTh0zNYtc8kBR+6maLMOzglOQ==", + "dev": true, + "requires": { + "async": "^2.1.4", + "chalk": "^2.3.0", + "conf": "^1.3.1", + "inquirer": "^5.0.0", + "lodash.debounce": "^4.0.8", + "os-name": "^2.0.1", + "request": "^2.74.0", + "tough-cookie": "^2.0.0", + "uuid": "^3.0.0" + }, + "dependencies": { + "conf": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/conf/-/conf-1.4.0.tgz", + "integrity": "sha512-bzlVWS2THbMetHqXKB8ypsXN4DQ/1qopGwNJi1eYbpwesJcd86FBjFciCQX/YwAhp9bM7NVnPFqZ5LpV7gP0Dg==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "env-paths": "^1.0.0", + "make-dir": "^1.0.0", + "pkg-up": "^2.0.0", + "write-file-atomic": "^2.3.0" + } + } + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true + }, + "is-scoped": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-scoped/-/is-scoped-1.0.0.tgz", + "integrity": "sha1-RJypgpnnEwOCViieyytUDcQ3yzA=", + "dev": true, + "requires": { + "scoped-regex": "^1.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isbinaryfile": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isbinaryfile/-/isbinaryfile-3.0.3.tgz", + "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", + "dev": true, + "requires": { + "buffer-alloc": "^1.2.0" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istextorbinary": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/istextorbinary/-/istextorbinary-2.2.1.tgz", + "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", + "dev": true, + "requires": { + "binaryextensions": "2", + "editions": "^1.3.3", + "textextensions": "2" + } + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "jhipster-core": { + "version": "3.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jhipster-core/-/jhipster-core-3.4.0.tgz", + "integrity": "sha512-iVJ6MF4jlpvtVL5gbn9t4Jw27RodjY04SXYSGfTLAzHyQRMmehHLvNq/3DBjVwHgBrDn1u2k17oLGouJus9MhA==", + "dev": true, + "requires": { + "chevrotain": "4.1.0", + "fs-extra": "7.0.0", + "lodash": "4.17.11", + "winston": "3.1.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "js-object-pretty-print": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-object-pretty-print/-/js-object-pretty-print-0.3.0.tgz", + "integrity": "sha1-RnDkUAZu4ezPNRdMfRl/WqOLz3Q=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", + "dev": true + }, + "kuler": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kuler/-/kuler-1.0.1.tgz", + "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", + "dev": true, + "requires": { + "colornames": "^1.1.1" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true + }, + "lodash.pad": { + "version": "4.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.pad/-/lodash.pad-4.5.1.tgz", + "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA=", + "dev": true + }, + "lodash.padend": { + "version": "4.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", + "dev": true + }, + "lodash.padstart": { + "version": "4.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.padstart/-/lodash.padstart-4.6.1.tgz", + "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=", + "dev": true + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "logform": { + "version": "1.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/logform/-/logform-1.10.0.tgz", + "integrity": "sha512-em5ojIhU18fIMOw/333mD+ZLE2fis0EzXl1ZwHx4iQzmpQi6odNiY/t+ITNr33JZhT9/KEaH+UPIipr6a9EjWg==", + "dev": true, + "requires": { + "colors": "^1.2.1", + "fast-safe-stringify": "^2.0.4", + "fecha": "^2.3.3", + "ms": "^2.1.1", + "triple-beam": "^1.2.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "macos-release": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/macos-release/-/macos-release-1.1.0.tgz", + "integrity": "sha512-mmLbumEYMi5nXReB9js3WGsB8UE6cDBWyIO62Z4DNx6GbRhDxHNjA1MlzSpJ2S2KM1wyiPRA0d19uHWYYvMHjA==", + "dev": true + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "mem-fs": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem-fs/-/mem-fs-1.1.3.tgz", + "integrity": "sha1-uK6NLj/Lb10/kWXBLUVRoGXZicw=", + "dev": true, + "requires": { + "through2": "^2.0.0", + "vinyl": "^1.1.0", + "vinyl-file": "^2.0.0" + } + }, + "mem-fs-editor": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mem-fs-editor/-/mem-fs-editor-5.1.0.tgz", + "integrity": "sha512-2Yt2GCYEbcotYbIJagmow4gEtHDqzpq5XN94+yAx/NT5+bGqIjkXnm3KCUQfE6kRfScGp9IZknScoGRKu8L78w==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "deep-extend": "^0.6.0", + "ejs": "^2.5.9", + "glob": "^7.0.3", + "globby": "^8.0.1", + "isbinaryfile": "^3.0.2", + "mkdirp": "^0.5.0", + "multimatch": "^2.0.0", + "rimraf": "^2.2.8", + "through2": "^2.0.0", + "vinyl": "^2.0.1" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "vinyl": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + } + } + }, + "meow": { + "version": "5.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + } + }, + "merge2": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/merge2/-/merge2-1.2.3.tgz", + "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "mime-db": { + "version": "1.36.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime-db/-/mime-db-1.36.0.tgz", + "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "dev": true + }, + "mime-types": { + "version": "2.1.20", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mime-types/-/mime-types-2.1.20.tgz", + "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "dev": true, + "requires": { + "mime-db": "~1.36.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "npmlog": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/npmlog/-/npmlog-2.0.4.tgz", + "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", + "dev": true, + "requires": { + "ansi": "~0.3.1", + "are-we-there-yet": "~1.1.2", + "gauge": "~1.2.5" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "one-time": { + "version": "0.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/one-time/-/one-time-0.0.4.tgz", + "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "os-name": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-name/-/os-name-2.0.1.tgz", + "integrity": "sha1-uaOGNhwXrjohc27wWZQFyajF3F4=", + "dev": true, + "requires": { + "macos-release": "^1.0.0", + "win-release": "^1.0.0" + } + }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-gitignore": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-gitignore/-/parse-gitignore-1.0.1.tgz", + "integrity": "sha512-UGyowyjtx26n65kdAMWhm6/3uy5uSrpcuH7tt+QEVudiBoVS+eqHxD5kbi9oWVRwj7sCzXqwuM+rUGw7earl6A==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "plugin-error": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", + "dev": true, + "requires": { + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "prettier": { + "version": "1.13.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/prettier/-/prettier-1.13.7.tgz", + "integrity": "sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w==", + "dev": true + }, + "pretty-bytes": { + "version": "5.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pretty-bytes/-/pretty-bytes-5.1.0.tgz", + "integrity": "sha512-wa5+qGVg9Yt7PB6rYm3kXlKzgzgivYTLRandezh43jjRqgyDyP+9YxfJpJiLs9yKD1WeU8/OvtToWpW7255FtA==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.1.29", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "randexp": { + "version": "0.4.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/randexp/-/randexp-0.4.9.tgz", + "integrity": "sha512-maAX1cnBkzIZ89O4tSQUOF098xjGMC8N+9vuY/WfHwg87THw6odD2Br35donlj5e6KnB1SB0QBHhTQhhDHuTPQ==", + "dev": true, + "requires": { + "drange": "^1.0.0", + "ret": "^0.2.0" + } + }, + "read-chunk": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-chunk/-/read-chunk-2.1.0.tgz", + "integrity": "sha1-agTAkoAF7Z1C4aasVgDhnLx/9lU=", + "dev": true, + "requires": { + "pify": "^3.0.0", + "safe-buffer": "^5.1.1" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "regexp-to-ast": { + "version": "0.3.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/regexp-to-ast/-/regexp-to-ast-0.3.5.tgz", + "integrity": "sha512-1CJygtdvsfNFwiyjaMLBWtg2tfEqx/jSZ8S6TV+GlNL8kiH8rb4cm5Pb7A/C2BpyM/fA8ZJEudlCwi/jvAY+Ow==", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ret/-/ret-0.2.2.tgz", + "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rx": { + "version": "4.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rx/-/rx-4.1.0.tgz", + "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", + "dev": true + }, + "rxjs": { + "version": "5.5.12", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/rxjs/-/rxjs-5.5.12.tgz", + "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "dev": true, + "requires": { + "symbol-observable": "1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + }, + "dependencies": { + "ret": { + "version": "0.1.15", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + } + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "scoped-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/scoped-regex/-/scoped-regex-1.0.0.tgz", + "integrity": "sha1-o0a7Gs1CB65wvXwMfKnlZra63bg=", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shelljs": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/shelljs/-/shelljs-0.8.2.tgz", + "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "requires": { + "is-arrayish": "^0.3.1" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.15.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/sshpk/-/sshpk-1.15.1.tgz", + "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "streamfilter": { + "version": "1.0.7", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/streamfilter/-/streamfilter-1.0.7.tgz", + "integrity": "sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ==", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "string-template": { + "version": "0.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-bom-stream": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz", + "integrity": "sha1-+H217yYT9paKpUWr/h7HKLaoKco=", + "dev": true, + "requires": { + "first-chunk-stream": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", + "dev": true + }, + "tabtab": { + "version": "2.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tabtab/-/tabtab-2.2.2.tgz", + "integrity": "sha1-egR/FDsBC0y9MfhX6ClhUSy/ThQ=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "inquirer": "^1.0.2", + "lodash.difference": "^4.5.0", + "lodash.uniq": "^4.5.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "npmlog": "^2.0.3", + "object-assign": "^4.1.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "external-editor": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/external-editor/-/external-editor-1.1.1.tgz", + "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "spawn-sync": "^1.0.15", + "tmp": "^0.0.29" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "inquirer": { + "version": "1.2.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/inquirer/-/inquirer-1.2.3.tgz", + "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", + "dev": true, + "requires": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "external-editor": "^1.1.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "mute-stream": "0.0.6", + "pinkie-promise": "^2.0.0", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mute-stream": { + "version": "0.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/mute-stream/-/mute-stream-0.0.6.tgz", + "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=", + "dev": true + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tmp": { + "version": "0.0.29", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, + "text-hex": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "textextensions": { + "version": "2.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/textextensions/-/textextensions-2.2.0.tgz", + "integrity": "sha512-j5EMxnryTvKxwH2Cq+Pb43tsf6sdEgw6Pdwxk83mPaq0ToeFJt6WE4J3s5BqY7vmjlLgkgXvhtXUxo80FyBhCA==", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "triple-beam": { + "version": "1.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "arr-union": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "untildify": { + "version": "3.0.3", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-file": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/vinyl-file/-/vinyl-file-2.0.0.tgz", + "integrity": "sha1-p+v1/779obfRjRQPyweyI++2dRo=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.3.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0", + "strip-bom-stream": "^2.0.0", + "vinyl": "^1.1.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "win-release": { + "version": "1.1.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha1-X6VeAr58qTTt/BJmVjLoSbcuUgk=", + "dev": true, + "requires": { + "semver": "^5.0.1" + } + }, + "winston": { + "version": "3.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/winston/-/winston-3.1.0.tgz", + "integrity": "sha512-FsQfEE+8YIEeuZEYhHDk5cILo1HOcWkGwvoidLrDgPog0r4bser1lEIOco2dN9zpDJ1M88hfDgZvxe5z4xNcwg==", + "dev": true, + "requires": { + "async": "^2.6.0", + "diagnostics": "^1.1.1", + "is-stream": "^1.1.0", + "logform": "^1.9.1", + "one-time": "0.0.4", + "readable-stream": "^2.3.6", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.2.0" + } + }, + "winston-transport": { + "version": "4.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/winston-transport/-/winston-transport-4.2.0.tgz", + "integrity": "sha512-0R1bvFqxSlK/ZKTH86nymOuKv/cT1PQBMuDdA7k7f0S9fM44dNH6bXnuxwXPrN8lefJgtZq08BKdyZ0DZIy/rg==", + "dev": true, + "requires": { + "readable-stream": "^2.3.6", + "triple-beam": "^1.2.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + }, + "yeoman-environment": { + "version": "2.3.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeoman-environment/-/yeoman-environment-2.3.0.tgz", + "integrity": "sha512-PHSAkVOqYdcR+C+Uht1SGC4eVD/9OhygYFkYaI66xF8vKIeS1RNYay+umj2ZrQeJ50tF5Q/RSO6qGDz9y3Ifug==", + "dev": true, + "requires": { + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^3.1.0", + "diff": "^3.3.1", + "escape-string-regexp": "^1.0.2", + "globby": "^8.0.1", + "grouped-queue": "^0.3.3", + "inquirer": "^5.2.0", + "is-scoped": "^1.0.0", + "lodash": "^4.17.10", + "log-symbols": "^2.1.0", + "mem-fs": "^1.1.0", + "strip-ansi": "^4.0.0", + "text-table": "^0.2.0", + "untildify": "^3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "yeoman-generator": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/yeoman-generator/-/yeoman-generator-3.0.0.tgz", + "integrity": "sha512-aHsNXzkdgAoakZTZsDX7T56wYWYd1O5E/GBIFAVMJLH7TKRr+1MiEJszZQbbCSA+J+lpT743/8L88j35yNdTLQ==", + "dev": true, + "requires": { + "async": "^2.6.0", + "chalk": "^2.3.0", + "cli-table": "^0.3.1", + "cross-spawn": "^6.0.5", + "dargs": "^6.0.0", + "dateformat": "^3.0.3", + "debug": "^3.1.0", + "detect-conflict": "^1.0.0", + "error": "^7.0.2", + "find-up": "^3.0.0", + "github-username": "^4.0.0", + "istextorbinary": "^2.2.1", + "lodash": "^4.17.10", + "make-dir": "^1.1.0", + "mem-fs-editor": "^5.0.0", + "minimist": "^1.2.0", + "pretty-bytes": "^5.1.0", + "read-chunk": "^2.1.0", + "read-pkg-up": "^4.0.0", + "rimraf": "^2.6.2", + "run-async": "^2.0.0", + "shelljs": "^0.8.0", + "text-table": "^0.2.0", + "through2": "^2.0.0", + "yeoman-environment": "^2.0.5" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://ssh.lighthouse.com.br/nexus/repository/npm-all/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + } + } + } + } +} diff --git a/jhipster/jhipster-uaa/uaa/package.json b/jhipster/jhipster-uaa/uaa/package.json new file mode 100644 index 0000000000..7565e8783c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/package.json @@ -0,0 +1,16 @@ +{ + "name": "uaa", + "version": "0.0.0", + "description": "Description for uaa", + "private": true, + "license": "UNLICENSED", + "cacheDirectories": [ + "node_modules" + ], + "devDependencies": { + "generator-jhipster": "5.4.2" + }, + "engines": { + "node": ">=8.9.0" + } +} diff --git a/jhipster/jhipster-uaa/uaa/pom.xml b/jhipster/jhipster-uaa/uaa/pom.xml new file mode 100644 index 0000000000..9c4783747a --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/pom.xml @@ -0,0 +1,915 @@ + + + 4.0.0 + + com.baeldung.jhipster.uaa + uaa + 0.0.1-SNAPSHOT + war + Uaa + + + + + + + + + + 3.0.0 + 1.8 + 2.12.6 + v8.12.0 + 6.4.1 + UTF-8 + UTF-8 + ${project.build.directory}/test-results + yyyyMMddHHmmss + ${java.version} + ${java.version} + -Djava.security.egd=file:/dev/./urandom -Xmx256m + jdt_apt + false + + + + + + + 2.0.25 + + 2.0.5.RELEASE + + 5.2.17.Final + + 3.22.0-GA + + 3.5.5 + 3.6 + 2.0.1.Final + 1.2.0.Final + + + 3.1.0 + 3.8.0 + 2.10 + 3.0.0-M2 + 3.1.0 + 2.22.0 + 3.2.2 + 0.9.11 + 0.8.2 + 3.4.2 + 3.5.0.1254 + 2.2.5 + + + http://localhost:9001 + src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/www/**/*.* + S3437,S4684,UndocumentedApi,BoldAndItalicTagsCheck + + src/main/webapp/app/**/*.* + Web:BoldAndItalicTagsCheck + + src/main/java/**/* + squid:S3437 + + src/main/java/**/* + squid:UndocumentedApi + + src/main/java/**/* + squid:S4684 + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + jacoco + ${project.testresult.directory}/lcov.info + ${project.basedir}/src/main/ + ${project.testresult.directory}/surefire-reports + ${project.basedir}/src/test/ + + + + + + + + io.github.jhipster + jhipster-dependencies + ${jhipster-dependencies.version} + pom + import + + + + + + + + io.github.jhipster + jhipster-framework + + + + org.springframework.boot + spring-boot-starter-cache + + + io.dropwizard.metrics + metrics-core + + + io.dropwizard.metrics + metrics-annotation + + + io.dropwizard.metrics + metrics-json + + + io.dropwizard.metrics + metrics-jvm + + + io.dropwizard.metrics + metrics-servlet + + + io.dropwizard.metrics + metrics-servlets + + + com.fasterxml.jackson.datatype + jackson-datatype-hibernate5 + + + com.fasterxml.jackson.datatype + jackson-datatype-hppc + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-afterburner + + + com.h2database + h2 + test + + + com.hazelcast + hazelcast + + + com.hazelcast + hazelcast-hibernate52 + + + com.hazelcast + hazelcast-spring + + + com.jayway.jsonpath + json-path + test + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-bean-validators + + + com.mattbertolini + liquibase-slf4j + + + com.ryantenney.metrics + metrics-spring + + + com.zaxxer + HikariCP + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + javax.cache + cache-api + + + mysql + mysql-connector-java + + + org.assertj + assertj-core + test + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + provided + + + org.hibernate + hibernate-envers + + + org.hibernate.validator + hibernate-validator + + + org.liquibase + liquibase-core + + + net.logstash.logback + logstash-logback-encoder + + + org.mapstruct + mapstruct-jdk8 + ${mapstruct.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + provided + + + org.springframework.boot + spring-boot-configuration-processor + provided + + + org.springframework.boot + spring-boot-loader-tools + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-logging + + + org.springframework.boot + spring-boot-starter-mail + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-test + test + + + org.springframework.security + spring-security-test + test + + + org.zalando + problem-spring-web + 0.24.0-RC.0 + + + org.springframework.security.oauth + spring-security-oauth2 + + + org.springframework.security + spring-security-jwt + + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.cloud + spring-cloud-starter-netflix-ribbon + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + org.springframework.retry + spring-retry + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.cloud + spring-cloud-security + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + org.springframework.cloud + spring-cloud-spring-service-connector + + + + org.springframework.security + spring-security-data + + + + + + spring-boot:run + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + ${maven-eclipse-plugin.version} + + true + true + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven-enforcer-plugin.version} + + + enforce-versions + + enforce + + + + + + + You are running an older version of Maven. JHipster requires at least Maven ${maven.version} + [${maven.version},) + + + + You are running an incompatible version of Java. JHipster requires JDK ${java.version} + [1.8,1.9) + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${maven-resources-plugin.version} + + + default-resources + validate + + copy-resources + + + target/classes + false + + # + + + + src/main/resources/ + true + + config/*.yml + + + + src/main/resources/ + false + + config/*.yml + + + + + + + docker-resources + verify + + copy-resources + + + target/classes/static/ + + + target/www + false + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + alphabetical + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + pre-unit-tests + + prepare-agent + + + + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + + + + + post-unit-test + test + + report + + + ${project.testresult.directory}/coverage/jacoco/jacoco.exec + ${project.testresult.directory}/coverage/jacoco + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + org.liquibase + liquibase-maven-plugin + ${liquibase.version} + + src/main/resources/config/liquibase/master.xml + src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml + org.h2.Driver + jdbc:h2:file:./target/h2db/db/uaa + + uaa + + hibernate:spring:com.baeldung.jhipster.uaa.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + true + debug + + + + org.javassist + javassist + ${javassist.version} + + + org.liquibase.ext + liquibase-hibernate5 + ${liquibase-hibernate5.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring-boot.version} + + + javax.validation + validation-api + ${validation-api.version} + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + ${start-class} + true + true + + + + + com.google.cloud.tools + jib-maven-plugin + ${jib-maven-plugin.version} + + + openjdk:8-jre-alpine + + + uaa:latest + + + + sh + + chmod +x /entrypoint.sh && sync && /entrypoint.sh + + + 9999 + 5701/udp + + + ALWAYS + 0 + + true + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.jacoco + + jacoco-maven-plugin + + + ${jacoco-maven-plugin.version} + + + prepare-agent + + + + + + + + + + + + + + + + no-liquibase + + ,no-liquibase + + + + swagger + + ,swagger + + + + tls + + ,tls + + + + dev + + true + + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-devtools + true + + + com.h2database + h2 + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + + + + dev${profile.tls}${profile.no-liquibase} + + + + prod + + + org.springframework.boot + spring-boot-starter-undertow + + + + + + maven-clean-plugin + ${maven-clean-plugin.version} + + + + target/www/ + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${start-class} + true + + + + + build-info + + + + + + pl.project13.maven + git-commit-id-plugin + ${git-commit-id-plugin.version} + + + + revision + + + + + false + true + + ^git.commit.id.abbrev$ + ^git.commit.id.describe$ + ^git.branch$ + + + + + + + + prod${profile.swagger}${profile.no-liquibase} + + + + + cc + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-devtools + true + + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + src/main/webapp/ + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${start-class} + true + true + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + default-compile + none + + + default-testCompile + none + + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin.version} + + + compile + compile + + add-source + compile + + + + test-compile + test-compile + + add-source + testCompile + + + + + incremental + true + ${scala.version} + + + + + + + dev,swagger + + + + + zipkin + + + org.springframework.cloud + spring-cloud-starter-zipkin + + + + + + IDE + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + + + + + + diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/.dockerignore b/jhipster/jhipster-uaa/uaa/src/main/docker/.dockerignore new file mode 100644 index 0000000000..b03bdc71ee --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/.dockerignore @@ -0,0 +1,14 @@ +# https://docs.docker.com/engine/reference/builder/#dockerignore-file +classes/ +generated-sources/ +generated-test-sources/ +h2db/ +maven-archiver/ +maven-status/ +reports/ +surefire-reports/ +test-classes/ +test-results/ +www/ +!*.jar +!*.war diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/Dockerfile b/jhipster/jhipster-uaa/uaa/src/main/docker/Dockerfile new file mode 100644 index 0000000000..f2bfb4d66a --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM openjdk:8-jre-alpine + +ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ + JHIPSTER_SLEEP=0 \ + JAVA_OPTS="" + +# Add a jhipster user to run our application so that it doesn't need to run as root +RUN adduser -D -s /bin/sh jhipster +WORKDIR /home/jhipster + +ADD entrypoint.sh entrypoint.sh +RUN chmod 755 entrypoint.sh && chown jhipster:jhipster entrypoint.sh +USER jhipster + +ENTRYPOINT ["./entrypoint.sh"] + +EXPOSE 9999 5701/udp + +ADD *.war app.war + diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/app.yml b/jhipster/jhipster-uaa/uaa/src/main/docker/app.yml new file mode 100644 index 0000000000..6efdf61cf7 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/app.yml @@ -0,0 +1,22 @@ +version: '2' +services: + uaa-app: + image: uaa + environment: + # - _JAVA_OPTIONS=-Xmx512m -Xms256m + - SPRING_PROFILES_ACTIVE=prod,swagger + - EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka + - SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config + - SPRING_DATASOURCE_URL=jdbc:mysql://uaa-mysql:3306/uaa?useUnicode=true&characterEncoding=utf8&useSSL=false + - JHIPSTER_SLEEP=30 # gives time for the JHipster Registry to boot before the application + uaa-mysql: + extends: + file: mysql.yml + service: uaa-mysql + jhipster-registry: + extends: + file: jhipster-registry.yml + service: jhipster-registry + environment: + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/docker-config/ diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/README.md b/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/README.md new file mode 100644 index 0000000000..6aab9ffdd5 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/README.md @@ -0,0 +1,7 @@ +# Central configuration sources details + +The JHipster-Registry will use the following directories as its configuration source : +- localhost-config : when running the registry in docker with the jhipster-registry.yml docker-compose file +- docker-config : when running the registry and the app both in docker with the app.yml docker-compose file + +For more info, refer to https://www.jhipster.tech/microservices-architecture/#registry_app_configuration diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/docker-config/application.yml b/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/docker-config/application.yml new file mode 100644 index 0000000000..8a973c0a35 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/docker-config/application.yml @@ -0,0 +1,15 @@ +# Common configuration shared between all applications +configserver: + name: Docker JHipster Registry + status: Connected to the JHipster Registry running in Docker + +jhipster: + security: + authentication: + jwt: + secret: my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded + +eureka: + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@jhipster-registry:8761/eureka/ diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/localhost-config/application.yml b/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/localhost-config/application.yml new file mode 100644 index 0000000000..db4602e419 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/central-server-config/localhost-config/application.yml @@ -0,0 +1,15 @@ +# Common configuration shared between all applications +configserver: + name: Docker JHipster Registry + status: Connected to the JHipster Registry running in Docker + +jhipster: + security: + authentication: + jwt: + secret: my-secret-key-which-should-be-changed-in-production-and-be-base64-encoded + +eureka: + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/entrypoint.sh b/jhipster/jhipster-uaa/uaa/src/main/docker/entrypoint.sh new file mode 100644 index 0000000000..ccffafb5a4 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} +exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar "${HOME}/app.war" "$@" diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/hazelcast-management-center.yml b/jhipster/jhipster-uaa/uaa/src/main/docker/hazelcast-management-center.yml new file mode 100644 index 0000000000..dc6739d543 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/hazelcast-management-center.yml @@ -0,0 +1,6 @@ +version: '2' +services: + uaa-hazelcast-management-center: + image: hazelcast/management-center:3.9.3 + ports: + - 8180:8080 diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/jhipster-registry.yml b/jhipster/jhipster-uaa/uaa/src/main/docker/jhipster-registry.yml new file mode 100644 index 0000000000..512bc54be6 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/jhipster-registry.yml @@ -0,0 +1,22 @@ +version: '2' +services: + jhipster-registry: + image: jhipster/jhipster-registry:v4.0.4 + volumes: + - ./central-server-config:/central-config + # When run with the "dev" Spring profile, the JHipster Registry will + # read the config from the local filesystem (central-server-config directory) + # When run with the "prod" Spring profile, it will read the configuration from a Git repository + # See https://www.jhipster.tech/microservices-architecture/#registry_app_configuration + environment: + # - _JAVA_OPTIONS=-Xmx512m -Xms256m + - SPRING_PROFILES_ACTIVE=dev,swagger,uaa + - SPRING_SECURITY_USER_PASSWORD=admin + - JHIPSTER_REGISTRY_PASSWORD=admin + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native + - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/localhost-config/ + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=git + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_URI=https://github.com/jhipster/jhipster-registry/ + # - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_PATHS=central-config + ports: + - 8761:8761 diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/mysql.yml b/jhipster/jhipster-uaa/uaa/src/main/docker/mysql.yml new file mode 100644 index 0000000000..52b44ac6d2 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/mysql.yml @@ -0,0 +1,13 @@ +version: '2' +services: + uaa-mysql: + image: mysql:5.7.20 + # volumes: + # - ~/volumes/jhipster/uaa/mysql/:/var/lib/mysql/ + environment: + - MYSQL_USER=root + - MYSQL_ALLOW_EMPTY_PASSWORD=yes + - MYSQL_DATABASE=uaa + ports: + - 3306:3306 + command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp diff --git a/jhipster/jhipster-uaa/uaa/src/main/docker/sonar.yml b/jhipster/jhipster-uaa/uaa/src/main/docker/sonar.yml new file mode 100644 index 0000000000..2e4ab78826 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/docker/sonar.yml @@ -0,0 +1,7 @@ +version: '2' +services: + uaa-sonar: + image: sonarqube:7.1-alpine + ports: + - 9001:9000 + - 9092:9092 diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/ApplicationWebXml.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/ApplicationWebXml.java new file mode 100644 index 0000000000..2bb237cdb7 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/ApplicationWebXml.java @@ -0,0 +1,21 @@ +package com.baeldung.jhipster.uaa; + +import com.baeldung.jhipster.uaa.config.DefaultProfileUtil; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * This is a helper Java class that provides an alternative to creating a web.xml. + * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc. + */ +public class ApplicationWebXml extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + /** + * set a default to use when no profile is configured. + */ + DefaultProfileUtil.addDefaultProfile(application.application()); + return application.sources(UaaApp.class); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/UaaApp.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/UaaApp.java new file mode 100644 index 0000000000..5ec5ee708d --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/UaaApp.java @@ -0,0 +1,107 @@ +package com.baeldung.jhipster.uaa; + +import com.baeldung.jhipster.uaa.config.ApplicationProperties; +import com.baeldung.jhipster.uaa.config.DefaultProfileUtil; + +import io.github.jhipster.config.JHipsterConstants; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.core.env.Environment; + +import javax.annotation.PostConstruct; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Arrays; +import java.util.Collection; + +@SpringBootApplication +@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class}) +@EnableDiscoveryClient +public class UaaApp { + + private static final Logger log = LoggerFactory.getLogger(UaaApp.class); + + private final Environment env; + + public UaaApp(Environment env) { + this.env = env; + } + + /** + * Initializes uaa. + *

+ * Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile + *

+ * You can find more information on how profiles work with JHipster on https://www.jhipster.tech/profiles/. + */ + @PostConstruct + public void initApplication() { + Collection activeProfiles = Arrays.asList(env.getActiveProfiles()); + if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { + log.error("You have misconfigured your application! It should not run " + + "with both the 'dev' and 'prod' profiles at the same time."); + } + if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)) { + log.error("You have misconfigured your application! It should not " + + "run with both the 'dev' and 'cloud' profiles at the same time."); + } + } + + /** + * Main method, used to run the application. + * + * @param args the command line arguments + */ + public static void main(String[] args) { + SpringApplication app = new SpringApplication(UaaApp.class); + DefaultProfileUtil.addDefaultProfile(app); + Environment env = app.run(args).getEnvironment(); + logApplicationStartup(env); + } + + private static void logApplicationStartup(Environment env) { + String protocol = "http"; + if (env.getProperty("server.ssl.key-store") != null) { + protocol = "https"; + } + String serverPort = env.getProperty("server.port"); + String contextPath = env.getProperty("server.servlet.context-path"); + if (StringUtils.isBlank(contextPath)) { + contextPath = "/"; + } + String hostAddress = "localhost"; + try { + hostAddress = InetAddress.getLocalHost().getHostAddress(); + } catch (UnknownHostException e) { + log.warn("The host name could not be determined, using `localhost` as fallback"); + } + log.info("\n----------------------------------------------------------\n\t" + + "Application '{}' is running! Access URLs:\n\t" + + "Local: \t\t{}://localhost:{}{}\n\t" + + "External: \t{}://{}:{}{}\n\t" + + "Profile(s): \t{}\n----------------------------------------------------------", + env.getProperty("spring.application.name"), + protocol, + serverPort, + contextPath, + protocol, + hostAddress, + serverPort, + contextPath, + env.getActiveProfiles()); + + String configServerStatus = env.getProperty("configserver.status"); + if (configServerStatus == null) { + configServerStatus = "Not found or not setup for this application"; + } + log.info("\n----------------------------------------------------------\n\t" + + "Config Server: \t{}\n----------------------------------------------------------", configServerStatus); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/aop/logging/LoggingAspect.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/aop/logging/LoggingAspect.java new file mode 100644 index 0000000000..c5eacb7b43 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/aop/logging/LoggingAspect.java @@ -0,0 +1,98 @@ +package com.baeldung.jhipster.uaa.aop.logging; + +import io.github.jhipster.config.JHipsterConstants; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.env.Environment; + +import java.util.Arrays; + +/** + * Aspect for logging execution of service and repository Spring components. + * + * By default, it only runs with the "dev" profile. + */ +@Aspect +public class LoggingAspect { + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + private final Environment env; + + public LoggingAspect(Environment env) { + this.env = env; + } + + /** + * Pointcut that matches all repositories, services and Web REST endpoints. + */ + @Pointcut("within(@org.springframework.stereotype.Repository *)" + + " || within(@org.springframework.stereotype.Service *)" + + " || within(@org.springframework.web.bind.annotation.RestController *)") + public void springBeanPointcut() { + // Method is empty as this is just a Pointcut, the implementations are in the advices. + } + + /** + * Pointcut that matches all Spring beans in the application's main packages. + */ + @Pointcut("within(com.baeldung.jhipster.uaa.repository..*)"+ + " || within(com.baeldung.jhipster.uaa.service..*)"+ + " || within(com.baeldung.jhipster.uaa.web.rest..*)") + public void applicationPackagePointcut() { + // Method is empty as this is just a Pointcut, the implementations are in the advices. + } + + /** + * Advice that logs methods throwing exceptions. + * + * @param joinPoint join point for advice + * @param e exception + */ + @AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e") + public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e); + + } else { + log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL"); + } + } + + /** + * Advice that logs when a method is entered and exited. + * + * @param joinPoint join point for advice + * @return result + * @throws Throwable throws IllegalArgumentException + */ + @Around("applicationPackagePointcut() && springBeanPointcut()") + public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { + if (log.isDebugEnabled()) { + log.debug("Enter: {}.{}() with argument[s] = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs())); + } + try { + Object result = joinPoint.proceed(); + if (log.isDebugEnabled()) { + log.debug("Exit: {}.{}() with result = {}", joinPoint.getSignature().getDeclaringTypeName(), + joinPoint.getSignature().getName(), result); + } + return result; + } catch (IllegalArgumentException e) { + log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), + joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName()); + + throw e; + } + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/ApplicationProperties.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/ApplicationProperties.java new file mode 100644 index 0000000000..040bb68b03 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/ApplicationProperties.java @@ -0,0 +1,14 @@ +package com.baeldung.jhipster.uaa.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Properties specific to Uaa. + *

+ * Properties are configured in the application.yml file. + * See {@link io.github.jhipster.config.JHipsterProperties} for a good example. + */ +@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) +public class ApplicationProperties { + +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/AsyncConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/AsyncConfiguration.java new file mode 100644 index 0000000000..ae7982ad84 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/AsyncConfiguration.java @@ -0,0 +1,59 @@ +package com.baeldung.jhipster.uaa.config; + +import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; +import io.github.jhipster.config.JHipsterProperties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.*; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.annotation.SchedulingConfigurer; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; + +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; + +@Configuration +@EnableAsync +@EnableScheduling +public class AsyncConfiguration implements AsyncConfigurer, SchedulingConfigurer { + + private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); + + private final JHipsterProperties jHipsterProperties; + + public AsyncConfiguration(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + } + + @Override + @Bean(name = "taskExecutor") + public Executor getAsyncExecutor() { + log.debug("Creating Async Task Executor"); + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); + executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); + executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); + executor.setThreadNamePrefix("uaa-Executor-"); + return new ExceptionHandlingAsyncTaskExecutor(executor); + } + + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return new SimpleAsyncUncaughtExceptionHandler(); + } + + @Override + public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { + taskRegistrar.setScheduler(scheduledTaskExecutor()); + } + + @Bean + public Executor scheduledTaskExecutor() { + return Executors.newScheduledThreadPool(jHipsterProperties.getAsync().getCorePoolSize()); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CacheConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CacheConfiguration.java new file mode 100644 index 0000000000..c2113b7248 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CacheConfiguration.java @@ -0,0 +1,155 @@ +package com.baeldung.jhipster.uaa.config; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; + +import com.hazelcast.config.*; +import com.hazelcast.core.HazelcastInstance; +import com.hazelcast.core.Hazelcast; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.web.ServerProperties; + +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.cloud.client.serviceregistry.Registration; +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; + +import javax.annotation.PreDestroy; + +@Configuration +@EnableCaching +public class CacheConfiguration { + + private final Logger log = LoggerFactory.getLogger(CacheConfiguration.class); + + private final Environment env; + + private final ServerProperties serverProperties; + + private final DiscoveryClient discoveryClient; + + private Registration registration; + + public CacheConfiguration(Environment env, ServerProperties serverProperties, DiscoveryClient discoveryClient) { + this.env = env; + this.serverProperties = serverProperties; + this.discoveryClient = discoveryClient; + } + + @Autowired(required = false) + public void setRegistration(Registration registration) { + this.registration = registration; + } + + @PreDestroy + public void destroy() { + log.info("Closing Cache Manager"); + Hazelcast.shutdownAll(); + } + + @Bean + public CacheManager cacheManager(HazelcastInstance hazelcastInstance) { + log.debug("Starting HazelcastCacheManager"); + CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance); + return cacheManager; + } + + @Bean + public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties) { + log.debug("Configuring Hazelcast"); + HazelcastInstance hazelCastInstance = Hazelcast.getHazelcastInstanceByName("uaa"); + if (hazelCastInstance != null) { + log.debug("Hazelcast already initialized"); + return hazelCastInstance; + } + Config config = new Config(); + config.setInstanceName("uaa"); + config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); + if (this.registration == null) { + log.warn("No discovery service is set up, Hazelcast cannot create a cluster."); + } else { + // The serviceId is by default the application's name, + // see the "spring.application.name" standard Spring property + String serviceId = registration.getServiceId(); + log.debug("Configuring Hazelcast clustering for instanceId: {}", serviceId); + // In development, everything goes through 127.0.0.1, with a different port + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + log.debug("Application is running with the \"dev\" profile, Hazelcast " + + "cluster will only work with localhost instances"); + + System.setProperty("hazelcast.local.localAddress", "127.0.0.1"); + config.getNetworkConfig().setPort(serverProperties.getPort() + 5701); + config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); + for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { + String clusterMember = "127.0.0.1:" + (instance.getPort() + 5701); + log.debug("Adding Hazelcast (dev) cluster member " + clusterMember); + config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); + } + } else { // Production configuration, one host per instance all using port 5701 + config.getNetworkConfig().setPort(5701); + config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); + for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { + String clusterMember = instance.getHost() + ":5701"; + log.debug("Adding Hazelcast (prod) cluster member " + clusterMember); + config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); + } + } + } + config.getMapConfigs().put("default", initializeDefaultMapConfig(jHipsterProperties)); + + // Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + config.setManagementCenterConfig(initializeDefaultManagementCenterConfig(jHipsterProperties)); + config.getMapConfigs().put("com.baeldung.jhipster.uaa.domain.*", initializeDomainMapConfig(jHipsterProperties)); + return Hazelcast.newHazelcastInstance(config); + } + + private ManagementCenterConfig initializeDefaultManagementCenterConfig(JHipsterProperties jHipsterProperties) { + ManagementCenterConfig managementCenterConfig = new ManagementCenterConfig(); + managementCenterConfig.setEnabled(jHipsterProperties.getCache().getHazelcast().getManagementCenter().isEnabled()); + managementCenterConfig.setUrl(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUrl()); + managementCenterConfig.setUpdateInterval(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUpdateInterval()); + return managementCenterConfig; + } + + private MapConfig initializeDefaultMapConfig(JHipsterProperties jHipsterProperties) { + MapConfig mapConfig = new MapConfig(); + + /* + Number of backups. If 1 is set as the backup-count for example, + then all entries of the map will be copied to another JVM for + fail-safety. Valid numbers are 0 (no backup), 1, 2, 3. + */ + mapConfig.setBackupCount(jHipsterProperties.getCache().getHazelcast().getBackupCount()); + + /* + Valid values are: + NONE (no eviction), + LRU (Least Recently Used), + LFU (Least Frequently Used). + NONE is the default. + */ + mapConfig.setEvictionPolicy(EvictionPolicy.LRU); + + /* + Maximum size of the map. When max size is reached, + map is evicted based on the policy defined. + Any integer between 0 and Integer.MAX_VALUE. 0 means + Integer.MAX_VALUE. Default is 0. + */ + mapConfig.setMaxSizeConfig(new MaxSizeConfig(0, MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE)); + + return mapConfig; + } + + private MapConfig initializeDomainMapConfig(JHipsterProperties jHipsterProperties) { + MapConfig mapConfig = new MapConfig(); + mapConfig.setTimeToLiveSeconds(jHipsterProperties.getCache().getHazelcast().getTimeToLiveSeconds()); + return mapConfig; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CloudDatabaseConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CloudDatabaseConfiguration.java new file mode 100644 index 0000000000..397e571b64 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/CloudDatabaseConfiguration.java @@ -0,0 +1,24 @@ +package com.baeldung.jhipster.uaa.config; + +import io.github.jhipster.config.JHipsterConstants; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.CacheManager; +import org.springframework.cloud.config.java.AbstractCloudConfig; +import org.springframework.context.annotation.*; + +import javax.sql.DataSource; + +@Configuration +@Profile(JHipsterConstants.SPRING_PROFILE_CLOUD) +public class CloudDatabaseConfiguration extends AbstractCloudConfig { + + private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class); + + @Bean + public DataSource dataSource(CacheManager cacheManager) { + log.info("Configuring JDBC datasource from a cloud provider"); + return connectionFactory().dataSource(); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/Constants.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/Constants.java new file mode 100644 index 0000000000..b9e3af4abf --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/Constants.java @@ -0,0 +1,17 @@ +package com.baeldung.jhipster.uaa.config; + +/** + * Application constants. + */ +public final class Constants { + + // Regex for acceptable logins + public static final String LOGIN_REGEX = "^[_.@A-Za-z0-9-]*$"; + + public static final String SYSTEM_ACCOUNT = "system"; + public static final String ANONYMOUS_USER = "anonymoususer"; + public static final String DEFAULT_LANGUAGE = "en"; + + private Constants() { + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DatabaseConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DatabaseConfiguration.java new file mode 100644 index 0000000000..7cd6c3c635 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DatabaseConfiguration.java @@ -0,0 +1,39 @@ +package com.baeldung.jhipster.uaa.config; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.h2.H2ConfigurationHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; + +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import java.sql.SQLException; + +@Configuration +@EnableJpaRepositories("com.baeldung.jhipster.uaa.repository") +@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") +@EnableTransactionManagement +public class DatabaseConfiguration { + + private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); + + + /** + * Open the TCP port for the H2 database, so it is available remotely. + * + * @return the H2 database TCP server + * @throws SQLException if the server failed to start + */ + @Bean(initMethod = "start", destroyMethod = "stop") + @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) + public Object h2TCPServer() throws SQLException { + log.debug("Starting H2 database"); + return H2ConfigurationHelper.createServer(); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DateTimeFormatConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DateTimeFormatConfiguration.java new file mode 100644 index 0000000000..67449284e1 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DateTimeFormatConfiguration.java @@ -0,0 +1,20 @@ +package com.baeldung.jhipster.uaa.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * Configure the converters to use the ISO format for dates by default. + */ +@Configuration +public class DateTimeFormatConfiguration implements WebMvcConfigurer { + + @Override + public void addFormatters(FormatterRegistry registry) { + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setUseIsoFormat(true); + registrar.registerFormatters(registry); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DefaultProfileUtil.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DefaultProfileUtil.java new file mode 100644 index 0000000000..6b4345c832 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/DefaultProfileUtil.java @@ -0,0 +1,51 @@ +package com.baeldung.jhipster.uaa.config; + +import io.github.jhipster.config.JHipsterConstants; + +import org.springframework.boot.SpringApplication; +import org.springframework.core.env.Environment; + +import java.util.*; + +/** + * Utility class to load a Spring profile to be used as default + * when there is no spring.profiles.active set in the environment or as command line argument. + * If the value is not available in application.yml then dev profile will be used as default. + */ +public final class DefaultProfileUtil { + + private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default"; + + private DefaultProfileUtil() { + } + + /** + * Set a default to use when no profile is configured. + * + * @param app the Spring application + */ + public static void addDefaultProfile(SpringApplication app) { + Map defProperties = new HashMap<>(); + /* + * The default profile to use when no other profiles are defined + * This cannot be set in the application.yml file. + * See https://github.com/spring-projects/spring-boot/issues/1219 + */ + defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); + app.setDefaultProperties(defProperties); + } + + /** + * Get the profiles that are applied else get default profiles. + * + * @param env spring environment + * @return profiles + */ + public static String[] getActiveProfiles(Environment env) { + String[] profiles = env.getActiveProfiles(); + if (profiles.length == 0) { + return env.getDefaultProfiles(); + } + return profiles; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/JacksonConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/JacksonConfiguration.java new file mode 100644 index 0000000000..1e596c1728 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/JacksonConfiguration.java @@ -0,0 +1,63 @@ +package com.baeldung.jhipster.uaa.config; + +import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.module.afterburner.AfterburnerModule; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.zalando.problem.ProblemModule; +import org.zalando.problem.violations.ConstraintViolationProblemModule; + +@Configuration +public class JacksonConfiguration { + + /** + * Support for Java date and time API. + * @return the corresponding Jackson module. + */ + @Bean + public JavaTimeModule javaTimeModule() { + return new JavaTimeModule(); + } + + @Bean + public Jdk8Module jdk8TimeModule() { + return new Jdk8Module(); + } + + + /* + * Support for Hibernate types in Jackson. + */ + @Bean + public Hibernate5Module hibernate5Module() { + return new Hibernate5Module(); + } + + /* + * Jackson Afterburner module to speed up serialization/deserialization. + */ + @Bean + public AfterburnerModule afterburnerModule() { + return new AfterburnerModule(); + } + + /* + * Module for serialization/deserialization of RFC7807 Problem. + */ + @Bean + ProblemModule problemModule() { + return new ProblemModule(); + } + + /* + * Module for serialization/deserialization of ConstraintViolationProblem. + */ + @Bean + ConstraintViolationProblemModule constraintViolationProblemModule() { + return new ConstraintViolationProblemModule(); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LiquibaseConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LiquibaseConfiguration.java new file mode 100644 index 0000000000..393f377062 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LiquibaseConfiguration.java @@ -0,0 +1,53 @@ +package com.baeldung.jhipster.uaa.config; + +import javax.sql.DataSource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.core.task.TaskExecutor; + +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.liquibase.AsyncSpringLiquibase; +import liquibase.integration.spring.SpringLiquibase; + +@Configuration +public class LiquibaseConfiguration { + + private final Logger log = LoggerFactory.getLogger(LiquibaseConfiguration.class); + + private final Environment env; + + private final CacheManager cacheManager; + + public LiquibaseConfiguration(Environment env, CacheManager cacheManager) { + this.env = env; + this.cacheManager = cacheManager; + } + + @Bean + public SpringLiquibase liquibase(@Qualifier("taskExecutor") TaskExecutor taskExecutor, + DataSource dataSource, LiquibaseProperties liquibaseProperties) { + + // Use liquibase.integration.spring.SpringLiquibase if you don't want Liquibase to start asynchronously + SpringLiquibase liquibase = new AsyncSpringLiquibase(taskExecutor, env); + liquibase.setDataSource(dataSource); + liquibase.setChangeLog("classpath:config/liquibase/master.xml"); + liquibase.setContexts(liquibaseProperties.getContexts()); + liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema()); + liquibase.setDropFirst(liquibaseProperties.isDropFirst()); + liquibase.setChangeLogParameters(liquibaseProperties.getParameters()); + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE)) { + liquibase.setShouldRun(false); + } else { + liquibase.setShouldRun(liquibaseProperties.isEnabled()); + log.debug("Configuring Liquibase"); + } + return liquibase; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LocaleConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LocaleConfiguration.java new file mode 100644 index 0000000000..0ae32aaf1d --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LocaleConfiguration.java @@ -0,0 +1,27 @@ +package com.baeldung.jhipster.uaa.config; + +import io.github.jhipster.config.locale.AngularCookieLocaleResolver; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.LocaleResolver; +import org.springframework.web.servlet.config.annotation.*; +import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; + +@Configuration +public class LocaleConfiguration implements WebMvcConfigurer { + + @Bean(name = "localeResolver") + public LocaleResolver localeResolver() { + AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); + cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); + return cookieLocaleResolver; + } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); + localeChangeInterceptor.setParamName("language"); + registry.addInterceptor(localeChangeInterceptor); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingAspectConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingAspectConfiguration.java new file mode 100644 index 0000000000..b0206bfea2 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingAspectConfiguration.java @@ -0,0 +1,19 @@ +package com.baeldung.jhipster.uaa.config; + +import com.baeldung.jhipster.uaa.aop.logging.LoggingAspect; + +import io.github.jhipster.config.JHipsterConstants; + +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; + +@Configuration +@EnableAspectJAutoProxy +public class LoggingAspectConfiguration { + + @Bean + @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) + public LoggingAspect loggingAspect(Environment env) { + return new LoggingAspect(env); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingConfiguration.java new file mode 100644 index 0000000000..dfef38f67d --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/LoggingConfiguration.java @@ -0,0 +1,163 @@ +package com.baeldung.jhipster.uaa.config; + +import java.net.InetSocketAddress; +import java.util.Iterator; + +import io.github.jhipster.config.JHipsterProperties; + +import ch.qos.logback.classic.AsyncAppender; +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.boolex.OnMarkerEvaluator; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.LoggerContextListener; +import ch.qos.logback.core.Appender; +import ch.qos.logback.core.filter.EvaluatorFilter; +import ch.qos.logback.core.spi.ContextAwareBase; +import ch.qos.logback.core.spi.FilterReply; +import net.logstash.logback.appender.LogstashTcpSocketAppender; +import net.logstash.logback.encoder.LogstashEncoder; +import net.logstash.logback.stacktrace.ShortenedThrowableConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.context.annotation.Configuration; + +@Configuration +@RefreshScope +public class LoggingConfiguration { + + private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH"; + + private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH"; + + private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class); + + private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + + private final String appName; + + private final String serverPort; + + private final String version; + + private final JHipsterProperties jHipsterProperties; + + public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, + @Value("${info.project.version:}") String version, JHipsterProperties jHipsterProperties) { + this.appName = appName; + this.serverPort = serverPort; + this.version = version; + this.jHipsterProperties = jHipsterProperties; + if (jHipsterProperties.getLogging().getLogstash().isEnabled()) { + addLogstashAppender(context); + addContextListener(context); + } + if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { + setMetricsMarkerLogbackFilter(context); + } + } + + private void addContextListener(LoggerContext context) { + LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener(); + loggerContextListener.setContext(context); + context.addListener(loggerContextListener); + } + + private void addLogstashAppender(LoggerContext context) { + log.info("Initializing Logstash logging"); + + LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender(); + logstashAppender.setName(LOGSTASH_APPENDER_NAME); + logstashAppender.setContext(context); + String optionalFields = ""; + String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"," + + optionalFields + "\"version\":\"" + version + "\"}"; + + // More documentation is available at: https://github.com/logstash/logstash-logback-encoder + LogstashEncoder logstashEncoder = new LogstashEncoder(); + // Set the Logstash appender config from JHipster properties + logstashEncoder.setCustomFields(customFields); + // Set the Logstash appender config from JHipster properties + logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(), jHipsterProperties.getLogging().getLogstash().getPort())); + + ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter(); + throwableConverter.setRootCauseFirst(true); + logstashEncoder.setThrowableConverter(throwableConverter); + logstashEncoder.setCustomFields(customFields); + + logstashAppender.setEncoder(logstashEncoder); + logstashAppender.start(); + + // Wrap the appender in an Async appender for performance + AsyncAppender asyncLogstashAppender = new AsyncAppender(); + asyncLogstashAppender.setContext(context); + asyncLogstashAppender.setName(ASYNC_LOGSTASH_APPENDER_NAME); + asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize()); + asyncLogstashAppender.addAppender(logstashAppender); + asyncLogstashAppender.start(); + + context.getLogger("ROOT").addAppender(asyncLogstashAppender); + } + + // Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender + private void setMetricsMarkerLogbackFilter(LoggerContext context) { + log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME); + OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator(); + onMarkerMetricsEvaluator.setContext(context); + onMarkerMetricsEvaluator.addMarker("metrics"); + onMarkerMetricsEvaluator.start(); + EvaluatorFilter metricsFilter = new EvaluatorFilter<>(); + metricsFilter.setContext(context); + metricsFilter.setEvaluator(onMarkerMetricsEvaluator); + metricsFilter.setOnMatch(FilterReply.DENY); + metricsFilter.start(); + + for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) { + for (Iterator> it = logger.iteratorForAppenders(); it.hasNext();) { + Appender appender = it.next(); + if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) { + log.debug("Filter metrics logs from the {} appender", appender.getName()); + appender.setContext(context); + appender.addFilter(metricsFilter); + appender.start(); + } + } + } + } + + /** + * Logback configuration is achieved by configuration file and API. + * When configuration file change is detected, the configuration is reset. + * This listener ensures that the programmatic configuration is also re-applied after reset. + */ + class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener { + + @Override + public boolean isResetResistant() { + return true; + } + + @Override + public void onStart(LoggerContext context) { + addLogstashAppender(context); + } + + @Override + public void onReset(LoggerContext context) { + addLogstashAppender(context); + } + + @Override + public void onStop(LoggerContext context) { + // Nothing to do. + } + + @Override + public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) { + // Nothing to do. + } + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/MetricsConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/MetricsConfiguration.java new file mode 100644 index 0000000000..4f98d0a3f1 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/MetricsConfiguration.java @@ -0,0 +1,99 @@ +package com.baeldung.jhipster.uaa.config; + +import io.github.jhipster.config.JHipsterProperties; + +import com.codahale.metrics.JmxReporter; +import com.codahale.metrics.JvmAttributeGaugeSet; +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.Slf4jReporter; +import com.codahale.metrics.health.HealthCheckRegistry; +import com.codahale.metrics.jvm.*; +import com.ryantenney.metrics.spring.config.annotation.EnableMetrics; +import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter; +import com.zaxxer.hikari.HikariDataSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.*; + +import javax.annotation.PostConstruct; +import java.lang.management.ManagementFactory; +import java.util.concurrent.TimeUnit; + +@Configuration +@EnableMetrics(proxyTargetClass = true) +public class MetricsConfiguration extends MetricsConfigurerAdapter { + + private static final String PROP_METRIC_REG_JVM_MEMORY = "jvm.memory"; + private static final String PROP_METRIC_REG_JVM_GARBAGE = "jvm.garbage"; + private static final String PROP_METRIC_REG_JVM_THREADS = "jvm.threads"; + private static final String PROP_METRIC_REG_JVM_FILES = "jvm.files"; + private static final String PROP_METRIC_REG_JVM_BUFFERS = "jvm.buffers"; + private static final String PROP_METRIC_REG_JVM_ATTRIBUTE_SET = "jvm.attributes"; + + private final Logger log = LoggerFactory.getLogger(MetricsConfiguration.class); + + private MetricRegistry metricRegistry = new MetricRegistry(); + + private HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); + + private final JHipsterProperties jHipsterProperties; + + private HikariDataSource hikariDataSource; + + public MetricsConfiguration(JHipsterProperties jHipsterProperties) { + this.jHipsterProperties = jHipsterProperties; + } + + @Autowired(required = false) + public void setHikariDataSource(HikariDataSource hikariDataSource) { + this.hikariDataSource = hikariDataSource; + } + + @Override + @Bean + public MetricRegistry getMetricRegistry() { + return metricRegistry; + } + + @Override + @Bean + public HealthCheckRegistry getHealthCheckRegistry() { + return healthCheckRegistry; + } + + @PostConstruct + public void init() { + log.debug("Registering JVM gauges"); + metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet()); + metricRegistry.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge()); + metricRegistry.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); + metricRegistry.register(PROP_METRIC_REG_JVM_ATTRIBUTE_SET, new JvmAttributeGaugeSet()); + if (hikariDataSource != null) { + log.debug("Monitoring the datasource"); + // remove the factory created by HikariDataSourceMetricsPostProcessor until JHipster migrate to Micrometer + hikariDataSource.setMetricsTrackerFactory(null); + hikariDataSource.setMetricRegistry(metricRegistry); + } + if (jHipsterProperties.getMetrics().getJmx().isEnabled()) { + log.debug("Initializing Metrics JMX reporting"); + JmxReporter jmxReporter = JmxReporter.forRegistry(metricRegistry).build(); + jmxReporter.start(); + } + if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { + log.info("Initializing Metrics Log reporting"); + Marker metricsMarker = MarkerFactory.getMarker("metrics"); + final Slf4jReporter reporter = Slf4jReporter.forRegistry(metricRegistry) + .outputTo(LoggerFactory.getLogger("metrics")) + .markWith(metricsMarker) + .convertRatesTo(TimeUnit.SECONDS) + .convertDurationsTo(TimeUnit.MILLISECONDS) + .build(); + reporter.start(jHipsterProperties.getMetrics().getLogs().getReportFrequency(), TimeUnit.SECONDS); + } + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaConfiguration.java new file mode 100644 index 0000000000..ce1ab5326c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaConfiguration.java @@ -0,0 +1,193 @@ +package com.baeldung.jhipster.uaa.config; + +import com.baeldung.jhipster.uaa.security.AuthoritiesConstants; +import io.github.jhipster.config.JHipsterProperties; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.ClassPathResource; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; +import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; +import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; +import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; +import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer; +import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer; +import org.springframework.security.oauth2.provider.token.TokenEnhancer; +import org.springframework.security.oauth2.provider.token.TokenEnhancerChain; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; +import org.springframework.security.oauth2.provider.token.store.KeyStoreKeyFactory; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.web.filter.CorsFilter; + +import javax.servlet.http.HttpServletResponse; +import java.security.KeyPair; +import java.util.ArrayList; +import java.util.Collection; + +@Configuration +@EnableAuthorizationServer +public class UaaConfiguration extends AuthorizationServerConfigurerAdapter implements ApplicationContextAware { + /** + * Access tokens will not expire any earlier than this. + */ + private static final int MIN_ACCESS_TOKEN_VALIDITY_SECS = 60; + + private ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } + + @EnableResourceServer + public static class ResourceServerConfiguration extends ResourceServerConfigurerAdapter { + + private final TokenStore tokenStore; + + private final JHipsterProperties jHipsterProperties; + + private final CorsFilter corsFilter; + + public ResourceServerConfiguration(TokenStore tokenStore, JHipsterProperties jHipsterProperties, CorsFilter corsFilter) { + this.tokenStore = tokenStore; + this.jHipsterProperties = jHipsterProperties; + this.corsFilter = corsFilter; + } + + @Override + public void configure(HttpSecurity http) throws Exception { + http + .exceptionHandling() + .authenticationEntryPoint((request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED)) + .and() + .csrf() + .disable() + .addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class) + .headers() + .frameOptions() + .disable() + .and() + .sessionManagement() + .sessionCreationPolicy(SessionCreationPolicy.STATELESS) + .and() + .authorizeRequests() + .antMatchers("/api/register").permitAll() + .antMatchers("/api/activate").permitAll() + .antMatchers("/api/authenticate").permitAll() + .antMatchers("/api/account/reset-password/init").permitAll() + .antMatchers("/api/account/reset-password/finish").permitAll() + .antMatchers("/api/**").authenticated() + .antMatchers("/management/health").permitAll() + .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN) + .antMatchers("/v2/api-docs/**").permitAll() + .antMatchers("/swagger-resources/configuration/ui").permitAll() + .antMatchers("/swagger-ui/index.html").hasAuthority(AuthoritiesConstants.ADMIN); + } + + @Override + public void configure(ResourceServerSecurityConfigurer resources) throws Exception { + resources.resourceId("jhipster-uaa").tokenStore(tokenStore); + } + } + + private final JHipsterProperties jHipsterProperties; + + private final UaaProperties uaaProperties; + + private final PasswordEncoder passwordEncoder; + + public UaaConfiguration(JHipsterProperties jHipsterProperties, UaaProperties uaaProperties, PasswordEncoder passwordEncoder) { + this.jHipsterProperties = jHipsterProperties; + this.uaaProperties = uaaProperties; + this.passwordEncoder = passwordEncoder; + } + + @Override + public void configure(ClientDetailsServiceConfigurer clients) throws Exception { + int accessTokenValidity = uaaProperties.getWebClientConfiguration().getAccessTokenValidityInSeconds(); + accessTokenValidity = Math.max(accessTokenValidity, MIN_ACCESS_TOKEN_VALIDITY_SECS); + int refreshTokenValidity = uaaProperties.getWebClientConfiguration().getRefreshTokenValidityInSecondsForRememberMe(); + refreshTokenValidity = Math.max(refreshTokenValidity, accessTokenValidity); + /* + For a better client design, this should be done by a ClientDetailsService (similar to UserDetailsService). + */ + clients.inMemory() + .withClient(uaaProperties.getWebClientConfiguration().getClientId()) + .secret(passwordEncoder.encode(uaaProperties.getWebClientConfiguration().getSecret())) + .scopes("openid") + .autoApprove(true) + .authorizedGrantTypes("implicit","refresh_token", "password", "authorization_code") + .accessTokenValiditySeconds(accessTokenValidity) + .refreshTokenValiditySeconds(refreshTokenValidity) + .and() + .withClient(jHipsterProperties.getSecurity().getClientAuthorization().getClientId()) + .secret(passwordEncoder.encode(jHipsterProperties.getSecurity().getClientAuthorization().getClientSecret())) + .scopes("web-app") + .authorities("ROLE_ADMIN") + .autoApprove(true) + .authorizedGrantTypes("client_credentials") + .accessTokenValiditySeconds((int) jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds()) + .refreshTokenValiditySeconds((int) jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSecondsForRememberMe()); + } + + @Override + public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { + //pick up all TokenEnhancers incl. those defined in the application + //this avoids changes to this class if an application wants to add its own to the chain + Collection tokenEnhancers = applicationContext.getBeansOfType(TokenEnhancer.class).values(); + TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain(); + tokenEnhancerChain.setTokenEnhancers(new ArrayList<>(tokenEnhancers)); + endpoints + .authenticationManager(authenticationManager) + .tokenStore(tokenStore()) + .tokenEnhancer(tokenEnhancerChain) + .reuseRefreshTokens(false); //don't reuse or we will run into session inactivity timeouts + } + + @Autowired + @Qualifier("authenticationManagerBean") + private AuthenticationManager authenticationManager; + + /** + * Apply the token converter (and enhancer) for token store. + * @return the JwtTokenStore managing the tokens. + */ + @Bean + public JwtTokenStore tokenStore() { + return new JwtTokenStore(jwtAccessTokenConverter()); + } + + /** + * This bean generates an token enhancer, which manages the exchange between JWT acces tokens and Authentication + * in both directions. + * + * @return an access token converter configured with the authorization server's public/private keys + */ + @Bean + public JwtAccessTokenConverter jwtAccessTokenConverter() { + JwtAccessTokenConverter converter = new JwtAccessTokenConverter(); + KeyPair keyPair = new KeyStoreKeyFactory( + new ClassPathResource(uaaProperties.getKeyStore().getName()), uaaProperties.getKeyStore().getPassword().toCharArray()) + .getKeyPair(uaaProperties.getKeyStore().getAlias()); + converter.setKeyPair(keyPair); + return converter; + } + + @Override + public void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception { + oauthServer.tokenKeyAccess("permitAll()").checkTokenAccess( + "isAuthenticated()"); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaProperties.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaProperties.java new file mode 100644 index 0000000000..00fb4d28f9 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaProperties.java @@ -0,0 +1,100 @@ +package com.baeldung.jhipster.uaa.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * Properties for UAA-based OAuth2 security. + */ +@Component +@ConfigurationProperties(prefix = "uaa", ignoreUnknownFields = false) +public class UaaProperties { + private KeyStore keyStore = new KeyStore(); + + public KeyStore getKeyStore() { + return keyStore; + } + + private WebClientConfiguration webClientConfiguration = new WebClientConfiguration(); + + public WebClientConfiguration getWebClientConfiguration() { + return webClientConfiguration; + } + + /** + * Keystore configuration for signing and verifying JWT tokens. + */ + public static class KeyStore { + //name of the keystore in the classpath + private String name = "config/tls/keystore.p12"; + //password used to access the key + private String password = "password"; + //name of the alias to fetch + private String alias = "selfsigned"; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + } + + public static class WebClientConfiguration { + //validity of the short-lived access token in secs (min: 60), don't make it too long + private int accessTokenValidityInSeconds = 5 * 60; + //validity of the refresh token in secs (defines the duration of "remember me") + private int refreshTokenValidityInSecondsForRememberMe = 7 * 24 * 60 * 60; + private String clientId = "web_app"; + private String secret = "changeit"; + + public int getAccessTokenValidityInSeconds() { + return accessTokenValidityInSeconds; + } + + public void setAccessTokenValidityInSeconds(int accessTokenValidityInSeconds) { + this.accessTokenValidityInSeconds = accessTokenValidityInSeconds; + } + + public int getRefreshTokenValidityInSecondsForRememberMe() { + return refreshTokenValidityInSecondsForRememberMe; + } + + public void setRefreshTokenValidityInSecondsForRememberMe(int refreshTokenValidityInSecondsForRememberMe) { + this.refreshTokenValidityInSecondsForRememberMe = refreshTokenValidityInSecondsForRememberMe; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaWebSecurityConfiguration.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaWebSecurityConfiguration.java new file mode 100644 index 0000000000..865eef9107 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/UaaWebSecurityConfiguration.java @@ -0,0 +1,72 @@ +package com.baeldung.jhipster.uaa.config; + +import org.springframework.beans.factory.BeanInitializationException; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.WebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.data.repository.query.SecurityEvaluationContextExtension; + +import javax.annotation.PostConstruct; + +@Configuration +@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) +public class UaaWebSecurityConfiguration extends WebSecurityConfigurerAdapter { + + private final UserDetailsService userDetailsService; + + private final AuthenticationManagerBuilder authenticationManagerBuilder; + + public UaaWebSecurityConfiguration(UserDetailsService userDetailsService, AuthenticationManagerBuilder authenticationManagerBuilder) { + this.userDetailsService = userDetailsService; + this.authenticationManagerBuilder = authenticationManagerBuilder; + } + + @PostConstruct + public void init() throws Exception { + try { + authenticationManagerBuilder + .userDetailsService(userDetailsService) + .passwordEncoder(passwordEncoder()); + } catch (Exception e) { + throw new BeanInitializationException("Security configuration failed", e); + } + } + + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + @Override + @Bean + public AuthenticationManager authenticationManagerBean() throws Exception { + return super.authenticationManagerBean(); + } + + @Override + public void configure(WebSecurity web) throws Exception { + web.ignoring() + .antMatchers(HttpMethod.OPTIONS, "/**") + .antMatchers("/app/**/*.{js,html}") + .antMatchers("/bower_components/**") + .antMatchers("/i18n/**") + .antMatchers("/content/**") + .antMatchers("/swagger-ui/index.html") + .antMatchers("/test/**") + .antMatchers("/h2-console/**"); + } + + @Bean + public SecurityEvaluationContextExtension securityEvaluationContextExtension() { + return new SecurityEvaluationContextExtension(); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/WebConfigurer.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/WebConfigurer.java new file mode 100644 index 0000000000..5ff65e9da8 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/WebConfigurer.java @@ -0,0 +1,148 @@ +package com.baeldung.jhipster.uaa.config; + +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.servlet.InstrumentedFilter; +import com.codahale.metrics.servlets.MetricsServlet; +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; +import io.github.jhipster.config.h2.H2ConfigurationHelper; +import io.undertow.UndertowOptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.*; +import org.springframework.boot.web.servlet.ServletContextInitializer; +import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.http.MediaType; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import javax.servlet.*; +import java.nio.charset.StandardCharsets; +import java.util.*; + + +/** + * Configuration of web application with Servlet 3.0 APIs. + */ +@Configuration +public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer { + + private final Logger log = LoggerFactory.getLogger(WebConfigurer.class); + + private final Environment env; + + private final JHipsterProperties jHipsterProperties; + + private MetricRegistry metricRegistry; + + public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) { + + this.env = env; + this.jHipsterProperties = jHipsterProperties; + } + + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + if (env.getActiveProfiles().length != 0) { + log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); + } + EnumSet disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC); + initMetrics(servletContext, disps); + if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { + initH2Console(servletContext); + } + log.info("Web application fully configured"); + } + + /** + * Customize the Servlet engine: Mime types, the document root, the cache. + */ + @Override + public void customize(WebServerFactory server) { + setMimeMappings(server); + + /* + * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288 + * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1. + * See the JHipsterProperties class and your application-*.yml configuration files + * for more information. + */ + if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && + server instanceof UndertowServletWebServerFactory) { + + ((UndertowServletWebServerFactory) server) + .addBuilderCustomizers(builder -> + builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)); + } + } + + private void setMimeMappings(WebServerFactory server) { + if (server instanceof ConfigurableServletWebServerFactory) { + MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); + // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711 + mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); + // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64 + mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); + ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; + servletWebServer.setMimeMappings(mappings); + } + } + + /** + * Initializes Metrics. + */ + private void initMetrics(ServletContext servletContext, EnumSet disps) { + log.debug("Initializing Metrics registries"); + servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, + metricRegistry); + servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, + metricRegistry); + + log.debug("Registering Metrics Filter"); + FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter", + new InstrumentedFilter()); + + metricsFilter.addMappingForUrlPatterns(disps, true, "/*"); + metricsFilter.setAsyncSupported(true); + + log.debug("Registering Metrics Servlet"); + ServletRegistration.Dynamic metricsAdminServlet = + servletContext.addServlet("metricsServlet", new MetricsServlet()); + + metricsAdminServlet.addMapping("/management/metrics/*"); + metricsAdminServlet.setAsyncSupported(true); + metricsAdminServlet.setLoadOnStartup(2); + } + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = jHipsterProperties.getCors(); + if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { + log.debug("Registering CORS filter"); + source.registerCorsConfiguration("/api/**", config); + source.registerCorsConfiguration("/management/**", config); + source.registerCorsConfiguration("/v2/api-docs", config); + } + return new CorsFilter(source); + } + + /** + * Initializes H2 console. + */ + private void initH2Console(ServletContext servletContext) { + log.debug("Initialize H2 console"); + H2ConfigurationHelper.initH2Console(servletContext); + } + + @Autowired(required = false) + public void setMetricRegistry(MetricRegistry metricRegistry) { + this.metricRegistry = metricRegistry; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/AuditEventConverter.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/AuditEventConverter.java new file mode 100644 index 0000000000..e5e6971bfc --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/AuditEventConverter.java @@ -0,0 +1,86 @@ +package com.baeldung.jhipster.uaa.config.audit; + +import com.baeldung.jhipster.uaa.domain.PersistentAuditEvent; + +import org.springframework.boot.actuate.audit.AuditEvent; +import org.springframework.security.web.authentication.WebAuthenticationDetails; +import org.springframework.stereotype.Component; + +import java.util.*; + +@Component +public class AuditEventConverter { + + /** + * Convert a list of PersistentAuditEvent to a list of AuditEvent + * + * @param persistentAuditEvents the list to convert + * @return the converted list. + */ + public List convertToAuditEvent(Iterable persistentAuditEvents) { + if (persistentAuditEvents == null) { + return Collections.emptyList(); + } + List auditEvents = new ArrayList<>(); + for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) { + auditEvents.add(convertToAuditEvent(persistentAuditEvent)); + } + return auditEvents; + } + + /** + * Convert a PersistentAuditEvent to an AuditEvent + * + * @param persistentAuditEvent the event to convert + * @return the converted list. + */ + public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) { + if (persistentAuditEvent == null) { + return null; + } + return new AuditEvent(persistentAuditEvent.getAuditEventDate(), persistentAuditEvent.getPrincipal(), + persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData())); + } + + /** + * Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface + * + * @param data the data to convert + * @return a map of String, Object + */ + public Map convertDataToObjects(Map data) { + Map results = new HashMap<>(); + + if (data != null) { + for (Map.Entry entry : data.entrySet()) { + results.put(entry.getKey(), entry.getValue()); + } + } + return results; + } + + /** + * Internal conversion. This method will allow to save additional data. + * By default, it will save the object as string + * + * @param data the data to convert + * @return a map of String, String + */ + public Map convertDataToStrings(Map data) { + Map results = new HashMap<>(); + + if (data != null) { + for (Map.Entry entry : data.entrySet()) { + // Extract the data that will be saved. + if (entry.getValue() instanceof WebAuthenticationDetails) { + WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) entry.getValue(); + results.put("remoteAddress", authenticationDetails.getRemoteAddress()); + results.put("sessionId", authenticationDetails.getSessionId()); + } else { + results.put(entry.getKey(), Objects.toString(entry.getValue())); + } + } + } + return results; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/package-info.java new file mode 100644 index 0000000000..c39bf76a2c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/audit/package-info.java @@ -0,0 +1,4 @@ +/** + * Audit specific code. + */ +package com.baeldung.jhipster.uaa.config.audit; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/package-info.java new file mode 100644 index 0000000000..bf6af99d80 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/config/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Framework configuration files. + */ +package com.baeldung.jhipster.uaa.config; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/AbstractAuditingEntity.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/AbstractAuditingEntity.java new file mode 100644 index 0000000000..919af9be23 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/AbstractAuditingEntity.java @@ -0,0 +1,79 @@ +package com.baeldung.jhipster.uaa.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.hibernate.envers.Audited; +import org.springframework.data.annotation.CreatedBy; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedBy; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import java.io.Serializable; +import java.time.Instant; +import javax.persistence.Column; +import javax.persistence.EntityListeners; +import javax.persistence.MappedSuperclass; + +/** + * Base abstract class for entities which will hold definitions for created, last modified by and created, + * last modified by date. + */ +@MappedSuperclass +@Audited +@EntityListeners(AuditingEntityListener.class) +public abstract class AbstractAuditingEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @CreatedBy + @Column(name = "created_by", nullable = false, length = 50, updatable = false) + @JsonIgnore + private String createdBy; + + @CreatedDate + @Column(name = "created_date", nullable = false, updatable = false) + @JsonIgnore + private Instant createdDate = Instant.now(); + + @LastModifiedBy + @Column(name = "last_modified_by", length = 50) + @JsonIgnore + private String lastModifiedBy; + + @LastModifiedDate + @Column(name = "last_modified_date") + @JsonIgnore + private Instant lastModifiedDate = Instant.now(); + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Instant getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Instant createdDate) { + this.createdDate = createdDate; + } + + public String getLastModifiedBy() { + return lastModifiedBy; + } + + public void setLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + public Instant getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Instant lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/Authority.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/Authority.java new file mode 100644 index 0000000000..ea7159a57f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/Authority.java @@ -0,0 +1,62 @@ +package com.baeldung.jhipster.uaa.domain; + +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Column; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + * An authority (a security role) used by Spring Security. + */ +@Entity +@Table(name = "jhi_authority") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +public class Authority implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotNull + @Size(max = 50) + @Id + @Column(length = 50) + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Authority authority = (Authority) o; + + return !(name != null ? !name.equals(authority.name) : authority.name != null); + } + + @Override + public int hashCode() { + return name != null ? name.hashCode() : 0; + } + + @Override + public String toString() { + return "Authority{" + + "name='" + name + '\'' + + "}"; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/PersistentAuditEvent.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/PersistentAuditEvent.java new file mode 100644 index 0000000000..af232b1a40 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/PersistentAuditEvent.java @@ -0,0 +1,81 @@ +package com.baeldung.jhipster.uaa.domain; + +import javax.persistence.*; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; + +/** + * Persist AuditEvent managed by the Spring Boot actuator. + * + * @see org.springframework.boot.actuate.audit.AuditEvent + */ +@Entity +@Table(name = "jhi_persistent_audit_event") +public class PersistentAuditEvent implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "event_id") + private Long id; + + @NotNull + @Column(nullable = false) + private String principal; + + @Column(name = "event_date") + private Instant auditEventDate; + + @Column(name = "event_type") + private String auditEventType; + + @ElementCollection + @MapKeyColumn(name = "name") + @Column(name = "value") + @CollectionTable(name = "jhi_persistent_audit_evt_data", joinColumns=@JoinColumn(name="event_id")) + private Map data = new HashMap<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPrincipal() { + return principal; + } + + public void setPrincipal(String principal) { + this.principal = principal; + } + + public Instant getAuditEventDate() { + return auditEventDate; + } + + public void setAuditEventDate(Instant auditEventDate) { + this.auditEventDate = auditEventDate; + } + + public String getAuditEventType() { + return auditEventType; + } + + public void setAuditEventType(String auditEventType) { + this.auditEventType = auditEventType; + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/User.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/User.java new file mode 100644 index 0000000000..3c5e7ffd2b --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/User.java @@ -0,0 +1,233 @@ +package com.baeldung.jhipster.uaa.domain; + +import com.baeldung.jhipster.uaa.config.Constants; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.apache.commons.lang3.StringUtils; +import org.hibernate.annotations.BatchSize; +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; +import javax.validation.constraints.Email; + +import javax.persistence.*; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Locale; +import java.util.Objects; +import java.util.Set; +import java.time.Instant; + +/** + * A user. + */ +@Entity +@Table(name = "jhi_user") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +public class User extends AbstractAuditingEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @NotNull + @Pattern(regexp = Constants.LOGIN_REGEX) + @Size(min = 1, max = 50) + @Column(length = 50, unique = true, nullable = false) + private String login; + + @JsonIgnore + @NotNull + @Size(min = 60, max = 60) + @Column(name = "password_hash", length = 60, nullable = false) + private String password; + + @Size(max = 50) + @Column(name = "first_name", length = 50) + private String firstName; + + @Size(max = 50) + @Column(name = "last_name", length = 50) + private String lastName; + + @Email + @Size(min = 5, max = 254) + @Column(length = 254, unique = true) + private String email; + + @NotNull + @Column(nullable = false) + private boolean activated = false; + + @Size(min = 2, max = 6) + @Column(name = "lang_key", length = 6) + private String langKey; + + @Size(max = 256) + @Column(name = "image_url", length = 256) + private String imageUrl; + + @Size(max = 20) + @Column(name = "activation_key", length = 20) + @JsonIgnore + private String activationKey; + + @Size(max = 20) + @Column(name = "reset_key", length = 20) + @JsonIgnore + private String resetKey; + + @Column(name = "reset_date") + private Instant resetDate = null; + + @JsonIgnore + @ManyToMany + @JoinTable( + name = "jhi_user_authority", + joinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "id")}, + inverseJoinColumns = {@JoinColumn(name = "authority_name", referencedColumnName = "name")}) + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) + @BatchSize(size = 20) + private Set authorities = new HashSet<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLogin() { + return login; + } + + // Lowercase the login before saving it in database + public void setLogin(String login) { + this.login = StringUtils.lowerCase(login, Locale.ENGLISH); + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public boolean getActivated() { + return activated; + } + + public void setActivated(boolean activated) { + this.activated = activated; + } + + public String getActivationKey() { + return activationKey; + } + + public void setActivationKey(String activationKey) { + this.activationKey = activationKey; + } + + public String getResetKey() { + return resetKey; + } + + public void setResetKey(String resetKey) { + this.resetKey = resetKey; + } + + public Instant getResetDate() { + return resetDate; + } + + public void setResetDate(Instant resetDate) { + this.resetDate = resetDate; + } + + public String getLangKey() { + return langKey; + } + + public void setLangKey(String langKey) { + this.langKey = langKey; + } + + public Set getAuthorities() { + return authorities; + } + + public void setAuthorities(Set authorities) { + this.authorities = authorities; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + User user = (User) o; + return !(user.getId() == null || getId() == null) && Objects.equals(getId(), user.getId()); + } + + @Override + public int hashCode() { + return Objects.hashCode(getId()); + } + + @Override + public String toString() { + return "User{" + + "login='" + login + '\'' + + ", firstName='" + firstName + '\'' + + ", lastName='" + lastName + '\'' + + ", email='" + email + '\'' + + ", imageUrl='" + imageUrl + '\'' + + ", activated='" + activated + '\'' + + ", langKey='" + langKey + '\'' + + ", activationKey='" + activationKey + '\'' + + "}"; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/package-info.java new file mode 100644 index 0000000000..c79cfa9aa2 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/domain/package-info.java @@ -0,0 +1,4 @@ +/** + * JPA domain objects. + */ +package com.baeldung.jhipster.uaa.domain; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/AuthorityRepository.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/AuthorityRepository.java new file mode 100644 index 0000000000..b60e601315 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/AuthorityRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.jhipster.uaa.repository; + +import com.baeldung.jhipster.uaa.domain.Authority; + +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * Spring Data JPA repository for the Authority entity. + */ +public interface AuthorityRepository extends JpaRepository { +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepository.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepository.java new file mode 100644 index 0000000000..6f63984c52 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepository.java @@ -0,0 +1,89 @@ +package com.baeldung.jhipster.uaa.repository; + +import com.baeldung.jhipster.uaa.config.Constants; +import com.baeldung.jhipster.uaa.config.audit.AuditEventConverter; +import com.baeldung.jhipster.uaa.domain.PersistentAuditEvent; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.actuate.audit.AuditEvent; +import org.springframework.boot.actuate.audit.AuditEventRepository; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; +import java.util.*; + +/** + * An implementation of Spring Boot's AuditEventRepository. + */ +@Repository +public class CustomAuditEventRepository implements AuditEventRepository { + + private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE"; + + /** + * Should be the same as in Liquibase migration. + */ + protected static final int EVENT_DATA_COLUMN_MAX_LENGTH = 255; + + private final PersistenceAuditEventRepository persistenceAuditEventRepository; + + private final AuditEventConverter auditEventConverter; + + private final Logger log = LoggerFactory.getLogger(getClass()); + + public CustomAuditEventRepository(PersistenceAuditEventRepository persistenceAuditEventRepository, + AuditEventConverter auditEventConverter) { + + this.persistenceAuditEventRepository = persistenceAuditEventRepository; + this.auditEventConverter = auditEventConverter; + } + + @Override + public List find(String principal, Instant after, String type) { + Iterable persistentAuditEvents = + persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfterAndAuditEventType(principal, after, type); + return auditEventConverter.convertToAuditEvent(persistentAuditEvents); + } + + @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) + public void add(AuditEvent event) { + if (!AUTHORIZATION_FAILURE.equals(event.getType()) && + !Constants.ANONYMOUS_USER.equals(event.getPrincipal())) { + + PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent(); + persistentAuditEvent.setPrincipal(event.getPrincipal()); + persistentAuditEvent.setAuditEventType(event.getType()); + persistentAuditEvent.setAuditEventDate(event.getTimestamp()); + Map eventData = auditEventConverter.convertDataToStrings(event.getData()); + persistentAuditEvent.setData(truncate(eventData)); + persistenceAuditEventRepository.save(persistentAuditEvent); + } + } + + /** + * Truncate event data that might exceed column length. + */ + private Map truncate(Map data) { + Map results = new HashMap<>(); + + if (data != null) { + for (Map.Entry entry : data.entrySet()) { + String value = entry.getValue(); + if (value != null) { + int length = value.length(); + if (length > EVENT_DATA_COLUMN_MAX_LENGTH) { + value = value.substring(0, EVENT_DATA_COLUMN_MAX_LENGTH); + log.warn("Event data for {} too long ({}) has been truncated to {}. Consider increasing column width.", + entry.getKey(), length, EVENT_DATA_COLUMN_MAX_LENGTH); + } + } + results.put(entry.getKey(), value); + } + } + return results; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/PersistenceAuditEventRepository.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/PersistenceAuditEventRepository.java new file mode 100644 index 0000000000..259887fcc4 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/PersistenceAuditEventRepository.java @@ -0,0 +1,25 @@ +package com.baeldung.jhipster.uaa.repository; + +import com.baeldung.jhipster.uaa.domain.PersistentAuditEvent; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.time.Instant; +import java.util.List; + +/** + * Spring Data JPA repository for the PersistentAuditEvent entity. + */ +public interface PersistenceAuditEventRepository extends JpaRepository { + + List findByPrincipal(String principal); + + List findByAuditEventDateAfter(Instant after); + + List findByPrincipalAndAuditEventDateAfter(String principal, Instant after); + + List findByPrincipalAndAuditEventDateAfterAndAuditEventType(String principal, Instant after, String type); + + Page findAllByAuditEventDateBetween(Instant fromDate, Instant toDate, Pageable pageable); +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/UserRepository.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/UserRepository.java new file mode 100644 index 0000000000..dda52a5ef5 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/UserRepository.java @@ -0,0 +1,47 @@ +package com.baeldung.jhipster.uaa.repository; + +import com.baeldung.jhipster.uaa.domain.User; + +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.EntityGraph; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.List; +import java.util.Optional; +import java.time.Instant; + +/** + * Spring Data JPA repository for the User entity. + */ +@Repository +public interface UserRepository extends JpaRepository { + + String USERS_BY_LOGIN_CACHE = "usersByLogin"; + + String USERS_BY_EMAIL_CACHE = "usersByEmail"; + + Optional findOneByActivationKey(String activationKey); + + List findAllByActivatedIsFalseAndCreatedDateBefore(Instant dateTime); + + Optional findOneByResetKey(String resetKey); + + Optional findOneByEmailIgnoreCase(String email); + + Optional findOneByLogin(String login); + + @EntityGraph(attributePaths = "authorities") + Optional findOneWithAuthoritiesById(Long id); + + @EntityGraph(attributePaths = "authorities") + @Cacheable(cacheNames = USERS_BY_LOGIN_CACHE) + Optional findOneWithAuthoritiesByLogin(String login); + + @EntityGraph(attributePaths = "authorities") + @Cacheable(cacheNames = USERS_BY_EMAIL_CACHE) + Optional findOneWithAuthoritiesByEmail(String email); + + Page findAllByLoginNot(Pageable pageable, String login); +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/package-info.java new file mode 100644 index 0000000000..135fad8759 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/repository/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Data JPA repositories. + */ +package com.baeldung.jhipster.uaa.repository; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/AuthoritiesConstants.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/AuthoritiesConstants.java new file mode 100644 index 0000000000..d6f18015c5 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/AuthoritiesConstants.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.uaa.security; + +/** + * Constants for Spring Security authorities. + */ +public final class AuthoritiesConstants { + + public static final String ADMIN = "ROLE_ADMIN"; + + public static final String USER = "ROLE_USER"; + + public static final String ANONYMOUS = "ROLE_ANONYMOUS"; + + private AuthoritiesConstants() { + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsService.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsService.java new file mode 100644 index 0000000000..5f0d249070 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsService.java @@ -0,0 +1,62 @@ +package com.baeldung.jhipster.uaa.security; + +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.UserRepository; +import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * Authenticate a user from the database. + */ +@Component("userDetailsService") +public class DomainUserDetailsService implements UserDetailsService { + + private final Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class); + + private final UserRepository userRepository; + + public DomainUserDetailsService(UserRepository userRepository) { + this.userRepository = userRepository; + } + + @Override + @Transactional + public UserDetails loadUserByUsername(final String login) { + log.debug("Authenticating {}", login); + + if (new EmailValidator().isValid(login, null)) { + return userRepository.findOneWithAuthoritiesByEmail(login) + .map(user -> createSpringSecurityUser(login, user)) + .orElseThrow(() -> new UsernameNotFoundException("User with email " + login + " was not found in the database")); + } + + String lowercaseLogin = login.toLowerCase(Locale.ENGLISH); + return userRepository.findOneWithAuthoritiesByLogin(lowercaseLogin) + .map(user -> createSpringSecurityUser(lowercaseLogin, user)) + .orElseThrow(() -> new UsernameNotFoundException("User " + lowercaseLogin + " was not found in the database")); + + } + + private org.springframework.security.core.userdetails.User createSpringSecurityUser(String lowercaseLogin, User user) { + if (!user.getActivated()) { + throw new UserNotActivatedException("User " + lowercaseLogin + " was not activated"); + } + List grantedAuthorities = user.getAuthorities().stream() + .map(authority -> new SimpleGrantedAuthority(authority.getName())) + .collect(Collectors.toList()); + return new org.springframework.security.core.userdetails.User(user.getLogin(), + user.getPassword(), + grantedAuthorities); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/IatTokenEnhancer.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/IatTokenEnhancer.java new file mode 100644 index 0000000000..d9c2e2b05a --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/IatTokenEnhancer.java @@ -0,0 +1,36 @@ +package com.baeldung.jhipster.uaa.security; + +import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.security.oauth2.provider.token.TokenEnhancer; +import org.springframework.stereotype.Component; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Adds the standard "iat" claim to tokens so we know when they have been created. + * This is needed for a session timeout due to inactivity (ignored in case of "remember-me"). + */ +@Component +public class IatTokenEnhancer implements TokenEnhancer { + + @Override + public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) { + addClaims((DefaultOAuth2AccessToken) accessToken); + return accessToken; + } + + private void addClaims(DefaultOAuth2AccessToken accessToken) { + DefaultOAuth2AccessToken token = accessToken; + Map additionalInformation = token.getAdditionalInformation(); + if (additionalInformation.isEmpty()) { + additionalInformation = new LinkedHashMap(); + } + //add "iat" claim with current time in secs + //this is used for an inactive session timeout + additionalInformation.put("iat", new Integer((int)(System.currentTimeMillis()/1000L))); + token.setAdditionalInformation(additionalInformation); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SecurityUtils.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SecurityUtils.java new file mode 100644 index 0000000000..b6ce7546df --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SecurityUtils.java @@ -0,0 +1,64 @@ +package com.baeldung.jhipster.uaa.security; + +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Optional; + +/** + * Utility class for Spring Security. + */ +public final class SecurityUtils { + + private SecurityUtils() { + } + + /** + * Get the login of the current user. + * + * @return the login of the current user + */ + public static Optional getCurrentUserLogin() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> { + if (authentication.getPrincipal() instanceof UserDetails) { + UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); + return springSecurityUser.getUsername(); + } else if (authentication.getPrincipal() instanceof String) { + return (String) authentication.getPrincipal(); + } + return null; + }); + } + + /** + * Check if a user is authenticated. + * + * @return true if the user is authenticated, false otherwise + */ + public static boolean isAuthenticated() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> authentication.getAuthorities().stream() + .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS))) + .orElse(false); + } + + /** + * If the current user has a specific authority (security role). + *

+ * The name of this method comes from the isUserInRole() method in the Servlet API + * + * @param authority the authority to check + * @return true if the current user has the authority, false otherwise + */ + public static boolean isCurrentUserInRole(String authority) { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return Optional.ofNullable(securityContext.getAuthentication()) + .map(authentication -> authentication.getAuthorities().stream() + .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority))) + .orElse(false); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SpringSecurityAuditorAware.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SpringSecurityAuditorAware.java new file mode 100644 index 0000000000..7b71ceab9d --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/SpringSecurityAuditorAware.java @@ -0,0 +1,20 @@ +package com.baeldung.jhipster.uaa.security; + +import com.baeldung.jhipster.uaa.config.Constants; + +import java.util.Optional; + +import org.springframework.data.domain.AuditorAware; +import org.springframework.stereotype.Component; + +/** + * Implementation of AuditorAware based on Spring Security. + */ +@Component +public class SpringSecurityAuditorAware implements AuditorAware { + + @Override + public Optional getCurrentAuditor() { + return Optional.of(SecurityUtils.getCurrentUserLogin().orElse(Constants.SYSTEM_ACCOUNT)); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/UserNotActivatedException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/UserNotActivatedException.java new file mode 100644 index 0000000000..0a1300e466 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/UserNotActivatedException.java @@ -0,0 +1,19 @@ +package com.baeldung.jhipster.uaa.security; + +import org.springframework.security.core.AuthenticationException; + +/** + * This exception is thrown in case of a not activated user trying to authenticate. + */ +public class UserNotActivatedException extends AuthenticationException { + + private static final long serialVersionUID = 1L; + + public UserNotActivatedException(String message) { + super(message); + } + + public UserNotActivatedException(String message, Throwable t) { + super(message, t); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/package-info.java new file mode 100644 index 0000000000..b812840289 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/security/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring Security configuration. + */ +package com.baeldung.jhipster.uaa.security; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/AuditEventService.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/AuditEventService.java new file mode 100644 index 0000000000..ace539f553 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/AuditEventService.java @@ -0,0 +1,51 @@ +package com.baeldung.jhipster.uaa.service; + +import com.baeldung.jhipster.uaa.config.audit.AuditEventConverter; +import com.baeldung.jhipster.uaa.repository.PersistenceAuditEventRepository; +import org.springframework.boot.actuate.audit.AuditEvent; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; +import java.util.Optional; + +/** + * Service for managing audit events. + *

+ * This is the default implementation to support SpringBoot Actuator AuditEventRepository + */ +@Service +@Transactional +public class AuditEventService { + + private final PersistenceAuditEventRepository persistenceAuditEventRepository; + + private final AuditEventConverter auditEventConverter; + + public AuditEventService( + PersistenceAuditEventRepository persistenceAuditEventRepository, + AuditEventConverter auditEventConverter) { + + this.persistenceAuditEventRepository = persistenceAuditEventRepository; + this.auditEventConverter = auditEventConverter; + } + + public Page findAll(Pageable pageable) { + return persistenceAuditEventRepository.findAll(pageable) + .map(auditEventConverter::convertToAuditEvent); + } + + public Page findByDates(Instant fromDate, Instant toDate, Pageable pageable) { + return persistenceAuditEventRepository.findAllByAuditEventDateBetween(fromDate, toDate, pageable) + .map(auditEventConverter::convertToAuditEvent); + } + + public Optional find(Long id) { + return Optional.ofNullable(persistenceAuditEventRepository.findById(id)) + .filter(Optional::isPresent) + .map(Optional::get) + .map(auditEventConverter::convertToAuditEvent); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/MailService.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/MailService.java new file mode 100644 index 0000000000..1535fcdac6 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/MailService.java @@ -0,0 +1,105 @@ +package com.baeldung.jhipster.uaa.service; + +import com.baeldung.jhipster.uaa.domain.User; + +import io.github.jhipster.config.JHipsterProperties; + +import java.nio.charset.StandardCharsets; +import java.util.Locale; +import javax.mail.internet.MimeMessage; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.MessageSource; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.thymeleaf.context.Context; +import org.thymeleaf.spring5.SpringTemplateEngine; + +/** + * Service for sending emails. + *

+ * We use the @Async annotation to send emails asynchronously. + */ +@Service +public class MailService { + + private final Logger log = LoggerFactory.getLogger(MailService.class); + + private static final String USER = "user"; + + private static final String BASE_URL = "baseUrl"; + + private final JHipsterProperties jHipsterProperties; + + private final JavaMailSender javaMailSender; + + private final MessageSource messageSource; + + private final SpringTemplateEngine templateEngine; + + public MailService(JHipsterProperties jHipsterProperties, JavaMailSender javaMailSender, + MessageSource messageSource, SpringTemplateEngine templateEngine) { + + this.jHipsterProperties = jHipsterProperties; + this.javaMailSender = javaMailSender; + this.messageSource = messageSource; + this.templateEngine = templateEngine; + } + + @Async + public void sendEmail(String to, String subject, String content, boolean isMultipart, boolean isHtml) { + log.debug("Send email[multipart '{}' and html '{}'] to '{}' with subject '{}' and content={}", + isMultipart, isHtml, to, subject, content); + + // Prepare message using a Spring helper + MimeMessage mimeMessage = javaMailSender.createMimeMessage(); + try { + MimeMessageHelper message = new MimeMessageHelper(mimeMessage, isMultipart, StandardCharsets.UTF_8.name()); + message.setTo(to); + message.setFrom(jHipsterProperties.getMail().getFrom()); + message.setSubject(subject); + message.setText(content, isHtml); + javaMailSender.send(mimeMessage); + log.debug("Sent email to User '{}'", to); + } catch (Exception e) { + if (log.isDebugEnabled()) { + log.warn("Email could not be sent to user '{}'", to, e); + } else { + log.warn("Email could not be sent to user '{}': {}", to, e.getMessage()); + } + } + } + + @Async + public void sendEmailFromTemplate(User user, String templateName, String titleKey) { + Locale locale = Locale.forLanguageTag(user.getLangKey()); + Context context = new Context(locale); + context.setVariable(USER, user); + context.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl()); + String content = templateEngine.process(templateName, context); + String subject = messageSource.getMessage(titleKey, null, locale); + sendEmail(user.getEmail(), subject, content, false, true); + + } + + @Async + public void sendActivationEmail(User user) { + log.debug("Sending activation email to '{}'", user.getEmail()); + sendEmailFromTemplate(user, "mail/activationEmail", "email.activation.title"); + } + + @Async + public void sendCreationEmail(User user) { + log.debug("Sending creation email to '{}'", user.getEmail()); + sendEmailFromTemplate(user, "mail/creationEmail", "email.activation.title"); + } + + @Async + public void sendPasswordResetMail(User user) { + log.debug("Sending password reset email to '{}'", user.getEmail()); + sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title"); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/UserService.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/UserService.java new file mode 100644 index 0000000000..8f5c7bffcc --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/UserService.java @@ -0,0 +1,293 @@ +package com.baeldung.jhipster.uaa.service; + +import com.baeldung.jhipster.uaa.config.Constants; +import com.baeldung.jhipster.uaa.domain.Authority; +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.AuthorityRepository; +import com.baeldung.jhipster.uaa.repository.UserRepository; +import com.baeldung.jhipster.uaa.security.AuthoritiesConstants; +import com.baeldung.jhipster.uaa.security.SecurityUtils; +import com.baeldung.jhipster.uaa.service.dto.UserDTO; +import com.baeldung.jhipster.uaa.service.util.RandomUtil; +import com.baeldung.jhipster.uaa.web.rest.errors.*; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.CacheManager; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.*; +import java.util.stream.Collectors; + +/** + * Service class for managing users. + */ +@Service +@Transactional +public class UserService { + + private final Logger log = LoggerFactory.getLogger(UserService.class); + + private final UserRepository userRepository; + + private final PasswordEncoder passwordEncoder; + + private final AuthorityRepository authorityRepository; + + private final CacheManager cacheManager; + + public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder, AuthorityRepository authorityRepository, CacheManager cacheManager) { + this.userRepository = userRepository; + this.passwordEncoder = passwordEncoder; + this.authorityRepository = authorityRepository; + this.cacheManager = cacheManager; + } + + public Optional activateRegistration(String key) { + log.debug("Activating user for activation key {}", key); + return userRepository.findOneByActivationKey(key) + .map(user -> { + // activate given user for the registration key. + user.setActivated(true); + user.setActivationKey(null); + this.clearUserCaches(user); + log.debug("Activated user: {}", user); + return user; + }); + } + + public Optional completePasswordReset(String newPassword, String key) { + log.debug("Reset user password for reset key {}", key); + return userRepository.findOneByResetKey(key) + .filter(user -> user.getResetDate().isAfter(Instant.now().minusSeconds(86400))) + .map(user -> { + user.setPassword(passwordEncoder.encode(newPassword)); + user.setResetKey(null); + user.setResetDate(null); + this.clearUserCaches(user); + return user; + }); + } + + public Optional requestPasswordReset(String mail) { + return userRepository.findOneByEmailIgnoreCase(mail) + .filter(User::getActivated) + .map(user -> { + user.setResetKey(RandomUtil.generateResetKey()); + user.setResetDate(Instant.now()); + this.clearUserCaches(user); + return user; + }); + } + + public User registerUser(UserDTO userDTO, String password) { + userRepository.findOneByLogin(userDTO.getLogin().toLowerCase()).ifPresent(existingUser -> { + boolean removed = removeNonActivatedUser(existingUser); + if (!removed) { + throw new LoginAlreadyUsedException(); + } + }); + userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()).ifPresent(existingUser -> { + boolean removed = removeNonActivatedUser(existingUser); + if (!removed) { + throw new EmailAlreadyUsedException(); + } + }); + User newUser = new User(); + String encryptedPassword = passwordEncoder.encode(password); + newUser.setLogin(userDTO.getLogin().toLowerCase()); + // new user gets initially a generated password + newUser.setPassword(encryptedPassword); + newUser.setFirstName(userDTO.getFirstName()); + newUser.setLastName(userDTO.getLastName()); + newUser.setEmail(userDTO.getEmail().toLowerCase()); + newUser.setImageUrl(userDTO.getImageUrl()); + newUser.setLangKey(userDTO.getLangKey()); + // new user is not active + newUser.setActivated(false); + // new user gets registration key + newUser.setActivationKey(RandomUtil.generateActivationKey()); + Set authorities = new HashSet<>(); + authorityRepository.findById(AuthoritiesConstants.USER).ifPresent(authorities::add); + newUser.setAuthorities(authorities); + userRepository.save(newUser); + this.clearUserCaches(newUser); + log.debug("Created Information for User: {}", newUser); + return newUser; + } + private boolean removeNonActivatedUser(User existingUser){ + if(existingUser.getActivated()) { + return false; + } + userRepository.delete(existingUser); + userRepository.flush(); + this.clearUserCaches(existingUser); + return true; + } + + public User createUser(UserDTO userDTO) { + User user = new User(); + user.setLogin(userDTO.getLogin().toLowerCase()); + user.setFirstName(userDTO.getFirstName()); + user.setLastName(userDTO.getLastName()); + user.setEmail(userDTO.getEmail().toLowerCase()); + user.setImageUrl(userDTO.getImageUrl()); + if (userDTO.getLangKey() == null) { + user.setLangKey(Constants.DEFAULT_LANGUAGE); // default language + } else { + user.setLangKey(userDTO.getLangKey()); + } + String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword()); + user.setPassword(encryptedPassword); + user.setResetKey(RandomUtil.generateResetKey()); + user.setResetDate(Instant.now()); + user.setActivated(true); + if (userDTO.getAuthorities() != null) { + Set authorities = userDTO.getAuthorities().stream() + .map(authorityRepository::findById) + .filter(Optional::isPresent) + .map(Optional::get) + .collect(Collectors.toSet()); + user.setAuthorities(authorities); + } + userRepository.save(user); + this.clearUserCaches(user); + log.debug("Created Information for User: {}", user); + return user; + } + + /** + * Update basic information (first name, last name, email, language) for the current user. + * + * @param firstName first name of user + * @param lastName last name of user + * @param email email id of user + * @param langKey language key + * @param imageUrl image URL of user + */ + public void updateUser(String firstName, String lastName, String email, String langKey, String imageUrl) { + SecurityUtils.getCurrentUserLogin() + .flatMap(userRepository::findOneByLogin) + .ifPresent(user -> { + user.setFirstName(firstName); + user.setLastName(lastName); + user.setEmail(email.toLowerCase()); + user.setLangKey(langKey); + user.setImageUrl(imageUrl); + this.clearUserCaches(user); + log.debug("Changed Information for User: {}", user); + }); + } + + /** + * Update all information for a specific user, and return the modified user. + * + * @param userDTO user to update + * @return updated user + */ + public Optional updateUser(UserDTO userDTO) { + return Optional.of(userRepository + .findById(userDTO.getId())) + .filter(Optional::isPresent) + .map(Optional::get) + .map(user -> { + this.clearUserCaches(user); + user.setLogin(userDTO.getLogin().toLowerCase()); + user.setFirstName(userDTO.getFirstName()); + user.setLastName(userDTO.getLastName()); + user.setEmail(userDTO.getEmail().toLowerCase()); + user.setImageUrl(userDTO.getImageUrl()); + user.setActivated(userDTO.isActivated()); + user.setLangKey(userDTO.getLangKey()); + Set managedAuthorities = user.getAuthorities(); + managedAuthorities.clear(); + userDTO.getAuthorities().stream() + .map(authorityRepository::findById) + .filter(Optional::isPresent) + .map(Optional::get) + .forEach(managedAuthorities::add); + this.clearUserCaches(user); + log.debug("Changed Information for User: {}", user); + return user; + }) + .map(UserDTO::new); + } + + public void deleteUser(String login) { + userRepository.findOneByLogin(login).ifPresent(user -> { + userRepository.delete(user); + this.clearUserCaches(user); + log.debug("Deleted User: {}", user); + }); + } + + public void changePassword(String currentClearTextPassword, String newPassword) { + SecurityUtils.getCurrentUserLogin() + .flatMap(userRepository::findOneByLogin) + .ifPresent(user -> { + String currentEncryptedPassword = user.getPassword(); + if (!passwordEncoder.matches(currentClearTextPassword, currentEncryptedPassword)) { + throw new InvalidPasswordException(); + } + String encryptedPassword = passwordEncoder.encode(newPassword); + user.setPassword(encryptedPassword); + this.clearUserCaches(user); + log.debug("Changed password for User: {}", user); + }); + } + + @Transactional(readOnly = true) + public Page getAllManagedUsers(Pageable pageable) { + return userRepository.findAllByLoginNot(pageable, Constants.ANONYMOUS_USER).map(UserDTO::new); + } + + @Transactional(readOnly = true) + public Optional getUserWithAuthoritiesByLogin(String login) { + return userRepository.findOneWithAuthoritiesByLogin(login); + } + + @Transactional(readOnly = true) + public Optional getUserWithAuthorities(Long id) { + return userRepository.findOneWithAuthoritiesById(id); + } + + @Transactional(readOnly = true) + public Optional getUserWithAuthorities() { + return SecurityUtils.getCurrentUserLogin().flatMap(userRepository::findOneWithAuthoritiesByLogin); + } + + /** + * Not activated users should be automatically deleted after 3 days. + *

+ * This is scheduled to get fired everyday, at 01:00 (am). + */ + @Scheduled(cron = "0 0 1 * * ?") + public void removeNotActivatedUsers() { + userRepository + .findAllByActivatedIsFalseAndCreatedDateBefore(Instant.now().minus(3, ChronoUnit.DAYS)) + .forEach(user -> { + log.debug("Deleting not activated user {}", user.getLogin()); + userRepository.delete(user); + this.clearUserCaches(user); + }); + } + + /** + * @return a list of all the authorities + */ + public List getAuthorities() { + return authorityRepository.findAll().stream().map(Authority::getName).collect(Collectors.toList()); + } + + private void clearUserCaches(User user) { + Objects.requireNonNull(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE)).evict(user.getLogin()); + Objects.requireNonNull(cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE)).evict(user.getEmail()); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/PasswordChangeDTO.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/PasswordChangeDTO.java new file mode 100644 index 0000000000..47a8720d4a --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/PasswordChangeDTO.java @@ -0,0 +1,35 @@ +package com.baeldung.jhipster.uaa.service.dto; + +/** + * A DTO representing a password change required data - current and new password. + */ +public class PasswordChangeDTO { + private String currentPassword; + private String newPassword; + + public PasswordChangeDTO() { + // Empty constructor needed for Jackson. + } + + public PasswordChangeDTO(String currentPassword, String newPassword) { + this.currentPassword = currentPassword; + this.newPassword = newPassword; + } + + public String getCurrentPassword() { + + return currentPassword; + } + + public void setCurrentPassword(String currentPassword) { + this.currentPassword = currentPassword; + } + + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/UserDTO.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/UserDTO.java new file mode 100644 index 0000000000..e8a2e3300c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/UserDTO.java @@ -0,0 +1,199 @@ +package com.baeldung.jhipster.uaa.service.dto; + +import com.baeldung.jhipster.uaa.config.Constants; + +import com.baeldung.jhipster.uaa.domain.Authority; +import com.baeldung.jhipster.uaa.domain.User; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; + +import javax.validation.constraints.*; +import java.time.Instant; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * A DTO representing a user, with his authorities. + */ +public class UserDTO { + + private Long id; + + @NotBlank + @Pattern(regexp = Constants.LOGIN_REGEX) + @Size(min = 1, max = 50) + private String login; + + @Size(max = 50) + private String firstName; + + @Size(max = 50) + private String lastName; + + @Email + @Size(min = 5, max = 254) + private String email; + + @Size(max = 256) + private String imageUrl; + + private boolean activated = false; + + @Size(min = 2, max = 6) + private String langKey; + + private String createdBy; + + private Instant createdDate; + + private String lastModifiedBy; + + private Instant lastModifiedDate; + + private Set authorities; + + public UserDTO() { + // Empty constructor needed for Jackson. + } + + public UserDTO(User user) { + this.id = user.getId(); + this.login = user.getLogin(); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.email = user.getEmail(); + this.activated = user.getActivated(); + this.imageUrl = user.getImageUrl(); + this.langKey = user.getLangKey(); + this.createdBy = user.getCreatedBy(); + this.createdDate = user.getCreatedDate(); + this.lastModifiedBy = user.getLastModifiedBy(); + this.lastModifiedDate = user.getLastModifiedDate(); + this.authorities = user.getAuthorities().stream() + .map(Authority::getName) + .collect(Collectors.toSet()); + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public boolean isActivated() { + return activated; + } + + public void setActivated(boolean activated) { + this.activated = activated; + } + + public String getLangKey() { + return langKey; + } + + public void setLangKey(String langKey) { + this.langKey = langKey; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Instant getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Instant createdDate) { + this.createdDate = createdDate; + } + + public String getLastModifiedBy() { + return lastModifiedBy; + } + + public void setLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + public Instant getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Instant lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public Set getAuthorities() { + return authorities; + } + + public void setAuthorities(Set authorities) { + this.authorities = authorities; + } + + @Override + public String toString() { + return "UserDTO{" + + "login='" + login + '\'' + + ", firstName='" + firstName + '\'' + + ", lastName='" + lastName + '\'' + + ", email='" + email + '\'' + + ", imageUrl='" + imageUrl + '\'' + + ", activated=" + activated + + ", langKey='" + langKey + '\'' + + ", createdBy=" + createdBy + + ", createdDate=" + createdDate + + ", lastModifiedBy='" + lastModifiedBy + '\'' + + ", lastModifiedDate=" + lastModifiedDate + + ", authorities=" + authorities + + "}"; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/package-info.java new file mode 100644 index 0000000000..9fcb17ad7e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/dto/package-info.java @@ -0,0 +1,4 @@ +/** + * Data Transfer Objects. + */ +package com.baeldung.jhipster.uaa.service.dto; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/UserMapper.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/UserMapper.java new file mode 100644 index 0000000000..11948b3dce --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/UserMapper.java @@ -0,0 +1,76 @@ +package com.baeldung.jhipster.uaa.service.mapper; + +import com.baeldung.jhipster.uaa.domain.Authority; +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.service.dto.UserDTO; + +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * Mapper for the entity User and its DTO called UserDTO. + * + * Normal mappers are generated using MapStruct, this one is hand-coded as MapStruct + * support is still in beta, and requires a manual step with an IDE. + */ +@Service +public class UserMapper { + + public UserDTO userToUserDTO(User user) { + return new UserDTO(user); + } + + public List usersToUserDTOs(List users) { + return users.stream() + .filter(Objects::nonNull) + .map(this::userToUserDTO) + .collect(Collectors.toList()); + } + + public User userDTOToUser(UserDTO userDTO) { + if (userDTO == null) { + return null; + } else { + User user = new User(); + user.setId(userDTO.getId()); + user.setLogin(userDTO.getLogin()); + user.setFirstName(userDTO.getFirstName()); + user.setLastName(userDTO.getLastName()); + user.setEmail(userDTO.getEmail()); + user.setImageUrl(userDTO.getImageUrl()); + user.setActivated(userDTO.isActivated()); + user.setLangKey(userDTO.getLangKey()); + Set authorities = this.authoritiesFromStrings(userDTO.getAuthorities()); + if (authorities != null) { + user.setAuthorities(authorities); + } + return user; + } + } + + public List userDTOsToUsers(List userDTOs) { + return userDTOs.stream() + .filter(Objects::nonNull) + .map(this::userDTOToUser) + .collect(Collectors.toList()); + } + + public User userFromId(Long id) { + if (id == null) { + return null; + } + User user = new User(); + user.setId(id); + return user; + } + + public Set authoritiesFromStrings(Set strings) { + return strings.stream().map(string -> { + Authority auth = new Authority(); + auth.setName(string); + return auth; + }).collect(Collectors.toSet()); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/package-info.java new file mode 100644 index 0000000000..053d4a8e4c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/mapper/package-info.java @@ -0,0 +1,4 @@ +/** + * MapStruct mappers for mapping domain objects and Data Transfer Objects. + */ +package com.baeldung.jhipster.uaa.service.mapper; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/package-info.java new file mode 100644 index 0000000000..ca7bcd8f09 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/package-info.java @@ -0,0 +1,4 @@ +/** + * Service layer beans. + */ +package com.baeldung.jhipster.uaa.service; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/util/RandomUtil.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/util/RandomUtil.java new file mode 100644 index 0000000000..8eab3ac101 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/service/util/RandomUtil.java @@ -0,0 +1,41 @@ +package com.baeldung.jhipster.uaa.service.util; + +import org.apache.commons.lang3.RandomStringUtils; + +/** + * Utility class for generating random Strings. + */ +public final class RandomUtil { + + private static final int DEF_COUNT = 20; + + private RandomUtil() { + } + + /** + * Generate a password. + * + * @return the generated password + */ + public static String generatePassword() { + return RandomStringUtils.randomAlphanumeric(DEF_COUNT); + } + + /** + * Generate an activation key. + * + * @return the generated activation key + */ + public static String generateActivationKey() { + return RandomStringUtils.randomNumeric(DEF_COUNT); + } + + /** + * Generate a reset key. + * + * @return the generated reset key + */ + public static String generateResetKey() { + return RandomStringUtils.randomNumeric(DEF_COUNT); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AccountResource.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AccountResource.java new file mode 100644 index 0000000000..144ce0f9d9 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AccountResource.java @@ -0,0 +1,189 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.codahale.metrics.annotation.Timed; + +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.UserRepository; +import com.baeldung.jhipster.uaa.security.SecurityUtils; +import com.baeldung.jhipster.uaa.service.MailService; +import com.baeldung.jhipster.uaa.service.UserService; +import com.baeldung.jhipster.uaa.service.dto.PasswordChangeDTO; +import com.baeldung.jhipster.uaa.service.dto.UserDTO; +import com.baeldung.jhipster.uaa.web.rest.errors.*; +import com.baeldung.jhipster.uaa.web.rest.vm.KeyAndPasswordVM; +import com.baeldung.jhipster.uaa.web.rest.vm.ManagedUserVM; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.*; + + +/** + * REST controller for managing the current user's account. + */ +@RestController +@RequestMapping("/api") +public class AccountResource { + + private final Logger log = LoggerFactory.getLogger(AccountResource.class); + + private final UserRepository userRepository; + + private final UserService userService; + + private final MailService mailService; + + public AccountResource(UserRepository userRepository, UserService userService, MailService mailService) { + + this.userRepository = userRepository; + this.userService = userService; + this.mailService = mailService; + } + + /** + * POST /register : register the user. + * + * @param managedUserVM the managed user View Model + * @throws InvalidPasswordException 400 (Bad Request) if the password is incorrect + * @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already used + * @throws LoginAlreadyUsedException 400 (Bad Request) if the login is already used + */ + @PostMapping("/register") + @Timed + @ResponseStatus(HttpStatus.CREATED) + public void registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) { + if (!checkPasswordLength(managedUserVM.getPassword())) { + throw new InvalidPasswordException(); + } + User user = userService.registerUser(managedUserVM, managedUserVM.getPassword()); + mailService.sendActivationEmail(user); + } + + /** + * GET /activate : activate the registered user. + * + * @param key the activation key + * @throws RuntimeException 500 (Internal Server Error) if the user couldn't be activated + */ + @GetMapping("/activate") + @Timed + public void activateAccount(@RequestParam(value = "key") String key) { + Optional user = userService.activateRegistration(key); + if (!user.isPresent()) { + throw new InternalServerErrorException("No user was found for this activation key"); + } + } + + /** + * GET /authenticate : check if the user is authenticated, and return its login. + * + * @param request the HTTP request + * @return the login if the user is authenticated + */ + @GetMapping("/authenticate") + @Timed + public String isAuthenticated(HttpServletRequest request) { + log.debug("REST request to check if the current user is authenticated"); + return request.getRemoteUser(); + } + + /** + * GET /account : get the current user. + * + * @return the current user + * @throws RuntimeException 500 (Internal Server Error) if the user couldn't be returned + */ + @GetMapping("/account") + @Timed + public UserDTO getAccount() { + return userService.getUserWithAuthorities() + .map(UserDTO::new) + .orElseThrow(() -> new InternalServerErrorException("User could not be found")); + } + + /** + * POST /account : update the current user information. + * + * @param userDTO the current user information + * @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already used + * @throws RuntimeException 500 (Internal Server Error) if the user login wasn't found + */ + @PostMapping("/account") + @Timed + public void saveAccount(@Valid @RequestBody UserDTO userDTO) { + final String userLogin = SecurityUtils.getCurrentUserLogin().orElseThrow(() -> new InternalServerErrorException("Current user login not found")); + Optional existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()); + if (existingUser.isPresent() && (!existingUser.get().getLogin().equalsIgnoreCase(userLogin))) { + throw new EmailAlreadyUsedException(); + } + Optional user = userRepository.findOneByLogin(userLogin); + if (!user.isPresent()) { + throw new InternalServerErrorException("User could not be found"); + } + userService.updateUser(userDTO.getFirstName(), userDTO.getLastName(), userDTO.getEmail(), + userDTO.getLangKey(), userDTO.getImageUrl()); + } + + /** + * POST /account/change-password : changes the current user's password + * + * @param passwordChangeDto current and new password + * @throws InvalidPasswordException 400 (Bad Request) if the new password is incorrect + */ + @PostMapping(path = "/account/change-password") + @Timed + public void changePassword(@RequestBody PasswordChangeDTO passwordChangeDto) { + if (!checkPasswordLength(passwordChangeDto.getNewPassword())) { + throw new InvalidPasswordException(); + } + userService.changePassword(passwordChangeDto.getCurrentPassword(), passwordChangeDto.getNewPassword()); + } + + /** + * POST /account/reset-password/init : Send an email to reset the password of the user + * + * @param mail the mail of the user + * @throws EmailNotFoundException 400 (Bad Request) if the email address is not registered + */ + @PostMapping(path = "/account/reset-password/init") + @Timed + public void requestPasswordReset(@RequestBody String mail) { + mailService.sendPasswordResetMail( + userService.requestPasswordReset(mail) + .orElseThrow(EmailNotFoundException::new) + ); + } + + /** + * POST /account/reset-password/finish : Finish to reset the password of the user + * + * @param keyAndPassword the generated key and the new password + * @throws InvalidPasswordException 400 (Bad Request) if the password is incorrect + * @throws RuntimeException 500 (Internal Server Error) if the password could not be reset + */ + @PostMapping(path = "/account/reset-password/finish") + @Timed + public void finishPasswordReset(@RequestBody KeyAndPasswordVM keyAndPassword) { + if (!checkPasswordLength(keyAndPassword.getNewPassword())) { + throw new InvalidPasswordException(); + } + Optional user = + userService.completePasswordReset(keyAndPassword.getNewPassword(), keyAndPassword.getKey()); + + if (!user.isPresent()) { + throw new InternalServerErrorException("No user was found for this reset key"); + } + } + + private static boolean checkPasswordLength(String password) { + return !StringUtils.isEmpty(password) && + password.length() >= ManagedUserVM.PASSWORD_MIN_LENGTH && + password.length() <= ManagedUserVM.PASSWORD_MAX_LENGTH; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AuditResource.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AuditResource.java new file mode 100644 index 0000000000..5f69a78cb0 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/AuditResource.java @@ -0,0 +1,77 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.baeldung.jhipster.uaa.service.AuditEventService; +import com.baeldung.jhipster.uaa.web.rest.util.PaginationUtil; + +import io.github.jhipster.web.util.ResponseUtil; +import org.springframework.boot.actuate.audit.AuditEvent; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.List; + +/** + * REST controller for getting the audit events. + */ +@RestController +@RequestMapping("/management/audits") +public class AuditResource { + + private final AuditEventService auditEventService; + + public AuditResource(AuditEventService auditEventService) { + this.auditEventService = auditEventService; + } + + /** + * GET /audits : get a page of AuditEvents. + * + * @param pageable the pagination information + * @return the ResponseEntity with status 200 (OK) and the list of AuditEvents in body + */ + @GetMapping + public ResponseEntity> getAll(Pageable pageable) { + Page page = auditEventService.findAll(pageable); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/management/audits"); + return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); + } + + /** + * GET /audits : get a page of AuditEvents between the fromDate and toDate. + * + * @param fromDate the start of the time period of AuditEvents to get + * @param toDate the end of the time period of AuditEvents to get + * @param pageable the pagination information + * @return the ResponseEntity with status 200 (OK) and the list of AuditEvents in body + */ + @GetMapping(params = {"fromDate", "toDate"}) + public ResponseEntity> getByDates( + @RequestParam(value = "fromDate") LocalDate fromDate, + @RequestParam(value = "toDate") LocalDate toDate, + Pageable pageable) { + + Page page = auditEventService.findByDates( + fromDate.atStartOfDay(ZoneId.systemDefault()).toInstant(), + toDate.atStartOfDay(ZoneId.systemDefault()).plusDays(1).toInstant(), + pageable); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/management/audits"); + return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); + } + + /** + * GET /audits/:id : get an AuditEvent by id. + * + * @param id the id of the entity to get + * @return the ResponseEntity with status 200 (OK) and the AuditEvent in body, or status 404 (Not Found) + */ + @GetMapping("/{id:.+}") + public ResponseEntity get(@PathVariable Long id) { + return ResponseUtil.wrapOrNotFound(auditEventService.find(id)); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/LogsResource.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/LogsResource.java new file mode 100644 index 0000000000..2bfe432452 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/LogsResource.java @@ -0,0 +1,39 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.baeldung.jhipster.uaa.web.rest.vm.LoggerVM; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; +import com.codahale.metrics.annotation.Timed; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * Controller for view and managing Log Level at runtime. + */ +@RestController +@RequestMapping("/management") +public class LogsResource { + + @GetMapping("/logs") + @Timed + public List getList() { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + return context.getLoggerList() + .stream() + .map(LoggerVM::new) + .collect(Collectors.toList()); + } + + @PutMapping("/logs") + @ResponseStatus(HttpStatus.NO_CONTENT) + @Timed + public void changeLevel(@RequestBody LoggerVM jsonLogger) { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + context.getLogger(jsonLogger.getName()).setLevel(Level.valueOf(jsonLogger.getLevel())); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/UserResource.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/UserResource.java new file mode 100644 index 0000000000..9df27661db --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/UserResource.java @@ -0,0 +1,190 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.baeldung.jhipster.uaa.config.Constants; +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.UserRepository; +import com.baeldung.jhipster.uaa.security.AuthoritiesConstants; +import com.baeldung.jhipster.uaa.service.MailService; +import com.baeldung.jhipster.uaa.service.UserService; +import com.baeldung.jhipster.uaa.service.dto.UserDTO; +import com.baeldung.jhipster.uaa.web.rest.errors.BadRequestAlertException; +import com.baeldung.jhipster.uaa.web.rest.errors.EmailAlreadyUsedException; +import com.baeldung.jhipster.uaa.web.rest.errors.LoginAlreadyUsedException; +import com.baeldung.jhipster.uaa.web.rest.util.HeaderUtil; +import com.baeldung.jhipster.uaa.web.rest.util.PaginationUtil; +import com.codahale.metrics.annotation.Timed; +import io.github.jhipster.web.util.ResponseUtil; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.*; + +/** + * REST controller for managing users. + *

+ * This class accesses the User entity, and needs to fetch its collection of authorities. + *

+ * For a normal use-case, it would be better to have an eager relationship between User and Authority, + * and send everything to the client side: there would be no View Model and DTO, a lot less code, and an outer-join + * which would be good for performance. + *

+ * We use a View Model and a DTO for 3 reasons: + *

    + *
  • We want to keep a lazy association between the user and the authorities, because people will + * quite often do relationships with the user, and we don't want them to get the authorities all + * the time for nothing (for performance reasons). This is the #1 goal: we should not impact our users' + * application because of this use-case.
  • + *
  • Not having an outer join causes n+1 requests to the database. This is not a real issue as + * we have by default a second-level cache. This means on the first HTTP call we do the n+1 requests, + * but then all authorities come from the cache, so in fact it's much better than doing an outer join + * (which will get lots of data from the database, for each HTTP call).
  • + *
  • As this manages users, for security reasons, we'd rather have a DTO layer.
  • + *
+ *

+ * Another option would be to have a specific JPA entity graph to handle this case. + */ +@RestController +@RequestMapping("/api") +public class UserResource { + + private final Logger log = LoggerFactory.getLogger(UserResource.class); + + private final UserService userService; + + private final UserRepository userRepository; + + private final MailService mailService; + + public UserResource(UserService userService, UserRepository userRepository, MailService mailService) { + + this.userService = userService; + this.userRepository = userRepository; + this.mailService = mailService; + } + + /** + * POST /users : Creates a new user. + *

+ * Creates a new user if the login and email are not already used, and sends an + * mail with an activation link. + * The user needs to be activated on creation. + * + * @param userDTO the user to create + * @return the ResponseEntity with status 201 (Created) and with body the new user, or with status 400 (Bad Request) if the login or email is already in use + * @throws URISyntaxException if the Location URI syntax is incorrect + * @throws BadRequestAlertException 400 (Bad Request) if the login or email is already in use + */ + @PostMapping("/users") + @Timed + @PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")") + public ResponseEntity createUser(@Valid @RequestBody UserDTO userDTO) throws URISyntaxException { + log.debug("REST request to save User : {}", userDTO); + + if (userDTO.getId() != null) { + throw new BadRequestAlertException("A new user cannot already have an ID", "userManagement", "idexists"); + // Lowercase the user login before comparing with database + } else if (userRepository.findOneByLogin(userDTO.getLogin().toLowerCase()).isPresent()) { + throw new LoginAlreadyUsedException(); + } else if (userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()).isPresent()) { + throw new EmailAlreadyUsedException(); + } else { + User newUser = userService.createUser(userDTO); + mailService.sendCreationEmail(newUser); + return ResponseEntity.created(new URI("/api/users/" + newUser.getLogin())) + .headers(HeaderUtil.createAlert( "userManagement.created", newUser.getLogin())) + .body(newUser); + } + } + + /** + * PUT /users : Updates an existing User. + * + * @param userDTO the user to update + * @return the ResponseEntity with status 200 (OK) and with body the updated user + * @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already in use + * @throws LoginAlreadyUsedException 400 (Bad Request) if the login is already in use + */ + @PutMapping("/users") + @Timed + @PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")") + public ResponseEntity updateUser(@Valid @RequestBody UserDTO userDTO) { + log.debug("REST request to update User : {}", userDTO); + Optional existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()); + if (existingUser.isPresent() && (!existingUser.get().getId().equals(userDTO.getId()))) { + throw new EmailAlreadyUsedException(); + } + existingUser = userRepository.findOneByLogin(userDTO.getLogin().toLowerCase()); + if (existingUser.isPresent() && (!existingUser.get().getId().equals(userDTO.getId()))) { + throw new LoginAlreadyUsedException(); + } + Optional updatedUser = userService.updateUser(userDTO); + + return ResponseUtil.wrapOrNotFound(updatedUser, + HeaderUtil.createAlert("userManagement.updated", userDTO.getLogin())); + } + + /** + * GET /users : get all users. + * + * @param pageable the pagination information + * @return the ResponseEntity with status 200 (OK) and with body all users + */ + @GetMapping("/users") + @Timed + public ResponseEntity> getAllUsers(Pageable pageable) { + final Page page = userService.getAllManagedUsers(pageable); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/users"); + return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); + } + + /** + * @return a string list of the all of the roles + */ + @GetMapping("/users/authorities") + @Timed + @PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")") + public List getAuthorities() { + return userService.getAuthorities(); + } + + /** + * GET /users/:login : get the "login" user. + * + * @param login the login of the user to find + * @return the ResponseEntity with status 200 (OK) and with body the "login" user, or with status 404 (Not Found) + */ + @GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}") + @Timed + public ResponseEntity getUser(@PathVariable String login) { + log.debug("REST request to get User : {}", login); + return ResponseUtil.wrapOrNotFound( + userService.getUserWithAuthoritiesByLogin(login) + .map(UserDTO::new)); + } + + /** + * DELETE /users/:login : delete the "login" User. + * + * @param login the login of the user to delete + * @return the ResponseEntity with status 200 (OK) + */ + @DeleteMapping("/users/{login:" + Constants.LOGIN_REGEX + "}") + @Timed + @PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")") + public ResponseEntity deleteUser(@PathVariable String login) { + log.debug("REST request to delete User: {}", login); + userService.deleteUser(login); + return ResponseEntity.ok().headers(HeaderUtil.createAlert( "userManagement.deleted", login)).build(); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/BadRequestAlertException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/BadRequestAlertException.java new file mode 100644 index 0000000000..f406afe24f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/BadRequestAlertException.java @@ -0,0 +1,42 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +public class BadRequestAlertException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + private final String entityName; + + private final String errorKey; + + public BadRequestAlertException(String defaultMessage, String entityName, String errorKey) { + this(ErrorConstants.DEFAULT_TYPE, defaultMessage, entityName, errorKey); + } + + public BadRequestAlertException(URI type, String defaultMessage, String entityName, String errorKey) { + super(type, defaultMessage, Status.BAD_REQUEST, null, null, null, getAlertParameters(entityName, errorKey)); + this.entityName = entityName; + this.errorKey = errorKey; + } + + public String getEntityName() { + return entityName; + } + + public String getErrorKey() { + return errorKey; + } + + private static Map getAlertParameters(String entityName, String errorKey) { + Map parameters = new HashMap<>(); + parameters.put("message", "error." + errorKey); + parameters.put("params", entityName); + return parameters; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/CustomParameterizedException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/CustomParameterizedException.java new file mode 100644 index 0000000000..ab0c08a12a --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/CustomParameterizedException.java @@ -0,0 +1,54 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; + +import java.util.HashMap; +import java.util.Map; + +import static org.zalando.problem.Status.BAD_REQUEST; + +/** + * Custom, parameterized exception, which can be translated on the client side. + * For example: + * + *

+ * throw new CustomParameterizedException("myCustomError", "hello", "world");
+ * 
+ * + * Can be translated with: + * + *
+ * "error.myCustomError" :  "The server says {{param0}} to {{param1}}"
+ * 
+ */ +public class CustomParameterizedException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + private static final String PARAM = "param"; + + public CustomParameterizedException(String message, String... params) { + this(message, toParamMap(params)); + } + + public CustomParameterizedException(String message, Map paramMap) { + super(ErrorConstants.PARAMETERIZED_TYPE, "Parameterized Exception", BAD_REQUEST, null, null, null, toProblemParameters(message, paramMap)); + } + + public static Map toParamMap(String... params) { + Map paramMap = new HashMap<>(); + if (params != null && params.length > 0) { + for (int i = 0; i < params.length; i++) { + paramMap.put(PARAM + i, params[i]); + } + } + return paramMap; + } + + public static Map toProblemParameters(String message, Map paramMap) { + Map parameters = new HashMap<>(); + parameters.put("message", message); + parameters.put("params", paramMap); + return parameters; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailAlreadyUsedException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailAlreadyUsedException.java new file mode 100644 index 0000000000..e1780ab42a --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailAlreadyUsedException.java @@ -0,0 +1,10 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +public class EmailAlreadyUsedException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public EmailAlreadyUsedException() { + super(ErrorConstants.EMAIL_ALREADY_USED_TYPE, "Email is already in use!", "userManagement", "emailexists"); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailNotFoundException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailNotFoundException.java new file mode 100644 index 0000000000..40487d117f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/EmailNotFoundException.java @@ -0,0 +1,13 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +public class EmailNotFoundException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public EmailNotFoundException() { + super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ErrorConstants.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ErrorConstants.java new file mode 100644 index 0000000000..9cf7cfdde4 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ErrorConstants.java @@ -0,0 +1,21 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import java.net.URI; + +public final class ErrorConstants { + + public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; + public static final String ERR_VALIDATION = "error.validation"; + public static final String PROBLEM_BASE_URL = "https://www.jhipster.tech/problem"; + public static final URI DEFAULT_TYPE = URI.create(PROBLEM_BASE_URL + "/problem-with-message"); + public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create(PROBLEM_BASE_URL + "/constraint-violation"); + public static final URI PARAMETERIZED_TYPE = URI.create(PROBLEM_BASE_URL + "/parameterized"); + public static final URI ENTITY_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/entity-not-found"); + public static final URI INVALID_PASSWORD_TYPE = URI.create(PROBLEM_BASE_URL + "/invalid-password"); + public static final URI EMAIL_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/email-already-used"); + public static final URI LOGIN_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/login-already-used"); + public static final URI EMAIL_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/email-not-found"); + + private ErrorConstants() { + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslator.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslator.java new file mode 100644 index 0000000000..320636c51d --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslator.java @@ -0,0 +1,107 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import com.baeldung.jhipster.uaa.web.rest.util.HeaderUtil; + +import org.springframework.dao.ConcurrencyFailureException; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.context.request.NativeWebRequest; +import org.zalando.problem.DefaultProblem; +import org.zalando.problem.Problem; +import org.zalando.problem.ProblemBuilder; +import org.zalando.problem.Status; +import org.zalando.problem.spring.web.advice.ProblemHandling; +import org.zalando.problem.violations.ConstraintViolationProblem; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.stream.Collectors; + +/** + * Controller advice to translate the server side exceptions to client-friendly json structures. + * The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807) + */ +@ControllerAdvice +public class ExceptionTranslator implements ProblemHandling { + + /** + * Post-process the Problem payload to add the message key for the front-end if needed + */ + @Override + public ResponseEntity process(@Nullable ResponseEntity entity, NativeWebRequest request) { + if (entity == null) { + return entity; + } + Problem problem = entity.getBody(); + if (!(problem instanceof ConstraintViolationProblem || problem instanceof DefaultProblem)) { + return entity; + } + ProblemBuilder builder = Problem.builder() + .withType(Problem.DEFAULT_TYPE.equals(problem.getType()) ? ErrorConstants.DEFAULT_TYPE : problem.getType()) + .withStatus(problem.getStatus()) + .withTitle(problem.getTitle()) + .with("path", request.getNativeRequest(HttpServletRequest.class).getRequestURI()); + + if (problem instanceof ConstraintViolationProblem) { + builder + .with("violations", ((ConstraintViolationProblem) problem).getViolations()) + .with("message", ErrorConstants.ERR_VALIDATION); + } else { + builder + .withCause(((DefaultProblem) problem).getCause()) + .withDetail(problem.getDetail()) + .withInstance(problem.getInstance()); + problem.getParameters().forEach(builder::with); + if (!problem.getParameters().containsKey("message") && problem.getStatus() != null) { + builder.with("message", "error.http." + problem.getStatus().getStatusCode()); + } + } + return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode()); + } + + @Override + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex, @Nonnull NativeWebRequest request) { + BindingResult result = ex.getBindingResult(); + List fieldErrors = result.getFieldErrors().stream() + .map(f -> new FieldErrorVM(f.getObjectName(), f.getField(), f.getCode())) + .collect(Collectors.toList()); + + Problem problem = Problem.builder() + .withType(ErrorConstants.CONSTRAINT_VIOLATION_TYPE) + .withTitle("Method argument not valid") + .withStatus(defaultConstraintViolationStatus()) + .with("message", ErrorConstants.ERR_VALIDATION) + .with("fieldErrors", fieldErrors) + .build(); + return create(ex, problem, request); + } + + @ExceptionHandler + public ResponseEntity handleNoSuchElementException(NoSuchElementException ex, NativeWebRequest request) { + Problem problem = Problem.builder() + .withStatus(Status.NOT_FOUND) + .with("message", ErrorConstants.ENTITY_NOT_FOUND_TYPE) + .build(); + return create(ex, problem, request); + } + + @ExceptionHandler + public ResponseEntity handleBadRequestAlertException(BadRequestAlertException ex, NativeWebRequest request) { + return create(ex, request, HeaderUtil.createFailureAlert(ex.getEntityName(), ex.getErrorKey(), ex.getMessage())); + } + + @ExceptionHandler + public ResponseEntity handleConcurrencyFailure(ConcurrencyFailureException ex, NativeWebRequest request) { + Problem problem = Problem.builder() + .withStatus(Status.CONFLICT) + .with("message", ErrorConstants.ERR_CONCURRENCY_FAILURE) + .build(); + return create(ex, problem, request); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/FieldErrorVM.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/FieldErrorVM.java new file mode 100644 index 0000000000..9f7c857374 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/FieldErrorVM.java @@ -0,0 +1,33 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import java.io.Serializable; + +public class FieldErrorVM implements Serializable { + + private static final long serialVersionUID = 1L; + + private final String objectName; + + private final String field; + + private final String message; + + public FieldErrorVM(String dto, String field, String message) { + this.objectName = dto; + this.field = field; + this.message = message; + } + + public String getObjectName() { + return objectName; + } + + public String getField() { + return field; + } + + public String getMessage() { + return message; + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InternalServerErrorException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InternalServerErrorException.java new file mode 100644 index 0000000000..43b50b86d5 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InternalServerErrorException.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +/** + * Simple exception with a message, that returns an Internal Server Error code. + */ +public class InternalServerErrorException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public InternalServerErrorException(String message) { + super(ErrorConstants.DEFAULT_TYPE, message, Status.INTERNAL_SERVER_ERROR); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InvalidPasswordException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InvalidPasswordException.java new file mode 100644 index 0000000000..f4662f5a94 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/InvalidPasswordException.java @@ -0,0 +1,13 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import org.zalando.problem.AbstractThrowableProblem; +import org.zalando.problem.Status; + +public class InvalidPasswordException extends AbstractThrowableProblem { + + private static final long serialVersionUID = 1L; + + public InvalidPasswordException() { + super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/LoginAlreadyUsedException.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/LoginAlreadyUsedException.java new file mode 100644 index 0000000000..35bc827501 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/LoginAlreadyUsedException.java @@ -0,0 +1,10 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +public class LoginAlreadyUsedException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public LoginAlreadyUsedException() { + super(ErrorConstants.LOGIN_ALREADY_USED_TYPE, "Login name already used!", "userManagement", "userexists"); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/package-info.java new file mode 100644 index 0000000000..8fe243f8c0 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/errors/package-info.java @@ -0,0 +1,6 @@ +/** + * Specific errors used with Zalando's "problem-spring-web" library. + * + * More information on https://github.com/zalando/problem-spring-web + */ +package com.baeldung.jhipster.uaa.web.rest.errors; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/package-info.java new file mode 100644 index 0000000000..28eb2dda3e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/package-info.java @@ -0,0 +1,4 @@ +/** + * Spring MVC REST controllers. + */ +package com.baeldung.jhipster.uaa.web.rest; diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/HeaderUtil.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/HeaderUtil.java new file mode 100644 index 0000000000..1ce4ab7664 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/HeaderUtil.java @@ -0,0 +1,45 @@ +package com.baeldung.jhipster.uaa.web.rest.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; + +/** + * Utility class for HTTP headers creation. + */ +public final class HeaderUtil { + + private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class); + + private static final String APPLICATION_NAME = "uaaApp"; + + private HeaderUtil() { + } + + public static HttpHeaders createAlert(String message, String param) { + HttpHeaders headers = new HttpHeaders(); + headers.add("X-" + APPLICATION_NAME + "-alert", message); + headers.add("X-" + APPLICATION_NAME + "-params", param); + return headers; + } + + public static HttpHeaders createEntityCreationAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".created", param); + } + + public static HttpHeaders createEntityUpdateAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".updated", param); + } + + public static HttpHeaders createEntityDeletionAlert(String entityName, String param) { + return createAlert(APPLICATION_NAME + "." + entityName + ".deleted", param); + } + + public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) { + log.error("Entity processing failed, {}", defaultMessage); + HttpHeaders headers = new HttpHeaders(); + headers.add("X-" + APPLICATION_NAME + "-error", "error." + errorKey); + headers.add("X-" + APPLICATION_NAME + "-params", entityName); + return headers; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtil.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtil.java new file mode 100644 index 0000000000..d8596539ed --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtil.java @@ -0,0 +1,45 @@ +package com.baeldung.jhipster.uaa.web.rest.util; + +import org.springframework.data.domain.Page; +import org.springframework.http.HttpHeaders; +import org.springframework.web.util.UriComponentsBuilder; + +/** + * Utility class for handling pagination. + * + *

+ * Pagination uses the same principles as the GitHub API, + * and follow RFC 5988 (Link header). + */ +public final class PaginationUtil { + + private PaginationUtil() { + } + + public static HttpHeaders generatePaginationHttpHeaders(Page page, String baseUrl) { + + HttpHeaders headers = new HttpHeaders(); + headers.add("X-Total-Count", Long.toString(page.getTotalElements())); + String link = ""; + if ((page.getNumber() + 1) < page.getTotalPages()) { + link = "<" + generateUri(baseUrl, page.getNumber() + 1, page.getSize()) + ">; rel=\"next\","; + } + // prev link + if ((page.getNumber()) > 0) { + link += "<" + generateUri(baseUrl, page.getNumber() - 1, page.getSize()) + ">; rel=\"prev\","; + } + // last and first link + int lastPage = 0; + if (page.getTotalPages() > 0) { + lastPage = page.getTotalPages() - 1; + } + link += "<" + generateUri(baseUrl, lastPage, page.getSize()) + ">; rel=\"last\","; + link += "<" + generateUri(baseUrl, 0, page.getSize()) + ">; rel=\"first\""; + headers.add(HttpHeaders.LINK, link); + return headers; + } + + private static String generateUri(String baseUrl, int page, int size) { + return UriComponentsBuilder.fromUriString(baseUrl).queryParam("page", page).queryParam("size", size).toUriString(); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/KeyAndPasswordVM.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/KeyAndPasswordVM.java new file mode 100644 index 0000000000..8e9c3843bb --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/KeyAndPasswordVM.java @@ -0,0 +1,27 @@ +package com.baeldung.jhipster.uaa.web.rest.vm; + +/** + * View Model object for storing the user's key and password. + */ +public class KeyAndPasswordVM { + + private String key; + + private String newPassword; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/LoggerVM.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/LoggerVM.java new file mode 100644 index 0000000000..45357b14c2 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/LoggerVM.java @@ -0,0 +1,46 @@ +package com.baeldung.jhipster.uaa.web.rest.vm; + +import ch.qos.logback.classic.Logger; + +/** + * View Model object for storing a Logback logger. + */ +public class LoggerVM { + + private String name; + + private String level; + + public LoggerVM(Logger logger) { + this.name = logger.getName(); + this.level = logger.getEffectiveLevel().toString(); + } + + public LoggerVM() { + // Empty public constructor used by Jackson. + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + @Override + public String toString() { + return "LoggerVM{" + + "name='" + name + '\'' + + ", level='" + level + '\'' + + '}'; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/ManagedUserVM.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/ManagedUserVM.java new file mode 100644 index 0000000000..ad6b11eb5f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/ManagedUserVM.java @@ -0,0 +1,35 @@ +package com.baeldung.jhipster.uaa.web.rest.vm; + +import com.baeldung.jhipster.uaa.service.dto.UserDTO; +import javax.validation.constraints.Size; + +/** + * View Model extending the UserDTO, which is meant to be used in the user management UI. + */ +public class ManagedUserVM extends UserDTO { + + public static final int PASSWORD_MIN_LENGTH = 4; + + public static final int PASSWORD_MAX_LENGTH = 100; + + @Size(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH) + private String password; + + public ManagedUserVM() { + // Empty constructor needed for Jackson. + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public String toString() { + return "ManagedUserVM{" + + "} " + super.toString(); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/package-info.java b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/package-info.java new file mode 100644 index 0000000000..0574701dbc --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/java/com/baeldung/jhipster/uaa/web/rest/vm/package-info.java @@ -0,0 +1,4 @@ +/** + * View Models used by Spring MVC REST controllers. + */ +package com.baeldung.jhipster.uaa.web.rest.vm; diff --git a/jhipster/jhipster-uaa/uaa/src/main/jib/entrypoint.sh b/jhipster/jhipster-uaa/uaa/src/main/jib/entrypoint.sh new file mode 100644 index 0000000000..44808a8fde --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/jib/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} +exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "com.baeldung.jhipster.uaa.UaaApp" "$@" diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/.h2.server.properties b/jhipster/jhipster-uaa/uaa/src/main/resources/.h2.server.properties new file mode 100644 index 0000000000..e36bc911c7 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/.h2.server.properties @@ -0,0 +1,5 @@ +#H2 Server Properties +0=JHipster H2 (Disk)|org.h2.Driver|jdbc\:h2\:file\:./target/h2db/db/uaa|uaa +webAllowOthers=true +webPort=8082 +webSSL=false diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/banner.txt b/jhipster/jhipster-uaa/uaa/src/main/resources/banner.txt new file mode 100644 index 0000000000..e0bc55aaff --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/banner.txt @@ -0,0 +1,10 @@ + + ${AnsiColor.GREEN} ██╗${AnsiColor.RED} ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗ + ${AnsiColor.GREEN} ██║${AnsiColor.RED} ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗ + ${AnsiColor.GREEN} ██║${AnsiColor.RED} ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝ + ${AnsiColor.GREEN}██╗ ██║${AnsiColor.RED} ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ + ${AnsiColor.GREEN}╚██████╔╝${AnsiColor.RED} ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ + ${AnsiColor.GREEN} ╚═════╝ ${AnsiColor.RED} ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ + +${AnsiColor.BRIGHT_BLUE}:: JHipster 🤓 :: Running Spring Boot ${spring-boot.version} :: +:: https://www.jhipster.tech ::${AnsiColor.DEFAULT} diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-dev.yml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-dev.yml new file mode 100644 index 0000000000..874b2cd533 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-dev.yml @@ -0,0 +1,157 @@ +# =================================================================== +# Spring Boot configuration for the "dev" profile. +# +# This configuration overrides the application.yml file. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +logging: + level: + ROOT: DEBUG + io.github.jhipster: DEBUG + com.baeldung.jhipster.uaa: DEBUG + +eureka: + instance: + prefer-ip-address: true + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ + +spring: + profiles: + active: dev + include: + - swagger + # Uncomment to activate TLS for the dev profile + #- tls + devtools: + restart: + enabled: true + livereload: + enabled: false # we use Webpack dev server + BrowserSync for livereload + jackson: + serialization.indent_output: true + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:h2:file:./target/h2db/db/uaa;DB_CLOSE_DELAY=-1 + username: uaa + password: + hikari: + auto-commit: false + h2: + console: + enabled: false + jpa: + database-platform: io.github.jhipster.domain.util.FixedH2Dialect + database: H2 + show-sql: true + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: true + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: true + hibernate.cache.region.factory_class: com.hazelcast.hibernate.HazelcastCacheRegionFactory + hibernate.cache.hazelcast.instance_name: uaa + hibernate.cache.use_minimal_puts: true + hibernate.cache.hazelcast.use_lite_member: true + liquibase: + contexts: dev + mail: + host: localhost + port: 25 + username: + password: + messages: + cache-duration: PT1S # 1 second, see the ISO 8601 standard + thymeleaf: + cache: false + sleuth: + sampler: + percentage: 1 # report 100% of traces + zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies + base-url: http://localhost:9411 + enabled: false + locator: + discovery: + enabled: true + +server: + port: 9999 + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + http: + version: V_1_1 # To use HTTP/2 you will need to activate TLS (see application-tls.yml) + cache: # Cache configuration + hazelcast: # Hazelcast distributed cache + time-to-live-seconds: 3600 + backup-count: 1 + management-center: # Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + enabled: false + update-interval: 3 + url: http://localhost:8180/mancenter + # CORS is only enabled by default with the "dev" profile, so BrowserSync can access the API + cors: + allowed-origins: "*" + allowed-methods: "*" + allowed-headers: "*" + exposed-headers: "Authorization,Link,X-Total-Count" + allow-credentials: true + max-age: 1800 + security: + client-authorization: + client-id: internal + client-secret: internal + mail: # specific JHipster mail property, for standard properties see MailProperties + from: uaa@localhost + base-url: http://127.0.0.1:8080 + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx: + enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: false + report-frequency: 60 # in seconds + logging: + logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration + enabled: false + host: localhost + port: 5000 + queue-size: 512 +uaa: + key-store: + name: config/tls/keystore.p12 + password: password + alias: selfsigned + web-client-configuration: + # Access Token is valid for 5 mins + access-token-validity-in-seconds: 3000 + # Refresh Token is valid for 7 days + refresh-token-validity-in-seconds-for-remember-me: 604800 + client-id: web_app + secret: changeit + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-prod.yml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-prod.yml new file mode 100644 index 0000000000..0d4c3c55a7 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-prod.yml @@ -0,0 +1,175 @@ +# =================================================================== +# Spring Boot configuration for the "prod" profile. +# +# This configuration overrides the application.yml file. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +logging: + level: + ROOT: INFO + com.baeldung.jhipster.uaa: INFO + io.github.jhipster: INFO + +eureka: + instance: + prefer-ip-address: true + client: + service-url: + defaultZone: http://admin:${jhipster.registry.password}@localhost:8761/eureka/ + +spring: + devtools: + restart: + enabled: false + livereload: + enabled: false + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:mysql://localhost:3306/uaa?useUnicode=true&characterEncoding=utf8&useSSL=false + username: root + password: + hikari: + auto-commit: false + data-source-properties: + cachePrepStmts: true + prepStmtCacheSize: 250 + prepStmtCacheSqlLimit: 2048 + useServerPrepStmts: true + jpa: + database-platform: org.hibernate.dialect.MySQL5InnoDBDialect + database: MYSQL + show-sql: false + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: true + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: false + hibernate.cache.region.factory_class: com.hazelcast.hibernate.HazelcastCacheRegionFactory + hibernate.cache.hazelcast.instance_name: uaa + hibernate.cache.use_minimal_puts: true + hibernate.cache.hazelcast.use_lite_member: true + liquibase: + contexts: prod + mail: + host: localhost + port: 25 + username: + password: + thymeleaf: + cache: true + sleuth: + sampler: + percentage: 1 # report 100% of traces + zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies + base-url: http://localhost:9411 + enabled: false + locator: + discovery: + enabled: true + +# =================================================================== +# To enable TLS in production, generate a certificate using: +# keytool -genkey -alias uaa -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650 +# +# You can also use Let's Encrypt: +# https://maximilian-boehm.com/hp2121/Create-a-Java-Keystore-JKS-from-Let-s-Encrypt-Certificates.htm +# +# Then, modify the server.ssl properties so your "server" configuration looks like: +# +# server: +# port: 443 +# ssl: +# key-store: classpath:config/tls/keystore.p12 +# key-store-password: password +# key-store-type: PKCS12 +# key-alias: uaa +# # The ciphers suite enforce the security by deactivating some old and deprecated SSL cipher, this list was tested against SSL Labs (https://www.ssllabs.com/ssltest/) +# ciphers: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 ,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,TLS_RSA_WITH_CAMELLIA_128_CBC_SHA +# =================================================================== +server: + port: 9999 + compression: + enabled: true + mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json + min-response-size: 1024 + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + http: + version: V_1_1 # To use HTTP/2 you will need SSL support (see above the "server.ssl" configuration) + cache: # Used by the CachingHttpHeadersFilter + timeToLiveInDays: 1461 + cache: # Cache configuration + hazelcast: # Hazelcast distributed cache + time-to-live-seconds: 3600 + backup-count: 1 + management-center: # Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html + enabled: false + update-interval: 3 + url: + security: + client-authorization: + client-id: internal + client-secret: internal + authentication: + jwt: + # Access Token is valid for 5 mins + token-validity-in-seconds: 300 + # Refresh Token is valid for 7 days + token-validity-in-seconds-for-remember-me: 252000 + mail: # specific JHipster mail property, for standard properties see MailProperties + from: uaa@localhost + base-url: http://my-server-url-to-change # Modify according to your server's URL + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx: + enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: false + report-frequency: 60 # in seconds + logging: + logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration + enabled: false + host: localhost + port: 5000 + queue-size: 512 +uaa: + #be sure to to change to a different keystore in production! + #create one using: keytool -genkey -alias uaa -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650 + key-store: + name: config/tls/keystore.p12 + password: password + alias: selfsigned + web-client-configuration: + # Access Token is valid for 5 mins + access-token-validity-in-seconds: 300 + # Refresh Token is valid for 7 days + refresh-token-validity-in-seconds-for-remember-me: 604800 + #change client secret in production, keep in sync with gateway configuration + client-id: web_app + secret: changeit + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-tls.yml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-tls.yml new file mode 100644 index 0000000000..e082c8f455 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application-tls.yml @@ -0,0 +1,18 @@ +# =================================================================== +# Activate this profile to enable TLS and HTTP/2. +# +# JHipster has generated a self-signed certificate, which will be used to encrypt traffic. +# As your browser will not understand this certificate, you will need to import it. +# +# Another (easiest) solution with Chrome is to enable the "allow-insecure-localhost" flag +# at chrome://flags/#allow-insecure-localhost +# =================================================================== +server: + ssl: + key-store: classpath:config/tls/keystore.p12 + key-store-password: password + key-store-type: PKCS12 + key-alias: selfsigned +jhipster: + http: + version: V_2_0 diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/application.yml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application.yml new file mode 100644 index 0000000000..0dfe1a15ce --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/application.yml @@ -0,0 +1,139 @@ +# =================================================================== +# Spring Boot configuration. +# +# This configuration will be overridden by the Spring profile you use, +# for example application-dev.yml if you use the "dev" profile. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +eureka: + client: + enabled: true + healthcheck: + enabled: true + fetch-registry: true + register-with-eureka: true + instance-info-replication-interval-seconds: 10 + registry-fetch-interval-seconds: 10 + instance: + appname: uaa + instanceId: uaa:${spring.application.instance-id:${random.value}} + lease-renewal-interval-in-seconds: 5 + lease-expiration-duration-in-seconds: 10 + status-page-url-path: ${management.endpoints.web.base-path}/info + health-check-url-path: ${management.endpoints.web.base-path}/health + metadata-map: + zone: primary # This is needed for the load balancer + profile: ${spring.profiles.active} + version: ${info.project.version:} + git-version: ${git.commit.id.describe:} + git-commit: ${git.commit.id.abbrev:} + git-branch: ${git.branch:} +ribbon: + eureka: + enabled: true +management: + endpoints: + web: + base-path: /management + exposure: + include: ["configprops", "env", "health", "info", "threaddump", "logfile" ] + endpoint: + health: + show-details: when_authorized + info: + git: + mode: full + health: + mail: + enabled: false # When using the MailService, configure an SMTP server and set this to true + metrics: + enabled: false # http://micrometer.io/ is disabled by default, as we use http://metrics.dropwizard.io/ instead + +spring: + application: + name: uaa + jpa: + open-in-view: false + hibernate: + ddl-auto: none + naming: + physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + messages: + basename: i18n/messages + mvc: + favicon: + enabled: false + thymeleaf: + mode: HTML +security: + oauth2: + resource: + filter-order: 3 + +server: + servlet: + session: + cookie: + http-only: true + +# Properties to be exposed on the /info management endpoint +info: + # Comma separated list of profiles that will trigger the ribbon to show + display-ribbon-on-profiles: "dev" + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + async: + core-pool-size: 2 + max-pool-size: 50 + queue-capacity: 10000 + # By default CORS is disabled. Uncomment to enable. + #cors: + #allowed-origins: "*" + #allowed-methods: "*" + #allowed-headers: "*" + #exposed-headers: "Authorization,Link,X-Total-Count" + #allow-credentials: true + #max-age: 1800 + mail: + from: uaa@localhost + swagger: + default-include-pattern: /api/.* + title: uaa API + description: uaa API documentation + version: 0.0.1 + terms-of-service-url: + contact-name: + contact-url: + contact-email: + license: + license-url: + +logging: + file: target/uaa.log + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap-prod.yml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap-prod.yml new file mode 100644 index 0000000000..078fafda5c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap-prod.yml @@ -0,0 +1,22 @@ +# =================================================================== +# Spring Cloud Config bootstrap configuration for the "prod" profile +# =================================================================== + +spring: + cloud: + config: + fail-fast: true + retry: + initial-interval: 1000 + max-interval: 2000 + max-attempts: 100 + uri: http://admin:${jhipster.registry.password}@localhost:8761/config + # name of the config server's property source (file.yml) that we want to use + name: uaa + profile: prod # profile(s) of the property source + label: master # toggle to switch to a different version of the configuration as stored in git + # it can be set to any label, branch or commit of the configuration source Git repository + +jhipster: + registry: + password: admin diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap.yml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap.yml new file mode 100644 index 0000000000..2edc350d9e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/bootstrap.yml @@ -0,0 +1,26 @@ +# =================================================================== +# Spring Cloud Config bootstrap configuration for the "dev" profile +# In prod profile, properties will be overwriten by the ones defined in bootstrap-prod.yml +# =================================================================== + +jhipster: + registry: + password: admin + +spring: + application: + name: uaa + profiles: + # The commented value for `active` can be replaced with valid Spring profiles to load. + # Otherwise, it will be filled in by maven when building the WAR file + # Either way, it can be overridden by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS` + active: #spring.profiles.active# + cloud: + config: + fail-fast: false # if not in "prod" profile, do not force to use Spring Cloud Config + uri: http://admin:${jhipster.registry.password}@localhost:8761/config + # name of the config server's property source (file.yml) that we want to use + name: uaa + profile: dev # profile(s) of the property source + label: master # toggle to switch to a different version of the configuration as stored in git + # it can be set to any label, branch or commit of the configuration source Git repository diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/authorities.csv b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/authorities.csv new file mode 100644 index 0000000000..af5c6dfa18 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/authorities.csv @@ -0,0 +1,3 @@ +name +ROLE_ADMIN +ROLE_USER diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml new file mode 100644 index 0000000000..3e3d8cd134 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/master.xml b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/master.xml new file mode 100644 index 0000000000..f2b0b1f7e6 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/master.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users.csv b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users.csv new file mode 100644 index 0000000000..b25922b699 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users.csv @@ -0,0 +1,5 @@ +id;login;password_hash;first_name;last_name;email;image_url;activated;lang_key;created_by;last_modified_by +1;system;$2a$10$mE.qmcV0mFU5NcKh73TZx.z4ueI/.bDWbj0T1BYyqP481kGGarKLG;System;System;system@localhost;;true;en;system;system +2;anonymoususer;$2a$10$j8S5d7Sr7.8VTOYNviDPOeWX8KcYILUVJBsYV83Y5NtECayypx9lO;Anonymous;User;anonymous@localhost;;true;en;system;system +3;admin;$2a$10$gSAhZrxMllrbgj/kkK9UceBPpChGWJA7SYIb1Mqo.n5aNLq1/oRrC;Administrator;Administrator;admin@localhost;;true;en;system;system +4;user;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;User;User;user@localhost;;true;en;system;system diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users_authorities.csv b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users_authorities.csv new file mode 100644 index 0000000000..06c5feeeea --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/config/liquibase/users_authorities.csv @@ -0,0 +1,6 @@ +user_id;authority_name +1;ROLE_ADMIN +1;ROLE_USER +3;ROLE_ADMIN +3;ROLE_USER +4;ROLE_USER diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/config/tls/keystore.p12 b/jhipster/jhipster-uaa/uaa/src/main/resources/config/tls/keystore.p12 new file mode 100644 index 0000000000000000000000000000000000000000..dee8bf3320cdfd3bb9adb7d46aa50e51fd66298f GIT binary patch literal 2612 zcmY+EcQhLc8^%M1y;D@}5wRk66+zV=H4-k>qP4dgH7n9kYKB`BH7Yf0_SP1OU0S0t zY8FL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20r> z0LjBL-TuHgbAsfg^4+E#Luy2UhbQYxE*Mm4!|O!Us`5W@caO^fLAJy#j`+F&B@?8? z-=t)MD)94Fjz#Etd|@DNo}Q_)may{wExURKgP zXXuT;OAL^6tXiB~CiHZGbJ71Nq5BtTA%B5ZfVfTb_$_+`6rIHPT$Mn}<02CO0xcE? zV(jddqWxjsa(g>X<7=nCRYcf2s6(Tz>m-$1_ zSHT_nM0#q9uq^3+pKai@?M*1xGATj=;dzC}fJ(F&qCJa4!*Xs|p-y#JYSu|d}RqE+*E@F43&??`7J zR$U=;;hM&BX;D8?25;h^R#9LOI}5@({aFjU_*m@<$Y!kGengG$8KRd#wO9jp{0yfy<)NX)xD%$wZ#uW|m&yQcl9IJpbIf z$Vb(u*HwcA?$}GHJv^iAL?AXIXmeL=YTGrv=rwe_tbb*<3R{-Z_Olf9i=G;_`DsBa zUxcUrmZ;o)ci86Lu<8l!wgFOjKw(|?MkIS2!Scw%smuj|?L<%on^7IIFutE<@f z_144w94ZK0lh6}wI15nmQPXVJx_nVo{LnClYRlEv9uFCWULm-FzfCGAnnE^mM>O;$ zhZsZ%?jbh2Azds=y3XBx7iV@2!6kMARK~>jpQVJH@5}q^qWGs#!u+2q=ZzFeRd%aC zZFwtFfE|hNeO%_GGj+e!usz?{jBK_yMv*PI2+1Adm`&%64B0oYl$L5Asnn&O*}fb< zJkS)De1!TEHZGPCJv4kPv@lPEkD0eIuX;jql^djS(jcDb4KpIR@sm71*fD2+3e$XCSL&d8S$Jl_?%eAP=t7ll?GO8AM?L5d-nAYeIm zAiV$>0D>;kqF2wDTCUQ{GO+!lg$l4jbzu;+iCv_U{~kR7@LiM#v&S62i>*5N3nl*r D3d^u+ literal 0 HcmV?d00001 diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages.properties b/jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000000..c1822828a1 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Your request cannot be processed +error.subtitle=Sorry, an error has occurred. +error.status=Status: +error.message=Message: + +# Activation email +email.activation.title=uaa account activation +email.activation.greeting=Dear {0} +email.activation.text1=Your uaa account has been created, please click on the URL below to activate it: +email.activation.text2=Regards, +email.signature=uaa Team. + +# Creation email +email.creation.text1=Your uaa account has been created, please click on the URL below to access it: + +# Reset email +email.reset.title=uaa password reset +email.reset.greeting=Dear {0} +email.reset.text1=For your uaa account a password reset was requested, please click on the URL below to reset it: +email.reset.text2=Regards, diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages_en.properties b/jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages_en.properties new file mode 100644 index 0000000000..c1822828a1 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/i18n/messages_en.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Your request cannot be processed +error.subtitle=Sorry, an error has occurred. +error.status=Status: +error.message=Message: + +# Activation email +email.activation.title=uaa account activation +email.activation.greeting=Dear {0} +email.activation.text1=Your uaa account has been created, please click on the URL below to activate it: +email.activation.text2=Regards, +email.signature=uaa Team. + +# Creation email +email.creation.text1=Your uaa account has been created, please click on the URL below to access it: + +# Reset email +email.reset.title=uaa password reset +email.reset.greeting=Dear {0} +email.reset.text1=For your uaa account a password reset was requested, please click on the URL below to reset it: +email.reset.text2=Regards, diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/logback-spring.xml b/jhipster/jhipster-uaa/uaa/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..a30ab8c1d2 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/logback-spring.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/templates/error.html b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/error.html new file mode 100644 index 0000000000..08616bcf1e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/error.html @@ -0,0 +1,163 @@ + + + + + + Your request cannot be processed + + + +

+

Your request cannot be processed :(

+ +

Sorry, an error has occurred.

+ + Status:  ()
+ + Message: 
+
+ + + +
+ + diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/activationEmail.html b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/activationEmail.html new file mode 100644 index 0000000000..aa3822981e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/activationEmail.html @@ -0,0 +1,25 @@ + + + + JHipster activation + + + + +

+ Dear +

+

+ Your JHipster account has been created, please click on the URL below to activate it: +

+

+ Activation Link +

+

+ Regards, +
+ JHipster. +

+ + diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/creationEmail.html b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/creationEmail.html new file mode 100644 index 0000000000..95e73d149e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/creationEmail.html @@ -0,0 +1,27 @@ + + + + JHipster creation + + + + +

+ Dear +

+

+ Your JHipster account has been created, please click on the URL below to access it: +

+

+ + Login link + +

+

+ Regards, +
+ JHipster. +

+ + diff --git a/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/passwordResetEmail.html b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/passwordResetEmail.html new file mode 100644 index 0000000000..5a90f208b5 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/main/resources/templates/mail/passwordResetEmail.html @@ -0,0 +1,25 @@ + + + + JHipster password reset + + + + +

+ Dear +

+

+ For your JHipster account a password reset was requested, please click on the URL below to reset it: +

+

+ Login link +

+

+ Regards, +
+ JHipster. +

+ + diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/SecurityBeanOverrideConfiguration.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/SecurityBeanOverrideConfiguration.java new file mode 100644 index 0000000000..2c2e27e151 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/SecurityBeanOverrideConfiguration.java @@ -0,0 +1,35 @@ +package com.baeldung.jhipster.uaa.config; + +import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.web.client.RestTemplate; + +/** + * Overrides UAA specific beans, so they do not interfere the testing + * This configuration must be included in @SpringBootTest in order to take effect. + */ +@Configuration +public class SecurityBeanOverrideConfiguration { + + @Bean + @Primary + public TokenStore tokenStore() { + return null; + } + + @Bean + @Primary + public JwtAccessTokenConverter jwtAccessTokenConverter() { + return null; + } + + @Bean + @Primary + public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) { + return null; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTest.java new file mode 100644 index 0000000000..0d5b60c163 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTest.java @@ -0,0 +1,197 @@ +package com.baeldung.jhipster.uaa.config; + +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.servlet.InstrumentedFilter; +import com.codahale.metrics.servlets.MetricsServlet; +import io.github.jhipster.config.JHipsterConstants; +import io.github.jhipster.config.JHipsterProperties; +import io.undertow.Undertow; +import io.undertow.Undertow.Builder; +import io.undertow.UndertowOptions; + +import org.h2.server.web.WebServlet; +import org.junit.Before; +import org.junit.Test; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.mock.env.MockEnvironment; +import org.springframework.mock.web.MockServletContext; +import org.springframework.test.util.ReflectionTestUtils; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.xnio.OptionMap; + +import javax.servlet.*; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Unit tests for the WebConfigurer class. + * + * @see WebConfigurer + */ +public class WebConfigurerTest { + + private WebConfigurer webConfigurer; + + private MockServletContext servletContext; + + private MockEnvironment env; + + private JHipsterProperties props; + + private MetricRegistry metricRegistry; + + @Before + public void setup() { + servletContext = spy(new MockServletContext()); + doReturn(mock(FilterRegistration.Dynamic.class)) + .when(servletContext).addFilter(anyString(), any(Filter.class)); + doReturn(mock(ServletRegistration.Dynamic.class)) + .when(servletContext).addServlet(anyString(), any(Servlet.class)); + + env = new MockEnvironment(); + props = new JHipsterProperties(); + + webConfigurer = new WebConfigurer(env, props); + metricRegistry = new MetricRegistry(); + webConfigurer.setMetricRegistry(metricRegistry); + } + + @Test + public void testStartUpProdServletContext() throws ServletException { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); + webConfigurer.onStartup(servletContext); + + assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); + assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry); + verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class)); + verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class)); + verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class)); + } + + @Test + public void testStartUpDevServletContext() throws ServletException { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); + webConfigurer.onStartup(servletContext); + + assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); + assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry); + verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class)); + verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class)); + verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class)); + } + + @Test + public void testCustomizeServletContainer() { + env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); + UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); + webConfigurer.customize(container); + assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg"); + assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8"); + assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8"); + + Builder builder = Undertow.builder(); + container.getBuilderCustomizers().forEach(c -> c.customize(builder)); + OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions"); + assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isNull(); + } + + @Test + public void testUndertowHttp2Enabled() { + props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0); + UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); + webConfigurer.customize(container); + Builder builder = Undertow.builder(); + container.getBuilderCustomizers().forEach(c -> c.customize(builder)); + OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions"); + assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isTrue(); + } + + @Test + public void testCorsFilterOnApiPath() throws Exception { + props.getCors().setAllowedOrigins(Collections.singletonList("*")); + props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); + props.getCors().setAllowedHeaders(Collections.singletonList("*")); + props.getCors().setMaxAge(1800L); + props.getCors().setAllowCredentials(true); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + options("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com") + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")) + .andExpect(header().string(HttpHeaders.VARY, "Origin")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true")) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800")); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")); + } + + @Test + public void testCorsFilterOnOtherPath() throws Exception { + props.getCors().setAllowedOrigins(Collections.singletonList("*")); + props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); + props.getCors().setAllowedHeaders(Collections.singletonList("*")); + props.getCors().setMaxAge(1800L); + props.getCors().setAllowCredentials(true); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/test/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } + + @Test + public void testCorsFilterDeactivated() throws Exception { + props.getCors().setAllowedOrigins(null); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } + + @Test + public void testCorsFilterDeactivated2() throws Exception { + props.getCors().setAllowedOrigins(new ArrayList<>()); + + MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) + .addFilters(webConfigurer.corsFilter()) + .build(); + + mockMvc.perform( + get("/api/test-cors") + .header(HttpHeaders.ORIGIN, "other.domain.com")) + .andExpect(status().isOk()) + .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTestController.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTestController.java new file mode 100644 index 0000000000..89e29d7541 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/config/WebConfigurerTestController.java @@ -0,0 +1,16 @@ +package com.baeldung.jhipster.uaa.config; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class WebConfigurerTestController { + + @GetMapping("/api/test-cors") + public void testCorsOnApiPath() { + } + + @GetMapping("/test/test-cors") + public void testCorsOnOtherPath() { + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepositoryIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepositoryIntTest.java new file mode 100644 index 0000000000..fbfcf8b607 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/repository/CustomAuditEventRepositoryIntTest.java @@ -0,0 +1,165 @@ +package com.baeldung.jhipster.uaa.repository; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.config.Constants; +import com.baeldung.jhipster.uaa.config.audit.AuditEventConverter; +import com.baeldung.jhipster.uaa.domain.PersistentAuditEvent; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.actuate.audit.AuditEvent; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpSession; +import org.springframework.security.web.authentication.WebAuthenticationDetails; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpSession; +import java.time.Instant; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; +import static com.baeldung.jhipster.uaa.repository.CustomAuditEventRepository.EVENT_DATA_COLUMN_MAX_LENGTH; + +/** + * Test class for the CustomAuditEventRepository class. + * + * @see CustomAuditEventRepository + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +@Transactional +public class CustomAuditEventRepositoryIntTest { + + @Autowired + private PersistenceAuditEventRepository persistenceAuditEventRepository; + + @Autowired + private AuditEventConverter auditEventConverter; + + private CustomAuditEventRepository customAuditEventRepository; + + private PersistentAuditEvent testUserEvent; + + private PersistentAuditEvent testOtherUserEvent; + + private PersistentAuditEvent testOldUserEvent; + + @Before + public void setup() { + customAuditEventRepository = new CustomAuditEventRepository(persistenceAuditEventRepository, auditEventConverter); + persistenceAuditEventRepository.deleteAll(); + Instant oneHourAgo = Instant.now().minusSeconds(3600); + + testUserEvent = new PersistentAuditEvent(); + testUserEvent.setPrincipal("test-user"); + testUserEvent.setAuditEventType("test-type"); + testUserEvent.setAuditEventDate(oneHourAgo); + Map data = new HashMap<>(); + data.put("test-key", "test-value"); + testUserEvent.setData(data); + + testOldUserEvent = new PersistentAuditEvent(); + testOldUserEvent.setPrincipal("test-user"); + testOldUserEvent.setAuditEventType("test-type"); + testOldUserEvent.setAuditEventDate(oneHourAgo.minusSeconds(10000)); + + testOtherUserEvent = new PersistentAuditEvent(); + testOtherUserEvent.setPrincipal("other-test-user"); + testOtherUserEvent.setAuditEventType("test-type"); + testOtherUserEvent.setAuditEventDate(oneHourAgo); + } + + @Test + public void addAuditEvent() { + Map data = new HashMap<>(); + data.put("test-key", "test-value"); + AuditEvent event = new AuditEvent("test-user", "test-type", data); + customAuditEventRepository.add(event); + List persistentAuditEvents = persistenceAuditEventRepository.findAll(); + assertThat(persistentAuditEvents).hasSize(1); + PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0); + assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal()); + assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType()); + assertThat(persistentAuditEvent.getData()).containsKey("test-key"); + assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("test-value"); + assertThat(persistentAuditEvent.getAuditEventDate()).isEqualTo(event.getTimestamp()); + } + + @Test + public void addAuditEventTruncateLargeData() { + Map data = new HashMap<>(); + StringBuilder largeData = new StringBuilder(); + for (int i = 0; i < EVENT_DATA_COLUMN_MAX_LENGTH + 10; i++) { + largeData.append("a"); + } + data.put("test-key", largeData); + AuditEvent event = new AuditEvent("test-user", "test-type", data); + customAuditEventRepository.add(event); + List persistentAuditEvents = persistenceAuditEventRepository.findAll(); + assertThat(persistentAuditEvents).hasSize(1); + PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0); + assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal()); + assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType()); + assertThat(persistentAuditEvent.getData()).containsKey("test-key"); + String actualData = persistentAuditEvent.getData().get("test-key"); + assertThat(actualData.length()).isEqualTo(EVENT_DATA_COLUMN_MAX_LENGTH); + assertThat(actualData).isSubstringOf(largeData); + assertThat(persistentAuditEvent.getAuditEventDate()).isEqualTo(event.getTimestamp()); + } + + @Test + public void testAddEventWithWebAuthenticationDetails() { + HttpSession session = new MockHttpSession(null, "test-session-id"); + MockHttpServletRequest request = new MockHttpServletRequest(); + request.setSession(session); + request.setRemoteAddr("1.2.3.4"); + WebAuthenticationDetails details = new WebAuthenticationDetails(request); + Map data = new HashMap<>(); + data.put("test-key", details); + AuditEvent event = new AuditEvent("test-user", "test-type", data); + customAuditEventRepository.add(event); + List persistentAuditEvents = persistenceAuditEventRepository.findAll(); + assertThat(persistentAuditEvents).hasSize(1); + PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0); + assertThat(persistentAuditEvent.getData().get("remoteAddress")).isEqualTo("1.2.3.4"); + assertThat(persistentAuditEvent.getData().get("sessionId")).isEqualTo("test-session-id"); + } + + @Test + public void testAddEventWithNullData() { + Map data = new HashMap<>(); + data.put("test-key", null); + AuditEvent event = new AuditEvent("test-user", "test-type", data); + customAuditEventRepository.add(event); + List persistentAuditEvents = persistenceAuditEventRepository.findAll(); + assertThat(persistentAuditEvents).hasSize(1); + PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0); + assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("null"); + } + + @Test + public void addAuditEventWithAnonymousUser() { + Map data = new HashMap<>(); + data.put("test-key", "test-value"); + AuditEvent event = new AuditEvent(Constants.ANONYMOUS_USER, "test-type", data); + customAuditEventRepository.add(event); + List persistentAuditEvents = persistenceAuditEventRepository.findAll(); + assertThat(persistentAuditEvents).hasSize(0); + } + + @Test + public void addAuditEventWithAuthorizationFailureType() { + Map data = new HashMap<>(); + data.put("test-key", "test-value"); + AuditEvent event = new AuditEvent("test-user", "AUTHORIZATION_FAILURE", data); + customAuditEventRepository.add(event); + List persistentAuditEvents = persistenceAuditEventRepository.findAll(); + assertThat(persistentAuditEvents).hasSize(0); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsServiceIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsServiceIntTest.java new file mode 100644 index 0000000000..6c15e47cb9 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/DomainUserDetailsServiceIntTest.java @@ -0,0 +1,127 @@ +package com.baeldung.jhipster.uaa.security; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.UserRepository; + +import org.apache.commons.lang3.RandomStringUtils; +import org.junit.Before; +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.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Locale; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Test class for DomainUserDetailsService. + * + * @see DomainUserDetailsService + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +@Transactional +public class DomainUserDetailsServiceIntTest { + + private static final String USER_ONE_LOGIN = "test-user-one"; + private static final String USER_ONE_EMAIL = "test-user-one@localhost"; + private static final String USER_TWO_LOGIN = "test-user-two"; + private static final String USER_TWO_EMAIL = "test-user-two@localhost"; + private static final String USER_THREE_LOGIN = "test-user-three"; + private static final String USER_THREE_EMAIL = "test-user-three@localhost"; + + @Autowired + private UserRepository userRepository; + + @Autowired + private UserDetailsService domainUserDetailsService; + + private User userOne; + private User userTwo; + private User userThree; + + @Before + public void init() { + userOne = new User(); + userOne.setLogin(USER_ONE_LOGIN); + userOne.setPassword(RandomStringUtils.random(60)); + userOne.setActivated(true); + userOne.setEmail(USER_ONE_EMAIL); + userOne.setFirstName("userOne"); + userOne.setLastName("doe"); + userOne.setLangKey("en"); + userRepository.save(userOne); + + userTwo = new User(); + userTwo.setLogin(USER_TWO_LOGIN); + userTwo.setPassword(RandomStringUtils.random(60)); + userTwo.setActivated(true); + userTwo.setEmail(USER_TWO_EMAIL); + userTwo.setFirstName("userTwo"); + userTwo.setLastName("doe"); + userTwo.setLangKey("en"); + userRepository.save(userTwo); + + userThree = new User(); + userThree.setLogin(USER_THREE_LOGIN); + userThree.setPassword(RandomStringUtils.random(60)); + userThree.setActivated(false); + userThree.setEmail(USER_THREE_EMAIL); + userThree.setFirstName("userThree"); + userThree.setLastName("doe"); + userThree.setLangKey("en"); + userRepository.save(userThree); + } + + @Test + @Transactional + public void assertThatUserCanBeFoundByLogin() { + UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN); + assertThat(userDetails).isNotNull(); + assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); + } + + @Test + @Transactional + public void assertThatUserCanBeFoundByLoginIgnoreCase() { + UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN.toUpperCase(Locale.ENGLISH)); + assertThat(userDetails).isNotNull(); + assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); + } + + @Test + @Transactional + public void assertThatUserCanBeFoundByEmail() { + UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL); + assertThat(userDetails).isNotNull(); + assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); + } + + @Test(expected = UsernameNotFoundException.class) + @Transactional + public void assertThatUserCanNotBeFoundByEmailIgnoreCase() { + domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH)); + } + + @Test + @Transactional + public void assertThatEmailIsPrioritizedOverLogin() { + UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_EMAIL); + assertThat(userDetails).isNotNull(); + assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); + } + + @Test(expected = UserNotActivatedException.class) + @Transactional + public void assertThatUserNotActivatedExceptionIsThrownForNotActivatedUsers() { + domainUserDetailsService.loadUserByUsername(USER_THREE_LOGIN); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/OAuth2TokenMockUtil.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/OAuth2TokenMockUtil.java new file mode 100644 index 0000000000..85a572234f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/OAuth2TokenMockUtil.java @@ -0,0 +1,83 @@ +package com.baeldung.jhipster.uaa.security; + +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.security.oauth2.provider.OAuth2Request; +import org.springframework.security.oauth2.provider.token.ResourceServerTokenServices; +import org.springframework.stereotype.Component; +import org.springframework.test.web.servlet.request.RequestPostProcessor; + +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; + +import static org.mockito.BDDMockito.given; + +/** + * A bean providing simple mocking of OAuth2 access tokens for security integration tests. + */ +@Component +public class OAuth2TokenMockUtil { + + @MockBean + private ResourceServerTokenServices tokenServices; + + private OAuth2Authentication createAuthentication(String username, Set scopes, Set roles) { + List authorities = roles.stream() + .map(SimpleGrantedAuthority::new) + .collect(Collectors.toList()); + + User principal = new User(username, "test", true, true, true, true, authorities); + Authentication authentication = new UsernamePasswordAuthenticationToken(principal, principal.getPassword(), + principal.getAuthorities()); + + // Create the authorization request and OAuth2Authentication object + OAuth2Request authRequest = new OAuth2Request(null, "testClient", null, true, scopes, null, null, null, + null); + return new OAuth2Authentication(authRequest, authentication); + } + + public RequestPostProcessor oauth2Authentication(String username, Set scopes, Set roles) { + String uuid = String.valueOf(UUID.randomUUID()); + + given(tokenServices.loadAuthentication(uuid)) + .willReturn(createAuthentication(username, scopes, roles)); + + given(tokenServices.readAccessToken(uuid)).willReturn(new DefaultOAuth2AccessToken(uuid)); + + return new OAuth2PostProcessor(uuid); + } + + public RequestPostProcessor oauth2Authentication(String username, Set scopes) { + return oauth2Authentication(username, scopes, Collections.emptySet()); + } + + public RequestPostProcessor oauth2Authentication(String username) { + return oauth2Authentication(username, Collections.emptySet()); + } + + public static class OAuth2PostProcessor implements RequestPostProcessor { + + private String token; + + public OAuth2PostProcessor(String token) { + this.token = token; + } + + @Override + public MockHttpServletRequest postProcessRequest(MockHttpServletRequest mockHttpServletRequest) { + mockHttpServletRequest.addHeader("Authorization", "Bearer " + token); + + return mockHttpServletRequest; + } + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/SecurityUtilsUnitTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/SecurityUtilsUnitTest.java new file mode 100644 index 0000000000..8da41864c8 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/security/SecurityUtilsUnitTest.java @@ -0,0 +1,64 @@ +package com.baeldung.jhipster.uaa.security; + +import org.junit.Test; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Test class for the SecurityUtils utility class. + * + * @see SecurityUtils + */ +public class SecurityUtilsUnitTest { + + @Test + public void testgetCurrentUserLogin() { + SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); + securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin")); + SecurityContextHolder.setContext(securityContext); + Optional login = SecurityUtils.getCurrentUserLogin(); + assertThat(login).contains("admin"); + } + + @Test + public void testIsAuthenticated() { + SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); + securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin")); + SecurityContextHolder.setContext(securityContext); + boolean isAuthenticated = SecurityUtils.isAuthenticated(); + assertThat(isAuthenticated).isTrue(); + } + + @Test + public void testAnonymousIsNotAuthenticated() { + SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); + Collection authorities = new ArrayList<>(); + authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS)); + securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities)); + SecurityContextHolder.setContext(securityContext); + boolean isAuthenticated = SecurityUtils.isAuthenticated(); + assertThat(isAuthenticated).isFalse(); + } + + @Test + public void testIsCurrentUserInRole() { + SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); + Collection authorities = new ArrayList<>(); + authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.USER)); + securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("user", "user", authorities)); + SecurityContextHolder.setContext(securityContext); + + assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.USER)).isTrue(); + assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)).isFalse(); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/MailServiceIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/MailServiceIntTest.java new file mode 100644 index 0000000000..5be48eea5c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/MailServiceIntTest.java @@ -0,0 +1,187 @@ +package com.baeldung.jhipster.uaa.service; +import com.baeldung.jhipster.uaa.config.Constants; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.domain.User; +import io.github.jhipster.config.JHipsterProperties; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.MessageSource; +import org.springframework.mail.MailSendException; +import org.springframework.mail.javamail.JavaMailSenderImpl; +import org.springframework.test.context.junit4.SpringRunner; +import org.thymeleaf.spring5.SpringTemplateEngine; + +import javax.mail.Multipart; +import javax.mail.internet.MimeBodyPart; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; +import java.io.ByteArrayOutputStream; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +public class MailServiceIntTest { + + @Autowired + private JHipsterProperties jHipsterProperties; + + @Autowired + private MessageSource messageSource; + + @Autowired + private SpringTemplateEngine templateEngine; + + @Spy + private JavaMailSenderImpl javaMailSender; + + @Captor + private ArgumentCaptor messageCaptor; + + private MailService mailService; + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + doNothing().when(javaMailSender).send(any(MimeMessage.class)); + mailService = new MailService(jHipsterProperties, javaMailSender, messageSource, templateEngine); + } + + @Test + public void testSendEmail() throws Exception { + mailService.sendEmail("john.doe@example.com", "testSubject", "testContent", false, false); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + assertThat(message.getSubject()).isEqualTo("testSubject"); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent()).isInstanceOf(String.class); + assertThat(message.getContent().toString()).isEqualTo("testContent"); + assertThat(message.getDataHandler().getContentType()).isEqualTo("text/plain; charset=UTF-8"); + } + + @Test + public void testSendHtmlEmail() throws Exception { + mailService.sendEmail("john.doe@example.com", "testSubject", "testContent", false, true); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + assertThat(message.getSubject()).isEqualTo("testSubject"); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent()).isInstanceOf(String.class); + assertThat(message.getContent().toString()).isEqualTo("testContent"); + assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); + } + + @Test + public void testSendMultipartEmail() throws Exception { + mailService.sendEmail("john.doe@example.com", "testSubject", "testContent", true, false); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + MimeMultipart mp = (MimeMultipart) message.getContent(); + MimeBodyPart part = (MimeBodyPart) ((MimeMultipart) mp.getBodyPart(0).getContent()).getBodyPart(0); + ByteArrayOutputStream aos = new ByteArrayOutputStream(); + part.writeTo(aos); + assertThat(message.getSubject()).isEqualTo("testSubject"); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent()).isInstanceOf(Multipart.class); + assertThat(aos.toString()).isEqualTo("\r\ntestContent"); + assertThat(part.getDataHandler().getContentType()).isEqualTo("text/plain; charset=UTF-8"); + } + + @Test + public void testSendMultipartHtmlEmail() throws Exception { + mailService.sendEmail("john.doe@example.com", "testSubject", "testContent", true, true); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + MimeMultipart mp = (MimeMultipart) message.getContent(); + MimeBodyPart part = (MimeBodyPart) ((MimeMultipart) mp.getBodyPart(0).getContent()).getBodyPart(0); + ByteArrayOutputStream aos = new ByteArrayOutputStream(); + part.writeTo(aos); + assertThat(message.getSubject()).isEqualTo("testSubject"); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo("john.doe@example.com"); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent()).isInstanceOf(Multipart.class); + assertThat(aos.toString()).isEqualTo("\r\ntestContent"); + assertThat(part.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); + } + + @Test + public void testSendEmailFromTemplate() throws Exception { + User user = new User(); + user.setLogin("john"); + user.setEmail("john.doe@example.com"); + user.setLangKey("en"); + mailService.sendEmailFromTemplate(user, "mail/testEmail", "email.test.title"); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + assertThat(message.getSubject()).isEqualTo("test title"); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent().toString()).isEqualToNormalizingNewlines("test title, http://127.0.0.1:8080, john\n"); + assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); + } + + @Test + public void testSendActivationEmail() throws Exception { + User user = new User(); + user.setLangKey(Constants.DEFAULT_LANGUAGE); + user.setLogin("john"); + user.setEmail("john.doe@example.com"); + mailService.sendActivationEmail(user); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent().toString()).isNotEmpty(); + assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); + } + + @Test + public void testCreationEmail() throws Exception { + User user = new User(); + user.setLangKey(Constants.DEFAULT_LANGUAGE); + user.setLogin("john"); + user.setEmail("john.doe@example.com"); + mailService.sendCreationEmail(user); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent().toString()).isNotEmpty(); + assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); + } + + @Test + public void testSendPasswordResetMail() throws Exception { + User user = new User(); + user.setLangKey(Constants.DEFAULT_LANGUAGE); + user.setLogin("john"); + user.setEmail("john.doe@example.com"); + mailService.sendPasswordResetMail(user); + verify(javaMailSender).send(messageCaptor.capture()); + MimeMessage message = messageCaptor.getValue(); + assertThat(message.getAllRecipients()[0].toString()).isEqualTo(user.getEmail()); + assertThat(message.getFrom()[0].toString()).isEqualTo("test@localhost"); + assertThat(message.getContent().toString()).isNotEmpty(); + assertThat(message.getDataHandler().getContentType()).isEqualTo("text/html;charset=UTF-8"); + } + + @Test + public void testSendEmailWithException() throws Exception { + doThrow(MailSendException.class).when(javaMailSender).send(any(MimeMessage.class)); + mailService.sendEmail("john.doe@example.com", "testSubject", "testContent", false, false); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/UserServiceIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/UserServiceIntTest.java new file mode 100644 index 0000000000..d544cb2d73 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/service/UserServiceIntTest.java @@ -0,0 +1,194 @@ +package com.baeldung.jhipster.uaa.service; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.config.Constants; +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.UserRepository; +import com.baeldung.jhipster.uaa.service.dto.UserDTO; +import com.baeldung.jhipster.uaa.service.util.RandomUtil; + +import org.apache.commons.lang3.RandomStringUtils; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.auditing.AuditingHandler; +import org.springframework.data.auditing.DateTimeProvider; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.time.LocalDateTime; +import java.util.Optional; +import java.util.List; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +/** + * Test class for the UserResource REST controller. + * + * @see UserService + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +@Transactional +public class UserServiceIntTest { + + @Autowired + private UserRepository userRepository; + + @Autowired + private UserService userService; + + @Autowired + private AuditingHandler auditingHandler; + + @Mock + DateTimeProvider dateTimeProvider; + + private User user; + + @Before + public void init() { + user = new User(); + user.setLogin("johndoe"); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + user.setEmail("johndoe@localhost"); + user.setFirstName("john"); + user.setLastName("doe"); + user.setImageUrl("http://placehold.it/50x50"); + user.setLangKey("en"); + + when(dateTimeProvider.getNow()).thenReturn(Optional.of(LocalDateTime.now())); + auditingHandler.setDateTimeProvider(dateTimeProvider); + } + + @Test + @Transactional + public void assertThatUserMustExistToResetPassword() { + userRepository.saveAndFlush(user); + Optional maybeUser = userService.requestPasswordReset("invalid.login@localhost"); + assertThat(maybeUser).isNotPresent(); + + maybeUser = userService.requestPasswordReset(user.getEmail()); + assertThat(maybeUser).isPresent(); + assertThat(maybeUser.orElse(null).getEmail()).isEqualTo(user.getEmail()); + assertThat(maybeUser.orElse(null).getResetDate()).isNotNull(); + assertThat(maybeUser.orElse(null).getResetKey()).isNotNull(); + } + + @Test + @Transactional + public void assertThatOnlyActivatedUserCanRequestPasswordReset() { + user.setActivated(false); + userRepository.saveAndFlush(user); + + Optional maybeUser = userService.requestPasswordReset(user.getLogin()); + assertThat(maybeUser).isNotPresent(); + userRepository.delete(user); + } + + @Test + @Transactional + public void assertThatResetKeyMustNotBeOlderThan24Hours() { + Instant daysAgo = Instant.now().minus(25, ChronoUnit.HOURS); + String resetKey = RandomUtil.generateResetKey(); + user.setActivated(true); + user.setResetDate(daysAgo); + user.setResetKey(resetKey); + userRepository.saveAndFlush(user); + + Optional maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey()); + assertThat(maybeUser).isNotPresent(); + userRepository.delete(user); + } + + @Test + @Transactional + public void assertThatResetKeyMustBeValid() { + Instant daysAgo = Instant.now().minus(25, ChronoUnit.HOURS); + user.setActivated(true); + user.setResetDate(daysAgo); + user.setResetKey("1234"); + userRepository.saveAndFlush(user); + + Optional maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey()); + assertThat(maybeUser).isNotPresent(); + userRepository.delete(user); + } + + @Test + @Transactional + public void assertThatUserCanResetPassword() { + String oldPassword = user.getPassword(); + Instant daysAgo = Instant.now().minus(2, ChronoUnit.HOURS); + String resetKey = RandomUtil.generateResetKey(); + user.setActivated(true); + user.setResetDate(daysAgo); + user.setResetKey(resetKey); + userRepository.saveAndFlush(user); + + Optional maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey()); + assertThat(maybeUser).isPresent(); + assertThat(maybeUser.orElse(null).getResetDate()).isNull(); + assertThat(maybeUser.orElse(null).getResetKey()).isNull(); + assertThat(maybeUser.orElse(null).getPassword()).isNotEqualTo(oldPassword); + + userRepository.delete(user); + } + + @Test + @Transactional + public void testFindNotActivatedUsersByCreationDateBefore() { + Instant now = Instant.now(); + when(dateTimeProvider.getNow()).thenReturn(Optional.of(now.minus(4, ChronoUnit.DAYS))); + user.setActivated(false); + User dbUser = userRepository.saveAndFlush(user); + dbUser.setCreatedDate(now.minus(4, ChronoUnit.DAYS)); + userRepository.saveAndFlush(user); + List users = userRepository.findAllByActivatedIsFalseAndCreatedDateBefore(now.minus(3, ChronoUnit.DAYS)); + assertThat(users).isNotEmpty(); + userService.removeNotActivatedUsers(); + users = userRepository.findAllByActivatedIsFalseAndCreatedDateBefore(now.minus(3, ChronoUnit.DAYS)); + assertThat(users).isEmpty(); + } + + @Test + @Transactional + public void assertThatAnonymousUserIsNotGet() { + user.setLogin(Constants.ANONYMOUS_USER); + if (!userRepository.findOneByLogin(Constants.ANONYMOUS_USER).isPresent()) { + userRepository.saveAndFlush(user); + } + final PageRequest pageable = PageRequest.of(0, (int) userRepository.count()); + final Page allManagedUsers = userService.getAllManagedUsers(pageable); + assertThat(allManagedUsers.getContent().stream() + .noneMatch(user -> Constants.ANONYMOUS_USER.equals(user.getLogin()))) + .isTrue(); + } + + + @Test + @Transactional + public void testRemoveNotActivatedUsers() { + // custom "now" for audit to use as creation date + when(dateTimeProvider.getNow()).thenReturn(Optional.of(Instant.now().minus(30, ChronoUnit.DAYS))); + + user.setActivated(false); + userRepository.saveAndFlush(user); + + assertThat(userRepository.findOneByLogin("johndoe")).isPresent(); + userService.removeNotActivatedUsers(); + assertThat(userRepository.findOneByLogin("johndoe")).isNotPresent(); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AccountResourceIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AccountResourceIntTest.java new file mode 100644 index 0000000000..559385da2e --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AccountResourceIntTest.java @@ -0,0 +1,811 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.config.Constants; +import com.baeldung.jhipster.uaa.domain.Authority; +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.AuthorityRepository; +import com.baeldung.jhipster.uaa.repository.UserRepository; +import com.baeldung.jhipster.uaa.security.AuthoritiesConstants; +import com.baeldung.jhipster.uaa.service.MailService; +import com.baeldung.jhipster.uaa.service.UserService; +import com.baeldung.jhipster.uaa.service.dto.PasswordChangeDTO; +import com.baeldung.jhipster.uaa.service.dto.UserDTO; +import com.baeldung.jhipster.uaa.web.rest.errors.ExceptionTranslator; +import com.baeldung.jhipster.uaa.web.rest.vm.KeyAndPasswordVM; +import com.baeldung.jhipster.uaa.web.rest.vm.ManagedUserVM; +import org.apache.commons.lang3.RandomStringUtils; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +/** + * Test class for the AccountResource REST controller. + * + * @see AccountResource + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +public class AccountResourceIntTest { + + @Autowired + private UserRepository userRepository; + + @Autowired + private AuthorityRepository authorityRepository; + + @Autowired + private UserService userService; + + @Autowired + private PasswordEncoder passwordEncoder; + + @Autowired + private HttpMessageConverter[] httpMessageConverters; + + @Autowired + private ExceptionTranslator exceptionTranslator; + + @Mock + private UserService mockUserService; + + @Mock + private MailService mockMailService; + + private MockMvc restMvc; + + private MockMvc restUserMockMvc; + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + doNothing().when(mockMailService).sendActivationEmail(any()); + AccountResource accountResource = + new AccountResource(userRepository, userService, mockMailService); + + AccountResource accountUserMockResource = + new AccountResource(userRepository, mockUserService, mockMailService); + this.restMvc = MockMvcBuilders.standaloneSetup(accountResource) + .setMessageConverters(httpMessageConverters) + .setControllerAdvice(exceptionTranslator) + .build(); + this.restUserMockMvc = MockMvcBuilders.standaloneSetup(accountUserMockResource) + .setControllerAdvice(exceptionTranslator) + .build(); + } + + @Test + public void testNonAuthenticatedUser() throws Exception { + restUserMockMvc.perform(get("/api/authenticate") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(content().string("")); + } + + @Test + public void testAuthenticatedUser() throws Exception { + restUserMockMvc.perform(get("/api/authenticate") + .with(request -> { + request.setRemoteUser("test"); + return request; + }) + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(content().string("test")); + } + + @Test + public void testGetExistingAccount() throws Exception { + Set authorities = new HashSet<>(); + Authority authority = new Authority(); + authority.setName(AuthoritiesConstants.ADMIN); + authorities.add(authority); + + User user = new User(); + user.setLogin("test"); + user.setFirstName("john"); + user.setLastName("doe"); + user.setEmail("john.doe@jhipster.com"); + user.setImageUrl("http://placehold.it/50x50"); + user.setLangKey("en"); + user.setAuthorities(authorities); + when(mockUserService.getUserWithAuthorities()).thenReturn(Optional.of(user)); + + restUserMockMvc.perform(get("/api/account") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.login").value("test")) + .andExpect(jsonPath("$.firstName").value("john")) + .andExpect(jsonPath("$.lastName").value("doe")) + .andExpect(jsonPath("$.email").value("john.doe@jhipster.com")) + .andExpect(jsonPath("$.imageUrl").value("http://placehold.it/50x50")) + .andExpect(jsonPath("$.langKey").value("en")) + .andExpect(jsonPath("$.authorities").value(AuthoritiesConstants.ADMIN)); + } + + @Test + public void testGetUnknownAccount() throws Exception { + when(mockUserService.getUserWithAuthorities()).thenReturn(Optional.empty()); + + restUserMockMvc.perform(get("/api/account") + .accept(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(status().isInternalServerError()); + } + + @Test + @Transactional + public void testRegisterValid() throws Exception { + ManagedUserVM validUser = new ManagedUserVM(); + validUser.setLogin("test-register-valid"); + validUser.setPassword("password"); + validUser.setFirstName("Alice"); + validUser.setLastName("Test"); + validUser.setEmail("test-register-valid@example.com"); + validUser.setImageUrl("http://placehold.it/50x50"); + validUser.setLangKey(Constants.DEFAULT_LANGUAGE); + validUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + assertThat(userRepository.findOneByLogin("test-register-valid").isPresent()).isFalse(); + + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(validUser))) + .andExpect(status().isCreated()); + + assertThat(userRepository.findOneByLogin("test-register-valid").isPresent()).isTrue(); + } + + @Test + @Transactional + public void testRegisterInvalidLogin() throws Exception { + ManagedUserVM invalidUser = new ManagedUserVM(); + invalidUser.setLogin("funky-log!n");// <-- invalid + invalidUser.setPassword("password"); + invalidUser.setFirstName("Funky"); + invalidUser.setLastName("One"); + invalidUser.setEmail("funky@example.com"); + invalidUser.setActivated(true); + invalidUser.setImageUrl("http://placehold.it/50x50"); + invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); + invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(invalidUser))) + .andExpect(status().isBadRequest()); + + Optional user = userRepository.findOneByEmailIgnoreCase("funky@example.com"); + assertThat(user.isPresent()).isFalse(); + } + + @Test + @Transactional + public void testRegisterInvalidEmail() throws Exception { + ManagedUserVM invalidUser = new ManagedUserVM(); + invalidUser.setLogin("bob"); + invalidUser.setPassword("password"); + invalidUser.setFirstName("Bob"); + invalidUser.setLastName("Green"); + invalidUser.setEmail("invalid");// <-- invalid + invalidUser.setActivated(true); + invalidUser.setImageUrl("http://placehold.it/50x50"); + invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); + invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(invalidUser))) + .andExpect(status().isBadRequest()); + + Optional user = userRepository.findOneByLogin("bob"); + assertThat(user.isPresent()).isFalse(); + } + + @Test + @Transactional + public void testRegisterInvalidPassword() throws Exception { + ManagedUserVM invalidUser = new ManagedUserVM(); + invalidUser.setLogin("bob"); + invalidUser.setPassword("123");// password with only 3 digits + invalidUser.setFirstName("Bob"); + invalidUser.setLastName("Green"); + invalidUser.setEmail("bob@example.com"); + invalidUser.setActivated(true); + invalidUser.setImageUrl("http://placehold.it/50x50"); + invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); + invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(invalidUser))) + .andExpect(status().isBadRequest()); + + Optional user = userRepository.findOneByLogin("bob"); + assertThat(user.isPresent()).isFalse(); + } + + @Test + @Transactional + public void testRegisterNullPassword() throws Exception { + ManagedUserVM invalidUser = new ManagedUserVM(); + invalidUser.setLogin("bob"); + invalidUser.setPassword(null);// invalid null password + invalidUser.setFirstName("Bob"); + invalidUser.setLastName("Green"); + invalidUser.setEmail("bob@example.com"); + invalidUser.setActivated(true); + invalidUser.setImageUrl("http://placehold.it/50x50"); + invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); + invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(invalidUser))) + .andExpect(status().isBadRequest()); + + Optional user = userRepository.findOneByLogin("bob"); + assertThat(user.isPresent()).isFalse(); + } + + @Test + @Transactional + public void testRegisterDuplicateLogin() throws Exception { + // First registration + ManagedUserVM firstUser = new ManagedUserVM(); + firstUser.setLogin("alice"); + firstUser.setPassword("password"); + firstUser.setFirstName("Alice"); + firstUser.setLastName("Something"); + firstUser.setEmail("alice@example.com"); + firstUser.setImageUrl("http://placehold.it/50x50"); + firstUser.setLangKey(Constants.DEFAULT_LANGUAGE); + firstUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + // Duplicate login, different email + ManagedUserVM secondUser = new ManagedUserVM(); + secondUser.setLogin(firstUser.getLogin()); + secondUser.setPassword(firstUser.getPassword()); + secondUser.setFirstName(firstUser.getFirstName()); + secondUser.setLastName(firstUser.getLastName()); + secondUser.setEmail("alice2@example.com"); + secondUser.setImageUrl(firstUser.getImageUrl()); + secondUser.setLangKey(firstUser.getLangKey()); + secondUser.setCreatedBy(firstUser.getCreatedBy()); + secondUser.setCreatedDate(firstUser.getCreatedDate()); + secondUser.setLastModifiedBy(firstUser.getLastModifiedBy()); + secondUser.setLastModifiedDate(firstUser.getLastModifiedDate()); + secondUser.setAuthorities(new HashSet<>(firstUser.getAuthorities())); + + // First user + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(firstUser))) + .andExpect(status().isCreated()); + + // Second (non activated) user + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(secondUser))) + .andExpect(status().isCreated()); + + Optional testUser = userRepository.findOneByEmailIgnoreCase("alice2@example.com"); + assertThat(testUser.isPresent()).isTrue(); + testUser.get().setActivated(true); + userRepository.save(testUser.get()); + + // Second (already activated) user + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(secondUser))) + .andExpect(status().is4xxClientError()); + } + + @Test + @Transactional + public void testRegisterDuplicateEmail() throws Exception { + // First user + ManagedUserVM firstUser = new ManagedUserVM(); + firstUser.setLogin("test-register-duplicate-email"); + firstUser.setPassword("password"); + firstUser.setFirstName("Alice"); + firstUser.setLastName("Test"); + firstUser.setEmail("test-register-duplicate-email@example.com"); + firstUser.setImageUrl("http://placehold.it/50x50"); + firstUser.setLangKey(Constants.DEFAULT_LANGUAGE); + firstUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + // Register first user + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(firstUser))) + .andExpect(status().isCreated()); + + Optional testUser1 = userRepository.findOneByLogin("test-register-duplicate-email"); + assertThat(testUser1.isPresent()).isTrue(); + + // Duplicate email, different login + ManagedUserVM secondUser = new ManagedUserVM(); + secondUser.setLogin("test-register-duplicate-email-2"); + secondUser.setPassword(firstUser.getPassword()); + secondUser.setFirstName(firstUser.getFirstName()); + secondUser.setLastName(firstUser.getLastName()); + secondUser.setEmail(firstUser.getEmail()); + secondUser.setImageUrl(firstUser.getImageUrl()); + secondUser.setLangKey(firstUser.getLangKey()); + secondUser.setAuthorities(new HashSet<>(firstUser.getAuthorities())); + + // Register second (non activated) user + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(secondUser))) + .andExpect(status().isCreated()); + + Optional testUser2 = userRepository.findOneByLogin("test-register-duplicate-email"); + assertThat(testUser2.isPresent()).isFalse(); + + Optional testUser3 = userRepository.findOneByLogin("test-register-duplicate-email-2"); + assertThat(testUser3.isPresent()).isTrue(); + + // Duplicate email - with uppercase email address + ManagedUserVM userWithUpperCaseEmail = new ManagedUserVM(); + userWithUpperCaseEmail.setId(firstUser.getId()); + userWithUpperCaseEmail.setLogin("test-register-duplicate-email-3"); + userWithUpperCaseEmail.setPassword(firstUser.getPassword()); + userWithUpperCaseEmail.setFirstName(firstUser.getFirstName()); + userWithUpperCaseEmail.setLastName(firstUser.getLastName()); + userWithUpperCaseEmail.setEmail("TEST-register-duplicate-email@example.com"); + userWithUpperCaseEmail.setImageUrl(firstUser.getImageUrl()); + userWithUpperCaseEmail.setLangKey(firstUser.getLangKey()); + userWithUpperCaseEmail.setAuthorities(new HashSet<>(firstUser.getAuthorities())); + + // Register third (not activated) user + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(userWithUpperCaseEmail))) + .andExpect(status().isCreated()); + + Optional testUser4 = userRepository.findOneByLogin("test-register-duplicate-email-3"); + assertThat(testUser4.isPresent()).isTrue(); + assertThat(testUser4.get().getEmail()).isEqualTo("test-register-duplicate-email@example.com"); + + testUser4.get().setActivated(true); + userService.updateUser((new UserDTO(testUser4.get()))); + + // Register 4th (already activated) user + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(secondUser))) + .andExpect(status().is4xxClientError()); + } + + @Test + @Transactional + public void testRegisterAdminIsIgnored() throws Exception { + ManagedUserVM validUser = new ManagedUserVM(); + validUser.setLogin("badguy"); + validUser.setPassword("password"); + validUser.setFirstName("Bad"); + validUser.setLastName("Guy"); + validUser.setEmail("badguy@example.com"); + validUser.setActivated(true); + validUser.setImageUrl("http://placehold.it/50x50"); + validUser.setLangKey(Constants.DEFAULT_LANGUAGE); + validUser.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); + + restMvc.perform( + post("/api/register") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(validUser))) + .andExpect(status().isCreated()); + + Optional userDup = userRepository.findOneByLogin("badguy"); + assertThat(userDup.isPresent()).isTrue(); + assertThat(userDup.get().getAuthorities()).hasSize(1) + .containsExactly(authorityRepository.findById(AuthoritiesConstants.USER).get()); + } + + @Test + @Transactional + public void testActivateAccount() throws Exception { + final String activationKey = "some activation key"; + User user = new User(); + user.setLogin("activate-account"); + user.setEmail("activate-account@example.com"); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(false); + user.setActivationKey(activationKey); + + userRepository.saveAndFlush(user); + + restMvc.perform(get("/api/activate?key={activationKey}", activationKey)) + .andExpect(status().isOk()); + + user = userRepository.findOneByLogin(user.getLogin()).orElse(null); + assertThat(user.getActivated()).isTrue(); + } + + @Test + @Transactional + public void testActivateAccountWithWrongKey() throws Exception { + restMvc.perform(get("/api/activate?key=wrongActivationKey")) + .andExpect(status().isInternalServerError()); + } + + @Test + @Transactional + @WithMockUser("save-account") + public void testSaveAccount() throws Exception { + User user = new User(); + user.setLogin("save-account"); + user.setEmail("save-account@example.com"); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + + userRepository.saveAndFlush(user); + + UserDTO userDTO = new UserDTO(); + userDTO.setLogin("not-used"); + userDTO.setFirstName("firstname"); + userDTO.setLastName("lastname"); + userDTO.setEmail("save-account@example.com"); + userDTO.setActivated(false); + userDTO.setImageUrl("http://placehold.it/50x50"); + userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); + userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); + + restMvc.perform( + post("/api/account") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(userDTO))) + .andExpect(status().isOk()); + + User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null); + assertThat(updatedUser.getFirstName()).isEqualTo(userDTO.getFirstName()); + assertThat(updatedUser.getLastName()).isEqualTo(userDTO.getLastName()); + assertThat(updatedUser.getEmail()).isEqualTo(userDTO.getEmail()); + assertThat(updatedUser.getLangKey()).isEqualTo(userDTO.getLangKey()); + assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); + assertThat(updatedUser.getImageUrl()).isEqualTo(userDTO.getImageUrl()); + assertThat(updatedUser.getActivated()).isEqualTo(true); + assertThat(updatedUser.getAuthorities()).isEmpty(); + } + + @Test + @Transactional + @WithMockUser("save-invalid-email") + public void testSaveInvalidEmail() throws Exception { + User user = new User(); + user.setLogin("save-invalid-email"); + user.setEmail("save-invalid-email@example.com"); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + + userRepository.saveAndFlush(user); + + UserDTO userDTO = new UserDTO(); + userDTO.setLogin("not-used"); + userDTO.setFirstName("firstname"); + userDTO.setLastName("lastname"); + userDTO.setEmail("invalid email"); + userDTO.setActivated(false); + userDTO.setImageUrl("http://placehold.it/50x50"); + userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); + userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); + + restMvc.perform( + post("/api/account") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(userDTO))) + .andExpect(status().isBadRequest()); + + assertThat(userRepository.findOneByEmailIgnoreCase("invalid email")).isNotPresent(); + } + + @Test + @Transactional + @WithMockUser("save-existing-email") + public void testSaveExistingEmail() throws Exception { + User user = new User(); + user.setLogin("save-existing-email"); + user.setEmail("save-existing-email@example.com"); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + + userRepository.saveAndFlush(user); + + User anotherUser = new User(); + anotherUser.setLogin("save-existing-email2"); + anotherUser.setEmail("save-existing-email2@example.com"); + anotherUser.setPassword(RandomStringUtils.random(60)); + anotherUser.setActivated(true); + + userRepository.saveAndFlush(anotherUser); + + UserDTO userDTO = new UserDTO(); + userDTO.setLogin("not-used"); + userDTO.setFirstName("firstname"); + userDTO.setLastName("lastname"); + userDTO.setEmail("save-existing-email2@example.com"); + userDTO.setActivated(false); + userDTO.setImageUrl("http://placehold.it/50x50"); + userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); + userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); + + restMvc.perform( + post("/api/account") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(userDTO))) + .andExpect(status().isBadRequest()); + + User updatedUser = userRepository.findOneByLogin("save-existing-email").orElse(null); + assertThat(updatedUser.getEmail()).isEqualTo("save-existing-email@example.com"); + } + + @Test + @Transactional + @WithMockUser("save-existing-email-and-login") + public void testSaveExistingEmailAndLogin() throws Exception { + User user = new User(); + user.setLogin("save-existing-email-and-login"); + user.setEmail("save-existing-email-and-login@example.com"); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + + userRepository.saveAndFlush(user); + + UserDTO userDTO = new UserDTO(); + userDTO.setLogin("not-used"); + userDTO.setFirstName("firstname"); + userDTO.setLastName("lastname"); + userDTO.setEmail("save-existing-email-and-login@example.com"); + userDTO.setActivated(false); + userDTO.setImageUrl("http://placehold.it/50x50"); + userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); + userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); + + restMvc.perform( + post("/api/account") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(userDTO))) + .andExpect(status().isOk()); + + User updatedUser = userRepository.findOneByLogin("save-existing-email-and-login").orElse(null); + assertThat(updatedUser.getEmail()).isEqualTo("save-existing-email-and-login@example.com"); + } + + @Test + @Transactional + @WithMockUser("change-password-wrong-existing-password") + public void testChangePasswordWrongExistingPassword() throws Exception { + User user = new User(); + String currentPassword = RandomStringUtils.random(60); + user.setPassword(passwordEncoder.encode(currentPassword)); + user.setLogin("change-password-wrong-existing-password"); + user.setEmail("change-password-wrong-existing-password@example.com"); + userRepository.saveAndFlush(user); + + restMvc.perform(post("/api/account/change-password") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO("1"+currentPassword, "new password")))) + .andExpect(status().isBadRequest()); + + User updatedUser = userRepository.findOneByLogin("change-password-wrong-existing-password").orElse(null); + assertThat(passwordEncoder.matches("new password", updatedUser.getPassword())).isFalse(); + assertThat(passwordEncoder.matches(currentPassword, updatedUser.getPassword())).isTrue(); + } + + @Test + @Transactional + @WithMockUser("change-password") + public void testChangePassword() throws Exception { + User user = new User(); + String currentPassword = RandomStringUtils.random(60); + user.setPassword(passwordEncoder.encode(currentPassword)); + user.setLogin("change-password"); + user.setEmail("change-password@example.com"); + userRepository.saveAndFlush(user); + + restMvc.perform(post("/api/account/change-password") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO(currentPassword, "new password")))) + .andExpect(status().isOk()); + + User updatedUser = userRepository.findOneByLogin("change-password").orElse(null); + assertThat(passwordEncoder.matches("new password", updatedUser.getPassword())).isTrue(); + } + + @Test + @Transactional + @WithMockUser("change-password-too-small") + public void testChangePasswordTooSmall() throws Exception { + User user = new User(); + String currentPassword = RandomStringUtils.random(60); + user.setPassword(passwordEncoder.encode(currentPassword)); + user.setLogin("change-password-too-small"); + user.setEmail("change-password-too-small@example.com"); + userRepository.saveAndFlush(user); + + restMvc.perform(post("/api/account/change-password") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO(currentPassword, "new")))) + .andExpect(status().isBadRequest()); + + User updatedUser = userRepository.findOneByLogin("change-password-too-small").orElse(null); + assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); + } + + @Test + @Transactional + @WithMockUser("change-password-too-long") + public void testChangePasswordTooLong() throws Exception { + User user = new User(); + String currentPassword = RandomStringUtils.random(60); + user.setPassword(passwordEncoder.encode(currentPassword)); + user.setLogin("change-password-too-long"); + user.setEmail("change-password-too-long@example.com"); + userRepository.saveAndFlush(user); + + restMvc.perform(post("/api/account/change-password") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO(currentPassword, RandomStringUtils.random(101))))) + .andExpect(status().isBadRequest()); + + User updatedUser = userRepository.findOneByLogin("change-password-too-long").orElse(null); + assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); + } + + @Test + @Transactional + @WithMockUser("change-password-empty") + public void testChangePasswordEmpty() throws Exception { + User user = new User(); + user.setPassword(RandomStringUtils.random(60)); + user.setLogin("change-password-empty"); + user.setEmail("change-password-empty@example.com"); + userRepository.saveAndFlush(user); + + restMvc.perform(post("/api/account/change-password").content(RandomStringUtils.random(0))) + .andExpect(status().isBadRequest()); + + User updatedUser = userRepository.findOneByLogin("change-password-empty").orElse(null); + assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); + } + + @Test + @Transactional + public void testRequestPasswordReset() throws Exception { + User user = new User(); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + user.setLogin("password-reset"); + user.setEmail("password-reset@example.com"); + userRepository.saveAndFlush(user); + + restMvc.perform(post("/api/account/reset-password/init") + .content("password-reset@example.com")) + .andExpect(status().isOk()); + } + + @Test + @Transactional + public void testRequestPasswordResetUpperCaseEmail() throws Exception { + User user = new User(); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + user.setLogin("password-reset"); + user.setEmail("password-reset@example.com"); + userRepository.saveAndFlush(user); + + restMvc.perform(post("/api/account/reset-password/init") + .content("password-reset@EXAMPLE.COM")) + .andExpect(status().isOk()); + } + + @Test + public void testRequestPasswordResetWrongEmail() throws Exception { + restMvc.perform( + post("/api/account/reset-password/init") + .content("password-reset-wrong-email@example.com")) + .andExpect(status().isBadRequest()); + } + + @Test + @Transactional + public void testFinishPasswordReset() throws Exception { + User user = new User(); + user.setPassword(RandomStringUtils.random(60)); + user.setLogin("finish-password-reset"); + user.setEmail("finish-password-reset@example.com"); + user.setResetDate(Instant.now().plusSeconds(60)); + user.setResetKey("reset key"); + userRepository.saveAndFlush(user); + + KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM(); + keyAndPassword.setKey(user.getResetKey()); + keyAndPassword.setNewPassword("new password"); + + restMvc.perform( + post("/api/account/reset-password/finish") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(keyAndPassword))) + .andExpect(status().isOk()); + + User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null); + assertThat(passwordEncoder.matches(keyAndPassword.getNewPassword(), updatedUser.getPassword())).isTrue(); + } + + @Test + @Transactional + public void testFinishPasswordResetTooSmall() throws Exception { + User user = new User(); + user.setPassword(RandomStringUtils.random(60)); + user.setLogin("finish-password-reset-too-small"); + user.setEmail("finish-password-reset-too-small@example.com"); + user.setResetDate(Instant.now().plusSeconds(60)); + user.setResetKey("reset key too small"); + userRepository.saveAndFlush(user); + + KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM(); + keyAndPassword.setKey(user.getResetKey()); + keyAndPassword.setNewPassword("foo"); + + restMvc.perform( + post("/api/account/reset-password/finish") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(keyAndPassword))) + .andExpect(status().isBadRequest()); + + User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null); + assertThat(passwordEncoder.matches(keyAndPassword.getNewPassword(), updatedUser.getPassword())).isFalse(); + } + + + @Test + @Transactional + public void testFinishPasswordResetWrongKey() throws Exception { + KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM(); + keyAndPassword.setKey("wrong reset key"); + keyAndPassword.setNewPassword("new password"); + + restMvc.perform( + post("/api/account/reset-password/finish") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(keyAndPassword))) + .andExpect(status().isInternalServerError()); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AuditResourceIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AuditResourceIntTest.java new file mode 100644 index 0000000000..24bbaf4b0c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/AuditResourceIntTest.java @@ -0,0 +1,146 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.config.audit.AuditEventConverter; +import com.baeldung.jhipster.uaa.domain.PersistentAuditEvent; +import com.baeldung.jhipster.uaa.repository.PersistenceAuditEventRepository; +import com.baeldung.jhipster.uaa.service.AuditEventService; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.MockitoAnnotations; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.web.PageableHandlerMethodArgumentResolver; +import org.springframework.format.support.FormattingConversionService; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; + +import static org.hamcrest.Matchers.hasItem; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +/** + * Test class for the AuditResource REST controller. + * + * @see AuditResource + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +@Transactional +public class AuditResourceIntTest { + + private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL"; + private static final String SAMPLE_TYPE = "SAMPLE_TYPE"; + private static final Instant SAMPLE_TIMESTAMP = Instant.parse("2015-08-04T10:11:30Z"); + private static final long SECONDS_PER_DAY = 60 * 60 * 24; + + @Autowired + private PersistenceAuditEventRepository auditEventRepository; + + @Autowired + private AuditEventConverter auditEventConverter; + + @Autowired + private MappingJackson2HttpMessageConverter jacksonMessageConverter; + + @Autowired + private FormattingConversionService formattingConversionService; + + @Autowired + private PageableHandlerMethodArgumentResolver pageableArgumentResolver; + + private PersistentAuditEvent auditEvent; + + private MockMvc restAuditMockMvc; + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + AuditEventService auditEventService = + new AuditEventService(auditEventRepository, auditEventConverter); + AuditResource auditResource = new AuditResource(auditEventService); + this.restAuditMockMvc = MockMvcBuilders.standaloneSetup(auditResource) + .setCustomArgumentResolvers(pageableArgumentResolver) + .setConversionService(formattingConversionService) + .setMessageConverters(jacksonMessageConverter).build(); + } + + @Before + public void initTest() { + auditEventRepository.deleteAll(); + auditEvent = new PersistentAuditEvent(); + auditEvent.setAuditEventType(SAMPLE_TYPE); + auditEvent.setPrincipal(SAMPLE_PRINCIPAL); + auditEvent.setAuditEventDate(SAMPLE_TIMESTAMP); + } + + @Test + public void getAllAudits() throws Exception { + // Initialize the database + auditEventRepository.save(auditEvent); + + // Get all the audits + restAuditMockMvc.perform(get("/management/audits")) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); + } + + @Test + public void getAudit() throws Exception { + // Initialize the database + auditEventRepository.save(auditEvent); + + // Get the audit + restAuditMockMvc.perform(get("/management/audits/{id}", auditEvent.getId())) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.principal").value(SAMPLE_PRINCIPAL)); + } + + @Test + public void getAuditsByDate() throws Exception { + // Initialize the database + auditEventRepository.save(auditEvent); + + // Generate dates for selecting audits by date, making sure the period will contain the audit + String fromDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0, 10); + String toDate = SAMPLE_TIMESTAMP.plusSeconds(SECONDS_PER_DAY).toString().substring(0, 10); + + // Get the audit + restAuditMockMvc.perform(get("/management/audits?fromDate="+fromDate+"&toDate="+toDate)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); + } + + @Test + public void getNonExistingAuditsByDate() throws Exception { + // Initialize the database + auditEventRepository.save(auditEvent); + + // Generate dates for selecting audits by date, making sure the period will not contain the sample audit + String fromDate = SAMPLE_TIMESTAMP.minusSeconds(2*SECONDS_PER_DAY).toString().substring(0, 10); + String toDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0, 10); + + // Query audits but expect no results + restAuditMockMvc.perform(get("/management/audits?fromDate=" + fromDate + "&toDate=" + toDate)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(header().string("X-Total-Count", "0")); + } + + @Test + public void getNonExistingAudit() throws Exception { + // Get the audit + restAuditMockMvc.perform(get("/management/audits/{id}", Long.MAX_VALUE)) + .andExpect(status().isNotFound()); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/LogsResourceIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/LogsResourceIntTest.java new file mode 100644 index 0000000000..18ab835be7 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/LogsResourceIntTest.java @@ -0,0 +1,67 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.config.SecurityBeanOverrideConfiguration; +import com.baeldung.jhipster.uaa.web.rest.vm.LoggerVM; +import ch.qos.logback.classic.AsyncAppender; +import ch.qos.logback.classic.LoggerContext; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.LoggerFactory; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Test class for the LogsResource REST controller. + * + * @see LogsResource + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +public class LogsResourceIntTest { + + private MockMvc restLogsMockMvc; + + @Before + public void setup() { + LogsResource logsResource = new LogsResource(); + this.restLogsMockMvc = MockMvcBuilders + .standaloneSetup(logsResource) + .build(); + } + + @Test + public void getAllLogs() throws Exception { + restLogsMockMvc.perform(get("/management/logs")) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)); + } + + @Test + public void changeLogs() throws Exception { + LoggerVM logger = new LoggerVM(); + logger.setLevel("INFO"); + logger.setName("ROOT"); + + restLogsMockMvc.perform(put("/management/logs") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(logger))) + .andExpect(status().isNoContent()); + } + + @Test + public void testLogstashAppender() { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + assertThat(context.getLogger("ROOT").getAppender("ASYNC_LOGSTASH")).isInstanceOf(AsyncAppender.class); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/TestUtil.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/TestUtil.java new file mode 100644 index 0000000000..ebacd1e593 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/TestUtil.java @@ -0,0 +1,135 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.hamcrest.Description; +import org.hamcrest.TypeSafeDiagnosingMatcher; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.format.support.DefaultFormattingConversionService; +import org.springframework.format.support.FormattingConversionService; +import org.springframework.http.MediaType; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Utility class for testing REST controllers. + */ +public class TestUtil { + + /** MediaType for JSON UTF8 */ + public static final MediaType APPLICATION_JSON_UTF8 = new MediaType( + MediaType.APPLICATION_JSON.getType(), + MediaType.APPLICATION_JSON.getSubtype(), StandardCharsets.UTF_8); + + /** + * Convert an object to JSON byte array. + * + * @param object + * the object to convert + * @return the JSON byte array + * @throws IOException + */ + public static byte[] convertObjectToJsonBytes(Object object) + throws IOException { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); + + JavaTimeModule module = new JavaTimeModule(); + mapper.registerModule(module); + + return mapper.writeValueAsBytes(object); + } + + /** + * Create a byte array with a specific size filled with specified data. + * + * @param size the size of the byte array + * @param data the data to put in the byte array + * @return the JSON byte array + */ + public static byte[] createByteArray(int size, String data) { + byte[] byteArray = new byte[size]; + for (int i = 0; i < size; i++) { + byteArray[i] = Byte.parseByte(data, 2); + } + return byteArray; + } + + /** + * A matcher that tests that the examined string represents the same instant as the reference datetime. + */ + public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher { + + private final ZonedDateTime date; + + public ZonedDateTimeMatcher(ZonedDateTime date) { + this.date = date; + } + + @Override + protected boolean matchesSafely(String item, Description mismatchDescription) { + try { + if (!date.isEqual(ZonedDateTime.parse(item))) { + mismatchDescription.appendText("was ").appendValue(item); + return false; + } + return true; + } catch (DateTimeParseException e) { + mismatchDescription.appendText("was ").appendValue(item) + .appendText(", which could not be parsed as a ZonedDateTime"); + return false; + } + + } + + @Override + public void describeTo(Description description) { + description.appendText("a String representing the same Instant as ").appendValue(date); + } + } + + /** + * Creates a matcher that matches when the examined string reprensents the same instant as the reference datetime + * @param date the reference datetime against which the examined string is checked + */ + public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) { + return new ZonedDateTimeMatcher(date); + } + + /** + * Verifies the equals/hashcode contract on the domain object. + */ + public static void equalsVerifier(Class clazz) throws Exception { + T domainObject1 = clazz.getConstructor().newInstance(); + assertThat(domainObject1.toString()).isNotNull(); + assertThat(domainObject1).isEqualTo(domainObject1); + assertThat(domainObject1.hashCode()).isEqualTo(domainObject1.hashCode()); + // Test with an instance of another class + Object testOtherObject = new Object(); + assertThat(domainObject1).isNotEqualTo(testOtherObject); + assertThat(domainObject1).isNotEqualTo(null); + // Test with an instance of the same class + T domainObject2 = clazz.getConstructor().newInstance(); + assertThat(domainObject1).isNotEqualTo(domainObject2); + // HashCodes are equals because the objects are not persisted yet + assertThat(domainObject1.hashCode()).isEqualTo(domainObject2.hashCode()); + } + + /** + * Create a FormattingConversionService which use ISO date format, instead of the localized one. + * @return the FormattingConversionService + */ + public static FormattingConversionService createFormattingConversionService() { + DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService (); + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setUseIsoFormat(true); + registrar.registerFormatters(dfcs); + return dfcs; + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/UserResourceIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/UserResourceIntTest.java new file mode 100644 index 0000000000..0cbed67a04 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/UserResourceIntTest.java @@ -0,0 +1,614 @@ +package com.baeldung.jhipster.uaa.web.rest; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.domain.Authority; +import com.baeldung.jhipster.uaa.domain.User; +import com.baeldung.jhipster.uaa.repository.UserRepository; +import com.baeldung.jhipster.uaa.security.AuthoritiesConstants; +import com.baeldung.jhipster.uaa.service.MailService; +import com.baeldung.jhipster.uaa.service.UserService; +import com.baeldung.jhipster.uaa.service.dto.UserDTO; +import com.baeldung.jhipster.uaa.service.mapper.UserMapper; +import com.baeldung.jhipster.uaa.web.rest.errors.ExceptionTranslator; +import com.baeldung.jhipster.uaa.web.rest.vm.ManagedUserVM; +import org.apache.commons.lang3.RandomStringUtils; +import org.junit.Before; +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.cache.CacheManager; +import org.springframework.data.web.PageableHandlerMethodArgumentResolver; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.transaction.annotation.Transactional; + +import javax.persistence.EntityManager; +import java.time.Instant; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.hasItem; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +/** + * Test class for the UserResource REST controller. + * + * @see UserResource + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +public class UserResourceIntTest { + + private static final String DEFAULT_LOGIN = "johndoe"; + private static final String UPDATED_LOGIN = "jhipster"; + + private static final Long DEFAULT_ID = 1L; + + private static final String DEFAULT_PASSWORD = "passjohndoe"; + private static final String UPDATED_PASSWORD = "passjhipster"; + + private static final String DEFAULT_EMAIL = "johndoe@localhost"; + private static final String UPDATED_EMAIL = "jhipster@localhost"; + + private static final String DEFAULT_FIRSTNAME = "john"; + private static final String UPDATED_FIRSTNAME = "jhipsterFirstName"; + + private static final String DEFAULT_LASTNAME = "doe"; + private static final String UPDATED_LASTNAME = "jhipsterLastName"; + + private static final String DEFAULT_IMAGEURL = "http://placehold.it/50x50"; + private static final String UPDATED_IMAGEURL = "http://placehold.it/40x40"; + + private static final String DEFAULT_LANGKEY = "en"; + private static final String UPDATED_LANGKEY = "fr"; + + @Autowired + private UserRepository userRepository; + + @Autowired + private MailService mailService; + + @Autowired + private UserService userService; + + @Autowired + private UserMapper userMapper; + + @Autowired + private MappingJackson2HttpMessageConverter jacksonMessageConverter; + + @Autowired + private PageableHandlerMethodArgumentResolver pageableArgumentResolver; + + @Autowired + private ExceptionTranslator exceptionTranslator; + + @Autowired + private EntityManager em; + + @Autowired + private CacheManager cacheManager; + + private MockMvc restUserMockMvc; + + private User user; + + @Before + public void setup() { + cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).clear(); + cacheManager.getCache(UserRepository.USERS_BY_EMAIL_CACHE).clear(); + UserResource userResource = new UserResource(userService, userRepository, mailService); + + this.restUserMockMvc = MockMvcBuilders.standaloneSetup(userResource) + .setCustomArgumentResolvers(pageableArgumentResolver) + .setControllerAdvice(exceptionTranslator) + .setMessageConverters(jacksonMessageConverter) + .build(); + } + + /** + * Create a User. + * + * This is a static method, as tests for other entities might also need it, + * if they test an entity which has a required relationship to the User entity. + */ + public static User createEntity(EntityManager em) { + User user = new User(); + user.setLogin(DEFAULT_LOGIN + RandomStringUtils.randomAlphabetic(5)); + user.setPassword(RandomStringUtils.random(60)); + user.setActivated(true); + user.setEmail(RandomStringUtils.randomAlphabetic(5) + DEFAULT_EMAIL); + user.setFirstName(DEFAULT_FIRSTNAME); + user.setLastName(DEFAULT_LASTNAME); + user.setImageUrl(DEFAULT_IMAGEURL); + user.setLangKey(DEFAULT_LANGKEY); + return user; + } + + @Before + public void initTest() { + user = createEntity(em); + user.setLogin(DEFAULT_LOGIN); + user.setEmail(DEFAULT_EMAIL); + } + + @Test + @Transactional + public void createUser() throws Exception { + int databaseSizeBeforeCreate = userRepository.findAll().size(); + + // Create the User + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setLogin(DEFAULT_LOGIN); + managedUserVM.setPassword(DEFAULT_PASSWORD); + managedUserVM.setFirstName(DEFAULT_FIRSTNAME); + managedUserVM.setLastName(DEFAULT_LASTNAME); + managedUserVM.setEmail(DEFAULT_EMAIL); + managedUserVM.setActivated(true); + managedUserVM.setImageUrl(DEFAULT_IMAGEURL); + managedUserVM.setLangKey(DEFAULT_LANGKEY); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform(post("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isCreated()); + + // Validate the User in the database + List userList = userRepository.findAll(); + assertThat(userList).hasSize(databaseSizeBeforeCreate + 1); + User testUser = userList.get(userList.size() - 1); + assertThat(testUser.getLogin()).isEqualTo(DEFAULT_LOGIN); + assertThat(testUser.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME); + assertThat(testUser.getLastName()).isEqualTo(DEFAULT_LASTNAME); + assertThat(testUser.getEmail()).isEqualTo(DEFAULT_EMAIL); + assertThat(testUser.getImageUrl()).isEqualTo(DEFAULT_IMAGEURL); + assertThat(testUser.getLangKey()).isEqualTo(DEFAULT_LANGKEY); + } + + @Test + @Transactional + public void createUserWithExistingId() throws Exception { + int databaseSizeBeforeCreate = userRepository.findAll().size(); + + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setId(1L); + managedUserVM.setLogin(DEFAULT_LOGIN); + managedUserVM.setPassword(DEFAULT_PASSWORD); + managedUserVM.setFirstName(DEFAULT_FIRSTNAME); + managedUserVM.setLastName(DEFAULT_LASTNAME); + managedUserVM.setEmail(DEFAULT_EMAIL); + managedUserVM.setActivated(true); + managedUserVM.setImageUrl(DEFAULT_IMAGEURL); + managedUserVM.setLangKey(DEFAULT_LANGKEY); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + // An entity with an existing ID cannot be created, so this API call must fail + restUserMockMvc.perform(post("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isBadRequest()); + + // Validate the User in the database + List userList = userRepository.findAll(); + assertThat(userList).hasSize(databaseSizeBeforeCreate); + } + + @Test + @Transactional + public void createUserWithExistingLogin() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + int databaseSizeBeforeCreate = userRepository.findAll().size(); + + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setLogin(DEFAULT_LOGIN);// this login should already be used + managedUserVM.setPassword(DEFAULT_PASSWORD); + managedUserVM.setFirstName(DEFAULT_FIRSTNAME); + managedUserVM.setLastName(DEFAULT_LASTNAME); + managedUserVM.setEmail("anothermail@localhost"); + managedUserVM.setActivated(true); + managedUserVM.setImageUrl(DEFAULT_IMAGEURL); + managedUserVM.setLangKey(DEFAULT_LANGKEY); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + // Create the User + restUserMockMvc.perform(post("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isBadRequest()); + + // Validate the User in the database + List userList = userRepository.findAll(); + assertThat(userList).hasSize(databaseSizeBeforeCreate); + } + + @Test + @Transactional + public void createUserWithExistingEmail() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + int databaseSizeBeforeCreate = userRepository.findAll().size(); + + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setLogin("anotherlogin"); + managedUserVM.setPassword(DEFAULT_PASSWORD); + managedUserVM.setFirstName(DEFAULT_FIRSTNAME); + managedUserVM.setLastName(DEFAULT_LASTNAME); + managedUserVM.setEmail(DEFAULT_EMAIL);// this email should already be used + managedUserVM.setActivated(true); + managedUserVM.setImageUrl(DEFAULT_IMAGEURL); + managedUserVM.setLangKey(DEFAULT_LANGKEY); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + // Create the User + restUserMockMvc.perform(post("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isBadRequest()); + + // Validate the User in the database + List userList = userRepository.findAll(); + assertThat(userList).hasSize(databaseSizeBeforeCreate); + } + + @Test + @Transactional + public void getAllUsers() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + + // Get all the users + restUserMockMvc.perform(get("/api/users?sort=id,desc") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.[*].login").value(hasItem(DEFAULT_LOGIN))) + .andExpect(jsonPath("$.[*].firstName").value(hasItem(DEFAULT_FIRSTNAME))) + .andExpect(jsonPath("$.[*].lastName").value(hasItem(DEFAULT_LASTNAME))) + .andExpect(jsonPath("$.[*].email").value(hasItem(DEFAULT_EMAIL))) + .andExpect(jsonPath("$.[*].imageUrl").value(hasItem(DEFAULT_IMAGEURL))) + .andExpect(jsonPath("$.[*].langKey").value(hasItem(DEFAULT_LANGKEY))); + } + + @Test + @Transactional + public void getUser() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + + assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull(); + + // Get the user + restUserMockMvc.perform(get("/api/users/{login}", user.getLogin())) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$.login").value(user.getLogin())) + .andExpect(jsonPath("$.firstName").value(DEFAULT_FIRSTNAME)) + .andExpect(jsonPath("$.lastName").value(DEFAULT_LASTNAME)) + .andExpect(jsonPath("$.email").value(DEFAULT_EMAIL)) + .andExpect(jsonPath("$.imageUrl").value(DEFAULT_IMAGEURL)) + .andExpect(jsonPath("$.langKey").value(DEFAULT_LANGKEY)); + + assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull(); + } + + @Test + @Transactional + public void getNonExistingUser() throws Exception { + restUserMockMvc.perform(get("/api/users/unknown")) + .andExpect(status().isNotFound()); + } + + @Test + @Transactional + public void updateUser() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + int databaseSizeBeforeUpdate = userRepository.findAll().size(); + + // Update the user + User updatedUser = userRepository.findById(user.getId()).get(); + + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setId(updatedUser.getId()); + managedUserVM.setLogin(updatedUser.getLogin()); + managedUserVM.setPassword(UPDATED_PASSWORD); + managedUserVM.setFirstName(UPDATED_FIRSTNAME); + managedUserVM.setLastName(UPDATED_LASTNAME); + managedUserVM.setEmail(UPDATED_EMAIL); + managedUserVM.setActivated(updatedUser.getActivated()); + managedUserVM.setImageUrl(UPDATED_IMAGEURL); + managedUserVM.setLangKey(UPDATED_LANGKEY); + managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); + managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); + managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); + managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform(put("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isOk()); + + // Validate the User in the database + List userList = userRepository.findAll(); + assertThat(userList).hasSize(databaseSizeBeforeUpdate); + User testUser = userList.get(userList.size() - 1); + assertThat(testUser.getFirstName()).isEqualTo(UPDATED_FIRSTNAME); + assertThat(testUser.getLastName()).isEqualTo(UPDATED_LASTNAME); + assertThat(testUser.getEmail()).isEqualTo(UPDATED_EMAIL); + assertThat(testUser.getImageUrl()).isEqualTo(UPDATED_IMAGEURL); + assertThat(testUser.getLangKey()).isEqualTo(UPDATED_LANGKEY); + } + + @Test + @Transactional + public void updateUserLogin() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + int databaseSizeBeforeUpdate = userRepository.findAll().size(); + + // Update the user + User updatedUser = userRepository.findById(user.getId()).get(); + + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setId(updatedUser.getId()); + managedUserVM.setLogin(UPDATED_LOGIN); + managedUserVM.setPassword(UPDATED_PASSWORD); + managedUserVM.setFirstName(UPDATED_FIRSTNAME); + managedUserVM.setLastName(UPDATED_LASTNAME); + managedUserVM.setEmail(UPDATED_EMAIL); + managedUserVM.setActivated(updatedUser.getActivated()); + managedUserVM.setImageUrl(UPDATED_IMAGEURL); + managedUserVM.setLangKey(UPDATED_LANGKEY); + managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); + managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); + managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); + managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform(put("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isOk()); + + // Validate the User in the database + List userList = userRepository.findAll(); + assertThat(userList).hasSize(databaseSizeBeforeUpdate); + User testUser = userList.get(userList.size() - 1); + assertThat(testUser.getLogin()).isEqualTo(UPDATED_LOGIN); + assertThat(testUser.getFirstName()).isEqualTo(UPDATED_FIRSTNAME); + assertThat(testUser.getLastName()).isEqualTo(UPDATED_LASTNAME); + assertThat(testUser.getEmail()).isEqualTo(UPDATED_EMAIL); + assertThat(testUser.getImageUrl()).isEqualTo(UPDATED_IMAGEURL); + assertThat(testUser.getLangKey()).isEqualTo(UPDATED_LANGKEY); + } + + @Test + @Transactional + public void updateUserExistingEmail() throws Exception { + // Initialize the database with 2 users + userRepository.saveAndFlush(user); + + User anotherUser = new User(); + anotherUser.setLogin("jhipster"); + anotherUser.setPassword(RandomStringUtils.random(60)); + anotherUser.setActivated(true); + anotherUser.setEmail("jhipster@localhost"); + anotherUser.setFirstName("java"); + anotherUser.setLastName("hipster"); + anotherUser.setImageUrl(""); + anotherUser.setLangKey("en"); + userRepository.saveAndFlush(anotherUser); + + // Update the user + User updatedUser = userRepository.findById(user.getId()).get(); + + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setId(updatedUser.getId()); + managedUserVM.setLogin(updatedUser.getLogin()); + managedUserVM.setPassword(updatedUser.getPassword()); + managedUserVM.setFirstName(updatedUser.getFirstName()); + managedUserVM.setLastName(updatedUser.getLastName()); + managedUserVM.setEmail("jhipster@localhost");// this email should already be used by anotherUser + managedUserVM.setActivated(updatedUser.getActivated()); + managedUserVM.setImageUrl(updatedUser.getImageUrl()); + managedUserVM.setLangKey(updatedUser.getLangKey()); + managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); + managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); + managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); + managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform(put("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isBadRequest()); + } + + @Test + @Transactional + public void updateUserExistingLogin() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + + User anotherUser = new User(); + anotherUser.setLogin("jhipster"); + anotherUser.setPassword(RandomStringUtils.random(60)); + anotherUser.setActivated(true); + anotherUser.setEmail("jhipster@localhost"); + anotherUser.setFirstName("java"); + anotherUser.setLastName("hipster"); + anotherUser.setImageUrl(""); + anotherUser.setLangKey("en"); + userRepository.saveAndFlush(anotherUser); + + // Update the user + User updatedUser = userRepository.findById(user.getId()).get(); + + ManagedUserVM managedUserVM = new ManagedUserVM(); + managedUserVM.setId(updatedUser.getId()); + managedUserVM.setLogin("jhipster");// this login should already be used by anotherUser + managedUserVM.setPassword(updatedUser.getPassword()); + managedUserVM.setFirstName(updatedUser.getFirstName()); + managedUserVM.setLastName(updatedUser.getLastName()); + managedUserVM.setEmail(updatedUser.getEmail()); + managedUserVM.setActivated(updatedUser.getActivated()); + managedUserVM.setImageUrl(updatedUser.getImageUrl()); + managedUserVM.setLangKey(updatedUser.getLangKey()); + managedUserVM.setCreatedBy(updatedUser.getCreatedBy()); + managedUserVM.setCreatedDate(updatedUser.getCreatedDate()); + managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy()); + managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate()); + managedUserVM.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + restUserMockMvc.perform(put("/api/users") + .contentType(TestUtil.APPLICATION_JSON_UTF8) + .content(TestUtil.convertObjectToJsonBytes(managedUserVM))) + .andExpect(status().isBadRequest()); + } + + @Test + @Transactional + public void deleteUser() throws Exception { + // Initialize the database + userRepository.saveAndFlush(user); + int databaseSizeBeforeDelete = userRepository.findAll().size(); + + // Delete the user + restUserMockMvc.perform(delete("/api/users/{login}", user.getLogin()) + .accept(TestUtil.APPLICATION_JSON_UTF8)) + .andExpect(status().isOk()); + + assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull(); + + // Validate the database is empty + List userList = userRepository.findAll(); + assertThat(userList).hasSize(databaseSizeBeforeDelete - 1); + } + + @Test + @Transactional + public void getAllAuthorities() throws Exception { + restUserMockMvc.perform(get("/api/users/authorities") + .accept(TestUtil.APPLICATION_JSON_UTF8) + .contentType(TestUtil.APPLICATION_JSON_UTF8)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) + .andExpect(jsonPath("$").isArray()) + .andExpect(jsonPath("$").value(hasItems(AuthoritiesConstants.USER, AuthoritiesConstants.ADMIN))); + } + + @Test + @Transactional + public void testUserEquals() throws Exception { + TestUtil.equalsVerifier(User.class); + User user1 = new User(); + user1.setId(1L); + User user2 = new User(); + user2.setId(user1.getId()); + assertThat(user1).isEqualTo(user2); + user2.setId(2L); + assertThat(user1).isNotEqualTo(user2); + user1.setId(null); + assertThat(user1).isNotEqualTo(user2); + } + + @Test + public void testUserFromId() { + assertThat(userMapper.userFromId(DEFAULT_ID).getId()).isEqualTo(DEFAULT_ID); + assertThat(userMapper.userFromId(null)).isNull(); + } + + @Test + public void testUserDTOtoUser() { + UserDTO userDTO = new UserDTO(); + userDTO.setId(DEFAULT_ID); + userDTO.setLogin(DEFAULT_LOGIN); + userDTO.setFirstName(DEFAULT_FIRSTNAME); + userDTO.setLastName(DEFAULT_LASTNAME); + userDTO.setEmail(DEFAULT_EMAIL); + userDTO.setActivated(true); + userDTO.setImageUrl(DEFAULT_IMAGEURL); + userDTO.setLangKey(DEFAULT_LANGKEY); + userDTO.setCreatedBy(DEFAULT_LOGIN); + userDTO.setLastModifiedBy(DEFAULT_LOGIN); + userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); + + User user = userMapper.userDTOToUser(userDTO); + assertThat(user.getId()).isEqualTo(DEFAULT_ID); + assertThat(user.getLogin()).isEqualTo(DEFAULT_LOGIN); + assertThat(user.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME); + assertThat(user.getLastName()).isEqualTo(DEFAULT_LASTNAME); + assertThat(user.getEmail()).isEqualTo(DEFAULT_EMAIL); + assertThat(user.getActivated()).isEqualTo(true); + assertThat(user.getImageUrl()).isEqualTo(DEFAULT_IMAGEURL); + assertThat(user.getLangKey()).isEqualTo(DEFAULT_LANGKEY); + assertThat(user.getCreatedBy()).isNull(); + assertThat(user.getCreatedDate()).isNotNull(); + assertThat(user.getLastModifiedBy()).isNull(); + assertThat(user.getLastModifiedDate()).isNotNull(); + assertThat(user.getAuthorities()).extracting("name").containsExactly(AuthoritiesConstants.USER); + } + + @Test + public void testUserToUserDTO() { + user.setId(DEFAULT_ID); + user.setCreatedBy(DEFAULT_LOGIN); + user.setCreatedDate(Instant.now()); + user.setLastModifiedBy(DEFAULT_LOGIN); + user.setLastModifiedDate(Instant.now()); + Set authorities = new HashSet<>(); + Authority authority = new Authority(); + authority.setName(AuthoritiesConstants.USER); + authorities.add(authority); + user.setAuthorities(authorities); + + UserDTO userDTO = userMapper.userToUserDTO(user); + + assertThat(userDTO.getId()).isEqualTo(DEFAULT_ID); + assertThat(userDTO.getLogin()).isEqualTo(DEFAULT_LOGIN); + assertThat(userDTO.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME); + assertThat(userDTO.getLastName()).isEqualTo(DEFAULT_LASTNAME); + assertThat(userDTO.getEmail()).isEqualTo(DEFAULT_EMAIL); + assertThat(userDTO.isActivated()).isEqualTo(true); + assertThat(userDTO.getImageUrl()).isEqualTo(DEFAULT_IMAGEURL); + assertThat(userDTO.getLangKey()).isEqualTo(DEFAULT_LANGKEY); + assertThat(userDTO.getCreatedBy()).isEqualTo(DEFAULT_LOGIN); + assertThat(userDTO.getCreatedDate()).isEqualTo(user.getCreatedDate()); + assertThat(userDTO.getLastModifiedBy()).isEqualTo(DEFAULT_LOGIN); + assertThat(userDTO.getLastModifiedDate()).isEqualTo(user.getLastModifiedDate()); + assertThat(userDTO.getAuthorities()).containsExactly(AuthoritiesConstants.USER); + assertThat(userDTO.toString()).isNotNull(); + } + + @Test + public void testAuthorityEquals() { + Authority authorityA = new Authority(); + assertThat(authorityA).isEqualTo(authorityA); + assertThat(authorityA).isNotEqualTo(null); + assertThat(authorityA).isNotEqualTo(new Object()); + assertThat(authorityA.hashCode()).isEqualTo(0); + assertThat(authorityA.toString()).isNotNull(); + + Authority authorityB = new Authority(); + assertThat(authorityA).isEqualTo(authorityB); + + authorityB.setName(AuthoritiesConstants.ADMIN); + assertThat(authorityA).isNotEqualTo(authorityB); + + authorityA.setName(AuthoritiesConstants.USER); + assertThat(authorityA).isNotEqualTo(authorityB); + + authorityB.setName(AuthoritiesConstants.USER); + assertThat(authorityA).isEqualTo(authorityB); + assertThat(authorityA.hashCode()).isEqualTo(authorityB.hashCode()); + } +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorIntTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorIntTest.java new file mode 100644 index 0000000000..25c5b865b7 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorIntTest.java @@ -0,0 +1,151 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import com.baeldung.jhipster.uaa.UaaApp; +import com.baeldung.jhipster.uaa.config.SecurityBeanOverrideConfiguration; +import org.junit.Before; +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.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Test class for the ExceptionTranslator controller advice. + * + * @see ExceptionTranslator + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = UaaApp.class) +public class ExceptionTranslatorIntTest { + + @Autowired + private ExceptionTranslatorTestController controller; + + @Autowired + private ExceptionTranslator exceptionTranslator; + + @Autowired + private MappingJackson2HttpMessageConverter jacksonMessageConverter; + + private MockMvc mockMvc; + + @Before + public void setup() { + mockMvc = MockMvcBuilders.standaloneSetup(controller) + .setControllerAdvice(exceptionTranslator) + .setMessageConverters(jacksonMessageConverter) + .build(); + } + + @Test + public void testConcurrencyFailure() throws Exception { + mockMvc.perform(get("/test/concurrency-failure")) + .andExpect(status().isConflict()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); + } + + @Test + public void testMethodArgumentNotValid() throws Exception { + mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) + .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) + .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) + .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); + } + + @Test + public void testParameterizedError() throws Exception { + mockMvc.perform(get("/test/parameterized-error")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("test parameterized error")) + .andExpect(jsonPath("$.params.param0").value("param0_value")) + .andExpect(jsonPath("$.params.param1").value("param1_value")); + } + + @Test + public void testParameterizedError2() throws Exception { + mockMvc.perform(get("/test/parameterized-error2")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("test parameterized error")) + .andExpect(jsonPath("$.params.foo").value("foo_value")) + .andExpect(jsonPath("$.params.bar").value("bar_value")); + } + + @Test + public void testMissingServletRequestPartException() throws Exception { + mockMvc.perform(get("/test/missing-servlet-request-part")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")); + } + + @Test + public void testMissingServletRequestParameterException() throws Exception { + mockMvc.perform(get("/test/missing-servlet-request-parameter")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")); + } + + @Test + public void testAccessDenied() throws Exception { + mockMvc.perform(get("/test/access-denied")) + .andExpect(status().isForbidden()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.403")) + .andExpect(jsonPath("$.detail").value("test access denied!")); + } + + @Test + public void testUnauthorized() throws Exception { + mockMvc.perform(get("/test/unauthorized")) + .andExpect(status().isUnauthorized()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.401")) + .andExpect(jsonPath("$.path").value("/test/unauthorized")) + .andExpect(jsonPath("$.detail").value("test authentication failed!")); + } + + @Test + public void testMethodNotSupported() throws Exception { + mockMvc.perform(post("/test/access-denied")) + .andExpect(status().isMethodNotAllowed()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.405")) + .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); + } + + @Test + public void testExceptionWithResponseStatus() throws Exception { + mockMvc.perform(get("/test/response-status")) + .andExpect(status().isBadRequest()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.400")) + .andExpect(jsonPath("$.title").value("test response status")); + } + + @Test + public void testInternalServerError() throws Exception { + mockMvc.perform(get("/test/internal-server-error")) + .andExpect(status().isInternalServerError()) + .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) + .andExpect(jsonPath("$.message").value("error.http.500")) + .andExpect(jsonPath("$.title").value("Internal Server Error")); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorTestController.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorTestController.java new file mode 100644 index 0000000000..0ea0445563 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/errors/ExceptionTranslatorTestController.java @@ -0,0 +1,86 @@ +package com.baeldung.jhipster.uaa.web.rest.errors; + +import org.springframework.dao.ConcurrencyFailureException; +import org.springframework.http.HttpStatus; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.HashMap; +import java.util.Map; + +@RestController +public class ExceptionTranslatorTestController { + + @GetMapping("/test/concurrency-failure") + public void concurrencyFailure() { + throw new ConcurrencyFailureException("test concurrency failure"); + } + + @PostMapping("/test/method-argument") + public void methodArgument(@Valid @RequestBody TestDTO testDTO) { + } + + @GetMapping("/test/parameterized-error") + public void parameterizedError() { + throw new CustomParameterizedException("test parameterized error", "param0_value", "param1_value"); + } + + @GetMapping("/test/parameterized-error2") + public void parameterizedError2() { + Map params = new HashMap<>(); + params.put("foo", "foo_value"); + params.put("bar", "bar_value"); + throw new CustomParameterizedException("test parameterized error", params); + } + + @GetMapping("/test/missing-servlet-request-part") + public void missingServletRequestPartException(@RequestPart String part) { + } + + @GetMapping("/test/missing-servlet-request-parameter") + public void missingServletRequestParameterException(@RequestParam String param) { + } + + @GetMapping("/test/access-denied") + public void accessdenied() { + throw new AccessDeniedException("test access denied!"); + } + + @GetMapping("/test/unauthorized") + public void unauthorized() { + throw new BadCredentialsException("test authentication failed!"); + } + + @GetMapping("/test/response-status") + public void exceptionWithReponseStatus() { + throw new TestResponseStatusException(); + } + + @GetMapping("/test/internal-server-error") + public void internalServerError() { + throw new RuntimeException(); + } + + public static class TestDTO { + + @NotNull + private String test; + + public String getTest() { + return test; + } + + public void setTest(String test) { + this.test = test; + } + } + + @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "test response status") + @SuppressWarnings("serial") + public static class TestResponseStatusException extends RuntimeException { + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtilUnitTest.java b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtilUnitTest.java new file mode 100644 index 0000000000..998a1da0cf --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/java/com/baeldung/jhipster/uaa/web/rest/util/PaginationUtilUnitTest.java @@ -0,0 +1,44 @@ +package com.baeldung.jhipster.uaa.web.rest.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.HttpHeaders; + +/** + * Tests based on parsing algorithm in app/components/util/pagination-util.service.js + * + * @see PaginationUtil + */ +public class PaginationUtilUnitTest { + + @Test + public void generatePaginationHttpHeadersTest() { + String baseUrl = "/api/_search/example"; + List content = new ArrayList<>(); + Page page = new PageImpl<>(content, PageRequest.of(6, 50), 400L); + HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, baseUrl); + List strHeaders = headers.get(HttpHeaders.LINK); + assertNotNull(strHeaders); + assertTrue(strHeaders.size() == 1); + String headerData = strHeaders.get(0); + assertTrue(headerData.split(",").length == 4); + String expectedData = "; rel=\"next\"," + + "; rel=\"prev\"," + + "; rel=\"last\"," + + "; rel=\"first\""; + assertEquals(expectedData, headerData); + List xTotalCountHeaders = headers.get("X-Total-Count"); + assertTrue(xTotalCountHeaders.size() == 1); + assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L)); + } + +} diff --git a/jhipster/jhipster-uaa/uaa/src/test/resources/config/application.yml b/jhipster/jhipster-uaa/uaa/src/test/resources/config/application.yml new file mode 100644 index 0000000000..d5389ee223 --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/resources/config/application.yml @@ -0,0 +1,120 @@ +# =================================================================== +# Spring Boot configuration. +# +# This configuration is used for unit/integration tests. +# +# More information on profiles: https://www.jhipster.tech/profiles/ +# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# =================================================================== +# Standard Spring Boot properties. +# Full reference is available at: +# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html +# =================================================================== + +eureka: + client: + enabled: false + instance: + appname: uaa + instanceId: uaa:${spring.application.instance-id:${random.value}} + +spring: + application: + name: uaa + cache: + type: simple + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:h2:mem:uaa;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + name: + username: + password: + hikari: + auto-commit: false + jpa: + database-platform: io.github.jhipster.domain.util.FixedH2Dialect + database: H2 + open-in-view: false + show-sql: false + hibernate: + ddl-auto: none + naming: + physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy + properties: + hibernate.id.new_generator_mappings: true + hibernate.connection.provider_disables_autocommit: true + hibernate.cache.use_second_level_cache: false + hibernate.cache.use_query_cache: false + hibernate.generate_statistics: true + hibernate.hbm2ddl.auto: validate + liquibase: + contexts: test + mail: + host: localhost + messages: + basename: i18n/messages + mvc: + favicon: + enabled: false + thymeleaf: + mode: HTML + + +server: + port: 10344 + address: localhost + +info: + project: + version: #project.version# + +# =================================================================== +# JHipster specific properties +# +# Full reference is available at: https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +jhipster: + async: + core-pool-size: 1 + max-pool-size: 50 + queue-capacity: 10000 + # To test logstash appender + logging: + logstash: + enabled: true + host: localhost + port: 5000 + queue-size: 512 + mail: + from: test@localhost + base-url: http://127.0.0.1:8080 + security: + authentication: + jwt: + # This token must be encoded using Base64 (you can type `echo 'secret-key'|base64` on your command line) + base64-secret: ZTljMjA0NzA0OWE0MTVhM2Y2MjJkNzg2MzU4NDFhYTZhM2JlOGY4MmM0Y2M4ZTQ3NzdkNjVjZmJkMTFhOGU2MmY3MWMzNDg4OGY2OWI2Zjc4NTFhNDVkOTZlMDVhNzFkNDUyZjMzNDYxNGY5NWNmYTI4NzA2NzRkYzQ4Y2ZiZjU= + # Token is valid 24 hours + token-validity-in-seconds: 86400 + client-authorization: + client-id: internal + client-secret: internal + metrics: # DropWizard Metrics configuration, used by MetricsConfiguration + jmx.enabled: true + logs: # Reports Dropwizard metrics in the logs + enabled: true + report-frequency: 60 # in seconds + +# =================================================================== +# Application specific properties +# Add your own application properties here, see the ApplicationProperties class +# to have type-safe configuration, like in the JHipsterProperties above +# +# More documentation is available at: +# https://www.jhipster.tech/common-application-properties/ +# =================================================================== + +# application: diff --git a/jhipster/jhipster-uaa/uaa/src/test/resources/config/bootstrap.yml b/jhipster/jhipster-uaa/uaa/src/test/resources/config/bootstrap.yml new file mode 100644 index 0000000000..11cd6af21c --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/resources/config/bootstrap.yml @@ -0,0 +1,4 @@ +spring: + cloud: + config: + enabled: false diff --git a/jhipster/jhipster-uaa/uaa/src/test/resources/i18n/messages_en.properties b/jhipster/jhipster-uaa/uaa/src/test/resources/i18n/messages_en.properties new file mode 100644 index 0000000000..f19db8692f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/resources/i18n/messages_en.properties @@ -0,0 +1 @@ +email.test.title=test title diff --git a/jhipster/jhipster-uaa/uaa/src/test/resources/logback.xml b/jhipster/jhipster-uaa/uaa/src/test/resources/logback.xml new file mode 100644 index 0000000000..4d3a18bcba --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/resources/logback.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jhipster/jhipster-uaa/uaa/src/test/resources/templates/mail/testEmail.html b/jhipster/jhipster-uaa/uaa/src/test/resources/templates/mail/testEmail.html new file mode 100644 index 0000000000..a4ca16a79f --- /dev/null +++ b/jhipster/jhipster-uaa/uaa/src/test/resources/templates/mail/testEmail.html @@ -0,0 +1 @@ + From 9c434f2ad80e0bca8de3b2921557b4d3ece4cba1 Mon Sep 17 00:00:00 2001 From: fanatixan Date: Sat, 3 Nov 2018 18:11:38 +0100 Subject: [PATCH 294/546] bael-2190 --- .../manytomany/extracolumn/model/Course.java | 67 +++++++++++++ .../extracolumn/model/CourseRating.java | 75 +++++++++++++++ .../extracolumn/model/CourseRatingKey.java | 59 ++++++++++++ .../extracolumn/model/CourseRegistration.java | 94 +++++++++++++++++++ .../manytomany/extracolumn/model/Student.java | 74 +++++++++++++++ 5 files changed, 369 insertions(+) create mode 100644 persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Course.java create mode 100644 persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRating.java create mode 100644 persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRatingKey.java create mode 100644 persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRegistration.java create mode 100644 persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Student.java diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Course.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Course.java new file mode 100644 index 0000000000..4849165c57 --- /dev/null +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Course.java @@ -0,0 +1,67 @@ +package com.baeldung.manytomany.extracolumn.model; + +import java.util.Set; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.OneToMany; + +@Entity +public class Course { + + @Id + private Long id; + + @ManyToMany(mappedBy = "likedCourses") + private Set likes; + + @OneToMany(mappedBy = "course") + private Set ratings; + + @OneToMany(mappedBy = "course") + private Set registrations; + + // additional properties + + public Course() { + } + + public Long getId() { + return id; + } + + public Set getRatings() { + return ratings; + } + + public Set getRegistrations() { + return registrations; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Course other = (Course) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRating.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRating.java new file mode 100644 index 0000000000..1b6c9d8b2c --- /dev/null +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRating.java @@ -0,0 +1,75 @@ +package com.baeldung.manytomany.extracolumn.model; + +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.MapsId; + +@Entity +public class CourseRating { + + @EmbeddedId + private CourseRatingKey id; + + @ManyToOne + @MapsId("student_id") + @JoinColumn(name = "student_id") + private Student student; + + @ManyToOne + @MapsId("course_id") + @JoinColumn(name = "course_id") + private Course course; + + private int rating; + + public CourseRating() { + } + + public int getRating() { + return rating; + } + + public void setRating(int rating) { + this.rating = rating; + } + + public CourseRatingKey getId() { + return id; + } + + public Student getStudent() { + return student; + } + + public Course getCourse() { + return course; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CourseRating other = (CourseRating) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRatingKey.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRatingKey.java new file mode 100644 index 0000000000..6638ae6968 --- /dev/null +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRatingKey.java @@ -0,0 +1,59 @@ +package com.baeldung.manytomany.extracolumn.model; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Embeddable; + +@Embeddable +public class CourseRatingKey implements Serializable { + + @Column(name = "student_id") + private Long studentId; + + @Column(name = "course_id") + private Long courseId; + + public CourseRatingKey() { + } + + public Long getStudentId() { + return studentId; + } + + public Long getCourseId() { + return courseId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((courseId == null) ? 0 : courseId.hashCode()); + result = prime * result + ((studentId == null) ? 0 : studentId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CourseRatingKey other = (CourseRatingKey) obj; + if (courseId == null) { + if (other.courseId != null) + return false; + } else if (!courseId.equals(other.courseId)) + return false; + if (studentId == null) { + if (other.studentId != null) + return false; + } else if (!studentId.equals(other.studentId)) + return false; + return true; + } + +} diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRegistration.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRegistration.java new file mode 100644 index 0000000000..225968dba4 --- /dev/null +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRegistration.java @@ -0,0 +1,94 @@ +package com.baeldung.manytomany.extracolumn.model; + +import java.time.LocalDateTime; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +@Entity +public class CourseRegistration { + + @Id + private Long id; + + @ManyToOne + @JoinColumn(name = "student_id") + private Student student; + + @ManyToOne + @JoinColumn(name = "course_id") + private Course course; + + private LocalDateTime registeredAt; + + private int grade; + + // additional properties + + public CourseRegistration() { + } + + public Student getStudent() { + return student; + } + + public void setStudent(Student student) { + this.student = student; + } + + public Course getCourse() { + return course; + } + + public void setCourse(Course course) { + this.course = course; + } + + public LocalDateTime getRegisteredAt() { + return registeredAt; + } + + public void setRegisteredAt(LocalDateTime registeredAt) { + this.registeredAt = registeredAt; + } + + public int getGrade() { + return grade; + } + + public void setGrade(int grade) { + this.grade = grade; + } + + public Long getId() { + return id; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CourseRegistration other = (CourseRegistration) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Student.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Student.java new file mode 100644 index 0000000000..6bc8271e7e --- /dev/null +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Student.java @@ -0,0 +1,74 @@ +package com.baeldung.manytomany.extracolumn.model; + +import java.util.Set; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.OneToMany; + +@Entity +public class Student { + + @Id + private Long id; + + @ManyToMany + @JoinTable(name = "course_like", joinColumns = @JoinColumn(name = "student_id"), inverseJoinColumns = @JoinColumn(name = "course_id")) + private Set likedCourses; + + @OneToMany(mappedBy = "student") + private Set ratings; + + @OneToMany(mappedBy = "student") + private Set registrations; + + // additional properties + + public Student() { + } + + public Long getId() { + return id; + } + + public Set getLikedCourses() { + return likedCourses; + } + + public Set getRatings() { + return ratings; + } + + public Set getRegistrations() { + return registrations; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Student other = (Student) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} From fcd01986fcbfe5b17d4afc69331c557cf47d4cd4 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sat, 3 Nov 2018 21:45:12 +0200 Subject: [PATCH 295/546] include spring-5-reactive-oauth to parent pom --- pom.xml | 1 + spring-5-reactive-oauth/pom.xml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/pom.xml b/pom.xml index fa8a1108b5..53f6bc77a4 100644 --- a/pom.xml +++ b/pom.xml @@ -468,6 +468,7 @@ spring-5-reactive-client spring-5-mvc spring-5-security + spring-5-reactive-oauth spring-activiti spring-akka spring-amqp diff --git a/spring-5-reactive-oauth/pom.xml b/spring-5-reactive-oauth/pom.xml index 72e0659bf0..73809681f2 100644 --- a/spring-5-reactive-oauth/pom.xml +++ b/spring-5-reactive-oauth/pom.xml @@ -56,4 +56,22 @@
+ + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.20.1 + + true + + **/*IntegrationTest.java + + + + + + +
From b89e76b4649b53bd34cae9bbfaf4acaca60c8378 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Sat, 3 Nov 2018 15:25:20 -0500 Subject: [PATCH 296/546] BAEL-1358: Renamed spring-cloud-zuul-ratelimit to spring-cloud-zuul --- spring-cloud/pom.xml | 1 + .../pom.xml | 4 ++-- .../cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java | 0 .../zuulratelimitdemo/controller/GreetingController.java | 0 .../src/main/resources/application.yml | 0 .../zuulratelimitdemo/controller/GreetingControllerTest.java | 0 6 files changed, 3 insertions(+), 2 deletions(-) rename spring-cloud/{spring-cloud-zuul-ratelimit => spring-cloud-zuul}/pom.xml (95%) rename spring-cloud/{spring-cloud-zuul-ratelimit => spring-cloud-zuul}/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java (100%) rename spring-cloud/{spring-cloud-zuul-ratelimit => spring-cloud-zuul}/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java (100%) rename spring-cloud/{spring-cloud-zuul-ratelimit => spring-cloud-zuul}/src/main/resources/application.yml (100%) rename spring-cloud/{spring-cloud-zuul-ratelimit => spring-cloud-zuul}/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java (100%) diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index 924ea2be36..2fd15202e6 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -37,6 +37,7 @@ spring-cloud-vault spring-cloud-security spring-cloud-task + spring-cloud-zuul diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/pom.xml b/spring-cloud/spring-cloud-zuul/pom.xml similarity index 95% rename from spring-cloud/spring-cloud-zuul-ratelimit/pom.xml rename to spring-cloud/spring-cloud-zuul/pom.xml index 46139b4f57..e387bacb4e 100644 --- a/spring-cloud/spring-cloud-zuul-ratelimit/pom.xml +++ b/spring-cloud/spring-cloud-zuul/pom.xml @@ -4,11 +4,11 @@ 4.0.0 com.baeldung.spring.cloud - spring-cloud-zuul-ratelimit + spring-cloud-zuul 0.0.1-SNAPSHOT jar - spring-cloud-zuul-ratelimit + spring-cloud-zuul Demo project for Spring Boot diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java b/spring-cloud/spring-cloud-zuul/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java similarity index 100% rename from spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java rename to spring-cloud/spring-cloud-zuul/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/ZuulRatelimitDemoApplication.java diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java b/spring-cloud/spring-cloud-zuul/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java similarity index 100% rename from spring-cloud/spring-cloud-zuul-ratelimit/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java rename to spring-cloud/spring-cloud-zuul/src/main/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingController.java diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/src/main/resources/application.yml b/spring-cloud/spring-cloud-zuul/src/main/resources/application.yml similarity index 100% rename from spring-cloud/spring-cloud-zuul-ratelimit/src/main/resources/application.yml rename to spring-cloud/spring-cloud-zuul/src/main/resources/application.yml diff --git a/spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java b/spring-cloud/spring-cloud-zuul/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java similarity index 100% rename from spring-cloud/spring-cloud-zuul-ratelimit/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java rename to spring-cloud/spring-cloud-zuul/src/test/java/com/baeldung/spring/cloud/zuulratelimitdemo/controller/GreetingControllerTest.java From d8bdac58138d274f58407c32527cb79802454672 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 4 Nov 2018 02:05:32 +0530 Subject: [PATCH 297/546] [BAEL-9551] - Clean up code --- .../roundUpToHundred/.gitignore | 1 - .../src/com/java/src/RoundUpToHundred.java | 20 ------------- .../com/java/src/RoundUpToHundredTest.java | 14 ---------- .../com/baeldung/algorithms/RunAlgorithm.java | 16 ++--------- algorithms-miscellaneous-1/README.md | 3 +- .../roundUpToHundred/.gitignore | 1 - .../com/java/src/RoundUpToHundredTest.java | 14 ---------- .../src/main/resources/maze/maze1.txt | 12 -------- .../src/main/resources/maze/maze2.txt | 22 --------------- algorithms-miscellaneous-2/README.md | 1 - .../roundUpToHundred/.gitignore | 1 - .../src/com/java/src/RoundUpToHundred.java | 20 ------------- .../com/baeldung/algorithms/RunAlgorithm.java | 28 +++++++++++++++++++ .../algorithms/ga/dijkstra/Dijkstra.java | 0 .../algorithms/ga/dijkstra/Graph.java | 0 .../baeldung/algorithms/ga/dijkstra/Node.java | 0 .../roundedup}/RoundUpToHundred.java | 2 +- .../algorithms/slope_one/InputData.java | 0 .../baeldung/algorithms/slope_one/Item.java | 0 .../algorithms/slope_one/SlopeOne.java | 0 .../baeldung/algorithms/slope_one/User.java | 0 .../DijkstraAlgorithmLongRunningUnitTest.java | 0 .../roundedup/RoundUpToHundredUnitTest.java} | 4 +-- .../roundUpToHundred/.gitignore | 1 - .../src/com/java/src/RoundUpToHundred.java | 20 ------------- .../com/java/src/RoundUpToHundredTest.java | 14 ---------- 26 files changed, 36 insertions(+), 158 deletions(-) delete mode 100644 algorithms-genetic/roundUpToHundred/.gitignore delete mode 100644 algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundred.java delete mode 100644 algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java delete mode 100644 algorithms-miscellaneous-1/roundUpToHundred/.gitignore delete mode 100644 algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java delete mode 100644 algorithms-miscellaneous-1/src/main/resources/maze/maze1.txt delete mode 100644 algorithms-miscellaneous-1/src/main/resources/maze/maze2.txt delete mode 100644 algorithms-miscellaneous-2/roundUpToHundred/.gitignore delete mode 100644 algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java create mode 100644 algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/RunAlgorithm.java rename {algorithms-genetic => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java (100%) rename {algorithms-genetic => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java (100%) rename {algorithms-genetic => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java (100%) rename {algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src => algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/roundedup}/RoundUpToHundred.java (90%) rename {algorithms-genetic => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/slope_one/InputData.java (100%) rename {algorithms-genetic => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/slope_one/Item.java (100%) rename {algorithms-genetic => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java (100%) rename {algorithms-genetic => algorithms-miscellaneous-2}/src/main/java/com/baeldung/algorithms/slope_one/User.java (100%) rename {algorithms-genetic => algorithms-miscellaneous-2}/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java (100%) rename algorithms-miscellaneous-2/{roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java => src/test/java/com/baeldung/algorithms/roundedup/RoundUpToHundredUnitTest.java} (83%) delete mode 100644 algorithms-sorting/roundUpToHundred/.gitignore delete mode 100644 algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java delete mode 100644 algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java diff --git a/algorithms-genetic/roundUpToHundred/.gitignore b/algorithms-genetic/roundUpToHundred/.gitignore deleted file mode 100644 index ae3c172604..0000000000 --- a/algorithms-genetic/roundUpToHundred/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundred.java deleted file mode 100644 index 6c02a340d3..0000000000 --- a/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundred.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.java.src; - -import java.util.Scanner; - -public class RoundUpToHundred { - - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - double input = scanner.nextDouble(); - scanner.close(); - - RoundUpToHundred.round(input); - } - - static long round(double input) { - long i = (long) Math.ceil(input); - return ((i + 99) / 100) * 100; - }; - -} diff --git a/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java deleted file mode 100644 index cb541ad49c..0000000000 --- a/algorithms-genetic/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.java.src; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class RoundUpToHundredTest { - @Test - public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { - assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); - assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); - assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); - } -} diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/RunAlgorithm.java b/algorithms-genetic/src/main/java/com/baeldung/algorithms/RunAlgorithm.java index ce04d26db3..779cb9b970 100644 --- a/algorithms-genetic/src/main/java/com/baeldung/algorithms/RunAlgorithm.java +++ b/algorithms-genetic/src/main/java/com/baeldung/algorithms/RunAlgorithm.java @@ -5,7 +5,6 @@ import java.util.Scanner; import com.baeldung.algorithms.ga.annealing.SimulatedAnnealing; import com.baeldung.algorithms.ga.ant_colony.AntColonyOptimization; import com.baeldung.algorithms.ga.binary.SimpleGeneticAlgorithm; -import com.baeldung.algorithms.slope_one.SlopeOne; public class RunAlgorithm { @@ -13,11 +12,8 @@ public class RunAlgorithm { Scanner in = new Scanner(System.in); System.out.println("Run algorithm:"); System.out.println("1 - Simulated Annealing"); - System.out.println("2 - Slope One"); - System.out.println("3 - Simple Genetic Algorithm"); - System.out.println("4 - Ant Colony"); - System.out.println("5 - Dijkstra"); - System.out.println("6 - All pairs in an array that add up to a given sum"); + System.out.println("2 - Simple Genetic Algorithm"); + System.out.println("3 - Ant Colony"); int decision = in.nextInt(); switch (decision) { case 1: @@ -25,19 +21,13 @@ public class RunAlgorithm { "Optimized distance for travel: " + SimulatedAnnealing.simulateAnnealing(10, 10000, 0.9995)); break; case 2: - SlopeOne.slopeOne(3); - break; - case 3: SimpleGeneticAlgorithm ga = new SimpleGeneticAlgorithm(); ga.runAlgorithm(50, "1011000100000100010000100000100111001000000100000100000000001111"); break; - case 4: + case 3: AntColonyOptimization antColony = new AntColonyOptimization(21); antColony.startAntOptimization(); break; - case 5: - System.out.println("Please run the DijkstraAlgorithmTest."); - break; default: System.out.println("Unknown option"); break; diff --git a/algorithms-miscellaneous-1/README.md b/algorithms-miscellaneous-1/README.md index 9efb2233bf..a04874c4d2 100644 --- a/algorithms-miscellaneous-1/README.md +++ b/algorithms-miscellaneous-1/README.md @@ -9,4 +9,5 @@ - [How to Find the Kth Largest Element in Java](http://www.baeldung.com/java-kth-largest-element) - [Multi-Swarm Optimization Algorithm in Java](http://www.baeldung.com/java-multi-swarm-algorithm) - [String Search Algorithms for Large Texts](http://www.baeldung.com/java-full-text-search-algorithms) -- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters) \ No newline at end of file +- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters) +- [Find the Middle Element of a Linked List](http://www.baeldung.com/java-linked-list-middle-element) \ No newline at end of file diff --git a/algorithms-miscellaneous-1/roundUpToHundred/.gitignore b/algorithms-miscellaneous-1/roundUpToHundred/.gitignore deleted file mode 100644 index ae3c172604..0000000000 --- a/algorithms-miscellaneous-1/roundUpToHundred/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java deleted file mode 100644 index cb541ad49c..0000000000 --- a/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.java.src; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class RoundUpToHundredTest { - @Test - public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { - assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); - assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); - assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); - } -} diff --git a/algorithms-miscellaneous-1/src/main/resources/maze/maze1.txt b/algorithms-miscellaneous-1/src/main/resources/maze/maze1.txt deleted file mode 100644 index 8b48c325d2..0000000000 --- a/algorithms-miscellaneous-1/src/main/resources/maze/maze1.txt +++ /dev/null @@ -1,12 +0,0 @@ -S ######## -# # -# ### ## # -# # # # -# # # # # -# ## ##### -# # # -# # # # # -##### #### -# # E -# # # # -########## \ No newline at end of file diff --git a/algorithms-miscellaneous-1/src/main/resources/maze/maze2.txt b/algorithms-miscellaneous-1/src/main/resources/maze/maze2.txt deleted file mode 100644 index df5b6bc66b..0000000000 --- a/algorithms-miscellaneous-1/src/main/resources/maze/maze2.txt +++ /dev/null @@ -1,22 +0,0 @@ -S ########################## -# # # # -# # #### ############### # -# # # # # # -# # #### # # ############### -# # # # # # # -# # # #### ### ########### # -# # # # # # -# ################## # -######### # # # # # -# # #### # ####### # # -# # ### ### # # # # # -# # ## # ##### # # -##### ####### # # # # # -# # ## ## #### # # -# ##### ####### # # -# # ############ -####### ######### # # -# # ######## # -# ####### ###### ## # E -# # # ## # -############################ \ No newline at end of file diff --git a/algorithms-miscellaneous-2/README.md b/algorithms-miscellaneous-2/README.md index 2634fd6b56..6772a94a8d 100644 --- a/algorithms-miscellaneous-2/README.md +++ b/algorithms-miscellaneous-2/README.md @@ -10,7 +10,6 @@ - [A Collaborative Filtering Recommendation System in Java](http://www.baeldung.com/java-collaborative-filtering-recommendations) - [Converting Between Roman and Arabic Numerals in Java](http://www.baeldung.com/java-convert-roman-arabic) - [Practical Java Examples of the Big O Notation](http://www.baeldung.com/java-algorithm-complexity) -- [Find the Middle Element of a Linked List](http://www.baeldung.com/java-linked-list-middle-element) - [An Introduction to the Theory of Big-O Notation](http://www.baeldung.com/big-o-notation) - [Check If Two Rectangles Overlap In Java](https://www.baeldung.com/java-check-if-two-rectangles-overlap) - [Calculate the Distance Between Two Points in Java](https://www.baeldung.com/java-distance-between-two-points) diff --git a/algorithms-miscellaneous-2/roundUpToHundred/.gitignore b/algorithms-miscellaneous-2/roundUpToHundred/.gitignore deleted file mode 100644 index ae3c172604..0000000000 --- a/algorithms-miscellaneous-2/roundUpToHundred/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java deleted file mode 100644 index 6c02a340d3..0000000000 --- a/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundred.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.java.src; - -import java.util.Scanner; - -public class RoundUpToHundred { - - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - double input = scanner.nextDouble(); - scanner.close(); - - RoundUpToHundred.round(input); - } - - static long round(double input) { - long i = (long) Math.ceil(input); - return ((i + 99) / 100) * 100; - }; - -} diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/RunAlgorithm.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/RunAlgorithm.java new file mode 100644 index 0000000000..a1a096bc30 --- /dev/null +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/RunAlgorithm.java @@ -0,0 +1,28 @@ +package com.baeldung.algorithms; + +import java.util.Scanner; + +import com.baeldung.algorithms.slope_one.SlopeOne; + +public class RunAlgorithm { + + public static void main(String[] args) throws InstantiationException, IllegalAccessException { + Scanner in = new Scanner(System.in); + System.out.println("1 - Slope One"); + System.out.println("2 - Dijkstra"); + int decision = in.nextInt(); + switch (decision) { + case 1: + SlopeOne.slopeOne(3); + break; + case 2: + System.out.println("Please run the DijkstraAlgorithmLongRunningUnitTest."); + break; + default: + System.out.println("Unknown option"); + break; + } + in.close(); + } + +} diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java similarity index 100% rename from algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/ga/dijkstra/Dijkstra.java diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java similarity index 100% rename from algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/ga/dijkstra/Graph.java diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java similarity index 100% rename from algorithms-genetic/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/ga/dijkstra/Node.java diff --git a/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/roundedup/RoundUpToHundred.java similarity index 90% rename from algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundred.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/roundedup/RoundUpToHundred.java index 6c02a340d3..333019e294 100644 --- a/algorithms-miscellaneous-1/roundUpToHundred/src/com/java/src/RoundUpToHundred.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/roundedup/RoundUpToHundred.java @@ -1,4 +1,4 @@ -package com.java.src; +package com.baeldung.algorithms.roundedup; import java.util.Scanner; diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/InputData.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/InputData.java similarity index 100% rename from algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/InputData.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/InputData.java diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/Item.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/Item.java similarity index 100% rename from algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/Item.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/Item.java diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java similarity index 100% rename from algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java diff --git a/algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/User.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/User.java similarity index 100% rename from algorithms-genetic/src/main/java/com/baeldung/algorithms/slope_one/User.java rename to algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/User.java diff --git a/algorithms-genetic/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java similarity index 100% rename from algorithms-genetic/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java diff --git a/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/roundedup/RoundUpToHundredUnitTest.java similarity index 83% rename from algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java rename to algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/roundedup/RoundUpToHundredUnitTest.java index cb541ad49c..5191d65787 100644 --- a/algorithms-miscellaneous-2/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/roundedup/RoundUpToHundredUnitTest.java @@ -1,10 +1,10 @@ -package com.java.src; +package com.baeldung.algorithms.roundedup; import static org.junit.Assert.assertEquals; import org.junit.Test; -public class RoundUpToHundredTest { +public class RoundUpToHundredUnitTest { @Test public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); diff --git a/algorithms-sorting/roundUpToHundred/.gitignore b/algorithms-sorting/roundUpToHundred/.gitignore deleted file mode 100644 index ae3c172604..0000000000 --- a/algorithms-sorting/roundUpToHundred/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java b/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java deleted file mode 100644 index 6c02a340d3..0000000000 --- a/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundred.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.java.src; - -import java.util.Scanner; - -public class RoundUpToHundred { - - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - double input = scanner.nextDouble(); - scanner.close(); - - RoundUpToHundred.round(input); - } - - static long round(double input) { - long i = (long) Math.ceil(input); - return ((i + 99) / 100) * 100; - }; - -} diff --git a/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java b/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java deleted file mode 100644 index cb541ad49c..0000000000 --- a/algorithms-sorting/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.java.src; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class RoundUpToHundredTest { - @Test - public void givenInput_whenRound_thenRoundUpToTheNearestHundred() { - assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99)); - assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2)); - assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400)); - } -} From 923993ec493cca7853c4cacc06e020992303d13a Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 3 Nov 2018 22:55:06 +0200 Subject: [PATCH 298/546] Update README.md --- algorithms-genetic/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/algorithms-genetic/README.md b/algorithms-genetic/README.md index 0f68918fff..39f8d59eee 100644 --- a/algorithms-genetic/README.md +++ b/algorithms-genetic/README.md @@ -1,4 +1,6 @@ ## Relevant articles: - [Introduction to Jenetics Library](http://www.baeldung.com/jenetics) -- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization) \ No newline at end of file +- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization) +- [Design a Genetic Algorithm in Java](https://www.baeldung.com/java-genetic-algorithm) +- [The Traveling Salesman Problem in Java](https://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) From 4337ccb90985a4b79d923e5d13086c067725ec6f Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 3 Nov 2018 22:57:18 +0200 Subject: [PATCH 299/546] Update README.md --- core-java/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/core-java/README.md b/core-java/README.md index 627535d1e5..ce2d5b3e64 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -17,12 +17,9 @@ - [Sorting in Java](http://www.baeldung.com/java-sorting) - [Getting Started with Java Properties](http://www.baeldung.com/java-properties) - [Grep in Java](http://www.baeldung.com/grep-in-java) -- [Simulated Annealing for Travelling Salesman Problem](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) -- [Slope One Algorithm: Collaborative Filtering Recommendation Systems](http://www.baeldung.com/java-collaborative-filtering-recommendations) - [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) - [URL Encoding and Decoding in Java](http://www.baeldung.com/java-url-encoding-decoding) - [The Basics of Java Generics](http://www.baeldung.com/java-generics) -- [The Traveling Salesman Problem in Java](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) - [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) - [How to Design a Genetic Algorithm in Java](http://www.baeldung.com/java-genetic-algorithm) - [Basic Introduction to JMX](http://www.baeldung.com/java-management-extensions) From 2899e3797331f969ecf556c1d82e073cb23715b8 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Sat, 3 Nov 2018 22:03:12 +0100 Subject: [PATCH 300/546] removed duplicate module --- cdi-portable-extension/flyway-cdi/pom.xml | 38 ---------- .../cdi/extension/FlywayExtension.java | 74 ------------------- .../baeldung/cdi/extension/FlywayType.java | 14 ---- .../src/main/resources/META-INF/beans.xml | 6 -- .../javax.enterprise.inject.spi.Extension | 2 - cdi-portable-extension/main-app/pom.xml | 52 ------------- .../com/baeldung/cdi/extension/MainApp.java | 16 ---- .../src/main/resources/META-INF/beans.xml | 6 -- .../db/migration/V1__Create_person_table.sql | 4 - .../resources/db/migration/V2__Add_people.sql | 3 - cdi-portable-extension/pom.xml | 30 -------- pom.xml | 1 - 12 files changed, 246 deletions(-) delete mode 100644 cdi-portable-extension/flyway-cdi/pom.xml delete mode 100644 cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayExtension.java delete mode 100644 cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayType.java delete mode 100644 cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/beans.xml delete mode 100644 cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension delete mode 100644 cdi-portable-extension/main-app/pom.xml delete mode 100644 cdi-portable-extension/main-app/src/main/java/com/baeldung/cdi/extension/MainApp.java delete mode 100644 cdi-portable-extension/main-app/src/main/resources/META-INF/beans.xml delete mode 100644 cdi-portable-extension/main-app/src/main/resources/db/migration/V1__Create_person_table.sql delete mode 100644 cdi-portable-extension/main-app/src/main/resources/db/migration/V2__Add_people.sql delete mode 100644 cdi-portable-extension/pom.xml diff --git a/cdi-portable-extension/flyway-cdi/pom.xml b/cdi-portable-extension/flyway-cdi/pom.xml deleted file mode 100644 index 9fb781aaab..0000000000 --- a/cdi-portable-extension/flyway-cdi/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4.0.0 - - flyway-cdi - - - com.baeldung - cdi-portable-extension - 1.0-SNAPSHOT - - - - - javax.enterprise - cdi-api - 2.0.SP1 - - - org.flywaydb - flyway-core - 5.1.4 - - - org.apache.tomcat - tomcat-jdbc - 8.5.33 - - - javax.annotation - javax.annotation-api - 1.3.2 - - - - diff --git a/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayExtension.java b/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayExtension.java deleted file mode 100644 index a5019b82c1..0000000000 --- a/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayExtension.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.baeldung.cdi.extension; - -import org.apache.tomcat.jdbc.pool.DataSource; -import org.flywaydb.core.Flyway; - -import javax.annotation.sql.DataSourceDefinition; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Default; -import javax.enterprise.inject.literal.InjectLiteral; -import javax.enterprise.inject.spi.*; -import javax.enterprise.util.AnnotationLiteral; - - -/** - * Flyway is now under CDI container like: - * - * @ApplicationScoped - * @FlywayType public class Flyway{ - * @Inject setDataSource(DataSource dataSource){ - * //... - * } - * } - */ - -public class FlywayExtension implements Extension { - - DataSourceDefinition dataSourceDefinition = null; - - public void registerFlywayType(@Observes BeforeBeanDiscovery bbdEvent) { - bbdEvent.addAnnotatedType(Flyway.class, Flyway.class.getName()); - } - - public void detectDataSourceDefinition(@Observes @WithAnnotations(DataSourceDefinition.class) ProcessAnnotatedType patEvent) { - AnnotatedType at = patEvent.getAnnotatedType(); - dataSourceDefinition = at.getAnnotation(DataSourceDefinition.class); - } - - public void processAnnotatedType(@Observes ProcessAnnotatedType patEvent) { - patEvent.configureAnnotatedType() - //Add Scope - .add(ApplicationScoped.Literal.INSTANCE) - //Add Qualifier - .add(new AnnotationLiteral() { - }) - //Decorate setDataSource(DataSource dataSource){} with @Inject - .filterMethods(annotatedMethod -> { - return annotatedMethod.getParameters().size() == 1 && - annotatedMethod.getParameters().get(0).getBaseType().equals(javax.sql.DataSource.class); - }) - .findFirst().get().add(InjectLiteral.INSTANCE); - } - - void afterBeanDiscovery(@Observes AfterBeanDiscovery abdEvent, BeanManager bm) { - abdEvent.addBean() - .types(javax.sql.DataSource.class, DataSource.class) - .qualifiers(new AnnotationLiteral() {}, new AnnotationLiteral() {}) - .scope(ApplicationScoped.class) - .name(DataSource.class.getName()) - .beanClass(DataSource.class) - .createWith(creationalContext -> { - DataSource instance = new DataSource(); - instance.setUrl(dataSourceDefinition.url()); - instance.setDriverClassName(dataSourceDefinition.className()); - return instance; - }); - } - - void runFlywayMigration(@Observes AfterDeploymentValidation adv, BeanManager manager) { - Flyway flyway = manager.createInstance().select(Flyway.class, new AnnotationLiteral() {}).get(); - flyway.migrate(); - } -} diff --git a/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayType.java b/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayType.java deleted file mode 100644 index 7c3a5affa6..0000000000 --- a/cdi-portable-extension/flyway-cdi/src/main/java/com/baeldung/cdi/extension/FlywayType.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.cdi.extension; - -import javax.inject.Qualifier; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.*; - -@Retention(RetentionPolicy.RUNTIME) -@Target({FIELD, METHOD, PARAMETER, TYPE}) -@Qualifier -public @interface FlywayType { -} \ No newline at end of file diff --git a/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/beans.xml b/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/beans.xml deleted file mode 100644 index 44959bfa99..0000000000 --- a/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - \ No newline at end of file diff --git a/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension deleted file mode 100644 index a82dc47714..0000000000 --- a/cdi-portable-extension/flyway-cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension +++ /dev/null @@ -1,2 +0,0 @@ -com.baeldung.cdi.extension.FlywayExtension - diff --git a/cdi-portable-extension/main-app/pom.xml b/cdi-portable-extension/main-app/pom.xml deleted file mode 100644 index fab9b8bf07..0000000000 --- a/cdi-portable-extension/main-app/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - main-app - jar - - - com.baeldung - cdi-portable-extension - 1.0-SNAPSHOT - - - - - - javax.enterprise - cdi-api - 2.0.SP1 - - - org.jboss.weld.se - weld-se-core - 3.0.5.Final - runtime - - - - com.baeldung - flyway-cdi - 1.0-SNAPSHOT - runtime - - - - com.h2database - h2 - 1.4.197 - runtime - - - - javax.annotation - javax.annotation-api - 1.3.2 - - - - - \ No newline at end of file diff --git a/cdi-portable-extension/main-app/src/main/java/com/baeldung/cdi/extension/MainApp.java b/cdi-portable-extension/main-app/src/main/java/com/baeldung/cdi/extension/MainApp.java deleted file mode 100644 index 1f6c5b43ba..0000000000 --- a/cdi-portable-extension/main-app/src/main/java/com/baeldung/cdi/extension/MainApp.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.cdi.extension; - -import javax.annotation.sql.DataSourceDefinition; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.se.SeContainer; -import javax.enterprise.inject.se.SeContainerInitializer; - -@ApplicationScoped -@DataSourceDefinition(name = "ds", className = "org.h2.Driver", url = "jdbc:h2:mem:testdb") -public class MainApp { - public static void main(String[] args) { - SeContainerInitializer initializer = SeContainerInitializer.newInstance(); - try (SeContainer container = initializer.initialize()) { - } - } -} \ No newline at end of file diff --git a/cdi-portable-extension/main-app/src/main/resources/META-INF/beans.xml b/cdi-portable-extension/main-app/src/main/resources/META-INF/beans.xml deleted file mode 100644 index 44959bfa99..0000000000 --- a/cdi-portable-extension/main-app/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - \ No newline at end of file diff --git a/cdi-portable-extension/main-app/src/main/resources/db/migration/V1__Create_person_table.sql b/cdi-portable-extension/main-app/src/main/resources/db/migration/V1__Create_person_table.sql deleted file mode 100644 index 6bddc7689e..0000000000 --- a/cdi-portable-extension/main-app/src/main/resources/db/migration/V1__Create_person_table.sql +++ /dev/null @@ -1,4 +0,0 @@ -create table PERSON ( - ID int not null, - NAME varchar(100) not null -); diff --git a/cdi-portable-extension/main-app/src/main/resources/db/migration/V2__Add_people.sql b/cdi-portable-extension/main-app/src/main/resources/db/migration/V2__Add_people.sql deleted file mode 100644 index d8f1d62667..0000000000 --- a/cdi-portable-extension/main-app/src/main/resources/db/migration/V2__Add_people.sql +++ /dev/null @@ -1,3 +0,0 @@ -insert into PERSON (ID, NAME) values (1, 'Axel'); -insert into PERSON (ID, NAME) values (2, 'Mr. Foo'); -insert into PERSON (ID, NAME) values (3, 'Ms. Bar'); diff --git a/cdi-portable-extension/pom.xml b/cdi-portable-extension/pom.xml deleted file mode 100644 index 66913de84d..0000000000 --- a/cdi-portable-extension/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - com.baeldung - cdi-portable-extension - 1.0-SNAPSHOT - pom - - - 1.8 - 1.8 - - - - main-app - flyway-cdi - - - - - javax.enterprise - cdi-api - 2.0.SP1 - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index fa8a1108b5..f8c91d5e73 100644 --- a/pom.xml +++ b/pom.xml @@ -615,7 +615,6 @@ spring-reactive-kotlin persistence-modules/jnosql spring-boot-angular-ecommerce - cdi-portable-extension jta java-websocket From c7b7d944098e7c2f13512549b4180578116e5859 Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Sun, 4 Nov 2018 00:06:46 -0300 Subject: [PATCH 301/546] BAEL-2312 - Abstract Classes in Java (#5598) * Initial Commit * Add files via upload * Update UppercaseFileReaderUnitTest.java --- .../application/Application.java | 30 +++++++++++++++++++ .../filereaders/BaseFileReader.java | 19 ++++++++++++ .../filereaders/LowercaseFileReader.java | 21 +++++++++++++ .../filereaders/StandardFileReader.java | 19 ++++++++++++ .../filereaders/UppercaseFileReader.java | 21 +++++++++++++ core-java/src/main/resources/files/test.txt | 10 +++++++ .../LowercaseFileReaderUnitTest.java | 18 +++++++++++ .../StandardFileReaderUnitTest.java | 18 +++++++++++ .../UppercaseFileReaderUnitTest.java | 18 +++++++++++ 9 files changed, 174 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java create mode 100644 core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java create mode 100644 core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java create mode 100644 core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java create mode 100644 core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java create mode 100644 core-java/src/main/resources/files/test.txt create mode 100644 core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java create mode 100644 core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java create mode 100644 core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java b/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java new file mode 100644 index 0000000000..fe30c66484 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java @@ -0,0 +1,30 @@ +package com.baeldung.abstractclasses.application; + +import com.baeldung.abstractclasses.filereaders.BaseFileReader; +import com.baeldung.abstractclasses.filereaders.LowercaseFileReader; +import com.baeldung.abstractclasses.filereaders.StandardFileReader; +import com.baeldung.abstractclasses.filereaders.UppercaseFileReader; +import java.io.IOException; + +public class Application { + + public static void main(String[] args) throws IOException { + + Application application = new Application(); + String filePath = application.getFilePathFromResourcesFolder("files/test.txt"); + + BaseFileReader lowercaseFileReader = new LowercaseFileReader(filePath); + lowercaseFileReader.readFile().forEach(line -> System.out.println(line)); + + BaseFileReader upperCaseFileReader = new UppercaseFileReader(filePath); + upperCaseFileReader.readFile().forEach(line -> System.out.println(line)); + + BaseFileReader standardFileReader = new StandardFileReader(filePath); + standardFileReader.readFile().forEach(line -> System.out.println(line)); + + } + + private String getFilePathFromResourcesFolder(String fileName) { + return getClass().getClassLoader().getResource(fileName).getPath().substring(1); + } +} diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java new file mode 100644 index 0000000000..659913f046 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java @@ -0,0 +1,19 @@ +package com.baeldung.abstractclasses.filereaders; + +import java.io.IOException; +import java.util.List; + +public abstract class BaseFileReader { + + protected String filePath; + + protected BaseFileReader(String filePath) { + this.filePath = filePath; + } + + public String getFilePath() { + return filePath; + } + + public abstract List readFile() throws IOException; +} diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java new file mode 100644 index 0000000000..0bbef45eb8 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java @@ -0,0 +1,21 @@ +package com.baeldung.abstractclasses.filereaders; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.stream.Collectors; + +public class LowercaseFileReader extends BaseFileReader { + + public LowercaseFileReader(String filePath) { + super(filePath); + } + + @Override + public List readFile() throws IOException { + return Files.lines(Paths.get(filePath)) + .map(String::toLowerCase) + .collect(Collectors.toList()); + } +} diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java new file mode 100644 index 0000000000..0a90d53c38 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java @@ -0,0 +1,19 @@ +package com.baeldung.abstractclasses.filereaders; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.stream.Collectors; + +public class StandardFileReader extends BaseFileReader { + + public StandardFileReader(String filePath) { + super(filePath); + } + + @Override + public List readFile() throws IOException { + return Files.lines(Paths.get(filePath)).collect(Collectors.toList()); + } +} diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java new file mode 100644 index 0000000000..4e8f150964 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java @@ -0,0 +1,21 @@ +package com.baeldung.abstractclasses.filereaders; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.stream.Collectors; + +public class UppercaseFileReader extends BaseFileReader { + + public UppercaseFileReader(String filePath) { + super(filePath); + } + + @Override + public List readFile() throws IOException { + return Files.lines(Paths.get(filePath)) + .map(String::toUpperCase) + .collect(Collectors.toList()); + } +} diff --git a/core-java/src/main/resources/files/test.txt b/core-java/src/main/resources/files/test.txt new file mode 100644 index 0000000000..08e53af69d --- /dev/null +++ b/core-java/src/main/resources/files/test.txt @@ -0,0 +1,10 @@ +This is line 1 +This is line 2 +This is line 3 +This is line 4 +This is line 5 +This is line 6 +This is line 7 +This is line 8 +This is line 9 +This is line 10 \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java new file mode 100644 index 0000000000..4058f6f03b --- /dev/null +++ b/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.abstractclasses; + +import com.baeldung.abstractclasses.filereaders.BaseFileReader; +import com.baeldung.abstractclasses.filereaders.LowercaseFileReader; +import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +public class LowercaseFileReaderUnitTest { + + @Test + public void givenLowercaseFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { + String filePath = getClass().getClassLoader().getResource("files/test.txt").getPath().substring(1); + BaseFileReader lowercaseFileReader = new LowercaseFileReader(filePath); + + assertThat(lowercaseFileReader.readFile()).isInstanceOf(List.class); + } +} diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java new file mode 100644 index 0000000000..e1c1435ef4 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.abstractclasses; + +import com.baeldung.abstractclasses.filereaders.BaseFileReader; +import com.baeldung.abstractclasses.filereaders.StandardFileReader; +import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +public class StandardFileReaderUnitTest { + + @Test + public void givenStandardFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { + String filePath = getClass().getClassLoader().getResource("files/test.txt").getPath().substring(1); + BaseFileReader standardFileReader = new StandardFileReader(filePath); + + assertThat(standardFileReader.readFile()).isInstanceOf(List.class); + } +} diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java new file mode 100644 index 0000000000..f9c5fbf94d --- /dev/null +++ b/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.abstractclasses; + +import com.baeldung.abstractclasses.filereaders.BaseFileReader; +import com.baeldung.abstractclasses.filereaders.UppercaseFileReader; +import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +public class UppercaseFileReaderUnitTest { + + @Test + public void givenUppercaseFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { + String filePath = getClass().getClassLoader().getResource("files/test.txt").getPath().substring(1); + BaseFileReader uppercaseFileReader = new UppercaseFileReader(filePath); + + assertThat(uppercaseFileReader.readFile()).isInstanceOf(List.class); + } +} From 81a7e1966e845fa85f16354ba127ae770e254b29 Mon Sep 17 00:00:00 2001 From: Ger Roza Date: Sun, 4 Nov 2018 02:23:38 -0300 Subject: [PATCH 302/546] [BAEL-2235] | core-java | Common Array Operations in Java (#5599) * * added all array operations and tests * fixed details, adn added some more methods to java array operations examples * * moved arrays operations package to core-java-collections submodule --- core-java-collections/pom.xml | 2 +- .../array/operations/ArrayOperations.java | 197 ++++++++++ .../operations/ArrayOperationsUnitTest.java | 365 ++++++++++++++++++ 3 files changed, 563 insertions(+), 1 deletion(-) create mode 100644 core-java-collections/src/main/java/com/baeldung/array/operations/ArrayOperations.java create mode 100644 core-java-collections/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java diff --git a/core-java-collections/pom.xml b/core-java-collections/pom.xml index d3ef953e01..31f0d7419f 100644 --- a/core-java-collections/pom.xml +++ b/core-java-collections/pom.xml @@ -61,7 +61,7 @@ 1.19 1.2.0 - 3.5 + 3.8.1 4.1 4.01 1.7.0 diff --git a/core-java-collections/src/main/java/com/baeldung/array/operations/ArrayOperations.java b/core-java-collections/src/main/java/com/baeldung/array/operations/ArrayOperations.java new file mode 100644 index 0000000000..98155ed952 --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/array/operations/ArrayOperations.java @@ -0,0 +1,197 @@ +package com.baeldung.array.operations; + +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Random; +import java.util.Set; +import java.util.function.Function; +import java.util.function.IntPredicate; +import java.util.function.Predicate; + +import org.apache.commons.lang3.ArrayUtils; + +public class ArrayOperations { + + // Get the first and last item of an array + public static T getFirstObject(T[] array) { + return array[0]; + } + + public static int getFirstInt(int[] array) { + return array[0]; + } + + public static T getLastObject(T[] array) { + return array[array.length - 1]; + } + + public static int getLastInt(int[] array) { + return array[array.length - 1]; + } + + // Append a new item to an array + public static T[] appendObject(T[] array, T newItem) { + return ArrayUtils.add(array, newItem); + } + + public static int[] appendInt(int[] array, int newItem) { + int[] newArray = Arrays.copyOf(array, array.length + 1); + newArray[newArray.length - 1] = newItem; + return newArray; + } + + public static int[] appendIntWithUtils(int[] array, int newItem) { + return ArrayUtils.add(array, newItem); + } + + // Compare two arrays to check if they have the same elements + public static boolean compareObjectArrays(T[] array1, T[] array2) { + return Arrays.equals(array1, array2); + } + + public static boolean compareIntArrays(int[] array1, int[] array2) { + return Arrays.equals(array1, array2); + } + + // Deep Compare (for nested arrays) + public static boolean deepCompareObjectArrayUsingArrays(T[][] array1, T[][] array2) { + // We can use Objects.deepEquals for a broader approach + return Arrays.deepEquals(array1, array2); + } + + public static boolean deepCompareIntArrayUsingArrays(int[][] array1, int[][] array2) { + return Arrays.deepEquals(array1, array2); + } + + // Check if array is empty + public static boolean isEmptyObjectArrayUsingUtils(T[] array1) { + return ArrayUtils.isEmpty(array1); + } + + public static boolean isEmptyIntArrayUsingUtils(int[] array1) { + return ArrayUtils.isEmpty(array1); + } + + // Remove duplicates + public static Integer[] removeDuplicateObjects(Integer[] array) { + // We can use other ways of converting the array to a set too + Set set = new HashSet<>(Arrays.asList(array)); + return set.toArray(new Integer[set.size()]); + } + + public static int[] removeDuplicateInts(int[] array) { + // Box + Integer[] list = ArrayUtils.toObject(array); + // Remove duplicates + Set set = new HashSet(Arrays.asList(list)); + // Create array and unbox + return ArrayUtils.toPrimitive(set.toArray(new Integer[set.size()])); + } + + // Remove duplicates preserving the order + public static Integer[] removeDuplicateWithOrderObjectArray(Integer[] array) { + // We can use other ways of converting the array to a set too + Set set = new LinkedHashSet<>(Arrays.asList(array)); + return set.toArray(new Integer[set.size()]); + } + + public static int[] removeDuplicateWithOrderIntArray(int[] array) { + // Box + Integer[] list = ArrayUtils.toObject(array); + // Remove duplicates + Set set = new LinkedHashSet(Arrays.asList(list)); + // Create array and unbox + return ArrayUtils.toPrimitive(set.toArray(new Integer[set.size()])); + } + + // Print an array + public static String printObjectArray(Integer[] array) { + return ArrayUtils.toString(array); + } + + public static String printObjectArray(Integer[][] array) { + return ArrayUtils.toString(array); + } + + public static String printIntArray(int[] array) { + return ArrayUtils.toString(array); + } + + public static String printIntArray(int[][] array) { + return ArrayUtils.toString(array); + } + + // Box or Unbox values + public static int[] unboxIntegerArray(Integer[] array) { + return ArrayUtils.toPrimitive(array); + } + + public static Integer[] boxIntArray(int[] array) { + return ArrayUtils.toObject(array); + } + + // Map array values + @SuppressWarnings("unchecked") + public static U[] mapObjectArray(T[] array, Function function, Class targetClazz) { + U[] newArray = (U[]) Array.newInstance(targetClazz, array.length); + for (int i = 0; i < array.length; i++) { + newArray[i] = function.apply(array[i]); + } + return newArray; + } + + public static String[] mapIntArrayToString(int[] array) { + return Arrays.stream(array) + .mapToObj(value -> String.format("Value: %s", value)) + .toArray(String[]::new); + } + + // Filter array values + public static Integer[] filterObjectArray(Integer[] array, Predicate predicate) { + return Arrays.stream(array) + .filter(predicate) + .toArray(Integer[]::new); + } + + public static int[] filterIntArray(int[] array, IntPredicate predicate) { + return Arrays.stream(array) + .filter(predicate) + .toArray(); + } + + // Insert item between others + public static int[] insertBetweenIntArray(int[] array, int... values) { + return ArrayUtils.insert(2, array, values); + } + + @SuppressWarnings("unchecked") + public static T[] insertBetweenObjectArray(T[] array, T... values) { + return ArrayUtils.insert(2, array, values); + } + + // Shuffling arrays + public static int[] shuffleIntArray(int[] array) { + // we create a different array instance for testing purposes + int[] shuffled = Arrays.copyOf(array, array.length); + ArrayUtils.shuffle(shuffled); + return shuffled; + } + + public static T[] shuffleObjectArray(T[] array) { + // we create a different array instance for testing purposes + T[] shuffled = Arrays.copyOf(array, array.length); + ArrayUtils.shuffle(shuffled); + return shuffled; + } + + // Get random number + public static int getRandomFromIntArray(int[] array) { + return array[new Random().nextInt(array.length)]; + } + + public static T getRandomFromObjectArray(T[] array) { + return array[new Random().nextInt(array.length)]; + } +} diff --git a/core-java-collections/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java b/core-java-collections/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java new file mode 100644 index 0000000000..a9c6d97d9f --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java @@ -0,0 +1,365 @@ +package com.baeldung.array.operations; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; + +import org.assertj.core.api.Condition; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ArrayOperationsUnitTest { + + private Integer[] defaultObjectArray; + private int[] defaultIntArray; + private Integer[][] defaultJaggedObjectArray; + private int[][] defaultJaggedIntArray; + + @BeforeEach + public void setupDefaults() { + defaultObjectArray = new Integer[] { 3, 5, 2, 5, 14, 4 }; + defaultIntArray = new int[] { 3, 5, 2, 5, 14, 4 }; + defaultJaggedObjectArray = new Integer[][] { { 1, 3 }, { 5 }, {} }; + defaultJaggedIntArray = new int[][] { { 1, 3 }, { 5 }, {} }; + } + + // Get the first and last item of an array + @Test + public void whenGetFirstObjectCalled_thenReturnFirstItemOfArray() { + Integer output = ArrayOperations.getFirstObject(defaultObjectArray); + + assertThat(output).isEqualTo(3); + } + + @Test + public void whenGetFirstIntCalled_thenReturnFirstItemOfArray() { + int output = ArrayOperations.getFirstInt(defaultIntArray); + + assertThat(output).isEqualTo(3); + } + + @Test + public void whenGetLastObjectCalled_thenReturnLastItemOfArray() { + Integer output = ArrayOperations.getLastObject(defaultObjectArray); + + assertThat(output).isEqualTo(4); + } + + @Test + public void whenGetLastIntCalled_thenReturnLastItemOfArray() { + int output = ArrayOperations.getLastInt(defaultIntArray); + + assertThat(output).isEqualTo(4); + } + + // Append a new item to an array + @Test + public void whenAppendObject_thenReturnArrayWithExtraItem() { + Integer[] output = ArrayOperations.appendObject(defaultObjectArray, 7); + + assertThat(output).endsWith(4, 7) + .hasSize(7); + } + + @Test + public void whenAppendInt_thenReturnArrayWithExtraItem() { + int[] output = ArrayOperations.appendInt(defaultIntArray, 7); + int[] outputUsingUtils = ArrayOperations.appendIntWithUtils(defaultIntArray, 7); + + assertThat(output).endsWith(4, 7) + .hasSize(7); + assertThat(outputUsingUtils).endsWith(4, 7) + .hasSize(7); + } + + // Compare two arrays to check if they have the same elements + @Test + public void whenCompareObjectArrays_thenReturnBoolean() { + Integer[] array2 = { 8, 7, 6 }; + Integer[] sameArray = { 3, 5, 2, 5, 14, 4 }; + boolean output = ArrayOperations.compareObjectArrays(defaultObjectArray, array2); + boolean output2 = ArrayOperations.compareObjectArrays(defaultObjectArray, sameArray); + + assertThat(output).isFalse(); + assertThat(output2).isTrue(); + } + + @Test + public void whenCompareIntArrays_thenReturnBoolean() { + int[] array2 = { 8, 7, 6 }; + int[] sameArray = { 3, 5, 2, 5, 14, 4 }; + boolean output = ArrayOperations.compareIntArrays(defaultIntArray, array2); + boolean output2 = ArrayOperations.compareIntArrays(defaultIntArray, sameArray); + + assertThat(output).isFalse(); + assertThat(output2).isTrue(); + } + + // Deep compare + @Test + public void whenDeepCompareObjectArrays_thenReturnBoolean() { + Integer[][] sameArray = { { 1, 3 }, { 5 }, {} }; + Integer[][] array2 = { { 1, 3 }, { 5 }, { 3 } }; + boolean output = ArrayOperations.deepCompareObjectArrayUsingArrays(defaultJaggedObjectArray, array2); + boolean output2 = ArrayOperations.deepCompareObjectArrayUsingArrays(defaultJaggedObjectArray, sameArray); + // Because arrays are Objects, we could wrongly use the non-deep approach + boolean outputUsingNonDeep = ArrayOperations.compareObjectArrays(defaultJaggedObjectArray, sameArray); + + assertThat(output).isFalse(); + assertThat(output2).isTrue(); + // This is not what we would expect! + assertThat(outputUsingNonDeep).isFalse(); + } + + @Test + public void whenDeepCompareIntArrays_thenReturnBoolean() { + int[][] sameArray = { { 1, 3 }, { 5 }, {} }; + int[][] array2 = { { 1, 3 }, { 5 }, { 3 } }; + boolean output = ArrayOperations.deepCompareIntArrayUsingArrays(defaultJaggedIntArray, array2); + boolean output2 = ArrayOperations.deepCompareIntArrayUsingArrays(defaultJaggedIntArray, sameArray); + + assertThat(output).isFalse(); + assertThat(output2).isTrue(); + } + + // Empty Check + @Test + public void whenIsEmptyObjectArray_thenReturnBoolean() { + Integer[] array2 = {}; + Integer[] array3 = null; + Integer[] array4 = { null, null, null }; + Integer[] array5 = { null }; + Integer[][] array6 = { {}, {}, {} }; + boolean output = ArrayOperations.isEmptyObjectArrayUsingUtils(defaultObjectArray); + boolean output2 = ArrayOperations.isEmptyObjectArrayUsingUtils(array2); + boolean output3 = ArrayOperations.isEmptyObjectArrayUsingUtils(array3); + boolean output4 = ArrayOperations.isEmptyObjectArrayUsingUtils(array4); + boolean output5 = ArrayOperations.isEmptyObjectArrayUsingUtils(array5); + boolean output6 = ArrayOperations.isEmptyObjectArrayUsingUtils(array6); + + assertThat(output).isFalse(); + assertThat(output2).isTrue(); + assertThat(output3).isTrue(); + // Mind these edge cases! + assertThat(output4).isFalse(); + assertThat(output5).isFalse(); + assertThat(output6).isFalse(); + } + + @Test + public void whenIsEmptyIntArray_thenReturnBoolean() { + int[] array2 = {}; + boolean output = ArrayOperations.isEmptyIntArrayUsingUtils(defaultIntArray); + boolean output2 = ArrayOperations.isEmptyIntArrayUsingUtils(array2); + + assertThat(output).isFalse(); + assertThat(output2).isTrue(); + } + + // Remove Duplicates + @Test + public void whenRemoveDuplicateObjectArray_thenReturnArrayWithNoDuplicates() { + Integer[] output = ArrayOperations.removeDuplicateObjects(defaultObjectArray); + + assertThat(output).containsOnlyOnce(5) + .hasSize(5) + .doesNotHaveDuplicates(); + } + + @Test + public void whenRemoveDuplicateIntArray_thenReturnArrayWithNoDuplicates() { + int[] output = ArrayOperations.removeDuplicateInts(defaultIntArray); + + assertThat(output).containsOnlyOnce(5) + .hasSize(5) + .doesNotHaveDuplicates(); + } + + // Remove Duplicates Preserving order + @Test + public void whenRemoveDuplicatePreservingOrderObjectArray_thenReturnArrayWithNoDuplicates() { + Integer[] array2 = { 3, 5, 2, 14, 4 }; + Integer[] output = ArrayOperations.removeDuplicateWithOrderObjectArray(defaultObjectArray); + + assertThat(output).containsOnlyOnce(5) + .hasSize(5) + .containsExactly(array2); + } + + @Test + public void whenRemoveDuplicatePreservingOrderIntArray_thenReturnArrayWithNoDuplicates() { + int[] array2 = { 3, 5, 2, 14, 4 }; + int[] output = ArrayOperations.removeDuplicateWithOrderIntArray(defaultIntArray); + + assertThat(output).containsOnlyOnce(5) + .hasSize(5) + .containsExactly(array2); + } + + // Print + @Test + public void whenPrintObjectArray_thenReturnString() { + String output = ArrayOperations.printObjectArray(defaultObjectArray); + String jaggedOutput = ArrayOperations.printObjectArray(defaultJaggedObjectArray); + // Comparing to Arrays output: + String wrongArraysOutput = Arrays.toString(defaultJaggedObjectArray); + String differentFormatArraysOutput = Arrays.toString(defaultObjectArray); + // We should use Arrays.deepToString for jagged arrays + String differentFormatJaggedArraysOutput = Arrays.deepToString(defaultJaggedObjectArray); + + assertThat(output).isEqualTo("{3,5,2,5,14,4}"); + assertThat(jaggedOutput).isEqualTo("{{1,3},{5},{}}"); + assertThat(differentFormatArraysOutput).isEqualTo("[3, 5, 2, 5, 14, 4]"); + assertThat(wrongArraysOutput).contains("[[Ljava.lang.Integer;@"); + assertThat(differentFormatJaggedArraysOutput).contains("[[1, 3], [5], []]"); + } + + @Test + public void whenPrintIntArray_thenReturnString() { + String output = ArrayOperations.printIntArray(defaultIntArray); + String jaggedOutput = ArrayOperations.printIntArray(defaultJaggedIntArray); + // Comparing to Arrays output: + String wrongArraysOutput = Arrays.toString(defaultJaggedObjectArray); + String differentFormatArraysOutput = Arrays.toString(defaultObjectArray); + + assertThat(output).isEqualTo("{3,5,2,5,14,4}"); + assertThat(jaggedOutput).isEqualTo("{{1,3},{5},{}}"); + assertThat(differentFormatArraysOutput).isEqualTo("[3, 5, 2, 5, 14, 4]"); + assertThat(wrongArraysOutput).contains("[[Ljava.lang.Integer;@"); + } + + // Box and unbox + @Test + public void whenUnboxObjectArray_thenReturnPrimitiveArray() { + int[] output = ArrayOperations.unboxIntegerArray(defaultObjectArray); + + assertThat(output).containsExactly(defaultIntArray); + } + + @Test + public void henBoxPrimitiveArray_thenReturnObjectArray() { + Integer[] output = ArrayOperations.boxIntArray(defaultIntArray); + + assertThat(output).containsExactly(defaultObjectArray); + } + + // Map values + @Test + public void whenMapMultiplyingObjectArray_thenReturnMultipliedArray() { + Integer[] multipliedExpectedArray = new Integer[] { 6, 10, 4, 10, 28, 8 }; + Integer[] output = ArrayOperations.mapObjectArray(defaultObjectArray, value -> value * 2, Integer.class); + + assertThat(output).containsExactly(multipliedExpectedArray); + } + + @Test + public void whenMapDividingObjectArray_thenReturnDividedArray() { + Double[] multipliedExpectedArray = new Double[] { 1.5, 2.5, 1.0, 2.5, 7.0, 2.0 }; + Double[] output = ArrayOperations.mapObjectArray(defaultObjectArray, value -> value / 2.0, Double.class); + + assertThat(output).containsExactly(multipliedExpectedArray); + } + + @Test + public void whenMapIntArrayToString_thenReturnArray() { + String[] expectedArray = new String[] { "Value: 3", "Value: 5", "Value: 2", "Value: 5", "Value: 14", + "Value: 4" }; + String[] output = ArrayOperations.mapIntArrayToString(defaultIntArray); + + assertThat(output).containsExactly(expectedArray); + } + + // Filter values + @Test + public void whenFilterObjectArray_thenReturnFilteredArray() { + Integer[] multipliedExpectedArray = new Integer[] { 2, 14, 4 }; + Integer[] output = ArrayOperations.filterObjectArray(defaultObjectArray, value -> value % 2 == 0); + + assertThat(output).containsExactly(multipliedExpectedArray); + } + + @Test + public void whenFilterIntArray_thenReturnFilteredArray() { + int[] expectedArray = new int[] { 2, 14, 4 }; + int[] output = ArrayOperations.filterIntArray(defaultIntArray, value -> (int) value % 2 == 0); + + assertThat(output).containsExactly(expectedArray); + } + + // Insert between + @Test + public void whenInsertBetweenIntArrayToString_thenReturnNewArray() { + int[] expectedArray = { 3, 5, 77, 88, 2, 5, 14, 4 }; + int[] output = ArrayOperations.insertBetweenIntArray(defaultIntArray, 77, 88); + + assertThat(output).containsExactly(expectedArray); + } + + @Test + public void whenInsertBetweenObjectArrayToString_thenReturnNewArray() { + Integer[] expectedArray = { 3, 5, 77, 99, 2, 5, 14, 4 }; + Integer[] output = ArrayOperations.insertBetweenObjectArray(defaultObjectArray, 77, 99); + + assertThat(output).containsExactly(expectedArray); + } + + // Shuffle between + @Test + public void whenShufflingIntArraySeveralTimes_thenAtLeastOneWithDifferentOrder() { + int[] output = ArrayOperations.shuffleIntArray(defaultIntArray); + int[] output2 = ArrayOperations.shuffleIntArray(defaultIntArray); + int[] output3 = ArrayOperations.shuffleIntArray(defaultIntArray); + int[] output4 = ArrayOperations.shuffleIntArray(defaultIntArray); + int[] output5 = ArrayOperations.shuffleIntArray(defaultIntArray); + int[] output6 = ArrayOperations.shuffleIntArray(defaultIntArray); + + Condition atLeastOneArraysIsNotEqual = new Condition( + "at least one output should be different (order-wise)") { + @Override + public boolean matches(int[] value) { + return !Arrays.equals(value, output) || !Arrays.equals(value, output2) || !Arrays.equals(value, output3) + || !Arrays.equals(value, output4) || !Arrays.equals(value, output5) + || !Arrays.equals(value, output6); + } + }; + + assertThat(defaultIntArray).has(atLeastOneArraysIsNotEqual); + } + + @Test + public void whenShufflingObjectArraySeveralTimes_thenAtLeastOneWithDifferentOrder() { + Integer[] output = ArrayOperations.shuffleObjectArray(defaultObjectArray); + Integer[] output2 = ArrayOperations.shuffleObjectArray(defaultObjectArray); + Integer[] output3 = ArrayOperations.shuffleObjectArray(defaultObjectArray); + Integer[] output4 = ArrayOperations.shuffleObjectArray(defaultObjectArray); + Integer[] output5 = ArrayOperations.shuffleObjectArray(defaultObjectArray); + Integer[] output6 = ArrayOperations.shuffleObjectArray(defaultObjectArray); + + Condition atLeastOneArraysIsNotEqual = new Condition( + "at least one output should be different (order-wise)") { + @Override + public boolean matches(Integer[] value) { + return !Arrays.equals(value, output) || !Arrays.equals(value, output2) || !Arrays.equals(value, output3) + || !Arrays.equals(value, output4) || !Arrays.equals(value, output5) + || !Arrays.equals(value, output6); + } + }; + + assertThat(defaultObjectArray).has(atLeastOneArraysIsNotEqual); + } + + // Get random item + @Test + public void whenGetRandomFromIntArrayToString_thenReturnItemContainedInArray() { + int output = ArrayOperations.getRandomFromIntArray(defaultIntArray); + + assertThat(defaultIntArray).contains(output); + } + + @Test + public void whenGetRandomFromObjectArrayToString_thenReturnItemContainedInArray() { + Integer output = ArrayOperations.getRandomFromObjectArray(defaultObjectArray); + + assertThat(defaultObjectArray).contains(output); + } +} From ee2e546508e2ca6e43ff6a509bc3bcf050149fcd Mon Sep 17 00:00:00 2001 From: Corneil du Plessis Date: Sun, 4 Nov 2018 12:53:55 +0200 Subject: [PATCH 303/546] BAEL-2106: Spring Boot deployment to Openshift --- spring-boot-bootstrap/openshift/configmap.yml | 7 + spring-boot-bootstrap/pom.xml | 532 ++++++++++-------- .../src/main/fabric8/deployment.yml | 29 + 3 files changed, 342 insertions(+), 226 deletions(-) create mode 100644 spring-boot-bootstrap/openshift/configmap.yml create mode 100644 spring-boot-bootstrap/src/main/fabric8/deployment.yml diff --git a/spring-boot-bootstrap/openshift/configmap.yml b/spring-boot-bootstrap/openshift/configmap.yml new file mode 100644 index 0000000000..94c8d689ae --- /dev/null +++ b/spring-boot-bootstrap/openshift/configmap.yml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: spring-boot-bootstrap +data: + application.properties: |- + spring.datasource.url=jdbc:mysql://baeldung-demo-db:3306/ \ No newline at end of file diff --git a/spring-boot-bootstrap/pom.xml b/spring-boot-bootstrap/pom.xml index b5bcc587b1..f1d5e9dac3 100644 --- a/spring-boot-bootstrap/pom.xml +++ b/spring-boot-bootstrap/pom.xml @@ -1,231 +1,311 @@ - 4.0.0 - org.baeldung - spring-boot-bootstrap - jar - spring-boot-bootstrap - Demo project for Spring Boot + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + org.baeldung + spring-boot-bootstrap + jar + spring-boot-bootstrap + Demo project for Spring Boot + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-test + test + + + io.rest-assured + rest-assured + ${rest-assured.version} + test + + + javax.servlet + javax.servlet-api + ${servlet.version} + + - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - org.springframework.cloud - spring-cloud-dependencies - Finchley.SR1 - pom - import - - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.cloud - spring-cloud-starter - - - org.springframework.boot - spring-boot-starter-cloud-connectors - - - com.h2database - h2 - - - mysql - mysql-connector-java - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-test - test - - - io.rest-assured - rest-assured - ${rest-assured.version} - test - - - javax.servlet - javax.servlet-api - ${servlet.version} - - - - - - cloud-gcp - - - org.springframework.cloud - spring-cloud-gcp-starter - 1.0.0.RELEASE - - - org.springframework.cloud - spring-cloud-gcp-starter-sql-mysql - 1.0.0.RELEASE - - - - ${project.name}-gcp - - - src/main/resources - - **/logback.xml - - - - - - com.google.cloud.tools - appengine-maven-plugin - 1.3.2 - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - cloudfoundry - - - org.springframework.cloud - spring-cloud-starter - - - org.springframework.boot - spring-boot-starter-cloud-connectors - - - - ${project.name}-cf - - - src/main/resources - - **/logback.xml - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - - - **/cloud/config/*.java - - - - - - - - autoconfiguration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*IntTest.java - - - **/AutoconfigurationTest.java - - - - - - - json - - - - - - - - thin-jar - - - - org.springframework.boot.experimental - spring-boot-thin-maven-plugin - ${thin.version} - - - - resolve - - resolve - - false - - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - **/cloud/*.java - - - - - - - 4.0.0 - + + + openshift + + 0.3.0.RELEASE + Finchley.SR2 + 3.5.37 + + + + + org.springframework.cloud + spring-cloud-kubernetes-dependencies + ${spring-cloud-k8s.version} + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + org.springframework.cloud + spring-cloud-starter-kubernetes-config + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-actuator + + + + + + src/main/resources + + **/logback.xml + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/cloud/config/*.java + + + + + org.springframework.boot + spring-boot-maven-plugin + + + io.fabric8 + fabric8-maven-plugin + ${fabric8.maven.plugin.version} + + + fmp + + resource + build + + + + + + + + + cloud-gcp + + + + org.springframework.cloud + spring-cloud-dependencies + Finchley.SR1 + pom + import + + + + + + org.springframework.cloud + spring-cloud-gcp-starter + 1.0.0.RELEASE + + + org.springframework.cloud + spring-cloud-gcp-starter-sql-mysql + 1.0.0.RELEASE + + + + ${project.name}-gcp + + + src/main/resources + + **/logback.xml + + + + + + com.google.cloud.tools + appengine-maven-plugin + 1.3.2 + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + cloudfoundry + + + + org.springframework.cloud + spring-cloud-dependencies + Finchley.SR1 + pom + import + + + + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.boot + spring-boot-starter-cloud-connectors + + + + ${project.name}-cf + + + src/main/resources + + **/logback.xml + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/cloud/config/*.java + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + thin-jar + + + + org.springframework.boot.experimental + spring-boot-thin-maven-plugin + ${thin.version} + + + + resolve + + resolve + + false + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/cloud/*.java + + + + + + + 4.0.0 + diff --git a/spring-boot-bootstrap/src/main/fabric8/deployment.yml b/spring-boot-bootstrap/src/main/fabric8/deployment.yml new file mode 100644 index 0000000000..c27613e83a --- /dev/null +++ b/spring-boot-bootstrap/src/main/fabric8/deployment.yml @@ -0,0 +1,29 @@ +spec: + template: + spec: + containers: + - env: + - name: SPRING_PROFILES_ACTIVE + value: mysql,openshift + - name: SPRING_DATASOURCE_USER + valueFrom: + secretKeyRef: + name: baeldung-demo-db + key: database-user + - name: SPRING_DATASOURCE_PASSWORD + valueFrom: + secretKeyRef: + name: baeldung-demo-db + key: database-password + livenessProbe: + httpGet: + path: /actuator/health + port: 8080 + scheme: HTTP + initialDelaySeconds: 180 + readinessProbe: + httpGet: + path: /actuator/health + port: 8080 + scheme: HTTP + initialDelaySeconds: 20 \ No newline at end of file From 74fc886a41eb3372df89ded09023a7382356769d Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 4 Nov 2018 17:47:39 +0530 Subject: [PATCH 304/546] [BAEL-10161] - Upgraded codebase to spring-5 --- spring-security-mvc-login/pom.xml | 15 ++++++++++++--- .../main/java/org/baeldung/spring/MvcConfig.java | 7 +++---- .../org/baeldung/spring/SecSecurityConfig.java | 13 ++++++++++--- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/spring-security-mvc-login/pom.xml b/spring-security-mvc-login/pom.xml index f70cf256dc..5ee216548a 100644 --- a/spring-security-mvc-login/pom.xml +++ b/spring-security-mvc-login/pom.xml @@ -10,9 +10,9 @@ com.baeldung - parent-spring-4 + parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-4 + ../parent-spring-5 @@ -138,6 +138,15 @@ org.apache.maven.plugins maven-war-plugin ${maven-war-plugin.version} + + + default-war + prepare-package + + false + + + @@ -167,7 +176,7 @@ - 4.2.6.RELEASE + 5.0.5.RELEASE 3.1.0 diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-mvc-login/src/main/java/org/baeldung/spring/MvcConfig.java index b59dbee0cf..b529048685 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/MvcConfig.java +++ b/spring-security-mvc-login/src/main/java/org/baeldung/spring/MvcConfig.java @@ -1,17 +1,18 @@ package org.baeldung.spring; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.JstlView; @EnableWebMvc @Configuration -public class MvcConfig extends WebMvcConfigurerAdapter { +public class MvcConfig implements WebMvcConfigurer { public MvcConfig() { super(); @@ -21,10 +22,8 @@ public class MvcConfig extends WebMvcConfigurerAdapter { @Override public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); registry.addViewController("/anonymous.html"); - registry.addViewController("/login.html"); registry.addViewController("/homepage.html"); registry.addViewController("/admin/adminpage.html"); diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java index accc7c9afd..97ce6b5bc2 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java +++ b/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java @@ -10,6 +10,8 @@ import org.springframework.security.config.annotation.authentication.builders.Au import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.authentication.AuthenticationFailureHandler; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; @@ -28,11 +30,11 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter { protected void configure(final AuthenticationManagerBuilder auth) throws Exception { // @formatter:off auth.inMemoryAuthentication() - .withUser("user1").password("user1Pass").roles("USER") + .withUser("user1").password(passwordEncoder().encode("user1Pass")).roles("USER") .and() - .withUser("user2").password("user2Pass").roles("USER") + .withUser("user2").password(passwordEncoder().encode("user2Pass")).roles("USER") .and() - .withUser("admin").password("adminPass").roles("ADMIN"); + .withUser("admin").password(passwordEncoder().encode("adminPass")).roles("ADMIN"); // @formatter:on } @@ -78,4 +80,9 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter { public AuthenticationFailureHandler authenticationFailureHandler() { return new CustomAuthenticationFailureHandler(); } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } } From 82e4adf6233d7e761032a021267374ee86c8259a Mon Sep 17 00:00:00 2001 From: Corneil du Plessis Date: Sun, 4 Nov 2018 15:52:06 +0200 Subject: [PATCH 305/546] BAEL-2106: Spring Boot deployment to Openshift --- spring-boot-bootstrap/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-bootstrap/pom.xml b/spring-boot-bootstrap/pom.xml index f1d5e9dac3..b5bf4bc7b6 100644 --- a/spring-boot-bootstrap/pom.xml +++ b/spring-boot-bootstrap/pom.xml @@ -298,7 +298,7 @@ maven-compiler-plugin - **/cloud/*.java + **/cloud/config/*.java From e924ed163d7606ef0daea4ea5ce7c34c6d45cb29 Mon Sep 17 00:00:00 2001 From: Akash Pandey Date: Sun, 4 Nov 2018 21:33:56 +0530 Subject: [PATCH 306/546] BAEL-2227 JPA Criteria Queries In Clause (#5606) * BAEL-2159: Mini Article on "Separate double into integer and decimal parts" * BEAL-2227: JPA Criteria Query In clause - Tutorial. * Minor Fix: Changed type of Predicate. * BAEL-2227: Code Review Comments: Extracted criteriaBuilder to a field. Refactored a private method to create criteria query. * BAEL-2227: Fixed spelling mistakes in the code. --- .../hibernate/entities/DeptEmployee.java | 8 ++ .../service/EmployeeSearchService.java | 15 +++ .../service/EmployeeSearchServiceImpl.java | 77 +++++++++++ .../EmployeeSearchServiceIntegrationTest.java | 122 ++++++++++++++++++ 4 files changed, 222 insertions(+) create mode 100644 persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java create mode 100644 persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java create mode 100644 persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java index 7a51009b62..27fff147b6 100644 --- a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java @@ -22,6 +22,14 @@ public class DeptEmployee { this.employeeNumber = employeeNumber; this.department = department; } + + public DeptEmployee(String name, String employeeNumber, String designation, Department department) { + super(); + this.name = name; + this.employeeNumber = employeeNumber; + this.designation = designation; + this.department = department; + } public long getId() { return id; diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java new file mode 100644 index 0000000000..85cdffd54d --- /dev/null +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java @@ -0,0 +1,15 @@ +package com.baeldung.hibernate.jpacriteriabuilder.service; + +import java.util.List; + +import com.baeldung.hibernate.entities.DeptEmployee; + +public interface EmployeeSearchService { + + List filterbyDesignationUsingCriteriaBuilder(List designaitons); + + List filterbyDesignationUsingExpression(List aurhors); + + List searchByDepartmentQuery(String query); + +} diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java new file mode 100644 index 0000000000..a9981b8066 --- /dev/null +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java @@ -0,0 +1,77 @@ +package com.baeldung.hibernate.jpacriteriabuilder.service; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaBuilder.In; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Root; +import javax.persistence.criteria.Subquery; + +import com.baeldung.hibernate.entities.Department; +import com.baeldung.hibernate.entities.DeptEmployee; + +public class EmployeeSearchServiceImpl implements EmployeeSearchService { + + private EntityManager entityManager; + private CriteriaBuilder criteriaBuilder; + + public EmployeeSearchServiceImpl(EntityManager entityManager) { + this.entityManager = entityManager; + this.criteriaBuilder = entityManager.getCriteriaBuilder(); + + } + + @Override + public List filterbyDesignationUsingCriteriaBuilder(List designations) { + CriteriaQuery criteriaQuery = createCriteriaQuery(DeptEmployee.class); + Root root = criteriaQuery.from(DeptEmployee.class); + In inClause = criteriaBuilder.in(root.get("designation")); + for (String designaiton : designations) { + inClause.value(designaiton); + } + criteriaQuery.select(root) + .where(inClause); + TypedQuery query = entityManager.createQuery(criteriaQuery); + return query.getResultList(); + } + + @Override + public List filterbyDesignationUsingExpression(List designations) { + CriteriaQuery criteriaQuery = createCriteriaQuery(DeptEmployee.class); + Root root = criteriaQuery.from(DeptEmployee.class); + criteriaQuery.select(root) + .where(root.get("designation") + .in(designations)); + TypedQuery query = entityManager.createQuery(criteriaQuery); + return query.getResultList(); + } + + @Override + public List searchByDepartmentQuery(String searchKey) { + CriteriaQuery criteriaQuery = createCriteriaQuery(DeptEmployee.class); + Root emp = criteriaQuery.from(DeptEmployee.class); + + Subquery subquery = criteriaQuery.subquery(Department.class); + Root dept = subquery.from(Department.class); + subquery.select(dept) + .distinct(true) + .where(criteriaBuilder.like(dept.get("name"), new StringBuffer("%").append(searchKey) + .append("%") + .toString())); + + criteriaQuery.select(emp) + .where(criteriaBuilder.in(emp.get("department")) + .value(subquery)); + + TypedQuery query = entityManager.createQuery(criteriaQuery); + return query.getResultList(); + } + + private CriteriaQuery createCriteriaQuery(Class klass) { + return criteriaBuilder.createQuery(klass); + } + +} diff --git a/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java new file mode 100644 index 0000000000..c7a1bc7b2a --- /dev/null +++ b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java @@ -0,0 +1,122 @@ +package com.baeldung.hibernate.jpacriteriabuilder; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import javax.persistence.EntityManager; + +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.hibernate.HibernateUtil; +import com.baeldung.hibernate.entities.Department; +import com.baeldung.hibernate.entities.DeptEmployee; +import com.baeldung.hibernate.jpacriteriabuilder.service.EmployeeSearchService; +import com.baeldung.hibernate.jpacriteriabuilder.service.EmployeeSearchServiceImpl; + +public class EmployeeSearchServiceIntegrationTest { + + private EntityManager entityManager; + private EmployeeSearchService searchService; + private Session session; + + @Before + public final void setup() throws HibernateException, IOException { + session = HibernateUtil.getSessionFactory() + .openSession(); + entityManager = session.getEntityManagerFactory() + .createEntityManager(); + searchService = new EmployeeSearchServiceImpl(entityManager); + + entityManager.getTransaction() + .begin(); + Department department = new Department("Pre Sales"); + DeptEmployee employee = new DeptEmployee("John Smith", "001", "Manager", department); + entityManager.persist(department); + entityManager.persist(employee); + employee = new DeptEmployee("Ian Evans", "002", "Associate", department); + entityManager.persist(department); + entityManager.persist(employee); + department = new Department("Copporate Sales"); + employee = new DeptEmployee("Robert Carter", "003", "Manager", department); + entityManager.persist(department); + entityManager.persist(employee); + employee = new DeptEmployee("John Carter", "004", "Senior Manager", department); + entityManager.persist(employee); + employee = new DeptEmployee("David Guetta", "009", "Associate", department); + entityManager.persist(department); + entityManager.persist(employee); + department = new Department("Post Sales"); + employee = new DeptEmployee("Robert Jonas", "005", "Director", department); + entityManager.persist(department); + entityManager.persist(employee); + employee = new DeptEmployee("John Ferros", "006", "Junior Associate", department); + entityManager.persist(department); + entityManager.persist(employee); + department = new Department("Client Support"); + employee = new DeptEmployee("Robert Mcclements", "007", "Director", department); + entityManager.persist(department); + entityManager.persist(employee); + employee = new DeptEmployee("Peter Parker", "008", "Manager", department); + entityManager.persist(department); + entityManager.persist(employee); + + } + + @After + public final void teardown() { + entityManager.getTransaction() + .rollback(); + entityManager.close(); + } + + @Test + public final void givenCriteriaQuery_whenSearchedUsingCriteriaBuilderWithListofAuthors_thenResultIsFilteredByAuthorNames() { + List designations = new ArrayList() { + { + add("Manager"); + add("Senior Manager"); + add("Director"); + } + }; + List result = searchService.filterbyDesignationUsingCriteriaBuilder(designations); + assertEquals("Number of Employees does not match with expected.", 6, result.size()); + assertThat(result.stream() + .map(DeptEmployee::getDesignation) + .distinct() + .collect(Collectors.toList()), containsInAnyOrder(designations.toArray())); + } + + @Test + public final void givenCriteriaQuery_whenSearchedUsingExpressionWithListofAuthors_thenResultIsFilteredByAuthorNames() { + List designations = new ArrayList() { + { + add("Manager"); + add("Senior Manager"); + add("Director"); + } + }; + List result = searchService.filterbyDesignationUsingExpression(designations); + assertEquals("Number of Employees does not match with expected.", 6, result.size()); + assertThat(result.stream() + .map(DeptEmployee::getDesignation) + .distinct() + .collect(Collectors.toList()), containsInAnyOrder(designations.toArray())); + } + + @Test + public final void givenCriteriaQuery_whenSearchedDepartmentLike_thenResultIsFilteredByDepartment() { + List result = searchService.searchByDepartmentQuery("Sales"); + assertEquals("Number of Employees does not match with expected.", 7, result.size()); + // assertThat(result.stream().map(DeptEmployee::getDesignation).distinct().collect(Collectors.toList()), containsInAnyOrder(designations.toArray())); + } +} From d2a4341d9763cf1c062b75b31cf597af8601aecc Mon Sep 17 00:00:00 2001 From: fanatixan Date: Sun, 4 Nov 2018 17:29:22 +0100 Subject: [PATCH 307/546] bael-2190 - JPA many-to-many: adding tests and changing package --- .../{extracolumn => }/model/Course.java | 6 ++- .../{extracolumn => }/model/CourseRating.java | 6 ++- .../model/CourseRatingKey.java | 2 +- .../model/CourseRegistration.java | 8 ++- .../{extracolumn => }/model/Student.java | 6 ++- .../manytomany/ManyToManyIntegrationTest.java | 24 +++++++++ .../ManyToManyTestConfiguration.java | 51 +++++++++++++++++++ .../src/test/resources/manytomany/db.sql | 44 ++++++++++++++++ .../test/resources/manytomany/test.properties | 6 +++ 9 files changed, 148 insertions(+), 5 deletions(-) rename persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/{extracolumn => }/model/Course.java (90%) rename persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/{extracolumn => }/model/CourseRating.java (90%) rename persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/{extracolumn => }/model/CourseRatingKey.java (96%) rename persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/{extracolumn => }/model/CourseRegistration.java (89%) rename persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/{extracolumn => }/model/Student.java (91%) create mode 100644 persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyIntegrationTest.java create mode 100644 persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyTestConfiguration.java create mode 100644 persistence-modules/spring-jpa/src/test/resources/manytomany/db.sql create mode 100644 persistence-modules/spring-jpa/src/test/resources/manytomany/test.properties diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Course.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/Course.java similarity index 90% rename from persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Course.java rename to persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/Course.java index 4849165c57..bdfb8e890f 100644 --- a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Course.java +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/Course.java @@ -1,16 +1,20 @@ -package com.baeldung.manytomany.extracolumn.model; +package com.baeldung.manytomany.model; import java.util.Set; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.OneToMany; +import javax.persistence.Table; @Entity +@Table(name = "course") public class Course { @Id + @Column(name = "id") private Long id; @ManyToMany(mappedBy = "likedCourses") diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRating.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRating.java similarity index 90% rename from persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRating.java rename to persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRating.java index 1b6c9d8b2c..4951f766bc 100644 --- a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRating.java +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRating.java @@ -1,12 +1,15 @@ -package com.baeldung.manytomany.extracolumn.model; +package com.baeldung.manytomany.model; +import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MapsId; +import javax.persistence.Table; @Entity +@Table(name = "course_rating") public class CourseRating { @EmbeddedId @@ -22,6 +25,7 @@ public class CourseRating { @JoinColumn(name = "course_id") private Course course; + @Column(name = "rating") private int rating; public CourseRating() { diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRatingKey.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRatingKey.java similarity index 96% rename from persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRatingKey.java rename to persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRatingKey.java index 6638ae6968..4e7430ed92 100644 --- a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRatingKey.java +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRatingKey.java @@ -1,4 +1,4 @@ -package com.baeldung.manytomany.extracolumn.model; +package com.baeldung.manytomany.model; import java.io.Serializable; diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRegistration.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRegistration.java similarity index 89% rename from persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRegistration.java rename to persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRegistration.java index 225968dba4..e1f30af883 100644 --- a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/CourseRegistration.java +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/CourseRegistration.java @@ -1,16 +1,20 @@ -package com.baeldung.manytomany.extracolumn.model; +package com.baeldung.manytomany.model; import java.time.LocalDateTime; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.Table; @Entity +@Table(name = "course_registration") public class CourseRegistration { @Id + @Column(name = "id") private Long id; @ManyToOne @@ -21,8 +25,10 @@ public class CourseRegistration { @JoinColumn(name = "course_id") private Course course; + @Column(name = "registered_at") private LocalDateTime registeredAt; + @Column(name = "grade") private int grade; // additional properties diff --git a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Student.java b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/Student.java similarity index 91% rename from persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Student.java rename to persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/Student.java index 6bc8271e7e..00561593a6 100644 --- a/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/extracolumn/model/Student.java +++ b/persistence-modules/spring-jpa/src/main/java/com/baeldung/manytomany/model/Student.java @@ -1,18 +1,22 @@ -package com.baeldung.manytomany.extracolumn.model; +package com.baeldung.manytomany.model; import java.util.Set; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.OneToMany; +import javax.persistence.Table; @Entity +@Table(name = "student") public class Student { @Id + @Column(name = "id") private Long id; @ManyToMany diff --git a/persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyIntegrationTest.java b/persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyIntegrationTest.java new file mode 100644 index 0000000000..5e4334f5d4 --- /dev/null +++ b/persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyIntegrationTest.java @@ -0,0 +1,24 @@ +package com.baeldung.manytomany; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@ContextConfiguration(classes = ManyToManyTestConfiguration.class) +@DirtiesContext +public class ManyToManyIntegrationTest { + + @PersistenceContext + EntityManager entityManager; + + @Test + public void contextStarted() { + } + +} diff --git a/persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyTestConfiguration.java b/persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyTestConfiguration.java new file mode 100644 index 0000000000..f4635b563a --- /dev/null +++ b/persistence-modules/spring-jpa/src/test/java/com/baeldung/manytomany/ManyToManyTestConfiguration.java @@ -0,0 +1,51 @@ +package com.baeldung.manytomany; + +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; +import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; +import org.springframework.orm.jpa.JpaVendorAdapter; +import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; +import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; + +@Configuration +@PropertySource("classpath:/manytomany/test.properties") +public class ManyToManyTestConfiguration { + + @Bean + public DataSource dataSource() { + EmbeddedDatabaseBuilder dbBuilder = new EmbeddedDatabaseBuilder(); + return dbBuilder.setType(EmbeddedDatabaseType.H2) + .addScript("classpath:/manytomany/db.sql") + .build(); + } + + @Bean + public LocalContainerEntityManagerFactoryBean entityManagerFactory(@Value("${hibernate.hbm2ddl.auto}") String hbm2ddlType, @Value("${hibernate.dialect}") String dialect, @Value("${hibernate.show_sql}") boolean showSql) { + LocalContainerEntityManagerFactoryBean result = new LocalContainerEntityManagerFactoryBean(); + + result.setDataSource(dataSource()); + result.setPackagesToScan("com.baeldung.manytomany.model"); + result.setJpaVendorAdapter(jpaVendorAdapter()); + + Map jpaProperties = new HashMap<>(); + jpaProperties.put("hibernate.hbm2ddl.auto", hbm2ddlType); + jpaProperties.put("hibernate.dialect", dialect); + jpaProperties.put("hibernate.show_sql", showSql); + result.setJpaPropertyMap(jpaProperties); + + return result; + } + + public JpaVendorAdapter jpaVendorAdapter() { + return new HibernateJpaVendorAdapter(); + } + +} diff --git a/persistence-modules/spring-jpa/src/test/resources/manytomany/db.sql b/persistence-modules/spring-jpa/src/test/resources/manytomany/db.sql new file mode 100644 index 0000000000..02905e41ee --- /dev/null +++ b/persistence-modules/spring-jpa/src/test/resources/manytomany/db.sql @@ -0,0 +1,44 @@ +CREATE TABLE course ( + id bigint(20) NOT NULL, + PRIMARY KEY (id) +); + + +CREATE TABLE student ( + id bigint(20) NOT NULL, + PRIMARY KEY (id) +); + + +CREATE TABLE course_like ( + student_id bigint(20) NOT NULL, + course_id bigint(20) NOT NULL, + PRIMARY KEY (student_id, course_id), + CONSTRAINT fk_course_like__student FOREIGN KEY (student_id) REFERENCES student (id), + CONSTRAINT fk_course_like__course FOREIGN KEY (course_id) REFERENCES course (id) +); + + + +CREATE TABLE course_rating ( + course_id bigint(20) NOT NULL, + student_id bigint(20) NOT NULL, + rating int(11) NOT NULL, + PRIMARY KEY (course_id, student_id), + CONSTRAINT fk_course_rating__student FOREIGN KEY (student_id) REFERENCES student (id), + CONSTRAINT fk_course_rating__course FOREIGN KEY (course_id) REFERENCES course (id) +); + + + +CREATE TABLE course_registration ( + id bigint(20) NOT NULL, + grade int(11), + registered_at datetime NOT NULL, + course_id bigint(20) NOT NULL, + student_id bigint(20) NOT NULL, + PRIMARY KEY (id), + CONSTRAINT fk_course_registration__student FOREIGN KEY (student_id) REFERENCES student (id), + CONSTRAINT fk_course_registration__course FOREIGN KEY (course_id) REFERENCES course (id) +); + diff --git a/persistence-modules/spring-jpa/src/test/resources/manytomany/test.properties b/persistence-modules/spring-jpa/src/test/resources/manytomany/test.properties new file mode 100644 index 0000000000..9e4236a6c2 --- /dev/null +++ b/persistence-modules/spring-jpa/src/test/resources/manytomany/test.properties @@ -0,0 +1,6 @@ +jdbc.driverClassName=org.h2.Driver +jdbc.url=jdbc:h2:mem:myDb;DB_CLOSE_DELAY=-1 + +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.show_sql=true +hibernate.hbm2ddl.auto=validate From c09e6d43feb6101b3cf3480515adf7d398b7a44c Mon Sep 17 00:00:00 2001 From: Corneil du Plessis Date: Sun, 4 Nov 2018 20:15:20 +0200 Subject: [PATCH 308/546] BAEL-2106: Spring Boot deployment to Openshift --- spring-boot-bootstrap/openshift/configmap.yml | 2 +- spring-boot-bootstrap/src/main/fabric8/deployment.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-bootstrap/openshift/configmap.yml b/spring-boot-bootstrap/openshift/configmap.yml index 94c8d689ae..931a614436 100644 --- a/spring-boot-bootstrap/openshift/configmap.yml +++ b/spring-boot-bootstrap/openshift/configmap.yml @@ -4,4 +4,4 @@ metadata: name: spring-boot-bootstrap data: application.properties: |- - spring.datasource.url=jdbc:mysql://baeldung-demo-db:3306/ \ No newline at end of file + spring.datasource.url=jdbc:mysql://baeldung-db:3306/baeldung_db \ No newline at end of file diff --git a/spring-boot-bootstrap/src/main/fabric8/deployment.yml b/spring-boot-bootstrap/src/main/fabric8/deployment.yml index c27613e83a..1bdf1ff167 100644 --- a/spring-boot-bootstrap/src/main/fabric8/deployment.yml +++ b/spring-boot-bootstrap/src/main/fabric8/deployment.yml @@ -4,16 +4,16 @@ spec: containers: - env: - name: SPRING_PROFILES_ACTIVE - value: mysql,openshift + value: mysql - name: SPRING_DATASOURCE_USER valueFrom: secretKeyRef: - name: baeldung-demo-db + name: baeldung-db key: database-user - name: SPRING_DATASOURCE_PASSWORD valueFrom: secretKeyRef: - name: baeldung-demo-db + name: baeldung-db key: database-password livenessProbe: httpGet: From 192c9443bd5ae800288a7dfaddae4e489fae471f Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Sun, 4 Nov 2018 13:04:05 -0600 Subject: [PATCH 309/546] BAEL-2015: add link back to article --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index ce2d5b3e64..35fdcd9132 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -156,3 +156,4 @@ - [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) - [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) - [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) +- [Understanding Memory Leaks in Java](https://www.baeldung.com/java-memory-leaks) From f2d3c040a73ee7303666e6d8210025facfa76949 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sun, 4 Nov 2018 13:10:56 -0600 Subject: [PATCH 310/546] BAEL-2015: add link back to article (#5619) --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index ce2d5b3e64..35fdcd9132 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -156,3 +156,4 @@ - [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) - [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) - [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) +- [Understanding Memory Leaks in Java](https://www.baeldung.com/java-memory-leaks) From 754480d447173422a4dd3d0568987648ca0e72f0 Mon Sep 17 00:00:00 2001 From: Rahul Srivastava Date: Mon, 5 Nov 2018 13:17:39 +0530 Subject: [PATCH 311/546] Revert "Giving proper indentation" This reverts commit 0d91f704c289cd8d5cb8b37aaddcff105eb4d142. --- .../main/java/com/baeldung/hexagonal/architecture/Car.java | 2 +- .../com/baeldung/hexagonal/architecture/FordAdapter.java | 5 +++++ .../com/baeldung/hexagonal/architecture/HondaAdapter.java | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java index ebc5f78193..79e5ddd061 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java +++ b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java @@ -5,7 +5,6 @@ import lombok.Data; @AllArgsConstructor @Data public class Car { - String manufacturerName; String fuleType; String modelNo; @@ -32,4 +31,5 @@ public class Car { public void enableChildLock() { //Enable child lock in the car } + } diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java index 7f4248c17e..75e83e5dce 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java @@ -8,21 +8,25 @@ public class FordAdapter implements ManufacturingPort { @Override public void manufacturingMethodology(Car car) { // Process for manufacturing ford car + } @Override public void manufacturingLocation(String location) { // Location at which ford manufacturing will take place + } @Override public void logoForTheCar(Car car) { // Put ford logo on the car + } @Override public void timeToMarketForTheCar(Car car) { // Find time to market for a particular ford car model + } @Override @@ -40,4 +44,5 @@ public class FordAdapter implements ManufacturingPort { public void fordEngineFuelTest(Car car) { //Do engine test for ford } + } diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java index d6773d9b6a..7b6bac1aa6 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java @@ -7,22 +7,26 @@ public class HondaAdapter implements ManufacturingPort { @Override public void manufacturingMethodology(Car car) { - // Process for manufacturing honda car + // Process for manufacturing honda car + } @Override public void manufacturingLocation(String location) { // Location at which honda manufacturing will take place + } @Override public void logoForTheCar(Car car) { // Put honda logo on the car + } @Override public void timeToMarketForTheCar(Car car) { // Find time to market for a particular honda car model + } @Override @@ -40,4 +44,5 @@ public class HondaAdapter implements ManufacturingPort { public void carCrashAndSafetyTest(Car car) { //Do car crash test got honda car } + } \ No newline at end of file From 3c4595757cb12526678bf3c4928e977ca9ade043 Mon Sep 17 00:00:00 2001 From: Rahul Srivastava Date: Mon, 5 Nov 2018 13:18:13 +0530 Subject: [PATCH 312/546] Revert "Hexagonal Architecture in Java" This reverts commit 9e74f7cd22fdd88826123e2b3f88010233f8c09d. --- .../baeldung/hexagonal/architecture/Car.java | 35 -------------- .../hexagonal/architecture/FordAdapter.java | 48 ------------------- .../hexagonal/architecture/HondaAdapter.java | 48 ------------------- .../architecture/ManufacturingPort.java | 14 ------ 4 files changed, 145 deletions(-) delete mode 100644 spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java delete mode 100644 spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java delete mode 100644 spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java delete mode 100644 spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/ManufacturingPort.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java deleted file mode 100644 index 79e5ddd061..0000000000 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/Car.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.baeldung.hexagonal.architecture; -import lombok.AllArgsConstructor; -import lombok.Data; - -@AllArgsConstructor -@Data -public class Car { - String manufacturerName; - String fuleType; - String modelNo; - String yearOfManufacture; - String vehicleType; - int noOfGears; - - public void startCar() { - //Start the car - } - - public void stopCar() { - //Stop the car - } - - public void changeGear(int gearNo){ - //Change gear - } - - public void openBoot() { - //Open boot of the car - } - - public void enableChildLock() { - //Enable child lock in the car - } - -} diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java deleted file mode 100644 index 75e83e5dce..0000000000 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/FordAdapter.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.baeldung.hexagonal.architecture; - -import java.util.List; -import java.util.Map; - -public class FordAdapter implements ManufacturingPort { - - @Override - public void manufacturingMethodology(Car car) { - // Process for manufacturing ford car - - } - - @Override - public void manufacturingLocation(String location) { - // Location at which ford manufacturing will take place - - } - - @Override - public void logoForTheCar(Car car) { - // Put ford logo on the car - - } - - @Override - public void timeToMarketForTheCar(Car car) { - // Find time to market for a particular ford car model - - } - - @Override - public List> totalManufacturingVolume() { - // Return car production volume of all ford manufacturing units - return null; - } - - @Override - public List listOfAllFactories() { - // Return list of all ford factories - return null; - } - - public void fordEngineFuelTest(Car car) { - //Do engine test for ford - } - -} diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java deleted file mode 100644 index 7b6bac1aa6..0000000000 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/HondaAdapter.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.baeldung.hexagonal.architecture; - -import java.util.List; -import java.util.Map; - -public class HondaAdapter implements ManufacturingPort { - - @Override - public void manufacturingMethodology(Car car) { - // Process for manufacturing honda car - - } - - @Override - public void manufacturingLocation(String location) { - // Location at which honda manufacturing will take place - - } - - @Override - public void logoForTheCar(Car car) { - // Put honda logo on the car - - } - - @Override - public void timeToMarketForTheCar(Car car) { - // Find time to market for a particular honda car model - - } - - @Override - public List> totalManufacturingVolume() { - // Return car production volume of all honda manufacturing units - return null; - } - - @Override - public List listOfAllFactories() { - // Return list of all honda factories - return null; - } - - public void carCrashAndSafetyTest(Car car) { - //Do car crash test got honda car - } - -} \ No newline at end of file diff --git a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/ManufacturingPort.java b/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/ManufacturingPort.java deleted file mode 100644 index 666e69ac05..0000000000 --- a/spring-5-reactive/src/main/java/com/baeldung/hexagonal/architecture/ManufacturingPort.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.hexagonal.architecture; - -import java.util.List; -import java.util.Map; - -public interface ManufacturingPort { - - public void manufacturingMethodology(Car car); - public void manufacturingLocation(String location); - public void logoForTheCar(Car car); - public void timeToMarketForTheCar(Car car); - public List> totalManufacturingVolume(); - public List listOfAllFactories(); -} From b9b4cec7ae774e95620856d5675b05b07a18a79e Mon Sep 17 00:00:00 2001 From: Rahul Srivastava Date: Mon, 5 Nov 2018 13:29:42 +0530 Subject: [PATCH 313/546] Adding new line to a string in Java --- .../string/AddingNewLineToString.java | 55 +++++++++++++++++++ .../main/java/com/baeldung/string/page.html | 12 ++++ 2 files changed, 67 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java create mode 100644 core-java/src/main/java/com/baeldung/string/page.html diff --git a/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java b/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java new file mode 100644 index 0000000000..e828af4cb7 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java @@ -0,0 +1,55 @@ +package com.baeldung.string; + +public class AddingNewLineToString { + + public static void main(String[] args) { + String line1 = "Humpty Dumpty sat on a wall."; + String line2 = "Humpty Dumpty had a great fall."; + String para = ""; + + //1. Using "\n" + System.out.println("1. Using \\n"); + para = line1+"\n"+line2; + System.out.println(para); + + //2. Using "\r\n" + System.out.println("2. Using \\r\\n"); + para = line1+"\r\n"+line2; + System.out.println(para); + + //3. Using "\r" + System.out.println("3. Using \\r"); + para = line1+"\r"+line2; + System.out.println(para); + + //4. Using "\n\r" Note that this is not same as "\r\n" + // Using "\n\r" is equivalent to adding two lines + System.out.println("4. Using \\n\\r"); + para = line1+"\n\r"+line2; + System.out.println(para); + + //5. Using System.lineSeparator() + System.out.println("5. Using System.lineSeparator()"); + para = line1+System.lineSeparator()+line2; + System.out.println(para); + + //6. Using System.getProperty("line.separator") + System.out.println("6. Using System.getProperty(\"line.separator\")"); + para = line1+System.getProperty("line.separator")+line2; + System.out.println(para); + + //Line break for HTML using
+ System.out.println("Line break for HTML using
"); + para = line1+"
"+line2; + + //Line break for HTML when string is in + +
Humpty Dumpty sat on a wall.

Humpty Dumpty had a great fall
+
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall
+
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall
+

Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall

+ + From 80357224acfd98d117054ddb70fd86d5e508bad8 Mon Sep 17 00:00:00 2001 From: Grigorios Dimopoulos Date: Mon, 5 Nov 2018 11:04:44 +0200 Subject: [PATCH 314/546] [Mercator]: Unit test fixes --- .../mercator/EllipticalMercatorUnitTest.java | 9 +++++---- .../algorithms/mercator/SphericalMercatorUnitTest.java | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java index ce2f171051..96b644c46c 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java @@ -1,21 +1,22 @@ package com.baeldung.algorithms.mercator; +import org.junit.Assert; import org.junit.Test; public class EllipticalMercatorUnitTest { @Test - public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.xAxisProjection(22); - assert result == 2449028.7974520186; + Assert.assertEquals(result, 2449028.7974520186, 0.0); } @Test - public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.yAxisProjection(44); - assert result == 5435749.887511954; + Assert.assertEquals(result, 5435749.887511954, 0.0); } } diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java index bbb34302ed..348c6ad3e4 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java @@ -1,21 +1,21 @@ package com.baeldung.algorithms.mercator; +import org.junit.Assert; import org.junit.Test; -import static junit.framework.TestCase.assertEquals; public class SphericalMercatorUnitTest { @Test - public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.xAxisProjection(22); - assert result == 2449028.7974520186; + Assert.assertEquals(result, 2449028.7974520186, 0.0); } @Test - public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.yAxisProjection(44); - assert result == 5465442.183322753; + Assert.assertEquals(result, 5465442.183322753, 0.0); } } From 1cad5abf8447ead5589978db78a07a61f06a6fd0 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Mon, 5 Nov 2018 15:37:48 +0530 Subject: [PATCH 315/546] BAEL-896 Working with dates in Kotlin -Moved snippets to test, now using assertions instead of println --- .../com/baeldung/kotlin/dates/CreateDate.kt | 31 ------------ .../com/baeldung/kotlin/dates/ExtractDate.kt | 24 ---------- .../com/baeldung/kotlin/dates/PeriodDate.kt | 44 ----------------- .../com/baeldung/kotlin/dates/PrintDate.kt | 26 ---------- .../kotlin/dates/CreateDateUnitTest.kt | 34 +++++++++++++ .../kotlin/dates/ExtractDateUnitTest.kt | 29 +++++++++++ .../kotlin/dates/FormatDateUnitTest.kt | 29 +++++++++++ .../kotlin/dates/PeriodDateUnitTest.kt | 48 +++++++++++++++++++ 8 files changed, 140 insertions(+), 125 deletions(-) delete mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt delete mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt delete mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt delete mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt create mode 100644 kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/CreateDateUnitTest.kt create mode 100644 kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/ExtractDateUnitTest.kt create mode 100644 kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/FormatDateUnitTest.kt create mode 100644 kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/PeriodDateUnitTest.kt diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt deleted file mode 100644 index 78705fc151..0000000000 --- a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/CreateDate.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.baeldung.kotlin.dates - -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -fun createDateUsingParseMethodDefaultFormat() { - - var date = LocalDate.parse("2018-12-31") - println(date) -} - -fun createDateUsingParseMethodCustomFormat() { - - var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy") - - var date = LocalDate.parse("31-12-2018", formatter) - - println(date) -} - -fun createDateUsingOfMethod() { - var date = LocalDate.of(2018, 12, 31) - println(date) - -} - -fun main(args: Array) { - - createDateUsingParseMethodCustomFormat() - createDateUsingOfMethod() -} \ No newline at end of file diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt deleted file mode 100644 index f5291b63db..0000000000 --- a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/ExtractDate.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.kotlin.dates - -import java.time.LocalDate - -fun extractingCommonComponents() { - var date = LocalDate.parse("2018-12-31") - - println(date.year) - println(date.month) - println(date.dayOfMonth) -} - -fun extractingEraDowDoy() { - var date = LocalDate.parse("2018-12-31") - - println(date.era) - println(date.dayOfWeek) - println(date.dayOfYear) -} - -fun main(args: Array) { - extractingCommonComponents() - extractingEraDowDoy() -} \ No newline at end of file diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt deleted file mode 100644 index f8689c55be..0000000000 --- a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PeriodDate.kt +++ /dev/null @@ -1,44 +0,0 @@ -package com.baeldung.kotlin.dates - -import java.time.LocalDate -import java.time.Period - -fun createAPeriod() { - var period = Period.of(1, 2, 3) - - println(period) -} - -fun addAPeriod() { - var period = Period.of(1, 2, 3) - - var date = LocalDate.of(2018, 6, 25) - var modifiedDate = date.plus(period) - - println(modifiedDate) -} - -fun subtractAPeriod() { - var period = Period.of(1, 2, 3) - - var date = LocalDate.of(2018, 6, 25) - var modifiedDate = date.minus(period) - - println(modifiedDate) -} - -fun getAPeriod() { - - var date1 = LocalDate.parse("2018-06-25") - var date2 = LocalDate.parse("2018-12-25") - - var period = Period.between(date1, date2) - println(period) -} - -fun main(args: Array) { - createAPeriod() - addAPeriod() - subtractAPeriod() - getAPeriod() -} \ No newline at end of file diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt deleted file mode 100644 index 73380e3152..0000000000 --- a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/dates/PrintDate.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.kotlin.dates - -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -fun printDateDefaultFormat() { - - var date = LocalDate.parse("2018-12-31") - println(date) -} - -fun printDateUsingCustomFormat() { - - var date = LocalDate.parse("2018-12-31") - - var formatter = DateTimeFormatter.ofPattern("dd-MMMM-yyyy") - var formattedDate = date.format(formatter) - println(formattedDate) -} - -fun main(args: Array) { - - printDateDefaultFormat() - - printDateUsingCustomFormat() -} \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/CreateDateUnitTest.kt b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/CreateDateUnitTest.kt new file mode 100644 index 0000000000..d52a2f0f19 --- /dev/null +++ b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/CreateDateUnitTest.kt @@ -0,0 +1,34 @@ +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class CreateDateUnitTest { + + @Test + fun givenString_whenDefaultFormat_thenCreated() { + + var date = LocalDate.parse("2018-12-31") + + assertThat(date).isEqualTo("2018-12-31") + } + + @Test + fun givenString_whenCustomFormat_thenCreated() { + + var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy") + var date = LocalDate.parse("31-12-2018", formatter) + + assertThat(date).isEqualTo("2018-12-31") + } + + @Test + fun givenYMD_whenUsingOf_thenCreated() { + var date = LocalDate.of(2018, 12, 31) + + assertThat(date).isEqualTo("2018-12-31") + } + +} \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/ExtractDateUnitTest.kt b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/ExtractDateUnitTest.kt new file mode 100644 index 0000000000..ef3841752b --- /dev/null +++ b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/ExtractDateUnitTest.kt @@ -0,0 +1,29 @@ +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.DayOfWeek +import java.time.LocalDate +import java.time.Month + +class ExtractDateUnitTest { + + @Test + fun givenDate_thenExtractedYMD() { + var date = LocalDate.parse("2018-12-31") + + assertThat(date.year).isEqualTo(2018) + assertThat(date.month).isEqualTo(Month.DECEMBER) + assertThat(date.dayOfMonth).isEqualTo(31) + } + + @Test + fun givenDate_thenExtractedEraDowDoy() { + var date = LocalDate.parse("2018-12-31") + + assertThat(date.era.toString()).isEqualTo("CE") + assertThat(date.dayOfWeek).isEqualTo(DayOfWeek.MONDAY) + assertThat(date.dayOfYear).isEqualTo(365) + } + +} \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/FormatDateUnitTest.kt b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/FormatDateUnitTest.kt new file mode 100644 index 0000000000..11ff6ec9f0 --- /dev/null +++ b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/FormatDateUnitTest.kt @@ -0,0 +1,29 @@ +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class FormatDateUnitTest { + + @Test + fun givenDate_whenDefaultFormat_thenFormattedString() { + + var date = LocalDate.parse("2018-12-31") + + assertThat(date.toString()).isEqualTo("2018-12-31") + } + + @Test + fun givenDate_whenCustomFormat_thenFormattedString() { + + var date = LocalDate.parse("2018-12-31") + + var formatter = DateTimeFormatter.ofPattern("dd-MMMM-yyyy") + var formattedDate = date.format(formatter) + + assertThat(formattedDate).isEqualTo("31-December-2018") + } + +} \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/PeriodDateUnitTest.kt b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/PeriodDateUnitTest.kt new file mode 100644 index 0000000000..e6b66634d3 --- /dev/null +++ b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/PeriodDateUnitTest.kt @@ -0,0 +1,48 @@ +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.LocalDate +import java.time.Period + +class PeriodDateUnitTest { + + @Test + fun givenYMD_thenCreatePeriod() { + var period = Period.of(1, 2, 3) + + assertThat(period.toString()).isEqualTo("P1Y2M3D") + } + + @Test + fun givenPeriod_whenAdd_thenModifiedDate() { + var period = Period.of(1, 2, 3) + + var date = LocalDate.of(2018, 6, 25) + var modifiedDate = date.plus(period) + + assertThat(modifiedDate).isEqualTo("2019-08-28") + } + + @Test + fun givenPeriod_whenSubtracted_thenModifiedDate() { + var period = Period.of(1, 2, 3) + + var date = LocalDate.of(2018, 6, 25) + var modifiedDate = date.minus(period) + + assertThat(modifiedDate).isEqualTo("2017-04-22") + } + + @Test + fun givenTwoDate_whenUsingBetween_thenDiffOfDates() { + + var date1 = LocalDate.parse("2018-06-25") + var date2 = LocalDate.parse("2018-12-25") + + var period = Period.between(date1, date2) + + assertThat(period.toString()).isEqualTo("P6M") + } + +} \ No newline at end of file From a8ee73cfc9d1e0d6cf4e092e79b95fc1d12ec74d Mon Sep 17 00:00:00 2001 From: yatendragoel Date: Mon, 5 Nov 2018 20:12:08 +0530 Subject: [PATCH 316/546] Convert java.time.Instant to java.sql.Timestamp and back Issue: BAEL-2203 --- .../ConvertInstantToTimestampUnitTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 java-dates/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java b/java-dates/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java new file mode 100644 index 0000000000..3ba01a591a --- /dev/null +++ b/java-dates/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java @@ -0,0 +1,30 @@ +package com.baeldung.datetime; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.sql.Timestamp; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.ZoneId; +import java.util.TimeZone; + +import org.junit.Test; + +public class ConvertInstantToTimestampUnitTest { + + @Test + public void givenInstant_whenConvertedToTimestamp_thenGetTimestampWithSamePointOnTimeline() { + Instant instant = Instant.now(); + Timestamp timestamp = Timestamp.from(instant); // same point on the time-line as Instant + assertThat(instant.toEpochMilli()).isEqualTo(timestamp.getTime()); + + instant = timestamp.toInstant(); + assertThat(instant.toEpochMilli()).isEqualTo(timestamp.getTime()); + + DateFormat df = DateFormat.getDateTimeInstance(); + df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'"); + df.setTimeZone(TimeZone.getTimeZone("UTC")); + assertThat(instant.toString()).isEqualTo(df.format(timestamp).toString()); + } +} From cc6af7ae4b70808e8e516f5b3771f1ace1c9f92b Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Mon, 5 Nov 2018 23:39:13 +0530 Subject: [PATCH 317/546] BAEL-10181 Fix tutorial-build-second | Issue with spring-mvc-kotlin -Upgraded kotlin libraries --- parent-kotlin/pom.xml | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/parent-kotlin/pom.xml b/parent-kotlin/pom.xml index 0a04da7dc2..f8283bd920 100644 --- a/parent-kotlin/pom.xml +++ b/parent-kotlin/pom.xml @@ -13,29 +13,29 @@ 1.0.0-SNAPSHOT
- - - jcenter - http://jcenter.bintray.com - - - kotlin-ktor - https://dl.bintray.com/kotlin/ktor/ - - - kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap - - - - + + + jcenter + http://jcenter.bintray.com + + + kotlin-ktor + https://dl.bintray.com/kotlin/ktor/ + + + kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap + + + + kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap - - + + org.springframework.boot @@ -202,9 +202,9 @@
- 1.3.0-rc-146 - 0.26.1-eap13 - 0.9.3 + 1.3.0 + 1.0.0 + 0.9.5 3.11.0 1.2.0 From 807f25e992dabab4bf909424b48c58b5e0f8010b Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Mon, 5 Nov 2018 21:27:46 +0200 Subject: [PATCH 318/546] using the boot parent --- spring-boot-security/pom.xml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/spring-boot-security/pom.xml b/spring-boot-security/pom.xml index 6bc013d1ed..d5c7976ba2 100644 --- a/spring-boot-security/pom.xml +++ b/spring-boot-security/pom.xml @@ -3,29 +3,17 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-security - 0.0.1-SNAPSHOT jar spring-boot-security Spring Boot Security Auto-Configuration + parent-boot-1 com.baeldung - parent-modules - 1.0.0-SNAPSHOT + 0.0.1-SNAPSHOT + ../parent-boot-1 - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - - org.springframework.boot @@ -39,7 +27,7 @@ org.springframework.boot spring-boot-starter-web - + org.springframework.security @@ -74,14 +62,8 @@ org.springframework.boot spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - 1.5.9.RELEASE - 2.0.4.RELEASE - - From da1a2cb3598d860cc7522712ad2ac79e592e012f Mon Sep 17 00:00:00 2001 From: Loredana Date: Mon, 5 Nov 2018 21:33:19 +0200 Subject: [PATCH 319/546] rename package, add java init --- .../java/com/baeldung/AppInitializer.java | 33 +++++++++++++++++++ .../controller/SecuredResourceController.java | 2 +- .../security/CustomAccessDeniedHandler.java | 2 +- .../CustomAuthenticationFailureHandler.java | 2 +- .../security/CustomLogoutSuccessHandler.java | 2 +- .../RefererAuthenticationSuccessHandler.java | 2 +- .../spring/ChannelSecSecurityConfig.java | 5 +-- .../baeldung/spring/MvcConfig.java | 2 +- .../spring/RedirectionSecurityConfig.java | 2 +- .../baeldung/spring/SecSecurityConfig.java | 9 ++--- .../webapp/WEB-INF/{web.xml => web-old.xml} | 2 +- .../SpringContextIntegrationTest.java | 2 +- .../baeldung/security/FormLoginUnitTest.java | 5 +-- .../RedirectionSecurityIntegrationTest.java | 2 +- 14 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/controller/SecuredResourceController.java (93%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/security/CustomAccessDeniedHandler.java (97%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/security/CustomAuthenticationFailureHandler.java (96%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/security/CustomLogoutSuccessHandler.java (96%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/security/RefererAuthenticationSuccessHandler.java (93%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/spring/ChannelSecSecurityConfig.java (96%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/spring/MvcConfig.java (97%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/spring/RedirectionSecurityConfig.java (97%) rename spring-security-mvc-login/src/main/java/{org => com}/baeldung/spring/SecSecurityConfig.java (94%) rename spring-security-mvc-login/src/main/webapp/WEB-INF/{web.xml => web-old.xml} (97%) rename spring-security-mvc-login/src/test/java/{org => com}/baeldung/SpringContextIntegrationTest.java (95%) rename spring-security-mvc-login/src/test/java/{org => com}/baeldung/security/FormLoginUnitTest.java (96%) rename spring-security-mvc-login/src/test/java/{org => com}/baeldung/security/RedirectionSecurityIntegrationTest.java (99%) diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java b/spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java new file mode 100644 index 0000000000..4f38d190eb --- /dev/null +++ b/spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java @@ -0,0 +1,33 @@ +package com.baeldung; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRegistration; + +import org.springframework.web.WebApplicationInitializer; +import org.springframework.web.context.ContextLoaderListener; +import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; +import org.springframework.web.context.support.GenericWebApplicationContext; +import org.springframework.web.filter.DelegatingFilterProxy; +import org.springframework.web.servlet.DispatcherServlet; + +public class AppInitializer implements WebApplicationInitializer { + + @Override + public void onStartup(final ServletContext sc) throws ServletException { + + AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext(); + + root.scan("com.baeldung"); + sc.addListener(new ContextLoaderListener(root)); + + ServletRegistration.Dynamic appServlet = sc.addServlet("mvc", new DispatcherServlet(new GenericWebApplicationContext())); + appServlet.setLoadOnStartup(1); + appServlet.addMapping("/"); + + sc.addFilter("securityFilter", new DelegatingFilterProxy("springSecurityFilterChain")) + .addMappingForUrlPatterns(null, false, "/*"); + + } + +} diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/controller/SecuredResourceController.java b/spring-security-mvc-login/src/main/java/com/baeldung/controller/SecuredResourceController.java similarity index 93% rename from spring-security-mvc-login/src/main/java/org/baeldung/controller/SecuredResourceController.java rename to spring-security-mvc-login/src/main/java/com/baeldung/controller/SecuredResourceController.java index 4b68eee983..a458a5aeac 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/controller/SecuredResourceController.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/controller/SecuredResourceController.java @@ -1,4 +1,4 @@ -package org.baeldung.controller; +package com.baeldung.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/security/CustomAccessDeniedHandler.java b/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAccessDeniedHandler.java similarity index 97% rename from spring-security-mvc-login/src/main/java/org/baeldung/security/CustomAccessDeniedHandler.java rename to spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAccessDeniedHandler.java index 64698072bc..9d9fa81dc0 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/security/CustomAccessDeniedHandler.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAccessDeniedHandler.java @@ -1,4 +1,4 @@ -package org.baeldung.security; +package com.baeldung.security; import java.io.IOException; diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/security/CustomAuthenticationFailureHandler.java b/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAuthenticationFailureHandler.java similarity index 96% rename from spring-security-mvc-login/src/main/java/org/baeldung/security/CustomAuthenticationFailureHandler.java rename to spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAuthenticationFailureHandler.java index 5eddf3883e..410d3f1ce9 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/security/CustomAuthenticationFailureHandler.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAuthenticationFailureHandler.java @@ -1,4 +1,4 @@ -package org.baeldung.security; +package com.baeldung.security; import org.springframework.http.HttpStatus; import org.springframework.security.core.AuthenticationException; diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/security/CustomLogoutSuccessHandler.java b/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomLogoutSuccessHandler.java similarity index 96% rename from spring-security-mvc-login/src/main/java/org/baeldung/security/CustomLogoutSuccessHandler.java rename to spring-security-mvc-login/src/main/java/com/baeldung/security/CustomLogoutSuccessHandler.java index 7360b4e03f..7949eee69a 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/security/CustomLogoutSuccessHandler.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomLogoutSuccessHandler.java @@ -1,4 +1,4 @@ -package org.baeldung.security; +package com.baeldung.security; import java.io.IOException; diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/security/RefererAuthenticationSuccessHandler.java b/spring-security-mvc-login/src/main/java/com/baeldung/security/RefererAuthenticationSuccessHandler.java similarity index 93% rename from spring-security-mvc-login/src/main/java/org/baeldung/security/RefererAuthenticationSuccessHandler.java rename to spring-security-mvc-login/src/main/java/com/baeldung/security/RefererAuthenticationSuccessHandler.java index 5b025d9fd1..05a2463699 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/security/RefererAuthenticationSuccessHandler.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/security/RefererAuthenticationSuccessHandler.java @@ -1,4 +1,4 @@ -package org.baeldung.security; +package com.baeldung.security; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler; diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/ChannelSecSecurityConfig.java b/spring-security-mvc-login/src/main/java/com/baeldung/spring/ChannelSecSecurityConfig.java similarity index 96% rename from spring-security-mvc-login/src/main/java/org/baeldung/spring/ChannelSecSecurityConfig.java rename to spring-security-mvc-login/src/main/java/com/baeldung/spring/ChannelSecSecurityConfig.java index 4f736360b9..e9a6a9e120 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/ChannelSecSecurityConfig.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/spring/ChannelSecSecurityConfig.java @@ -1,6 +1,5 @@ -package org.baeldung.spring; +package com.baeldung.spring; -import org.baeldung.security.CustomLogoutSuccessHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @@ -10,6 +9,8 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; +import com.baeldung.security.CustomLogoutSuccessHandler; + @Configuration // @ImportResource({ "classpath:channelWebSecurityConfig.xml" }) @EnableWebSecurity diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java similarity index 97% rename from spring-security-mvc-login/src/main/java/org/baeldung/spring/MvcConfig.java rename to spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java index b529048685..a9c7e0cf15 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/MvcConfig.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.spring; +package com.baeldung.spring; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/RedirectionSecurityConfig.java b/spring-security-mvc-login/src/main/java/com/baeldung/spring/RedirectionSecurityConfig.java similarity index 97% rename from spring-security-mvc-login/src/main/java/org/baeldung/spring/RedirectionSecurityConfig.java rename to spring-security-mvc-login/src/main/java/com/baeldung/spring/RedirectionSecurityConfig.java index 1472a1f89c..3516438a6e 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/RedirectionSecurityConfig.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/spring/RedirectionSecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.spring; +package com.baeldung.spring; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-mvc-login/src/main/java/com/baeldung/spring/SecSecurityConfig.java similarity index 94% rename from spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java rename to spring-security-mvc-login/src/main/java/com/baeldung/spring/SecSecurityConfig.java index 97ce6b5bc2..08a83f8633 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java +++ b/spring-security-mvc-login/src/main/java/com/baeldung/spring/SecSecurityConfig.java @@ -1,8 +1,5 @@ -package org.baeldung.spring; +package com.baeldung.spring; -import org.baeldung.security.CustomAccessDeniedHandler; -import org.baeldung.security.CustomAuthenticationFailureHandler; -import org.baeldung.security.CustomLogoutSuccessHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @@ -16,6 +13,10 @@ import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.authentication.AuthenticationFailureHandler; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; +import com.baeldung.security.CustomAccessDeniedHandler; +import com.baeldung.security.CustomAuthenticationFailureHandler; +import com.baeldung.security.CustomLogoutSuccessHandler; + @Configuration // @ImportResource({ "classpath:webSecurityConfig.xml" }) @EnableWebSecurity diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/web.xml b/spring-security-mvc-login/src/main/webapp/WEB-INF/web-old.xml similarity index 97% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/web.xml rename to spring-security-mvc-login/src/main/webapp/WEB-INF/web-old.xml index eef48ec9b3..bc6f310147 100644 --- a/spring-security-mvc-login/src/main/webapp/WEB-INF/web.xml +++ b/spring-security-mvc-login/src/main/webapp/WEB-INF/web-old.xml @@ -15,7 +15,7 @@ contextConfigLocation - org.baeldung.spring + com.baeldung.spring diff --git a/spring-security-mvc-login/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-mvc-login/src/test/java/com/baeldung/SpringContextIntegrationTest.java similarity index 95% rename from spring-security-mvc-login/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to spring-security-mvc-login/src/test/java/com/baeldung/SpringContextIntegrationTest.java index 1d7f9ae497..20de02d5c5 100644 --- a/spring-security-mvc-login/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ b/spring-security-mvc-login/src/test/java/com/baeldung/SpringContextIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung; +package com.baeldung; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-security-mvc-login/src/test/java/org/baeldung/security/FormLoginUnitTest.java b/spring-security-mvc-login/src/test/java/com/baeldung/security/FormLoginUnitTest.java similarity index 96% rename from spring-security-mvc-login/src/test/java/org/baeldung/security/FormLoginUnitTest.java rename to spring-security-mvc-login/src/test/java/com/baeldung/security/FormLoginUnitTest.java index 4b3a091e6c..b7d959bf36 100644 --- a/spring-security-mvc-login/src/test/java/org/baeldung/security/FormLoginUnitTest.java +++ b/spring-security-mvc-login/src/test/java/com/baeldung/security/FormLoginUnitTest.java @@ -1,6 +1,5 @@ -package org.baeldung.security; +package com.baeldung.security; -import org.baeldung.spring.SecSecurityConfig; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,6 +12,8 @@ import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; +import com.baeldung.spring.SecSecurityConfig; + import javax.servlet.Filter; import static org.junit.Assert.assertTrue; diff --git a/spring-security-mvc-login/src/test/java/org/baeldung/security/RedirectionSecurityIntegrationTest.java b/spring-security-mvc-login/src/test/java/com/baeldung/security/RedirectionSecurityIntegrationTest.java similarity index 99% rename from spring-security-mvc-login/src/test/java/org/baeldung/security/RedirectionSecurityIntegrationTest.java rename to spring-security-mvc-login/src/test/java/com/baeldung/security/RedirectionSecurityIntegrationTest.java index 2b7a8ce5b9..1235e2e69f 100644 --- a/spring-security-mvc-login/src/test/java/org/baeldung/security/RedirectionSecurityIntegrationTest.java +++ b/spring-security-mvc-login/src/test/java/com/baeldung/security/RedirectionSecurityIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.security; +package com.baeldung.security; import org.junit.Before; import org.junit.Test; From 433bb89de6eec5b84eb9e100d6ff87601f637967 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 6 Nov 2018 01:34:08 +0530 Subject: [PATCH 320/546] BAEL-10181 Fix tutorial-build-second | Issue with spring-mvc-kotlin (#5623) -Upgraded kotlin libraries --- parent-kotlin/pom.xml | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/parent-kotlin/pom.xml b/parent-kotlin/pom.xml index 0a04da7dc2..f8283bd920 100644 --- a/parent-kotlin/pom.xml +++ b/parent-kotlin/pom.xml @@ -13,29 +13,29 @@ 1.0.0-SNAPSHOT
- - - jcenter - http://jcenter.bintray.com - - - kotlin-ktor - https://dl.bintray.com/kotlin/ktor/ - - - kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap - - - - + + + jcenter + http://jcenter.bintray.com + + + kotlin-ktor + https://dl.bintray.com/kotlin/ktor/ + + + kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap + + + + kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap - - + + org.springframework.boot @@ -202,9 +202,9 @@ - 1.3.0-rc-146 - 0.26.1-eap13 - 0.9.3 + 1.3.0 + 1.0.0 + 0.9.5 3.11.0 1.2.0 From e52a4d0ce65641d5730698da34e388748d0c9316 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Mon, 5 Nov 2018 23:51:10 +0000 Subject: [PATCH 321/546] Handshake failures (#5624) * BAEL-2250: Adding files for the article on SSL handshake failure. * BAEL-2250 cleanup formatting * Applied review feedback on the article. * Adding cipher suite and protocol selection in server and client * Corrected some code conventions. * Revert: BAEL-2250 cleanup formatting * Made further changes for the review comments on the tutorial. * Fixed some formatting issues. --- .../com/baeldung/ssl/example/SimpleClient.java | 14 +++++++++----- .../com/baeldung/ssl/example/SimpleServer.java | 8 ++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java b/core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java index c641a58a78..d6efc34c3e 100644 --- a/core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java +++ b/core-java/src/main/java/com/baeldung/ssl/example/SimpleClient.java @@ -8,22 +8,26 @@ import java.net.Socket; import javax.net.SocketFactory; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.SSLParameters; public class SimpleClient { - static void startClient(String host, int port) throws IOException { + static String startClient(String host, int port) throws IOException { SocketFactory factory = SSLSocketFactory.getDefault(); + try (Socket connection = factory.createSocket(host, port)) { ((SSLSocket) connection).setEnabledCipherSuites( new String[] { "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"}); ((SSLSocket) connection).setEnabledProtocols( new String[] { "TLSv1.2"}); - BufferedReader input = new BufferedReader( - new InputStreamReader(connection.getInputStream())); - System.out.println(input.readLine()); + SSLParameters sslParams = new SSLParameters(); + sslParams.setEndpointIdentificationAlgorithm("HTTPS"); + ((SSLSocket) connection).setSSLParameters(sslParams); + BufferedReader input = new BufferedReader(new InputStreamReader(connection.getInputStream())); + return input.readLine(); } } public static void main(String[] args) throws IOException { - startClient("localhost", 1234); + System.out.println(startClient("localhost", 8443)); } } diff --git a/core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java b/core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java index 3bbabdfbb8..27d15d04d7 100644 --- a/core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java +++ b/core-java/src/main/java/com/baeldung/ssl/example/SimpleServer.java @@ -4,7 +4,6 @@ import java.io.IOException; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; -import java.util.Date; import javax.net.ServerSocketFactory; import javax.net.ssl.SSLServerSocket; @@ -13,6 +12,7 @@ import javax.net.ssl.SSLServerSocketFactory; public class SimpleServer { static void startServer(int port) throws IOException { ServerSocketFactory factory = SSLServerSocketFactory.getDefault(); + try (ServerSocket listener = factory.createServerSocket(port)) { ((SSLServerSocket) listener).setNeedClientAuth(true); ((SSLServerSocket) listener).setEnabledCipherSuites( @@ -22,13 +22,13 @@ public class SimpleServer { while (true) { try (Socket socket = listener.accept()) { PrintWriter out = new PrintWriter(socket.getOutputStream(), true); - out.println(new Date().toString()); + out.println("Hello World!"); } } } } public static void main(String[] args) throws IOException { - startServer(1234); + startServer(8443); } -} +} \ No newline at end of file From 3c558d642798f3f977f7466463649bbfdc65b8a6 Mon Sep 17 00:00:00 2001 From: Sandip Singh Date: Tue, 6 Nov 2018 14:21:19 +0530 Subject: [PATCH 322/546] BAEL-2303 Updated the code as per the review comments. --- .../baeldung/reducingIfElse/AddCommand.java | 14 ++++---- .../com/baeldung/reducingIfElse/AddRule.java | 4 +-- .../baeldung/reducingIfElse/Calculator.java | 5 ++- .../com/baeldung/reducingIfElse/Command.java | 8 ++--- .../com/baeldung/reducingIfElse/Result.java | 13 ++++++++ .../com/baeldung/reducingIfElse/Rule.java | 2 +- .../baeldung/reducingIfElse/RuleEngine.java | 10 ++++-- .../reduceIfelse/CalculatorUnitTest.java | 32 +++++++++++++++++++ .../reduceIfelse/RuleEngineUnitTest.java | 12 +++---- 9 files changed, 70 insertions(+), 30 deletions(-) create mode 100644 core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java create mode 100644 core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java index 5aa0de7adc..279a3b2c55 100644 --- a/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddCommand.java @@ -1,19 +1,17 @@ package com.baeldung.reducingIfElse; -public class AddCommand implements Command { +public class AddCommand implements Command { private int a; private int b; + public AddCommand(int a, int b) { + this.a = a; + this.b = b; + } + @Override public Integer execute() { return a + b; } - - @Override - public Command takeInput(Integer a, Integer b) { - this.a = a; - this.b = b; - return this; - } } diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java index 871ff1f2d1..f24c973ead 100644 --- a/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/AddRule.java @@ -15,7 +15,7 @@ public class AddRule implements Rule { } @Override - public int getResult() { - return result; + public Result getResult() { + return new Result(result); } } diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java index 9b8cce130f..550d92e183 100644 --- a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Calculator.java @@ -77,8 +77,7 @@ public class Calculator { return targetOperation.apply(a, b); } - public int calculate(int a, int b, Command command) { - return command.takeInput(a, b) - .execute(); + public int calculate(Command command) { + return command.execute(); } } diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java index d9f00e31b4..c084fcc6a0 100644 --- a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Command.java @@ -1,7 +1,5 @@ package com.baeldung.reducingIfElse; -public interface Command { - R execute(); - - Command takeInput(A a, B b); -} +public interface Command { + Integer execute(); +} \ No newline at end of file diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java new file mode 100644 index 0000000000..d5ed12202e --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Result.java @@ -0,0 +1,13 @@ +package com.baeldung.reducingIfElse; + +public class Result { + int value; + + public Result(int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java index 202072dd66..5a6c84b0f9 100644 --- a/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/Rule.java @@ -4,5 +4,5 @@ public interface Rule { boolean evaluate(Expression expression); - int getResult(); + Result getResult(); } diff --git a/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java b/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java index 3af67aff11..ac56915dee 100644 --- a/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java +++ b/core-java-8/src/main/java/com/baeldung/reducingIfElse/RuleEngine.java @@ -2,6 +2,7 @@ package com.baeldung.reducingIfElse; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; public class RuleEngine { @@ -12,9 +13,12 @@ public class RuleEngine { rules.add(new AddRule()); } - public List process(Expression expression) { - return rules.stream() + public Result process(Expression expression) { + + Rule rule = rules.stream() .filter(r -> r.evaluate(expression)) - .collect(Collectors.toList()); + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("Expression does not matches any Rule")); + return rule.getResult(); } } diff --git a/core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java b/core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java new file mode 100644 index 0000000000..fa351930d8 --- /dev/null +++ b/core-java-8/src/test/java/com/baeldung/reduceIfelse/CalculatorUnitTest.java @@ -0,0 +1,32 @@ +package com.baeldung.reduceIfelse; + +import com.baeldung.reducingIfElse.AddCommand; +import com.baeldung.reducingIfElse.Calculator; +import com.baeldung.reducingIfElse.Operator; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class CalculatorUnitTest { + + @Test + public void whenCalculateUsingStringOperator_thenReturnCorrectResult() { + Calculator calculator = new Calculator(); + int result = calculator.calculate(3, 4, "add"); + assertEquals(7, result); + } + + @Test + public void whenCalculateUsingEnumOperator_thenReturnCorrectResult() { + Calculator calculator = new Calculator(); + int result = calculator.calculate(3, 4, Operator.valueOf("ADD")); + assertEquals(7, result); + } + + @Test + public void whenCalculateUsingCommand_thenReturnCorrectResult() { + Calculator calculator = new Calculator(); + int result = calculator.calculate(new AddCommand(3, 7)); + assertEquals(10, result); + } +} diff --git a/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java b/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java index 227dd12f0d..4a30b3efac 100644 --- a/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java +++ b/core-java-8/src/test/java/com/baeldung/reduceIfelse/RuleEngineUnitTest.java @@ -2,12 +2,10 @@ package com.baeldung.reduceIfelse; import com.baeldung.reducingIfElse.Expression; import com.baeldung.reducingIfElse.Operator; -import com.baeldung.reducingIfElse.Rule; +import com.baeldung.reducingIfElse.Result; import com.baeldung.reducingIfElse.RuleEngine; import org.junit.Test; -import java.util.List; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -17,11 +15,9 @@ public class RuleEngineUnitTest { public void whenNumbersGivenToRuleEngine_thenReturnCorrectResult() { Expression expression = new Expression(5, 5, Operator.ADD); RuleEngine engine = new RuleEngine(); - List rules = engine.process(expression); + Result result = engine.process(expression); - assertNotNull(rules); - assertEquals(1, rules.size()); - assertEquals(10, rules.get(0) - .getResult()); + assertNotNull(result); + assertEquals(10, result.getValue()); } } From ee0d4c103a288a2e6393764d95c63e185b45e51a Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Tue, 6 Nov 2018 10:46:21 -0800 Subject: [PATCH 323/546] BAEL-2250 updated readme (#5631) --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index 35fdcd9132..856cc58097 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -157,3 +157,4 @@ - [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) - [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) - [Understanding Memory Leaks in Java](https://www.baeldung.com/java-memory-leaks) +- [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) From 5a5c5c34b50892b96900a744464efdc9482a496b Mon Sep 17 00:00:00 2001 From: Marko Previsic Date: Wed, 7 Nov 2018 01:24:41 +0100 Subject: [PATCH 324/546] Guide to BufferedReader Issue: BAEL-2255 --- .../bufferedreader/BufferedReaderExample.java | 84 +++++++++++++++++++ core-java-io/src/main/resources/input.txt | 45 ++++++++++ .../BufferedReaderExampleUnitTest.java | 75 +++++++++++++++++ .../BufferedReaderUnitTest.java | 58 +++++++++++++ 4 files changed, 262 insertions(+) create mode 100644 core-java-io/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java create mode 100644 core-java-io/src/main/resources/input.txt create mode 100644 core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java create mode 100644 core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java diff --git a/core-java-io/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java b/core-java-io/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java new file mode 100644 index 0000000000..c7f0e878ac --- /dev/null +++ b/core-java-io/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java @@ -0,0 +1,84 @@ +package com.baeldung.bufferedreader; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.stream.Collectors; + +public class BufferedReaderExample { + + public String readAllLines(BufferedReader reader) throws IOException { + StringBuilder content = new StringBuilder(); + String line; + + while ((line = reader.readLine()) != null) { + content.append(line); + content.append(System.lineSeparator()); + } + + return content.toString(); + } + + public String readAllLinesWithStream(BufferedReader reader) { + return reader + .lines() + .collect(Collectors.joining(System.lineSeparator())); + } + + public String readAllCharsOneByOne(BufferedReader reader) throws IOException { + StringBuilder content = new StringBuilder(); + + int value; + while ((value = reader.read()) != -1) { + content.append((char) value); + } + + return content.toString(); + } + + public String readMultipleChars(BufferedReader reader) throws IOException { + int length = 5; + char[] chars = new char[length]; + int charsRead = reader.read(chars, 0, length); + + String result; + if (charsRead != -1) { + result = new String(chars, 0, charsRead); + } else { + result = ""; + } + + return result; + } + + public String readFile() { + BufferedReader reader = null; + try { + reader = new BufferedReader(new FileReader("src/main/resources/input.txt")); + String content = readAllLines(reader); + return content; + } catch (IOException e) { + e.printStackTrace(); + return null; + } finally { + try { + if (reader != null) { + reader.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + public String readFileTryWithResources() { + try (BufferedReader reader = new BufferedReader(new FileReader("src/main/resources/input.txt"))) { + String content = readAllLines(reader); + return content; + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + +} diff --git a/core-java-io/src/main/resources/input.txt b/core-java-io/src/main/resources/input.txt new file mode 100644 index 0000000000..650da894e8 --- /dev/null +++ b/core-java-io/src/main/resources/input.txt @@ -0,0 +1,45 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In lacus enim, scelerisque id sapien ut, semper euismod quam. Nunc ullamcorper semper blandit. Praesent quis quam mollis, iaculis lectus a, fringilla leo. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis vitae auctor mauris. Pellentesque eu pellentesque lorem, vel ultricies libero. Pellentesque vestibulum sagittis eros. In vestibulum lacus elit. Interdum et malesuada fames ac ante ipsum primis in faucibus. + +Vivamus pharetra lacus fringilla nisl molestie eleifend. Donec et dolor non quam mattis mattis. Proin malesuada maximus elit id semper. Donec facilisis dolor ut feugiat auctor. Proin accumsan semper consectetur. Vivamus facilisis odio vel bibendum imperdiet. Sed rutrum nisi nec nisi interdum fringilla. Aliquam laoreet velit ullamcorper egestas ultrices. Aliquam ultricies sem sed orci interdum, eu porta purus malesuada. Sed accumsan, nunc ut maximus rhoncus, arcu ante pretium ex, non ultrices magna nisi et velit. Pellentesque tempor mi quis lacus consectetur, quis imperdiet enim efficitur. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. + +Nunc sed maximus erat. Aenean imperdiet finibus massa ac aliquam. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis dignissim cursus purus, eu tempus urna. Nunc sed mauris scelerisque, luctus eros ut, viverra nisi. Maecenas congue sed ligula in eleifend. Praesent nec dignissim enim, dictum efficitur massa. Nullam eros dui, rutrum quis aliquam accumsan, sollicitudin cursus eros. Phasellus euismod, lorem vitae vehicula ullamcorper, leo lorem vestibulum magna, vitae malesuada libero ipsum id lorem. Aenean finibus turpis facilisis tortor bibendum, vitae dignissim dolor dictum. Ut quis ornare nisi, non rutrum sapien. + +Etiam placerat, est eget placerat imperdiet, neque urna tristique est, a dictum nisl dolor vitae leo. Vivamus porttitor mi vitae volutpat ultrices. Quisque at ante porta mauris ultricies iaculis. Phasellus iaculis sollicitudin urna nec facilisis. Suspendisse dapibus vulputate scelerisque. Fusce felis diam, eleifend in tristique in, malesuada a purus. Suspendisse euismod ipsum sed urna imperdiet, quis venenatis lacus dapibus. Maecenas vitae est vel sem fringilla ornare at ut mi. Quisque porta, nulla at rutrum fringilla, mi ligula egestas libero, ac convallis elit diam et sapien. Vestibulum purus tortor, ornare ut enim sed, mattis lobortis erat. Maecenas ac ante tincidunt, euismod mauris a, fermentum diam. Nullam arcu est, consequat sed enim in, bibendum aliquet velit. Donec bibendum magna ac augue sagittis vehicula. Curabitur nec mauris eu augue bibendum volutpat. Fusce fringilla varius fringilla. + +Aliquam faucibus massa non orci accumsan, porta consectetur diam vulputate. Nullam nec erat mollis, imperdiet libero nec, tincidunt neque. Aenean varius purus nec est auctor, sed vulputate libero varius. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vel neque elit. Donec vulputate fermentum nulla, ut aliquam neque tempor in. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec vel venenatis est. Suspendisse luctus elit quis dui dapibus, id sodales dolor cursus. Curabitur ut vehicula dui. Fusce aliquet est et ante feugiat, et tempus ex congue. Nunc eget dapibus leo. Nunc eu accumsan diam. Suspendisse risus eros, rutrum et volutpat in, consequat in nulla. Suspendisse id felis a orci accumsan iaculis. + +Duis tincidunt diam eget tortor aliquet sodales. Etiam sodales purus ac urna mollis, et cursus enim porttitor. Nulla viverra ligula nunc, ornare condimentum felis posuere sed. Fusce aliquet pretium sagittis. Sed ac mi elementum massa dictum ornare. Integer quis dapibus lectus. Curabitur in rhoncus justo, et vulputate justo. Integer eget efficitur felis. + +Sed finibus vel tortor ac egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vestibulum nulla mi, blandit efficitur sapien fermentum eu. Integer sed turpis eros. Phasellus sed aliquam ligula. Etiam dictum quam in dapibus mattis. Donec et tristique quam. Pellentesque gravida luctus dolor, eu ornare sapien. Donec justo ante, lacinia non sem et, ultricies dignissim nibh. Vivamus eu nisl et magna pulvinar efficitur. Sed at vehicula lectus, sit amet luctus sem. Morbi vehicula sapien nisi, nec sagittis orci vestibulum et. + +Praesent non finibus diam. Quisque sit amet nisl vitae augue lobortis commodo. Morbi ullamcorper, tortor id ornare maximus, erat ipsum ullamcorper ipsum, in imperdiet diam sem vel erat. Sed pellentesque quis ex sed volutpat. Vestibulum volutpat diam ac dignissim sollicitudin. Praesent at luctus ex, at volutpat dui. Nunc nulla dui, lobortis et pharetra quis, efficitur in turpis. Donec sodales auctor purus id mollis. Sed auctor eu erat eget bibendum. Mauris tincidunt ornare neque id consequat. Suspendisse non massa ante. Quisque velit enim, rhoncus at erat eget, scelerisque placerat elit. Donec finibus luctus dolor. In sed eleifend lorem. Sed tempor ullamcorper lorem nec tristique. Fusce nec volutpat neque, id elementum est. + +Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum mattis elementum tellus, vitae maximus nulla eleifend ut. Vestibulum eu nibh vulputate, posuere felis eget, aliquet ex. Nullam leo ex, lacinia a ante ac, accumsan efficitur ligula. Vestibulum ornare gravida tempus. Proin rhoncus felis sit amet dolor commodo facilisis. Integer aliquet, diam sed pharetra feugiat, sem massa mollis orci, eget pretium libero nunc at quam. Ut rhoncus quam vitae massa hendrerit, ornare condimentum odio varius. Donec odio sapien, tristique eget libero ac, interdum facilisis odio. Phasellus nec mauris vel dolor semper mattis et quis ligula. Donec nec porttitor nunc. Integer maximus quam vitae sem gravida, ut commodo ex porttitor. + +Sed cursus nisi turpis, vel laoreet massa blandit ut. Cras posuere velit nulla, nec pellentesque ipsum dignissim eget. Donec pharetra, ex et commodo viverra, leo dolor dapibus tellus, vel dignissim est sem ac lectus. Quisque a arcu dapibus, aliquet magna sed, rhoncus neque. Integer suscipit, nulla ac varius lacinia, orci metus scelerisque neque, a laoreet nibh risus vitae dolor. Pellentesque felis metus, pulvinar vel cursus id, ultrices non purus. Donec mi lectus, faucibus sit amet nunc at, sagittis pretium lectus. Fusce nec purus arcu. Mauris neque neque, blandit eget mi at, auctor tempus orci. Mauris sapien lorem, luctus nec tellus non, porttitor aliquam dui. + +Mauris non ex risus. Aliquam imperdiet in eros eget placerat. Sed congue sed sapien porta sollicitudin. Phasellus tempor hendrerit metus vitae tincidunt. Suspendisse congue nisi sed augue dapibus, at pretium ante mollis. Cras non posuere nulla. Proin malesuada finibus magna vel iaculis. Cras in dapibus lorem. Pellentesque volutpat dolor sit amet magna tincidunt mollis. Nunc et lectus sodales, accumsan est vitae, ornare augue. Maecenas malesuada arcu leo, eget blandit lectus porttitor et. Nam aliquam sapien sit amet purus consequat lobortis. Aenean varius, augue porta dignissim efficitur, felis velit dapibus leo, tincidunt ultricies magna felis id ligula. Duis hendrerit, lectus eu elementum euismod, elit lectus consequat mi, sit amet egestas justo massa ut urna. Proin eleifend interdum ultrices. + +Donec lacinia orci pharetra ornare tincidunt. Nulla facilisi. Maecenas malesuada dui ac elit sagittis tincidunt id dictum dolor. Quisque lobortis purus ac metus volutpat viverra. Proin finibus sapien ut odio semper consectetur. Sed gravida luctus egestas. Mauris pretium volutpat elit, at commodo arcu sagittis nec. Ut condimentum fringilla urna ac dignissim. Cras aliquam metus pulvinar, pulvinar nibh at, placerat arcu. Nulla ornare tortor sed lectus mollis, vitae fringilla tellus egestas. Vivamus efficitur tincidunt sapien, sed finibus mi congue eu. Nullam magna velit, lacinia vitae ligula eget, molestie consectetur felis. Suspendisse varius turpis orci, ac laoreet arcu accumsan sed. Fusce quis fermentum lacus, nec varius libero. Pellentesque ac odio ut justo lobortis elementum sit amet vehicula lorem. Nulla interdum nulla eget mi tristique, vitae egestas nunc egestas. + +Curabitur commodo libero eu elit tincidunt, quis placerat risus vehicula. Vestibulum vehicula id nunc iaculis fermentum. Aenean semper, tellus ac semper rutrum, justo lorem feugiat leo, quis vulputate neque dui non ligula. Etiam egestas, enim eget tempor porta, nunc est tristique ante, vel suscipit massa lorem vel diam. Donec faucibus ante id turpis rhoncus congue. Nullam laoreet, diam efficitur scelerisque consequat, ligula leo ultrices est, non fermentum elit mauris ut dolor. Morbi non porttitor lorem. Sed volutpat sapien et lorem porttitor, ultricies ultricies tellus congue. Mauris sodales, tortor nec sagittis finibus, dui odio aliquet nibh, in luctus sapien massa eu risus. Nulla in est sed ante molestie vehicula vel nec lectus. Fusce maximus a quam eget aliquam. Vivamus pulvinar quis nisi a maximus. Proin cursus lacus sapien, et hendrerit elit pretium a. Donec tellus lectus, consectetur id dolor a, luctus rutrum libero. Suspendisse auctor scelerisque dui, nec pellentesque felis viverra nec. Cras elit ex, varius sed pulvinar sed, suscipit ultrices lacus. + +Vivamus eu luctus lectus. Maecenas congue magna orci, quis semper nulla blandit vel. Phasellus dignissim risus placerat lacinia sagittis. Praesent at gravida nisi, at pulvinar diam. Nulla egestas lectus sed felis facilisis egestas. Curabitur posuere gravida urna eu vestibulum. Pellentesque at dolor gravida, placerat quam sit amet, fermentum ligula. Morbi fringilla, mi eget mollis dictum, neque dolor ullamcorper leo, a rutrum libero ipsum eget orci. Curabitur consectetur iaculis vestibulum. Suspendisse ultricies ligula et neque lacinia luctus. Sed dignissim neque id eros sollicitudin pellentesque. + +Donec et magna quis lectus pharetra finibus a fringilla sapien. Phasellus accumsan, erat eu sodales cursus, tortor elit dapibus risus, ut ornare neque arcu in tellus. Nam ac vehicula diam, at aliquam nisl. Cras in sem eget nisi ultrices rutrum sit amet eu velit. Sed molestie tellus eget ante scelerisque, sit amet pulvinar neque fringilla. Nunc volutpat facilisis egestas. Cras sodales dui ac massa egestas, in mattis leo rhoncus. Pellentesque vitae urna vehicula ipsum sodales suscipit. Sed commodo tempus fringilla. + +Etiam egestas elit vitae mi maximus fringilla quis eget libero. Fusce finibus ultrices tellus at molestie. Pellentesque posuere blandit elementum. Etiam eu erat eu urna hendrerit euismod. Nulla quis lectus rhoncus, ultricies urna eget, pretium neque. Cras sit amet ipsum sit amet purus rutrum ultricies nec vitae tortor. Sed tempor dapibus augue in pulvinar. Ut pretium sapien in malesuada accumsan. Donec eget ultrices erat, ut efficitur ligula. Sed posuere mauris est, nec convallis ipsum tempus non. + +Duis a ullamcorper ante. Quisque eu ultricies metus, at aliquet odio. Nullam tempus molestie augue ut varius. Fusce purus eros, dictum nec finibus sed, sodales et diam. Suspendisse sed mi purus. Donec eleifend ipsum diam, nec fringilla enim laoreet non. Phasellus condimentum, magna sit amet porttitor suscipit, arcu risus lobortis dolor, ac fringilla nibh nisl vel purus. Phasellus facilisis posuere orci sit amet tempus. Nam nec enim maximus, rhoncus felis a, rutrum diam. + +Suspendisse potenti. Donec vel tempor neque. In aliquet nulla in eleifend bibendum. Sed sapien sem, finibus in sodales vitae, euismod in sem. Phasellus nec elit a erat pulvinar semper. Aliquam luctus nisl in libero molestie aliquam. Nunc ac ornare felis. Ut non mauris ut ipsum rhoncus pretium. Curabitur tristique lacus a sagittis aliquam. Morbi vel volutpat tellus. Maecenas volutpat, lacus sed tempus imperdiet, eros tellus volutpat nisi, a egestas augue nulla quis arcu. In sollicitudin imperdiet efficitur. Suspendisse viverra aliquet nisi, congue ultrices arcu hendrerit in. + +Maecenas vitae vestibulum nunc. Nullam semper faucibus tincidunt. Etiam sed hendrerit risus. Proin gravida, urna nec tincidunt tempus, nulla sapien porttitor nibh, porttitor lobortis nunc quam et tortor. Praesent ut varius lacus, ut hendrerit enim. Ut nec turpis ac felis imperdiet bibendum. Phasellus porttitor enim odio, et vehicula mi convallis vel. Quisque porta scelerisque sagittis. Praesent dignissim sagittis vulputate. Aenean non justo ac est volutpat bibendum. Aliquam mattis, sapien dapibus pellentesque semper, velit urna malesuada diam, nec varius nibh eros at erat. Proin leo ante, ultricies id velit ut, faucibus porta nibh. Sed nec fermentum urna, sed mollis leo. Aliquam erat volutpat. + +Donec condimentum, urna sed hendrerit vestibulum, ante nibh lacinia dui, in tincidunt odio sem eget orci. In hac habitasse platea dictumst. Mauris id ex id ante tempus finibus eu sagittis erat. Quisque interdum urna risus, vel varius nibh euismod non. Nulla eget pellentesque quam. Aliquam vestibulum ac tortor non lobortis. Sed vitae erat sed libero dignissim dictum nec in turpis. Vivamus id ornare elit, ut facilisis lectus. Morbi dictum purus eget ipsum dignissim porttitor. Sed at vehicula purus, nec rhoncus quam. Nunc a nisl quis arcu blandit fermentum vel quis odio. Vivamus rhoncus, sapien sed lacinia hendrerit, velit urna fermentum dolor, id feugiat magna ligula sed urna. Proin euismod efficitur libero, eget porttitor lacus tempus quis. Duis tincidunt quis est a laoreet. Nam sit amet tristique nisl, sit amet mattis mi. + +Aenean id dictum nulla, sed laoreet magna. Morbi consectetur in turpis at aliquam. Maecenas rutrum feugiat metus, at ullamcorper augue fermentum ut. Vivamus in magna pretium nibh dictum rhoncus luctus at orci. In hac habitasse platea dictumst. Fusce convallis, nulla nec hendrerit suscipit, ipsum diam lobortis sem, vitae elementum lectus erat sit amet magna. Quisque sollicitudin fringilla purus, ac molestie justo congue vitae. Nulla sapien leo, ullamcorper ac tellus in, cursus rhoncus enim. Suspendisse rutrum magna non ex elementum elementum id vitae enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse ornare libero eu molestie pulvinar. Phasellus faucibus, magna eget rutrum porta, lorem turpis blandit lectus, eu viverra massa risus et ex. + +Ut consectetur eros lacus, ac ullamcorper lacus mattis a. Cras congue justo ut erat interdum, et scelerisque nisi malesuada. Quisque sed sapien sollicitudin purus tincidunt finibus vestibulum vel dolor. Cras iaculis bibendum erat, a dictum urna viverra et. Integer non neque vulputate, tincidunt purus nec, rutrum arcu. Aliquam nec magna non sem semper laoreet quis at quam. Mauris dui lectus, convallis eu efficitur at, facilisis nec lorem. Cras felis sem, egestas ac rutrum vel, mollis et ex. Aenean semper egestas libero, nec commodo mi blandit efficitur. Duis nec quam in massa dignissim sagittis vel vitae leo. Nam molestie hendrerit auctor. + +Sed suscipit egestas tellus sed cursus. Donec vel massa sit amet dui condimentum accumsan. Phasellus libero eros, lobortis a nisi id, porttitor maximus lectus. Praesent consectetur diam urna, id viverra turpis elementum in. Vivamus vitae pretium justo, nec tempor felis. Vivamus volutpat ultricies magna. Suspendisse vulputate lectus ac orci volutpat ullamcorper. Nulla eu leo pretium, commodo arcu accumsan, tempor nisl. Fusce sit amet tellus a ipsum vehicula laoreet sed vitae mauris. Duis porttitor massa mattis nibh placerat consequat. Fusce rutrum commodo tortor eget pellentesque. Suspendisse tempor enim libero, consequat dictum nibh dictum varius. Pellentesque feugiat sit amet urna sed facilisis. Curabitur a sagittis augue. \ No newline at end of file diff --git a/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java b/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java new file mode 100644 index 0000000000..9af00c086a --- /dev/null +++ b/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java @@ -0,0 +1,75 @@ +package com.baeldung.bufferedreader; + +import org.junit.Test; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; + +public class BufferedReaderExampleUnitTest { + + private static final String FILE_PATH = "src/main/resources/input.txt"; + + @Test + public void givenBufferedReader_whenReadAllLines_thenReturnsContent() throws IOException { + BufferedReader reader = new BufferedReader(new FileReader(FILE_PATH)); + + BufferedReaderExample bre = new BufferedReaderExample(); + String content = bre.readAllLines(reader); + + assertThat(content).isNotEmpty(); + assertThat(content).contains("Lorem ipsum"); + } + + @Test + public void givenBufferedReader_whenReadAllLinesWithStream_thenReturnsContent() throws IOException { + BufferedReader reader = new BufferedReader(new FileReader(FILE_PATH)); + + BufferedReaderExample bre = new BufferedReaderExample(); + String content = bre.readAllLinesWithStream(reader); + + assertThat(content).isNotEmpty(); + assertThat(content).contains("Lorem ipsum"); + } + + @Test + public void whenReadFile_thenReturnsContent() { + BufferedReaderExample bre = new BufferedReaderExample(); + String content = bre.readFile(); + + assertThat(content.toString()).contains("Lorem ipsum"); + } + + @Test + public void givenBufferedReader_whenReadAllCharsOneByOne_thenReturnsContent() throws IOException { + BufferedReader reader = new BufferedReader(new FileReader(FILE_PATH)); + + BufferedReaderExample bre = new BufferedReaderExample(); + String content = bre.readAllCharsOneByOne(reader); + + assertThat(content).isNotEmpty(); + assertThat(content).contains("Lorem ipsum"); + } + + @Test + public void givenBufferedReader_whenReadMultipleChars_thenReturnsContent() throws IOException { + BufferedReader reader = new BufferedReader(new FileReader(FILE_PATH)); + + BufferedReaderExample bre = new BufferedReaderExample(); + String content = bre.readMultipleChars(reader); + + assertThat(content).isNotEmpty(); + assertThat(content).isEqualTo("Lorem"); + } + + @Test + public void whenReadFileTryWithResources_thenReturnsContent() { + BufferedReaderExample bre = new BufferedReaderExample(); + String content = bre.readFileTryWithResources(); + + assertThat(content.toString()).contains("Lorem ipsum"); + } + +} diff --git a/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java b/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java new file mode 100644 index 0000000000..985eb05aec --- /dev/null +++ b/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java @@ -0,0 +1,58 @@ +package com.baeldung.bufferedreader; + +import org.junit.Test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class BufferedReaderUnitTest { + + private static final String FILE_PATH = "src/main/resources/input.txt"; + + @Test + public void givenBufferedReader_whenSkipUnderscores_thenOk() throws IOException { + StringBuilder result = new StringBuilder(); + + try (BufferedReader reader = new BufferedReader(new StringReader("1__2__3__4__5"))) { + int value; + while((value = reader.read()) != -1) { + result.append((char) value); + reader.skip(2L); + } + } + + assertEquals("12345", result.toString()); + } + + @Test + public void givenBufferedReader_whenSkipsWhitespacesAtBeginning_thenOk() throws IOException { + String result; + + try (BufferedReader reader = new BufferedReader(new StringReader(" Lorem ipsum dolor sit amet."))) { + do { + reader.mark(1); + } while(Character.isWhitespace(reader.read())); + + reader.reset(); + result = reader.readLine(); + } + + assertEquals("Lorem ipsum dolor sit amet.", result); + } + + @Test + public void whenCreatesNewBufferedReader_thenOk() throws IOException { + try(BufferedReader reader = Files.newBufferedReader(Paths.get(FILE_PATH))) { + assertNotNull(reader); + assertTrue(reader.ready()); + } + } + +} From edbc6830949cd334bb739d2d324d168f532c4573 Mon Sep 17 00:00:00 2001 From: Trevor Gowing Date: Wed, 7 Nov 2018 19:12:00 +0200 Subject: [PATCH 325/546] How to limit query results (#5616) * JPA/Hibernate * Spring Data JPA BAEL-2208 --- .../limit/CustomPassengerRepository.java | 8 ++ .../java/com/baeldung/limit/Passenger.java | 82 +++++++++++++++++++ .../baeldung/limit/PassengerRepository.java | 8 ++ .../limit/PassengerRepositoryImpl.java | 20 +++++ .../baeldung/limit/LimitIntegrationTest.java | 69 ++++++++++++++++ 5 files changed, 187 insertions(+) create mode 100644 persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/CustomPassengerRepository.java create mode 100644 persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java create mode 100644 persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepository.java create mode 100644 persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepositoryImpl.java create mode 100644 persistence-modules/spring-data-jpa/src/test/java/com/baeldung/limit/LimitIntegrationTest.java diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/CustomPassengerRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/CustomPassengerRepository.java new file mode 100644 index 0000000000..e9b5ba272f --- /dev/null +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/CustomPassengerRepository.java @@ -0,0 +1,8 @@ +package com.baeldung.limit; + +import java.util.List; + +interface CustomPassengerRepository { + + List findOrderedBySeatNumberLimitedTo(int limit); +} diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java new file mode 100644 index 0000000000..e7eb3af10b --- /dev/null +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java @@ -0,0 +1,82 @@ +package com.baeldung.limit; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import java.util.Objects; + +@Entity +class Passenger { + + @Id + @GeneratedValue + @Column(nullable = false) + private Long id; + + @Basic(optional = false) + @Column(nullable = false) + private String fistName; + + @Basic(optional = false) + @Column(nullable = false) + private String lastName; + + @Basic(optional = false) + @Column(nullable = false) + private int seatNumber; + + private Passenger(String fistName, String lastName, int seatNumber) { + this.fistName = fistName; + this.lastName = lastName; + this.seatNumber = seatNumber; + } + + static Passenger from(String firstName, String lastName, int seatNumber) { + return new Passenger(firstName, lastName, seatNumber); + } + + @Override + public boolean equals(Object object) { + if (this == object) + return true; + if (object == null || getClass() != object.getClass()) + return false; + Passenger passenger = (Passenger) object; + return getSeatNumber() == passenger.getSeatNumber() && Objects.equals(getFistName(), passenger.getFistName()) + && Objects.equals(getLastName(), passenger.getLastName()); + } + + @Override + public int hashCode() { + return Objects.hash(getFistName(), getLastName(), getSeatNumber()); + } + + @Override + public String toString() { + final StringBuilder toStringBuilder = new StringBuilder(getClass().getSimpleName()); + toStringBuilder.append("{ id=").append(id); + toStringBuilder.append(", fistName='").append(fistName).append('\''); + toStringBuilder.append(", lastName='").append(lastName).append('\''); + toStringBuilder.append(", seatNumber=").append(seatNumber); + toStringBuilder.append('}'); + return toStringBuilder.toString(); + } + + Long getId() { + return id; + } + + String getFistName() { + return fistName; + } + + String getLastName() { + return lastName; + } + + int getSeatNumber() { + return seatNumber; + } +} diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepository.java new file mode 100644 index 0000000000..6301f6e307 --- /dev/null +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepository.java @@ -0,0 +1,8 @@ +package com.baeldung.limit; + +import org.springframework.data.jpa.repository.JpaRepository; + +interface PassengerRepository extends JpaRepository, CustomPassengerRepository { + + Passenger findFirstByOrderBySeatNumberAsc(); +} diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepositoryImpl.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepositoryImpl.java new file mode 100644 index 0000000000..2d13eb7cad --- /dev/null +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepositoryImpl.java @@ -0,0 +1,20 @@ +package com.baeldung.limit; + +import org.springframework.stereotype.Repository; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import java.util.List; + +@Repository +class PassengerRepositoryImpl implements CustomPassengerRepository { + + @PersistenceContext + private EntityManager entityManager; + + @Override + public List findOrderedBySeatNumberLimitedTo(int limit) { + return entityManager.createQuery("SELECT p FROM Passenger p ORDER BY p.seatNumber", + Passenger.class).setMaxResults(limit).getResultList(); + } +} diff --git a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/limit/LimitIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/limit/LimitIntegrationTest.java new file mode 100644 index 0000000000..27e0ebdd9f --- /dev/null +++ b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/limit/LimitIntegrationTest.java @@ -0,0 +1,69 @@ +package com.baeldung.limit; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +@DataJpaTest +@RunWith(SpringRunner.class) +public class LimitIntegrationTest { + + @PersistenceContext + private EntityManager entityManager; + @Autowired + private PassengerRepository repository; + + @Before + public void before() { + entityManager.persist(Passenger.from("Jill", "Smith", 50)); + entityManager.persist(Passenger.from("Eve", "Jackson", 95)); + entityManager.persist(Passenger.from("Fred", "Bloggs", 22)); + entityManager.persist(Passenger.from("Ricki", "Bobbie", 36)); + entityManager.persist(Passenger.from("Siya", "Kolisi", 85)); + } + + @Test + public void givenSeveralPassengersWhenOrderedBySeatNumberLimitedToThenThePassengerInTheFirstFilledSeatIsReturned() { + Passenger expected = Passenger.from("Fred", "Bloggs", 22); + + List passengers = repository.findOrderedBySeatNumberLimitedTo(1); + + assertEquals(1, passengers.size()); + + Passenger actual = passengers.get(0); + assertEquals(actual, expected); + } + + @Test + public void givenSeveralPassengersWhenFindFirstByOrderBySeatNumberAscThenThePassengerInTheFirstFilledSeatIsReturned() { + Passenger expected = Passenger.from("Fred", "Bloggs", 22); + + Passenger actual = repository.findFirstByOrderBySeatNumberAsc(); + + assertEquals(actual, expected); + } + + @Test + public void givenSeveralPassengersWhenFindPageSortedByThenThePassengerInTheFirstFilledSeatIsReturned() { + Passenger expected = Passenger.from("Fred", "Bloggs", 22); + + Page page = repository.findAll(PageRequest.of(0, 1, Sort.by(Sort.Direction.ASC, "seatNumber"))); + + assertEquals(page.getContent().size(), 1); + + Passenger actual = page.getContent().get(0); + assertEquals(expected, actual); + } +} From 90135befd985b039340877699ef8e7f23c8972df Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Wed, 7 Nov 2018 20:34:58 +0100 Subject: [PATCH 326/546] added link --- core-java-concurrency/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-concurrency/README.md b/core-java-concurrency/README.md index eeb9a83748..fbe50c2dfa 100644 --- a/core-java-concurrency/README.md +++ b/core-java-concurrency/README.md @@ -30,3 +30,4 @@ - [Life Cycle of a Thread in Java](http://www.baeldung.com/java-thread-lifecycle) - [Runnable vs. Callable in Java](http://www.baeldung.com/java-runnable-callable) - [Brief Introduction to Java Thread.yield()](https://www.baeldung.com/java-thread-yield) +- [Print Even and Odd Numbers Using 2 Threads](https://www.baeldung.com/java-even-odd-numbers-with-2-threads) From 6f9e1fd10374914bd45656a483113f8764dee6e0 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Thu, 8 Nov 2018 15:13:12 +0530 Subject: [PATCH 327/546] BAEL-2300: Adding files for the tutorial on character encoding. --- .../encoding/CharacterEncodingExamples.java | 32 ++++++++++ .../CharacterEncodingExamplesUnitTest.java | 61 +++++++++++++++++++ core-java/src/test/resources/encoding.txt | 1 + 3 files changed, 94 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java create mode 100644 core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java create mode 100644 core-java/src/test/resources/encoding.txt diff --git a/core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java b/core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java new file mode 100644 index 0000000000..bdd92e37f6 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java @@ -0,0 +1,32 @@ +package com.baeldung.encoding; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; + +public class CharacterEncodingExamples { + + static String readFile(String filePath, String encoding) throws IOException { + File file = new File(filePath); + StringBuffer buffer = new StringBuffer(); + try (InputStreamReader isr = new InputStreamReader(new FileInputStream(file), encoding)) { + int data; + while ((data = isr.read()) != -1) { + buffer.append((char) data); + } + } + return buffer.toString(); + } + + static String convertToBinary(String input, String encoding) throws UnsupportedEncodingException { + byte[] bytes = input.getBytes(encoding); + StringBuffer buffer = new StringBuffer(); + for (int b : bytes) { + buffer.append(Integer.toBinaryString((b + 256) % 256)); + buffer.append(" "); + } + return buffer.toString(); + } +} diff --git a/core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java b/core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java new file mode 100644 index 0000000000..95b3605d95 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java @@ -0,0 +1,61 @@ +package com.baeldung.encoding; + +import java.io.IOException; + +import org.junit.Assert; +import org.junit.Test; + +public class CharacterEncodingExamplesUnitTest { + + @Test + public void givenTextFile_whenCalledWithEncodingASCII_thenProduceIncorrectResult() throws IOException { + Assert.assertEquals( + CharacterEncodingExamples.readFile( + "src/test/resources/encoding.txt", "US-ASCII"), + "The fa��ade pattern is a software-design pattern commonly used with object-oriented programming."); + } + + @Test + public void givenTextFile_whenCalledWithEncodingUTF8_thenProduceCorrectResult() throws IOException { + Assert.assertEquals( + CharacterEncodingExamples.readFile( + "src/test/resources/encoding.txt", "UTF-8"), + "The façade pattern is a software-design pattern commonly used with object-oriented programming."); + } + + @Test + public void givenCharacterA_whenConvertedtoBinaryWithEncodingASCII_thenProduceResult() throws IOException { + Assert.assertEquals( + CharacterEncodingExamples.convertToBinary("A", "US-ASCII"), + "1000001 "); + } + + @Test + public void givenCharacterA_whenConvertedtoBinaryWithEncodingUTF8_thenProduceResult() throws IOException { + Assert.assertEquals( + CharacterEncodingExamples.convertToBinary("A", "UTF-8"), + "1000001 "); + } + + @Test + public void givenCharacterCh_whenConvertedtoBinaryWithEncodingBig5_thenProduceResult() throws IOException { + Assert.assertEquals( + CharacterEncodingExamples.convertToBinary("語", "Big5"), + "10111011 1111001 "); + } + + @Test + public void givenCharacterCh_whenConvertedtoBinaryWithEncodingUTF8_thenProduceResult() throws IOException { + Assert.assertEquals( + CharacterEncodingExamples.convertToBinary("語", "UTF-8"), + "11101000 10101010 10011110 "); + } + + @Test + public void givenCharacterCh_whenConvertedtoBinaryWithEncodingUTF32_thenProduceResult() throws IOException { + Assert.assertEquals( + CharacterEncodingExamples.convertToBinary("語", "UTF-32"), + "0 0 10001010 10011110 "); + } + +} diff --git a/core-java/src/test/resources/encoding.txt b/core-java/src/test/resources/encoding.txt new file mode 100644 index 0000000000..e1cf027df0 --- /dev/null +++ b/core-java/src/test/resources/encoding.txt @@ -0,0 +1 @@ +The façade pattern is a software-design pattern commonly used with object-oriented programming. \ No newline at end of file From 6dd09ae35d94275b2515e419c79e10c71d87ad6b Mon Sep 17 00:00:00 2001 From: Rahul Srivastava Date: Thu, 8 Nov 2018 15:39:06 +0530 Subject: [PATCH 328/546] New line in Java for HTML and Changing HTML file --- .../string/AddingNewLineToString.java | 48 ++++++++++++------- .../main/java/com/baeldung/string/page.html | 29 +++++++++-- 2 files changed, 55 insertions(+), 22 deletions(-) diff --git a/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java b/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java index e828af4cb7..0b3fd2ca92 100644 --- a/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java +++ b/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java @@ -7,49 +7,63 @@ public class AddingNewLineToString { String line2 = "Humpty Dumpty had a great fall."; String para = ""; + System.out.println("***New Line in a String in Java***"); //1. Using "\n" System.out.println("1. Using \\n"); - para = line1+"\n"+line2; + para = line1 + "\n" + line2; System.out.println(para); //2. Using "\r\n" System.out.println("2. Using \\r\\n"); - para = line1+"\r\n"+line2; + para = line1 + "\r\n" + line2; System.out.println(para); //3. Using "\r" System.out.println("3. Using \\r"); - para = line1+"\r"+line2; + para = line1 + "\r" + line2; System.out.println(para); //4. Using "\n\r" Note that this is not same as "\r\n" // Using "\n\r" is equivalent to adding two lines System.out.println("4. Using \\n\\r"); - para = line1+"\n\r"+line2; + para = line1 + "\n\r" + line2; System.out.println(para); //5. Using System.lineSeparator() System.out.println("5. Using System.lineSeparator()"); - para = line1+System.lineSeparator()+line2; + para = line1 + System.lineSeparator() + line2; System.out.println(para); //6. Using System.getProperty("line.separator") System.out.println("6. Using System.getProperty(\"line.separator\")"); - para = line1+System.getProperty("line.separator")+line2; + para = line1 + System.getProperty("line.separator") + line2; System.out.println(para); - //Line break for HTML using
- System.out.println("Line break for HTML using
"); - para = line1+"
"+line2; + System.out.println("***HTML to rendered in a browser***"); + //1. Line break for HTML using
+ System.out.println("1. Line break for HTML using
"); + para = line1 + "
" + line2; + System.out.println(para); - //Line break for HTML when string is in -
Humpty Dumpty sat on a wall.

Humpty Dumpty had a great fall
-
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall
-
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall
+ + +
+
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.
+
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.
+
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.
+
Humpty Dumpty sat on a wall.

Humpty Dumpty had a great fall.
+
Humpty Dumpty sat on a wall.
+Humpty Dumpty had a great fall
+

Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall

+

Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall

+

Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall

+

Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall

+

Humpty Dumpty sat on a wall. +Humpty Dumpty had a great fall

- + \ No newline at end of file From e1056e04de7cfe9cf4cec5d6fa5fe41c645fa03a Mon Sep 17 00:00:00 2001 From: Mike Wojtyna Date: Thu, 8 Nov 2018 18:54:05 +0100 Subject: [PATCH 329/546] Add BAEL-2272 persisting DDD aggregates examples (#5630) * Add BAEL-2272 persisting DDD aggregates examples * Update pom.xml --- ddd/pom.xml | 91 ++++++++++++++ .../PersistingDddAggregatesApplication.java | 12 ++ .../java/com/baeldung/ddd/order/Order.java | 52 ++++++++ .../com/baeldung/ddd/order/OrderLine.java | 67 +++++++++++ .../java/com/baeldung/ddd/order/Product.java | 52 ++++++++ .../com/baeldung/ddd/order/jpa/JpaOrder.java | 111 ++++++++++++++++++ .../baeldung/ddd/order/jpa/JpaOrderLine.java | 70 +++++++++++ .../ddd/order/jpa/JpaOrderRepository.java | 7 ++ .../baeldung/ddd/order/jpa/JpaProduct.java | 79 +++++++++++++ .../ddd/order/mongo/OrderMongoRepository.java | 9 ++ .../com/baeldung/ddd/order/OrderTest.java | 70 +++++++++++ .../jpa/PersistOrderIntegrationTest.java | 40 +++++++ .../jpa/ViolateOrderBusinessRulesTest.java | 35 ++++++ .../mongo/OrderMongoIntegrationTest.java | 50 ++++++++ pom.xml | 1 + 15 files changed, 746 insertions(+) create mode 100644 ddd/pom.xml create mode 100644 ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/Order.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/Product.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java create mode 100644 ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java create mode 100644 ddd/src/test/java/com/baeldung/ddd/order/OrderTest.java create mode 100644 ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderIntegrationTest.java create mode 100644 ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesTest.java create mode 100644 ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoIntegrationTest.java diff --git a/ddd/pom.xml b/ddd/pom.xml new file mode 100644 index 0000000000..a61ae24e92 --- /dev/null +++ b/ddd/pom.xml @@ -0,0 +1,91 @@ + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.0.6.RELEASE + + + + com.baeldung.ddd + ddd + 0.0.1-SNAPSHOT + jar + ddd + DDD series examples + + + 1.0.1 + 2.22.0 + + + + + org.springframework.boot + spring-boot-starter-data-mongodb + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + org.junit.platform + junit-platform-launcher + ${junit-platform.version} + test + + + org.joda + joda-money + ${joda-money.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + runtime + + + mysql + mysql-connector-java + runtime + + + org.postgresql + postgresql + runtime + + + org.springframework.boot + spring-boot-devtools + true + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + de.flapdoodle.embed + de.flapdoodle.embed.mongo + test + + + \ No newline at end of file diff --git a/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java b/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java new file mode 100644 index 0000000000..cd9be34278 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.ddd; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PersistingDddAggregatesApplication { + + public static void main(String[] args) { + SpringApplication.run(PersistingDddAggregatesApplication.class, args); + } +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/Order.java b/ddd/src/main/java/com/baeldung/ddd/order/Order.java new file mode 100644 index 0000000000..125bc5fe2d --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/Order.java @@ -0,0 +1,52 @@ +package com.baeldung.ddd.order; + +import java.util.ArrayList; +import java.util.List; + +import org.joda.money.Money; + +public class Order { + private final List orderLines; + private Money totalCost; + + public Order(List orderLines) { + checkNotNull(orderLines); + if (orderLines.isEmpty()) { + throw new IllegalArgumentException("Order must have at least one order line item"); + } + this.orderLines = new ArrayList<>(orderLines); + totalCost = calculateTotalCost(); + } + + public void addLineItem(OrderLine orderLine) { + checkNotNull(orderLine); + orderLines.add(orderLine); + totalCost = totalCost.plus(orderLine.cost()); + } + + public List getOrderLines() { + return new ArrayList<>(orderLines); + } + + public void removeLineItem(int line) { + OrderLine removedLine = orderLines.remove(line); + totalCost = totalCost.minus(removedLine.cost()); + } + + public Money totalCost() { + return totalCost; + } + + private Money calculateTotalCost() { + return orderLines.stream() + .map(OrderLine::cost) + .reduce(Money::plus) + .get(); + } + + private static void checkNotNull(Object par) { + if (par == null) { + throw new NullPointerException("Parameter cannot be null"); + } + } +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java b/ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java new file mode 100644 index 0000000000..000f55f2fb --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java @@ -0,0 +1,67 @@ +package com.baeldung.ddd.order; + +import org.joda.money.Money; + +public class OrderLine { + private final Product product; + private final int quantity; + + public OrderLine(Product product, int quantity) { + super(); + this.product = product; + this.quantity = quantity; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + OrderLine other = (OrderLine) obj; + if (product == null) { + if (other.product != null) { + return false; + } + } else if (!product.equals(other.product)) { + return false; + } + if (quantity != other.quantity) { + return false; + } + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((product == null) ? 0 : product.hashCode()); + result = prime * result + quantity; + return result; + } + + @Override + public String toString() { + return "OrderLine [product=" + product + ", quantity=" + quantity + "]"; + } + + Money cost() { + return product.getPrice() + .multipliedBy(quantity); + } + + Product getProduct() { + return product; + } + + int getQuantity() { + return quantity; + } + +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/Product.java b/ddd/src/main/java/com/baeldung/ddd/order/Product.java new file mode 100644 index 0000000000..0afcaa434f --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/Product.java @@ -0,0 +1,52 @@ +package com.baeldung.ddd.order; + +import org.joda.money.Money; + +public class Product { + private final Money price; + + public Product(Money price) { + super(); + this.price = price; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + Product other = (Product) obj; + if (price == null) { + if (other.price != null) { + return false; + } + } else if (!price.equals(other.price)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((price == null) ? 0 : price.hashCode()); + return result; + } + + @Override + public String toString() { + return "Product [price=" + price + "]"; + } + + Money getPrice() { + return price; + } + +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java new file mode 100644 index 0000000000..ed11b0dca4 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java @@ -0,0 +1,111 @@ +package com.baeldung.ddd.order.jpa; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "order_table") +class JpaOrder { + private String currencyUnit; + @Id + @GeneratedValue + private Long id; + @ElementCollection(fetch = FetchType.EAGER) + private final List orderLines; + private BigDecimal totalCost; + + JpaOrder() { + totalCost = null; + orderLines = new ArrayList<>(); + } + + JpaOrder(List orderLines) { + checkNotNull(orderLines); + if (orderLines.isEmpty()) { + throw new IllegalArgumentException("Order must have at least one order line item"); + } + this.orderLines = new ArrayList<>(orderLines); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + JpaOrder other = (JpaOrder) obj; + if (id == null) { + if (other.id != null) { + return false; + } + } else if (!id.equals(other.id)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public String toString() { + return "JpaOrder [currencyUnit=" + currencyUnit + ", id=" + id + ", orderLines=" + orderLines + ", totalCost=" + totalCost + "]"; + } + + void addLineItem(JpaOrderLine orderLine) { + checkNotNull(orderLine); + orderLines.add(orderLine); + } + + String getCurrencyUnit() { + return currencyUnit; + } + + Long getId() { + return id; + } + + List getOrderLines() { + return new ArrayList<>(orderLines); + } + + BigDecimal getTotalCost() { + return totalCost; + } + + void removeLineItem(int line) { + JpaOrderLine removedLine = orderLines.remove(line); + } + + void setCurrencyUnit(String currencyUnit) { + this.currencyUnit = currencyUnit; + } + + void setTotalCost(BigDecimal totalCost) { + this.totalCost = totalCost; + } + + private static void checkNotNull(Object par) { + if (par == null) { + throw new NullPointerException("Parameter cannot be null"); + } + } +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java new file mode 100644 index 0000000000..a3b50f0502 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java @@ -0,0 +1,70 @@ +package com.baeldung.ddd.order.jpa; + +import javax.persistence.Embeddable; +import javax.persistence.Embedded; + +@Embeddable +class JpaOrderLine { + @Embedded + private final JpaProduct product; + private final int quantity; + + JpaOrderLine() { + quantity = 0; + product = null; + } + + JpaOrderLine(JpaProduct product, int quantity) { + super(); + this.product = product; + this.quantity = quantity; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + JpaOrderLine other = (JpaOrderLine) obj; + if (product == null) { + if (other.product != null) { + return false; + } + } else if (!product.equals(other.product)) { + return false; + } + if (quantity != other.quantity) { + return false; + } + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((product == null) ? 0 : product.hashCode()); + result = prime * result + quantity; + return result; + } + + @Override + public String toString() { + return "JpaOrderLine [product=" + product + ", quantity=" + quantity + "]"; + } + + JpaProduct getProduct() { + return product; + } + + int getQuantity() { + return quantity; + } + +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java new file mode 100644 index 0000000000..b6e08e8372 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java @@ -0,0 +1,7 @@ +package com.baeldung.ddd.order.jpa; + +import org.springframework.data.jpa.repository.JpaRepository; + +public interface JpaOrderRepository extends JpaRepository { + +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java new file mode 100644 index 0000000000..61e67fa12a --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java @@ -0,0 +1,79 @@ +package com.baeldung.ddd.order.jpa; + +import java.math.BigDecimal; + +import javax.persistence.Embeddable; + +@Embeddable +class JpaProduct { + private String currencyUnit; + private BigDecimal price; + + public JpaProduct() { + } + + public JpaProduct(BigDecimal price, String currencyUnit) { + super(); + this.price = price; + currencyUnit = currencyUnit; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + JpaProduct other = (JpaProduct) obj; + if (currencyUnit == null) { + if (other.currencyUnit != null) { + return false; + } + } else if (!currencyUnit.equals(other.currencyUnit)) { + return false; + } + if (price == null) { + if (other.price != null) { + return false; + } + } else if (!price.equals(other.price)) { + return false; + } + return true; + } + + public String getCurrencyUnit() { + return currencyUnit; + } + + public BigDecimal getPrice() { + return price; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((currencyUnit == null) ? 0 : currencyUnit.hashCode()); + result = prime * result + ((price == null) ? 0 : price.hashCode()); + return result; + } + + public void setCurrencyUnit(String currencyUnit) { + this.currencyUnit = currencyUnit; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + @Override + public String toString() { + return "JpaProduct [currencyUnit=" + currencyUnit + ", price=" + price + "]"; + } +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java b/ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java new file mode 100644 index 0000000000..79f9ec9f21 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java @@ -0,0 +1,9 @@ +package com.baeldung.ddd.order.mongo; + +import org.springframework.data.mongodb.repository.MongoRepository; + +import com.baeldung.ddd.order.Order; + +public interface OrderMongoRepository extends MongoRepository { + +} diff --git a/ddd/src/test/java/com/baeldung/ddd/order/OrderTest.java b/ddd/src/test/java/com/baeldung/ddd/order/OrderTest.java new file mode 100644 index 0000000000..431a6a5293 --- /dev/null +++ b/ddd/src/test/java/com/baeldung/ddd/order/OrderTest.java @@ -0,0 +1,70 @@ +package com.baeldung.ddd.order; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.catchThrowable; + +import java.util.ArrayList; +import java.util.Arrays; + +import org.joda.money.CurrencyUnit; +import org.joda.money.Money; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +class OrderTest { + @DisplayName("given order with two items, when calculate total cost, then sum is returned") + @Test + void test0() throws Exception { + // given + OrderLine ol0 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 10.00)), 2); + OrderLine ol1 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 5.00)), 10); + Order order = new Order(Arrays.asList(ol0, ol1)); + + // when + Money totalCost = order.totalCost(); + + // then + assertThat(totalCost).isEqualTo(Money.of(CurrencyUnit.USD, 70.00)); + } + + @DisplayName("when create order without line items, then exception is thrown") + @Test + void test1() throws Exception { + // when + Throwable throwable = catchThrowable(() -> new Order(new ArrayList<>())); + + // then + assertThat(throwable).isInstanceOf(IllegalArgumentException.class); + } + + @DisplayName("given order with two line items, when add another line item, then total cost is updated") + @Test + void test2() throws Exception { + // given + OrderLine ol0 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 10.00)), 1); + OrderLine ol1 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 5.00)), 1); + Order order = new Order(Arrays.asList(ol0, ol1)); + + // when + order.addLineItem(new OrderLine(new Product(Money.of(CurrencyUnit.USD, 20.00)), 2)); + + // then + assertThat(order.totalCost()).isEqualTo(Money.of(CurrencyUnit.USD, 55)); + } + + @DisplayName("given order with three line items, when remove item, then total cost is updated") + @Test + void test3() throws Exception { + // given + OrderLine ol0 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 10.00)), 1); + OrderLine ol1 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 20.00)), 1); + OrderLine ol2 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 30.00)), 1); + Order order = new Order(Arrays.asList(ol0, ol1, ol2)); + + // when + order.removeLineItem(1); + + // then + assertThat(order.totalCost()).isEqualTo(Money.of(CurrencyUnit.USD, 40.00)); + } +} diff --git a/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderIntegrationTest.java b/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderIntegrationTest.java new file mode 100644 index 0000000000..c503c9960b --- /dev/null +++ b/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderIntegrationTest.java @@ -0,0 +1,40 @@ +package com.baeldung.ddd.order.jpa; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.math.BigDecimal; +import java.util.Arrays; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; + +@SpringJUnitConfig +@SpringBootTest +public class PersistOrderIntegrationTest { + @Autowired + private JpaOrderRepository repository; + + @DisplayName("given order with two line items, when persist, then order is saved") + @Test + public void test() throws Exception { + // given + JpaOrder order = prepareTestOrderWithTwoLineItems(); + + // when + JpaOrder savedOrder = repository.save(order); + + // then + JpaOrder foundOrder = repository.findById(savedOrder.getId()) + .get(); + assertThat(foundOrder.getOrderLines()).hasSize(2); + } + + private JpaOrder prepareTestOrderWithTwoLineItems() { + JpaOrderLine ol0 = new JpaOrderLine(new JpaProduct(BigDecimal.valueOf(10.00), "USD"), 2); + JpaOrderLine ol1 = new JpaOrderLine(new JpaProduct(BigDecimal.valueOf(5.00), "USD"), 10); + return new JpaOrder(Arrays.asList(ol0, ol1)); + } +} diff --git a/ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesTest.java b/ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesTest.java new file mode 100644 index 0000000000..3eda9250f9 --- /dev/null +++ b/ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesTest.java @@ -0,0 +1,35 @@ +package com.baeldung.ddd.order.jpa; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.math.BigDecimal; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +public class ViolateOrderBusinessRulesTest { + @DisplayName("given two non-zero order line items, when create an order with them, it's possible to set total cost to zero") + @Test + void test() throws Exception { + // given + // available products + JpaProduct lungChingTea = new JpaProduct(BigDecimal.valueOf(10.00), "USD"); + JpaProduct gyokuroMiyazakiTea = new JpaProduct(BigDecimal.valueOf(20.00), "USD"); + // Lung Ching tea order line + JpaOrderLine orderLine0 = new JpaOrderLine(lungChingTea, 2); + // Gyokuro Miyazaki tea order line + JpaOrderLine orderLine1 = new JpaOrderLine(gyokuroMiyazakiTea, 3); + + // when + // create the order + JpaOrder order = new JpaOrder(); + order.addLineItem(orderLine0); + order.addLineItem(orderLine1); + order.setTotalCost(BigDecimal.ZERO); + order.setCurrencyUnit("USD"); + + // then + // this doesn't look good... + assertThat(order.getTotalCost()).isEqualTo(BigDecimal.ZERO); + } +} diff --git a/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoIntegrationTest.java b/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoIntegrationTest.java new file mode 100644 index 0000000000..ca4315c416 --- /dev/null +++ b/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoIntegrationTest.java @@ -0,0 +1,50 @@ +package com.baeldung.ddd.order.mongo; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; + +import org.joda.money.CurrencyUnit; +import org.joda.money.Money; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; + +import com.baeldung.ddd.order.Order; +import com.baeldung.ddd.order.OrderLine; +import com.baeldung.ddd.order.Product; + +@SpringJUnitConfig +@SpringBootTest +public class OrderMongoIntegrationTest { + @Autowired + private OrderMongoRepository repo; + + @DisplayName("given order with two line items, when persist using mongo repository, then order is saved") + @Test + void test() throws Exception { + // given + Order order = prepareTestOrderWithTwoLineItems(); + + // when + repo.save(order); + + // then + List foundOrders = repo.findAll(); + assertThat(foundOrders).hasSize(1); + List foundOrderLines = foundOrders.iterator() + .next() + .getOrderLines(); + assertThat(foundOrderLines).hasSize(2); + assertThat(foundOrderLines).containsOnlyElementsOf(order.getOrderLines()); + } + + private Order prepareTestOrderWithTwoLineItems() { + OrderLine ol0 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 10.00)), 2); + OrderLine ol1 = new OrderLine(new Product(Money.of(CurrencyUnit.USD, 5.00)), 10); + return new Order(Arrays.asList(ol0, ol1)); + } +} diff --git a/pom.xml b/pom.xml index 62e3e58e66..aa79dae1d5 100644 --- a/pom.xml +++ b/pom.xml @@ -522,6 +522,7 @@ spring-jms spring-jooq persistence-modules/spring-jpa + ddd From 2b581cb3f6dcc0a31653b31bfbf1091bb001ce9c Mon Sep 17 00:00:00 2001 From: Laurentiu Delcea Date: Thu, 8 Nov 2018 21:37:35 +0200 Subject: [PATCH 330/546] BAEL-1962 Convert ZonedDateTime for MongoDB interactions (#5640) --- .../spring-data-mongodb/pom.xml | 2 +- .../java/com/baeldung/config/MongoConfig.java | 6 ++- .../main/java/com/baeldung/model/Action.java | 51 +++++++++++++++++++ .../baeldung/repository/ActionRepository.java | 6 +++ .../converter/ZonedDateTimeReadConverter.java | 14 +++++ .../ZonedDateTimeWriteConverter.java | 13 +++++ .../repository/ActionRepositoryLiveTest.java | 50 ++++++++++++++++++ 7 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/Action.java create mode 100644 persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/repository/ActionRepository.java create mode 100644 persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeReadConverter.java create mode 100644 persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeWriteConverter.java create mode 100644 persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/ActionRepositoryLiveTest.java diff --git a/persistence-modules/spring-data-mongodb/pom.xml b/persistence-modules/spring-data-mongodb/pom.xml index 466acf5a43..76ec5a96a6 100644 --- a/persistence-modules/spring-data-mongodb/pom.xml +++ b/persistence-modules/spring-data-mongodb/pom.xml @@ -109,7 +109,7 @@ - 2.1.0.RELEASE + 2.1.2.RELEASE 4.1.4 1.1.3 5.1.0.RELEASE diff --git a/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java index f1048fa145..9fa90acf86 100644 --- a/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java +++ b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/config/MongoConfig.java @@ -3,6 +3,8 @@ package com.baeldung.config; import java.util.ArrayList; import java.util.List; +import converter.ZonedDateTimeReadConverter; +import converter.ZonedDateTimeWriteConverter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.converter.Converter; @@ -52,6 +54,8 @@ public class MongoConfig extends AbstractMongoConfiguration { @Override public MongoCustomConversions customConversions() { converters.add(new UserWriterConverter()); + converters.add(new ZonedDateTimeReadConverter()); + converters.add(new ZonedDateTimeWriteConverter()); return new MongoCustomConversions(converters); } @@ -64,5 +68,5 @@ public class MongoConfig extends AbstractMongoConfiguration { MongoTransactionManager transactionManager(MongoDbFactory dbFactory) { return new MongoTransactionManager(dbFactory); } - + } diff --git a/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/Action.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/Action.java new file mode 100644 index 0000000000..aa480dbdf7 --- /dev/null +++ b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/model/Action.java @@ -0,0 +1,51 @@ +package com.baeldung.model; + +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.ZonedDateTime; + +@Document +public class Action { + + @Id + private String id; + + private String description; + private ZonedDateTime time; + + public Action(String id, String description, ZonedDateTime time) { + this.id = id; + this.description = description; + this.time = time; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ZonedDateTime getTime() { + return time; + } + + public void setTime(ZonedDateTime time) { + this.time = time; + } + + @Override + public String toString() { + return "Action{id='" + id + "', description='" + description + "', time=" + time + '}'; + } +} diff --git a/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/repository/ActionRepository.java b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/repository/ActionRepository.java new file mode 100644 index 0000000000..bdca490fe6 --- /dev/null +++ b/persistence-modules/spring-data-mongodb/src/main/java/com/baeldung/repository/ActionRepository.java @@ -0,0 +1,6 @@ +package com.baeldung.repository; + +import com.baeldung.model.Action; +import org.springframework.data.mongodb.repository.MongoRepository; + +public interface ActionRepository extends MongoRepository { } \ No newline at end of file diff --git a/persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeReadConverter.java b/persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeReadConverter.java new file mode 100644 index 0000000000..a2d847957b --- /dev/null +++ b/persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeReadConverter.java @@ -0,0 +1,14 @@ +package converter; + +import org.springframework.core.convert.converter.Converter; + +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.util.Date; + +public class ZonedDateTimeReadConverter implements Converter { + @Override + public ZonedDateTime convert(Date date) { + return date.toInstant().atZone(ZoneOffset.UTC); + } +} \ No newline at end of file diff --git a/persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeWriteConverter.java b/persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeWriteConverter.java new file mode 100644 index 0000000000..e13ac2d130 --- /dev/null +++ b/persistence-modules/spring-data-mongodb/src/main/java/converter/ZonedDateTimeWriteConverter.java @@ -0,0 +1,13 @@ +package converter; + +import org.springframework.core.convert.converter.Converter; + +import java.time.ZonedDateTime; +import java.util.Date; + +public class ZonedDateTimeWriteConverter implements Converter { + @Override + public Date convert(ZonedDateTime zonedDateTime) { + return Date.from(zonedDateTime.toInstant()); + } +} \ No newline at end of file diff --git a/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/ActionRepositoryLiveTest.java b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/ActionRepositoryLiveTest.java new file mode 100644 index 0000000000..096015ca0a --- /dev/null +++ b/persistence-modules/spring-data-mongodb/src/test/java/com/baeldung/repository/ActionRepositoryLiveTest.java @@ -0,0 +1,50 @@ +package com.baeldung.repository; + +import com.baeldung.config.MongoConfig; +import com.baeldung.model.Action; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.mongodb.core.MongoOperations; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.time.ZoneOffset; +import java.time.ZonedDateTime; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = MongoConfig.class) +public class ActionRepositoryLiveTest { + + @Autowired + private MongoOperations mongoOps; + + @Autowired + private ActionRepository actionRepository; + + @Before + public void setup() { + if (!mongoOps.collectionExists(Action.class)) { + mongoOps.createCollection(Action.class); + } + } + + @Test + public void givenSavedAction_TimeIsRetrievedCorrectly() { + String id = "testId"; + ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); + + actionRepository.save(new Action(id, "click-action", now)); + Action savedAction = actionRepository.findById(id).get(); + + Assert.assertEquals(now.withNano(0), savedAction.getTime().withNano(0)); + } + + @After + public void tearDown() { + mongoOps.dropCollection(Action.class); + } +} \ No newline at end of file From 23143a0c175074a6a9f4e9705374e6b6b9b38903 Mon Sep 17 00:00:00 2001 From: charlesgonzales <39999268+charlesgonzales@users.noreply.github.com> Date: Fri, 9 Nov 2018 04:23:23 +0800 Subject: [PATCH 331/546] Bi-monthly test fix - BAEL-10195 (#5626) * Update README.md * Update README.md * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.MD --- algorithms-sorting/README.md | 2 +- apache-pulsar/README.md | 3 +++ core-java-collections/README.md | 4 ++++ core-java-io/README.md | 1 + core-java/README.md | 2 ++ core-kotlin/README.md | 7 ++++++- core-scala/README.md | 3 +++ gradle/README.md | 1 + jackson/README.md | 1 + java-dates/README.md | 1 + java-strings/README.md | 1 + jersey/README.md | 1 + jib/README.md | 3 +++ json/README.md | 3 ++- libraries-data/README.md | 2 ++ libraries/README.md | 1 + maven/README.md | 1 + persistence-modules/spring-data-redis/README.md | 1 + spring-5-reactive/README.md | 3 ++- spring-mvc-simple/README.md | 1 + spring-security-mvc-boot/README.MD | 1 + 21 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 apache-pulsar/README.md create mode 100644 core-scala/README.md create mode 100644 jib/README.md diff --git a/algorithms-sorting/README.md b/algorithms-sorting/README.md index f88b93e25e..36460293b0 100644 --- a/algorithms-sorting/README.md +++ b/algorithms-sorting/README.md @@ -4,4 +4,4 @@ - [Merge Sort in Java](https://www.baeldung.com/java-merge-sort) - [Quicksort Algorithm Implementation in Java](https://www.baeldung.com/java-quicksort) - [Insertion Sort in Java](https://www.baeldung.com/java-insertion-sort) - +- [Heap Sort in Java](https://www.baeldung.com/java-heap-sort) diff --git a/apache-pulsar/README.md b/apache-pulsar/README.md new file mode 100644 index 0000000000..2970bc3d88 --- /dev/null +++ b/apache-pulsar/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Introduction to Apache Pulsar](https://www.baeldung.com/apache-pulsar) diff --git a/core-java-collections/README.md b/core-java-collections/README.md index d0aaaa7182..fbc8144954 100644 --- a/core-java-collections/README.md +++ b/core-java-collections/README.md @@ -39,3 +39,7 @@ - [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) - [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections) - [Guide to EnumSet](https://www.baeldung.com/java-enumset) +- [Removing Elements from Java Collections](https://www.baeldung.com/java-collection-remove-elements) +- [Converting a Collection to ArrayList in Java](https://www.baeldung.com/java-convert-collection-arraylist) +- [Java 8 Streams: Find Items From One List Based On Values From Another List](https://www.baeldung.com/java-streams-find-list-items) +- [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections) diff --git a/core-java-io/README.md b/core-java-io/README.md index ae4c267b8a..c81e466b57 100644 --- a/core-java-io/README.md +++ b/core-java-io/README.md @@ -33,3 +33,4 @@ - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) - [Read a File into an ArrayList](https://www.baeldung.com/java-file-to-arraylist) - [Guide to Java OutputStream](https://www.baeldung.com/java-outputstream) +- [Reading a CSV File into an Array](https://www.baeldung.com/java-csv-file-array) diff --git a/core-java/README.md b/core-java/README.md index 856cc58097..10fbdb87a7 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -157,4 +157,6 @@ - [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) - [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) - [Understanding Memory Leaks in Java](https://www.baeldung.com/java-memory-leaks) +- [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide) +- [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) diff --git a/core-kotlin/README.md b/core-kotlin/README.md index ab9e96c2e1..1b04b71228 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -40,5 +40,10 @@ - [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) - [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings) - [Kotlin return, break, continue Keywords](https://www.baeldung.com/kotlin-return-break-continue) -- [Mapping of Data Objects in Kotlin](https://www.baeldung.com/kotlin-data-objects-mapping) +- [Mapping of Data Objects in Kotlin](https://www.baeldung.com/kotlin-data-objects) - [Initializing Arrays in Kotlin](https://www.baeldung.com/kotlin-initialize-array) +- [Threads vs Coroutines in Kotlin](https://www.baeldung.com/kotlin-threads-coroutines) +- [Guide to Kotlin Interfaces](https://www.baeldung.com/kotlin-interfaces) +- [Guide to Sorting in Kotlin](https://www.baeldung.com/kotlin-sort) +- [Dependency Injection for Kotlin with Injekt](https://www.baeldung.com/kotlin-dependency-injection-with-injekt) +- [Implementing a Binary Tree in Kotlin](https://www.baeldung.com/kotlin-binary-tree) diff --git a/core-scala/README.md b/core-scala/README.md new file mode 100644 index 0000000000..eed344193f --- /dev/null +++ b/core-scala/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Introduction to Scala](https://www.baeldung.com/scala-intro) diff --git a/gradle/README.md b/gradle/README.md index 229466dfec..a1f5c74c57 100644 --- a/gradle/README.md +++ b/gradle/README.md @@ -4,3 +4,4 @@ - [Creating a Fat Jar in Gradle](http://www.baeldung.com/gradle-fat-jar) - [A Custom Task in Gradle](http://www.baeldung.com/gradle-custom-task) - [Kotlin Dependency Injection with Kodein](http://www.baeldung.com/kotlin-kodein-dependency-injection) +- [Using JUnit 5 with Gradle](https://www.baeldung.com/junit-5-gradle) diff --git a/jackson/README.md b/jackson/README.md index a05c95de94..04e88d0ea1 100644 --- a/jackson/README.md +++ b/jackson/README.md @@ -36,3 +36,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Jackson – Change Name of Field](http://www.baeldung.com/jackson-name-of-property) - [Serialize Only Fields that meet a Custom Criteria with Jackson](http://www.baeldung.com/jackson-serialize-field-custom-criteria) - [Mapping Nested Values with Jackson](http://www.baeldung.com/jackson-nested-values) +- [Convert XML to JSON Using Jackson](https://www.baeldung.com/jackson-convert-xml-json) diff --git a/java-dates/README.md b/java-dates/README.md index f99bfeb861..66046b16a6 100644 --- a/java-dates/README.md +++ b/java-dates/README.md @@ -23,3 +23,4 @@ - [Increment Date in Java](http://www.baeldung.com/java-increment-date) - [Add Hours To a Date In Java](http://www.baeldung.com/java-add-hours-date) - [Guide to DateTimeFormatter](https://www.baeldung.com/java-datetimeformatter) +- [Format ZonedDateTime to String](https://www.baeldung.com/java-format-zoned-datetime-string) diff --git a/java-strings/README.md b/java-strings/README.md index a653087401..1b24a2b821 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -35,3 +35,4 @@ - [String Not Empty Test Assertions in Java](https://www.baeldung.com/java-assert-string-not-empty) - [String Performance Hints](https://www.baeldung.com/java-string-performance) - [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) +- [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) diff --git a/jersey/README.md b/jersey/README.md index c548a79c6d..1dd871b3e8 100644 --- a/jersey/README.md +++ b/jersey/README.md @@ -2,3 +2,4 @@ - [Jersey MVC Support](https://www.baeldung.com/jersey-mvc) - [Bean Validation in Jersey](https://www.baeldung.com/jersey-bean-validation) - [Set a Response Body in JAX-RS](https://www.baeldung.com/jax-rs-response) +- [Exploring the Jersey Test Framework](https://www.baeldung.com/jersey-test) diff --git a/jib/README.md b/jib/README.md new file mode 100644 index 0000000000..82bd2fed42 --- /dev/null +++ b/jib/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Dockerizing Java Apps using Jib](https://www.baeldung.com/jib-dockerizing) diff --git a/json/README.md b/json/README.md index e0679bc60b..2e253a4ae9 100644 --- a/json/README.md +++ b/json/README.md @@ -9,4 +9,5 @@ - [Introduction to JsonPath](http://www.baeldung.com/guide-to-jayway-jsonpath) - [Introduction to JSON-Java (org.json)](http://www.baeldung.com/java-org-json) - [Overview of JSON Pointer](https://www.baeldung.com/json-pointer) -- [Introduction to the JSON Binding API (JSR 367) in Java](http://www.baeldung.com/java-json-binding-api) \ No newline at end of file +- [Introduction to the JSON Binding API (JSR 367) in Java](http://www.baeldung.com/java-json-binding-api) +- [Get a Value by Key in a JSONArray](https://www.baeldung.com/java-jsonarray-get-value-by-key) diff --git a/libraries-data/README.md b/libraries-data/README.md index 63ee5f9947..7e40a4a2e2 100644 --- a/libraries-data/README.md +++ b/libraries-data/README.md @@ -12,3 +12,5 @@ - [Guide to JMapper](https://www.baeldung.com/jmapper) - [A Guide to Apache Crunch](https://www.baeldung.com/apache-crunch) - [Building a Data Pipeline with Flink and Kafka](https://www.baeldung.com/kafka-flink-data-pipeline) +- [Intro to Apache Storm](https://www.baeldung.com/apache-storm) +- [Guide to Ebean ORM](https://www.baeldung.com/ebean-orm) diff --git a/libraries/README.md b/libraries/README.md index fcf687d806..851e3a3d17 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -83,6 +83,7 @@ - [Guide to JMapper](http://www.baeldung.com/jmapper) - [An Introduction to Apache Commons Lang 3](https://www.baeldung.com/java-commons-lang-3) - [Exactly Once Processing in Kafka](https://www.baeldung.com/kafka-exactly-once) +- [An Introduction to SuanShu](https://www.baeldung.com/suanshu) The libraries module contains examples related to small libraries that are relatively easy to use and does not require any separate module of its own. diff --git a/maven/README.md b/maven/README.md index 970250d142..1c0e50f95a 100644 --- a/maven/README.md +++ b/maven/README.md @@ -13,3 +13,4 @@ - [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure) - [Apache Maven Tutorial](https://www.baeldung.com/maven) - [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version) +- [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module) diff --git a/persistence-modules/spring-data-redis/README.md b/persistence-modules/spring-data-redis/README.md index da44920e16..a20f5052f0 100644 --- a/persistence-modules/spring-data-redis/README.md +++ b/persistence-modules/spring-data-redis/README.md @@ -3,6 +3,7 @@ ### Relevant Articles: - [Introduction to Spring Data Redis](http://www.baeldung.com/spring-data-redis-tutorial) - [PubSub Messaging with Spring Data Redis](http://www.baeldung.com/spring-data-redis-pub-sub) +- [An Introduction to Spring Data Redis Reactive](https://www.baeldung.com/spring-data-redis-reactive) ### Build the Project with Tests Running ``` diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 1431554882..267925b798 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -14,4 +14,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring Webflux and CORS](http://www.baeldung.com/spring-webflux-cors) - [Handling Errors in Spring WebFlux](http://www.baeldung.com/spring-webflux-errors) - [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) -- [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/a-guide-to-spring-session-reactive-support-websession/) \ No newline at end of file +- [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) +- [Validation for Functional Endpoints in Spring 5](https://www.baeldung.com/spring-functional-endpoints-validation) diff --git a/spring-mvc-simple/README.md b/spring-mvc-simple/README.md index 39053534fa..a9b002afd7 100644 --- a/spring-mvc-simple/README.md +++ b/spring-mvc-simple/README.md @@ -6,3 +6,4 @@ - [Servlet Redirect vs Forward](http://www.baeldung.com/servlet-redirect-forward) - [Apache Tiles Integration with Spring MVC](http://www.baeldung.com/spring-mvc-apache-tiles) - [Guide to Spring Email](http://www.baeldung.com/spring-email) +- [Request Method Not Supported (405) in Spring](https://www.baeldung.com/spring-request-method-not-supported-405) diff --git a/spring-security-mvc-boot/README.MD b/spring-security-mvc-boot/README.MD index 6f01bfdc65..20036283a3 100644 --- a/spring-security-mvc-boot/README.MD +++ b/spring-security-mvc-boot/README.MD @@ -12,3 +12,4 @@ The "REST With Spring" Classes: http://github.learnspringsecurity.com - [Spring Data with Spring Security](https://www.baeldung.com/spring-data-security) - [Spring Security – Whitelist IP Range](https://www.baeldung.com/spring-security-whitelist-ip-range) - [Find the Registered Spring Security Filters](https://www.baeldung.com/spring-security-registered-filters) +- [HTTPS using Self-Signed Certificate in Spring Boot](https://www.baeldung.com/spring-boot-https-self-signed-certificate) From 6a352be9778f6220030f3b6c0163eba2374bb52b Mon Sep 17 00:00:00 2001 From: cdjole Date: Fri, 9 Nov 2018 01:07:59 +0100 Subject: [PATCH 332/546] Calculate circle area. (#5644) --- .../java/com/baeldung/area/circle/Circle.java | 30 ++++++++++++++++ .../com/baeldung/area/circle/CircleArea.java | 36 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/area/circle/Circle.java create mode 100644 core-java/src/main/java/com/baeldung/area/circle/CircleArea.java diff --git a/core-java/src/main/java/com/baeldung/area/circle/Circle.java b/core-java/src/main/java/com/baeldung/area/circle/Circle.java new file mode 100644 index 0000000000..595bc3d2e7 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/area/circle/Circle.java @@ -0,0 +1,30 @@ +package com.baeldung.area.circle; + +public class Circle { + + private double radius; + + public Circle(double radius) { + this.radius = radius; + } + + public double getRadius() { + return radius; + } + + public void setRadius(double radius) { + this.radius = radius; + } + + public double getArea() { + return calculateArea(); + } + + private double calculateArea() { + return radius * radius * Math.PI; + } + + public String toString() { + return "The area of the circle [radius = " + radius + "]: " + calculateArea(); + } +} diff --git a/core-java/src/main/java/com/baeldung/area/circle/CircleArea.java b/core-java/src/main/java/com/baeldung/area/circle/CircleArea.java new file mode 100644 index 0000000000..4d78637af6 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/area/circle/CircleArea.java @@ -0,0 +1,36 @@ +package com.baeldung.area.circle; + +import java.util.InputMismatchException; +import java.util.Scanner; + +public class CircleArea { + + public static void main(String[] args) { + if (args.length > 0) { + try { + double radius = Double.parseDouble(args[0]); + calculateArea(radius); + } catch (NumberFormatException nfe) { + System.out.println("Invalid value for radius"); + System.exit(0); + } + } + + try (Scanner scanner = new Scanner(System.in)) { + System.out.println("Please enter radius value: "); + double radius = scanner.nextDouble(); + calculateArea(radius); + } catch (InputMismatchException e) { + System.out.println("Invalid value for radius"); + System.exit(0); + } + + Circle circle = new Circle(7); + System.out.println(circle); + } + + private static void calculateArea(double radius) { + double area = radius * radius * Math.PI; + System.out.println("The area of the circle [radius = " + radius + "]: " + area); + } +} From 4590bb37f16f1c10229772431510abf5f6da039b Mon Sep 17 00:00:00 2001 From: Rahul Srivastava Date: Fri, 9 Nov 2018 11:01:57 +0530 Subject: [PATCH 333/546] Deleting html file --- .../main/java/com/baeldung/string/page.html | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 core-java/src/main/java/com/baeldung/string/page.html diff --git a/core-java/src/main/java/com/baeldung/string/page.html b/core-java/src/main/java/com/baeldung/string/page.html deleted file mode 100644 index fc39ee0057..0000000000 --- a/core-java/src/main/java/com/baeldung/string/page.html +++ /dev/null @@ -1,31 +0,0 @@ - - -Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.
-Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall.
-Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall.
-Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall.
-Humpty Dumpty sat on a wall. -Humpty Dumpty had a great fall. -
- - - - - -
-
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.
-
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.
-
Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.
-
Humpty Dumpty sat on a wall.

Humpty Dumpty had a great fall.
-
Humpty Dumpty sat on a wall.
-Humpty Dumpty had a great fall
-
-

Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall

-

Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall

-

Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall

-

Humpty Dumpty sat on a wall. Humpty Dumpty had a great fall

-

Humpty Dumpty sat on a wall. -Humpty Dumpty had a great fall

- - \ No newline at end of file From 064113f939a4a3176ffc74ce98badb161c10b76a Mon Sep 17 00:00:00 2001 From: charlesgonzales <39999268+charlesgonzales@users.noreply.github.com> Date: Fri, 9 Nov 2018 17:46:30 +0800 Subject: [PATCH 334/546] Add/fix links Team_BAEL-10195 (#5647) * Update README.md * Update README.md --- lombok/README.md | 2 +- persistence-modules/hibernate5/README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lombok/README.md b/lombok/README.md index 34ec569e89..bd6282fd18 100644 --- a/lombok/README.md +++ b/lombok/README.md @@ -4,4 +4,4 @@ - [Using Lombok’s @Getter for Boolean Fields](https://www.baeldung.com/lombok-getter-boolean) - [Lombok @Builder with Inheritance](https://www.baeldung.com/lombok-builder-inheritance) - [Lombok Builder with Default Value](https://www.baeldung.com/lombok-builder-default-value) -- [Lombok Builder with Custom Setter](https://www.baeldung.com/lombok-builder-with-custom-setter) +- [Lombok Builder with Custom Setter](https://www.baeldung.com/lombok-builder-custom-setter) diff --git a/persistence-modules/hibernate5/README.md b/persistence-modules/hibernate5/README.md index 7f52531076..a94379b5cb 100644 --- a/persistence-modules/hibernate5/README.md +++ b/persistence-modules/hibernate5/README.md @@ -18,3 +18,4 @@ - [@JoinColumn Annotation Explained](https://www.baeldung.com/jpa-join-column) - [Hibernate 5 Naming Strategy Configuration](https://www.baeldung.com/hibernate-naming-strategy) - [Proxy in Hibernate load() Method](https://www.baeldung.com/hibernate-proxy-load-method) +- [Custom Types in Hibernate](https://www.baeldung.com/hibernate-custom-types) From 8e6fff4fc88b2cb9100018b2cb5a14f40f64e78b Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 9 Nov 2018 16:35:44 +0300 Subject: [PATCH 335/546] BAEL-1596 Spring Events (#5605) * Annotation-driven event listener + generic events * update examples + add tests * add article link * add more tests for Spring Events --- spring-all/README.md | 9 ++-- .../AnnotationDrivenEventListener.java | 46 +++++++++++++++++++ .../synchronous/ContextRefreshedListener.java | 7 +++ .../CustomSpringEventPublisher.java | 12 +++++ .../synchronous/GenericSpringAppEvent.java | 18 ++++++++ .../synchronous/GenericSpringEvent.java | 21 +++++++++ .../GenericSpringEventListener.java | 22 +++++++++ .../GenericStringSpringAppEvent.java | 9 ++++ .../synchronous/GenericStringSpringEvent.java | 9 ++++ ...ntextRefreshedListenerIntegrationTest.java | 9 +++- ...enericAppEventListenerIntegrationTest.java | 28 +++++++++++ ...nousCustomSpringEventsIntegrationTest.java | 29 +++++++++++- 12 files changed, 214 insertions(+), 5 deletions(-) create mode 100644 spring-all/src/main/java/org/baeldung/springevents/synchronous/AnnotationDrivenEventListener.java create mode 100644 spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringAppEvent.java create mode 100644 spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEvent.java create mode 100644 spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEventListener.java create mode 100644 spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringAppEvent.java create mode 100644 spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringEvent.java create mode 100644 spring-all/src/test/java/org/baeldung/springevents/synchronous/GenericAppEventListenerIntegrationTest.java diff --git a/spring-all/README.md b/spring-all/README.md index ded5e26285..34e5c3435e 100644 --- a/spring-all/README.md +++ b/spring-all/README.md @@ -4,10 +4,12 @@ This project is used to replicate Spring Exceptions only. -###The Course +### The Course + The "REST With Spring" Classes: http://bit.ly/restwithspring - -### Relevant articles: + +### Relevant articles: + - [Guide to Spring @Autowired](http://www.baeldung.com/spring-autowire) - [Properties with Spring](http://www.baeldung.com/properties-with-spring) - checkout the `org.baeldung.properties` package for all scenarios of properties injection and usage - [Spring Profiles](http://www.baeldung.com/spring-profiles) @@ -30,3 +32,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring Web Contexts](http://www.baeldung.com/spring-web-contexts) - [Spring Cache – Creating a Custom KeyGenerator](http://www.baeldung.com/spring-cache-custom-keygenerator) - [Spring @Primary Annotation](http://www.baeldung.com/spring-primary) +- [Spring Events](https://www.baeldung.com/spring-events) diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/AnnotationDrivenEventListener.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/AnnotationDrivenEventListener.java new file mode 100644 index 0000000000..f750c40a6e --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/AnnotationDrivenEventListener.java @@ -0,0 +1,46 @@ +package org.baeldung.springevents.synchronous; + +import org.springframework.context.event.ContextStartedEvent; +import org.springframework.context.event.EventListener; +import org.springframework.stereotype.Component; +import org.springframework.transaction.event.TransactionPhase; +import org.springframework.transaction.event.TransactionalEventListener; + +@Component +public class AnnotationDrivenEventListener { + + // for tests + private boolean hitContextStartedHandler = false; + private boolean hitSuccessfulEventHandler = false; + private boolean hitCustomEventHandler = false; + + @EventListener + public void handleContextStart(final ContextStartedEvent cse) { + System.out.println("Handling context started event."); + hitContextStartedHandler = true; + } + + @EventListener(condition = "#event.success") + public void handleSuccessful(final GenericSpringEvent event) { + System.out.println("Handling generic event (conditional): " + event.getWhat()); + hitSuccessfulEventHandler = true; + } + + @TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT) + public void handleCustom(final CustomSpringEvent event) { + System.out.println("Handling event inside a transaction BEFORE COMMIT."); + hitCustomEventHandler = true; + } + + boolean isHitContextStartedHandler() { + return hitContextStartedHandler; + } + + boolean isHitSuccessfulEventHandler() { + return hitSuccessfulEventHandler; + } + + boolean isHitCustomEventHandler() { + return hitCustomEventHandler; + } +} diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/ContextRefreshedListener.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/ContextRefreshedListener.java index 052437e555..9f8b2e6e83 100644 --- a/spring-all/src/main/java/org/baeldung/springevents/synchronous/ContextRefreshedListener.java +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/ContextRefreshedListener.java @@ -7,9 +7,16 @@ import org.springframework.stereotype.Component; @Component public class ContextRefreshedListener implements ApplicationListener { + // for tests + private boolean hitContextRefreshedHandler = false; + @Override public void onApplicationEvent(final ContextRefreshedEvent cse) { System.out.println("Handling context re-freshed event. "); + hitContextRefreshedHandler = true; } + boolean isHitContextRefreshedHandler() { + return hitContextRefreshedHandler; + } } \ No newline at end of file diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/CustomSpringEventPublisher.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/CustomSpringEventPublisher.java index 4569de1d5e..3182090d5d 100644 --- a/spring-all/src/main/java/org/baeldung/springevents/synchronous/CustomSpringEventPublisher.java +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/CustomSpringEventPublisher.java @@ -16,4 +16,16 @@ public class CustomSpringEventPublisher { applicationEventPublisher.publishEvent(customSpringEvent); } + public void publishGenericEvent(final String message, boolean success) { + System.out.println("Publishing generic event."); + final GenericSpringEvent genericSpringEvent = new GenericStringSpringEvent(message, success); + applicationEventPublisher.publishEvent(genericSpringEvent); + } + + public void publishGenericAppEvent(final String message) { + System.out.println("Publishing generic event."); + final GenericSpringAppEvent genericSpringEvent = new GenericStringSpringAppEvent(this, message); + applicationEventPublisher.publishEvent(genericSpringEvent); + } + } diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringAppEvent.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringAppEvent.java new file mode 100644 index 0000000000..6804312189 --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringAppEvent.java @@ -0,0 +1,18 @@ +package org.baeldung.springevents.synchronous; + +import org.springframework.context.ApplicationEvent; + +public class GenericSpringAppEvent extends ApplicationEvent { + + private final T what; + + public GenericSpringAppEvent(final Object source, final T what) { + super(source); + this.what = what; + } + + public T getWhat() { + return what; + } + +} diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEvent.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEvent.java new file mode 100644 index 0000000000..ce2c223fec --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEvent.java @@ -0,0 +1,21 @@ +package org.baeldung.springevents.synchronous; + +public class GenericSpringEvent { + + private final T what; + protected final boolean success; + + public GenericSpringEvent(final T what, final boolean success) { + this.what = what; + this.success = success; + } + + public T getWhat() { + return what; + } + + public boolean isSuccess() { + return success; + } + +} diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEventListener.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEventListener.java new file mode 100644 index 0000000000..1f5e3e7068 --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericSpringEventListener.java @@ -0,0 +1,22 @@ +package org.baeldung.springevents.synchronous; + +import org.springframework.context.ApplicationListener; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; + +@Component +public class GenericSpringEventListener implements ApplicationListener> { + + // for testing + private boolean hitEventHandler = false; + + @Override + public void onApplicationEvent(@NonNull final GenericSpringAppEvent event) { + System.out.println("Received spring generic event - " + event.getWhat()); + hitEventHandler = true; + } + + boolean isHitEventHandler() { + return hitEventHandler; + } +} \ No newline at end of file diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringAppEvent.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringAppEvent.java new file mode 100644 index 0000000000..fd214696e7 --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringAppEvent.java @@ -0,0 +1,9 @@ +package org.baeldung.springevents.synchronous; + +class GenericStringSpringAppEvent extends GenericSpringAppEvent { + + GenericStringSpringAppEvent(final Object source, final String what) { + super(source, what); + } + +} diff --git a/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringEvent.java b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringEvent.java new file mode 100644 index 0000000000..dd4e4e3ed4 --- /dev/null +++ b/spring-all/src/main/java/org/baeldung/springevents/synchronous/GenericStringSpringEvent.java @@ -0,0 +1,9 @@ +package org.baeldung.springevents.synchronous; + +public class GenericStringSpringEvent extends GenericSpringEvent { + + GenericStringSpringEvent(final String what, final boolean success) { + super(what, success); + } + +} diff --git a/spring-all/src/test/java/org/baeldung/springevents/synchronous/ContextRefreshedListenerIntegrationTest.java b/spring-all/src/test/java/org/baeldung/springevents/synchronous/ContextRefreshedListenerIntegrationTest.java index ac8758bbf6..e8e6f91b06 100644 --- a/spring-all/src/test/java/org/baeldung/springevents/synchronous/ContextRefreshedListenerIntegrationTest.java +++ b/spring-all/src/test/java/org/baeldung/springevents/synchronous/ContextRefreshedListenerIntegrationTest.java @@ -3,16 +3,23 @@ package org.baeldung.springevents.synchronous; import org.baeldung.springevents.synchronous.SynchronousSpringEventsConfig; import org.junit.Test; import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import static org.springframework.util.Assert.isTrue; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { SynchronousSpringEventsConfig.class }, loader = AnnotationConfigContextLoader.class) public class ContextRefreshedListenerIntegrationTest { + @Autowired + private ContextRefreshedListener listener; + @Test - public void testContextRefreshedListener() throws InterruptedException { + public void testContextRefreshedListener() { System.out.println("Test context re-freshed listener."); + isTrue(listener.isHitContextRefreshedHandler(), "Refresh should be called once"); } } \ No newline at end of file diff --git a/spring-all/src/test/java/org/baeldung/springevents/synchronous/GenericAppEventListenerIntegrationTest.java b/spring-all/src/test/java/org/baeldung/springevents/synchronous/GenericAppEventListenerIntegrationTest.java new file mode 100644 index 0000000000..f183314b6d --- /dev/null +++ b/spring-all/src/test/java/org/baeldung/springevents/synchronous/GenericAppEventListenerIntegrationTest.java @@ -0,0 +1,28 @@ +package org.baeldung.springevents.synchronous; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.support.AnnotationConfigContextLoader; + +import static org.springframework.util.Assert.isTrue; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { SynchronousSpringEventsConfig.class }, loader = AnnotationConfigContextLoader.class) +public class GenericAppEventListenerIntegrationTest { + + @Autowired + private CustomSpringEventPublisher publisher; + @Autowired + private GenericSpringEventListener listener; + + @Test + public void testGenericSpringEvent() { + isTrue(!listener.isHitEventHandler(), "The initial value should be false"); + publisher.publishGenericAppEvent("Hello world!!!"); + isTrue(listener.isHitEventHandler(), "Now the value should be changed to true"); + } + +} \ No newline at end of file diff --git a/spring-all/src/test/java/org/baeldung/springevents/synchronous/SynchronousCustomSpringEventsIntegrationTest.java b/spring-all/src/test/java/org/baeldung/springevents/synchronous/SynchronousCustomSpringEventsIntegrationTest.java index f9783f57dc..b169cfec36 100644 --- a/spring-all/src/test/java/org/baeldung/springevents/synchronous/SynchronousCustomSpringEventsIntegrationTest.java +++ b/spring-all/src/test/java/org/baeldung/springevents/synchronous/SynchronousCustomSpringEventsIntegrationTest.java @@ -1,5 +1,6 @@ package org.baeldung.springevents.synchronous; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -7,16 +8,42 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import static org.springframework.util.Assert.isTrue; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { SynchronousSpringEventsConfig.class }, loader = AnnotationConfigContextLoader.class) public class SynchronousCustomSpringEventsIntegrationTest { @Autowired private CustomSpringEventPublisher publisher; + @Autowired + private AnnotationDrivenEventListener listener; @Test - public void testCustomSpringEvents() throws InterruptedException { + public void testCustomSpringEvents() { + isTrue(!listener.isHitCustomEventHandler(), "The value should be false"); publisher.publishEvent("Hello world!!"); System.out.println("Done publishing synchronous custom event. "); + isTrue(listener.isHitCustomEventHandler(), "Now the value should be changed to true"); + } + + @Test + public void testGenericSpringEvent() { + isTrue(!listener.isHitSuccessfulEventHandler(), "The initial value should be false"); + publisher.publishGenericEvent("Hello world!!!", true); + isTrue(listener.isHitSuccessfulEventHandler(), "Now the value should be changed to true"); + } + + @Test + public void testGenericSpringEventNotProcessed() { + isTrue(!listener.isHitSuccessfulEventHandler(), "The initial value should be false"); + publisher.publishGenericEvent("Hello world!!!", false); + isTrue(!listener.isHitSuccessfulEventHandler(), "The value should still be false"); + } + + @Ignore("fix me") + @Test + public void testContextStartedEvent() { + isTrue(listener.isHitContextStartedHandler(), "Start should be called once"); } } From 2d872af165e3eec9d0b4a2b0274a10bbfa8a3186 Mon Sep 17 00:00:00 2001 From: cdjole Date: Fri, 9 Nov 2018 19:25:50 +0100 Subject: [PATCH 336/546] Circle class update. (#5648) --- core-java/src/main/java/com/baeldung/area/circle/Circle.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core-java/src/main/java/com/baeldung/area/circle/Circle.java b/core-java/src/main/java/com/baeldung/area/circle/Circle.java index 595bc3d2e7..40eed079e4 100644 --- a/core-java/src/main/java/com/baeldung/area/circle/Circle.java +++ b/core-java/src/main/java/com/baeldung/area/circle/Circle.java @@ -16,10 +16,6 @@ public class Circle { this.radius = radius; } - public double getArea() { - return calculateArea(); - } - private double calculateArea() { return radius * radius * Math.PI; } From 61ffac2c77c1f20878893898ce7e19cb11c99db3 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Fri, 9 Nov 2018 20:54:10 +0100 Subject: [PATCH 337/546] jpa cast error --- .../baeldung/jpa/stringcast/DummyEntity.java | 44 ++++++++++++++ .../jpa/stringcast/QueryExecutor.java | 41 +++++++++++++ .../main/resources/META-INF/persistence.xml | 15 +++++ .../jpa/stringcast/SpringCastTest.java | 58 +++++++++++++++++++ .../src/test/resources/persistence.xml | 35 +++++++++++ 5 files changed, 193 insertions(+) create mode 100644 persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/DummyEntity.java create mode 100644 persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/QueryExecutor.java create mode 100644 persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/DummyEntity.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/DummyEntity.java new file mode 100644 index 0000000000..12b57ff112 --- /dev/null +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/DummyEntity.java @@ -0,0 +1,44 @@ +package com.baeldung.jpa.stringcast; + +import javax.persistence.*; + +@SqlResultSetMapping(name = "textQueryMapping", classes = { + @ConstructorResult(targetClass = DummyEntity.class, columns = { + @ColumnResult(name = "text") + }) +}) +@Entity +@Table(name = "dummy") +public class DummyEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String text; + + public DummyEntity() { + + } + + public DummyEntity(String text) { + this.text = text; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + +} diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/QueryExecutor.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/QueryExecutor.java new file mode 100644 index 0000000000..6f1e2ee5ca --- /dev/null +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/QueryExecutor.java @@ -0,0 +1,41 @@ +package com.baeldung.jpa.stringcast; + +import com.sun.istack.internal.Nullable; + +import javax.persistence.EntityManager; +import javax.persistence.Query; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +public class QueryExecutor { + + public static List executeNativeQueryNoCastCheck(String statement, EntityManager em) { + Query query = em.createNativeQuery(statement); + return query.getResultList(); + } + + public static List executeNativeQueryWithCastCheck(String statement, EntityManager em) { + Query query = em.createNativeQuery(statement); + List results = query.getResultList(); + + if (results.isEmpty()) { + return new ArrayList<>(); + } + + if (results.get(0) instanceof String) { + return ((List) results) + .stream() + .map(s -> new String[] { s }) + .collect(Collectors.toList()); + } else { + return (List) results; + } + } + + public static List executeNativeQueryGeneric(String statement, String mapping, EntityManager em) { + Query query = em.createNativeQuery(statement, mapping); + return query.getResultList(); + } + +} diff --git a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml index 3d881673b2..6345e7f364 100644 --- a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml @@ -20,6 +20,21 @@
+ + + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.stringcast.DummyEntity + + + + + + + + + + + org.hibernate.jpa.HibernatePersistenceProvider diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java new file mode 100644 index 0000000000..f66bd5d4e4 --- /dev/null +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java @@ -0,0 +1,58 @@ +package com.baeldung.jpa.stringcast; + +import org.junit.BeforeClass; +import org.junit.Test; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.EntityTransaction; +import javax.persistence.Persistence; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class SpringCastTest { + + private static EntityManager em; + private static EntityManagerFactory emFactory; + + @BeforeClass + public static void setup() { + emFactory = Persistence.createEntityManagerFactory("jpa-h2"); + em = emFactory.createEntityManager(); + + // insert an object into the db + DummyEntity dummyEntity = new DummyEntity(); + dummyEntity.setText("text"); + + EntityTransaction tr = em.getTransaction(); + tr.begin(); + em.persist(dummyEntity); + tr.commit(); + } + + @Test(expected = ClassCastException.class) + public void givenExecutorNoCastCheck_whenQueryReturnsOneColumn_thenClassCastThrown() { + List results = QueryExecutor.executeNativeQueryNoCastCheck("select text from dummy", em); + + // fails + for (String[] row : results) { + // do nothing + } + } + + @Test + public void givenExecutorWithCastCheck_whenQueryReturnsOneColumn_thenNoClassCastThrown() { + List results = QueryExecutor.executeNativeQueryWithCastCheck("select text from dummy", em); + assertEquals("text", results.get(0)[0]); + } + + @Test + public void givenExecutorGeneric_whenQueryReturnsOneColumn_thenNoClassCastThrown() { + List results = QueryExecutor.executeNativeQueryGeneric("select text from dummy", "textQueryMapping", em); + assertEquals("text", results + .get(0) + .getText()); + } + +} diff --git a/persistence-modules/java-jpa/src/test/resources/persistence.xml b/persistence-modules/java-jpa/src/test/resources/persistence.xml index d94221b54f..f65f2c7c62 100644 --- a/persistence-modules/java-jpa/src/test/resources/persistence.xml +++ b/persistence-modules/java-jpa/src/test/resources/persistence.xml @@ -17,5 +17,40 @@ + + + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.stringcast.DummyEntity + + + + + + + + + + + + + + + + com.baeldung.jpa.stringcast.DummyEntity + + + + + + + + + + + + + + + From 1d26380c072d4694fd8ac194befb1f7571bef858 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Fri, 9 Nov 2018 20:55:36 +0100 Subject: [PATCH 338/546] format --- .../test/java/com/baeldung/jpa/stringcast/SpringCastTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java index f66bd5d4e4..ffe8da9bec 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java @@ -50,9 +50,7 @@ public class SpringCastTest { @Test public void givenExecutorGeneric_whenQueryReturnsOneColumn_thenNoClassCastThrown() { List results = QueryExecutor.executeNativeQueryGeneric("select text from dummy", "textQueryMapping", em); - assertEquals("text", results - .get(0) - .getText()); + assertEquals("text", results.get(0).getText()); } } From 792d6f6cc4de6165d76528bec62346d97d70f01f Mon Sep 17 00:00:00 2001 From: geroza Date: Fri, 9 Nov 2018 16:18:03 -0200 Subject: [PATCH 339/546] First commit to migrate the following articles from core-java: * to core-java-lang: * https://www.baeldung.com/java-reflection * https://www.baeldung.com/java-generics * https://www.baeldung.com/java-eclipse-equals-and-hashcode * https://www.baeldung.com/java-chained-exceptions * https://www.baeldung.com/java-primitive-conversions //to package * https://www.baeldung.com/java-method-reflection * https://www.baeldung.com/java-enum-iteration * https://www.baeldung.com/java-reflection-change-annotation-params * https://www.baeldung.com/java-dynamic-proxies * https://www.baeldung.com/java-double-brace-initialization * https://www.baeldung.com/java-hashcode * https://www.baeldung.com/java-diamond-operator * https://www.baeldung.com/java-static (?https://github.com/eugenp/tutorials/pull/3392) * https://www.baeldung.com/java-comparator-comparable * https://www.baeldung.com/java-continue-and-break * https://www.baeldung.com/java-initialization * https://www.baeldung.com/java-nested-classes * https://www.baeldung.com/java-loops * https://www.baeldung.com/java-varargs --- core-java-lang/.gitignore | 25 + core-java-lang/pom.xml | 547 ++++++++++++++++++ .../baeldung/breakcontinue/BreakContinue.java | 1 + .../chainedexception/LogWithChain.java | 0 .../chainedexception/LogWithoutChain.java | 0 .../GirlFriendOfManagerUpsetException.java | 0 .../exceptions/ManagerUpsetException.java | 0 .../exceptions/NoLeaveGrantedException.java | 0 .../exceptions/TeamLeadUpsetException.java | 0 .../java/com/baeldung/comparable/Player.java | 0 .../com/baeldung/comparable/PlayerSorter.java | 0 .../java/com/baeldung/comparator/Player.java | 0 .../comparator/PlayerAgeComparator.java | 0 .../baeldung/comparator/PlayerAgeSorter.java | 0 .../comparator/PlayerRankingComparator.java | 0 .../comparator/PlayerRankingSorter.java | 0 .../DynamicInvocationHandler.java | 0 .../TimingDynamicInvocationHandler.java | 0 .../equalshashcode/entities/ComplexClass.java | 0 .../entities/PrimitiveClass.java | 0 .../equalshashcode/entities/Rectangle.java | 0 .../equalshashcode/entities/Shape.java | 0 .../equalshashcode/entities/Square.java | 0 .../java/com/baeldung/generics/Building.java | 0 .../java/com/baeldung/generics/Generics.java | 0 .../java/com/baeldung/generics/House.java | 0 .../com/baeldung/hashcode/entities/User.java | 0 .../baeldung/initializationguide/User.java | 0 .../com/baeldung/java/reflection/Animal.java | 0 .../com/baeldung/java/reflection/Bird.java | 0 .../java/reflection/DynamicGreeter.java | 0 .../com/baeldung/java/reflection/Eating.java | 0 .../com/baeldung/java/reflection/Goat.java | 0 .../com/baeldung/java/reflection/Greeter.java | 0 .../java/reflection/GreetingAnnotation.java | 0 .../baeldung/java/reflection/Greetings.java | 0 .../baeldung/java/reflection/Locomotion.java | 0 .../baeldung/java/reflection/Operations.java | 0 .../com/baeldung/java/reflection/Person.java | 0 .../com/baeldung/loops/InfiniteLoops.java | 0 .../java/com/baeldung/loops/LoopsInJava.java | 0 .../java/com/baeldung/staticdemo/Car.java | 0 .../com/baeldung/staticdemo/Singleton.java | 0 .../com/baeldung/staticdemo/StaticBlock.java | 0 .../breakcontinue/BreakContinueUnitTest.java | 0 .../comparable/ComparableUnitTest.java | 0 .../comparator/ComparatorUnitTest.java | 0 .../comparator/Java8ComparatorUnitTest.java | 0 .../DynamicProxyIntegrationTest.java | 0 .../entities/ComplexClassUnitTest.java | 2 +- .../entities/PrimitiveClassUnitTest.java | 4 +- .../entities/SquareClassUnitTest.java | 2 +- .../baeldung/generics/GenericsUnitTest.java | 0 .../application/ApplicationUnitTest.java | 0 .../hashcode/entities/UserUnitTest.java | 0 .../initializationguide/UserUnitTest.java | 0 .../java/com}/baeldung/java/diamond/Car.java | 2 +- .../java/diamond/DiamondOperatorUnitTest.java | 2 +- .../com}/baeldung/java/diamond/Diesel.java | 2 +- .../com}/baeldung/java/diamond/Engine.java | 2 +- .../com}/baeldung/java/diamond/Vehicle.java | 2 +- .../java/doublebrace/DoubleBraceUnitTest.java | 0 .../java/enumiteration/DaysOfWeekEnum.java | 0 .../enumiteration/EnumIterationExamples.java | 0 .../java/reflection/OperationsUnitTest.java | 0 .../java/reflection/ReflectionUnitTest.java | 0 .../com/baeldung/loops/WhenUsingLoops.java | 0 .../baeldung/nestedclass/AnonymousInner.java | 0 .../com/baeldung/nestedclass/Enclosing.java | 0 .../baeldung/nestedclass/NewEnclosing.java | 0 .../com/baeldung/nestedclass/NewOuter.java | 0 .../java/com/baeldung/nestedclass/Outer.java | 0 .../PrimitiveConversionsJUnitTest.java | 2 +- .../staticdemo/CarIntegrationTest.java | 0 .../staticdemo/SingletonIntegrationTest.java | 0 .../StaticBlockIntegrationTest.java | 0 .../baeldung/varargs/FormatterUnitTest.java | 0 .../equalshashcode/entities/ComplexClass.java | 63 -- .../entities/PrimitiveClass.java | 54 -- .../equalshashcode/entities/Rectangle.java | 58 -- .../equalshashcode/entities/Shape.java | 7 - .../equalshashcode/entities/Square.java | 58 -- .../operations/MoreOperationsUnitTest.java | 38 -- pom.xml | 1 + 84 files changed, 583 insertions(+), 289 deletions(-) create mode 100644 core-java-lang/.gitignore create mode 100644 core-java-lang/pom.xml rename {core-java => core-java-lang}/src/main/java/com/baeldung/breakcontinue/BreakContinue.java (99%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/chainedexception/LogWithChain.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/comparable/Player.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/comparable/PlayerSorter.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/comparator/Player.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/comparator/PlayerAgeComparator.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/comparator/PlayerAgeSorter.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/comparator/PlayerRankingComparator.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/comparator/PlayerRankingSorter.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/dynamicproxy/DynamicInvocationHandler.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/dynamicproxy/TimingDynamicInvocationHandler.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/equalshashcode/entities/ComplexClass.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/equalshashcode/entities/PrimitiveClass.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/equalshashcode/entities/Rectangle.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/equalshashcode/entities/Shape.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/equalshashcode/entities/Square.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/generics/Building.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/generics/Generics.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/generics/House.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/hashcode/entities/User.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/initializationguide/User.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Animal.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Bird.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/DynamicGreeter.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Eating.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Goat.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Greeter.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/GreetingAnnotation.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Greetings.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Locomotion.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Operations.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/java/reflection/Person.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/loops/InfiniteLoops.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/loops/LoopsInJava.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/staticdemo/Car.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/staticdemo/Singleton.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/staticdemo/StaticBlock.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/breakcontinue/BreakContinueUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/comparable/ComparableUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/comparator/ComparatorUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/comparator/Java8ComparatorUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/dynamicproxy/DynamicProxyIntegrationTest.java (100%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/equalshashcode/entities/ComplexClassUnitTest.java (95%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/equalshashcode/entities/PrimitiveClassUnitTest.java (85%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/equalshashcode/entities/SquareClassUnitTest.java (93%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/generics/GenericsUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/initializationguide/UserUnitTest.java (100%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/java/diamond/Car.java (64%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/java/diamond/DiamondOperatorUnitTest.java (88%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/java/diamond/Diesel.java (78%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/java/diamond/Engine.java (56%) rename {core-java/src/test/java/org => core-java-lang/src/test/java/com}/baeldung/java/diamond/Vehicle.java (58%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java (100%) rename {core-java/src/main => core-java-lang/src/test}/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java (100%) rename {core-java/src/main => core-java-lang/src/test}/java/com/baeldung/java/enumiteration/EnumIterationExamples.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/java/reflection/ReflectionUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/loops/WhenUsingLoops.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/nestedclass/AnonymousInner.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/nestedclass/Enclosing.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/nestedclass/NewEnclosing.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/nestedclass/NewOuter.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/nestedclass/Outer.java (100%) rename {core-java/src/test/java/com/baeldung => core-java-lang/src/test/java/com/baeldung/primitiveconversion}/PrimitiveConversionsJUnitTest.java (99%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/staticdemo/CarIntegrationTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/staticdemo/SingletonIntegrationTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/staticdemo/StaticBlockIntegrationTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/varargs/FormatterUnitTest.java (100%) delete mode 100644 core-java/src/main/java/org/baeldung/equalshashcode/entities/ComplexClass.java delete mode 100644 core-java/src/main/java/org/baeldung/equalshashcode/entities/PrimitiveClass.java delete mode 100644 core-java/src/main/java/org/baeldung/equalshashcode/entities/Rectangle.java delete mode 100644 core-java/src/main/java/org/baeldung/equalshashcode/entities/Shape.java delete mode 100644 core-java/src/main/java/org/baeldung/equalshashcode/entities/Square.java delete mode 100644 core-java/src/test/java/com/baeldung/java/reflection/operations/MoreOperationsUnitTest.java diff --git a/core-java-lang/.gitignore b/core-java-lang/.gitignore new file mode 100644 index 0000000000..374c8bf907 --- /dev/null +++ b/core-java-lang/.gitignore @@ -0,0 +1,25 @@ +*.class + +0.* + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* +.resourceCache + +# Packaged files # +*.jar +*.war +*.ear + +# Files generated by integration tests +backup-pom.xml +/bin/ +/temp + +#IntelliJ specific +.idea/ +*.iml \ No newline at end of file diff --git a/core-java-lang/pom.xml b/core-java-lang/pom.xml new file mode 100644 index 0000000000..b13b279a03 --- /dev/null +++ b/core-java-lang/pom.xml @@ -0,0 +1,547 @@ + + 4.0.0 + com.baeldung + core-java-lang + 0.1.0-SNAPSHOT + jar + core-java-lang + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.bouncycastle + bcprov-jdk15on + ${bouncycastle.version} + + + org.unix4j + unix4j-command + ${unix4j.version} + + + com.googlecode.grep4j + grep4j + ${grep4j.version} + + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.google.code.gson + gson + ${gson.version} + + + + log4j + log4j + ${log4j.version} + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.javamoney + moneta + ${javamoney.moneta.version} + + + org.owasp.esapi + esapi + ${esapi.version} + + + com.sun.messaging.mq + fscontext + ${fscontext.version} + + + com.codepoetics + protonpack + ${protonpack.version} + + + one.util + streamex + ${streamex.version} + + + io.vavr + vavr + ${vavr.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator-annprocess.version} + + + org.springframework + spring-web + ${springframework.spring-web.version} + + + com.h2database + h2 + ${h2database.version} + + + javax.mail + mail + ${javax.mail.version} + + + + org.apache.tika + tika-core + ${tika.version} + + + net.sf.jmimemagic + jmimemagic + ${jmime-magic.version} + + + + org.javassist + javassist + ${javaassist.version} + + + com.sun + tools + 1.8.0 + system + ${java.home}/../lib/tools.jar + + + + + core-java-lang + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + **/*LongRunningUnitTest.java + **/*ManualTest.java + + true + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + + true + libs/ + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + package + + single + + + ${project.basedir} + + + org.baeldung.executable.ExecutableMavenJar + + + + jar-with-dependencies + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven-shade-plugin.version} + + + + shade + + + true + + + org.baeldung.executable.ExecutableMavenJar + + + + + + + + + com.jolira + onejar-maven-plugin + ${onejar-maven-plugin.version} + + + + org.baeldung.executable.ExecutableMavenJar + true + ${project.build.finalName}-onejar.${project.packaging} + + + one-jar + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot-maven-plugin.version} + + + + repackage + + + spring-boot + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + java + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + -Xmx300m + -XX:+UseParallelGC + -classpath + + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + 1.8 + 1.8 + + + + + + + + integration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*ManualTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + json + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + run-benchmarks + + none + + exec + + + test + java + + -classpath + + org.openjdk.jmh.Main + .* + + + + + + + + + + + + buildAgentLoader + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + agentLoader + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/application/AgentLoader.class + com/baeldung/instrumentation/application/Launcher.class + + + + + + + + + + buildApplication + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + application + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/application/MyAtm.class + com/baeldung/instrumentation/application/MyAtmApplication.class + com/baeldung/instrumentation/application/Launcher.class + + + + + + + + + + buildAgent + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + agent + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/agent/AtmTransformer.class + com/baeldung/instrumentation/agent/MyInstrumentationAgent.class + + + + + + + + + + + + + + 2.8.5 + 2.8.2 + + + 3.5 + 1.55 + 1.10 + 2.5 + 3.6.1 + 1.0.3 + 0.4 + 1.8.7 + 1.16.12 + 4.6-b01 + 1.13 + 0.6.5 + 0.9.0 + + + 3.10.0 + + + 2.21.0 + 4.3.4.RELEASE + + 1.1 + 1.4.197 + 2.1.0.1 + 1.19 + + 1.19 + 3.0.0-M1 + 1.5.0-b01 + 3.0.2 + 1.4.4 + 3.1.1 + 2.0.3.RELEASE + 1.6.0 + 61.1 + + 1.18 + 0.1.5 + + 3.21.0-GA + + + diff --git a/core-java/src/main/java/com/baeldung/breakcontinue/BreakContinue.java b/core-java-lang/src/main/java/com/baeldung/breakcontinue/BreakContinue.java similarity index 99% rename from core-java/src/main/java/com/baeldung/breakcontinue/BreakContinue.java rename to core-java-lang/src/main/java/com/baeldung/breakcontinue/BreakContinue.java index ce85b487c1..23bb531273 100644 --- a/core-java/src/main/java/com/baeldung/breakcontinue/BreakContinue.java +++ b/core-java-lang/src/main/java/com/baeldung/breakcontinue/BreakContinue.java @@ -11,6 +11,7 @@ import java.util.Map.Entry; * @author Santosh * */ + public class BreakContinue { public static int unlabeledBreak() { diff --git a/core-java/src/main/java/com/baeldung/chainedexception/LogWithChain.java b/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithChain.java similarity index 100% rename from core-java/src/main/java/com/baeldung/chainedexception/LogWithChain.java rename to core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithChain.java diff --git a/core-java/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java b/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java similarity index 100% rename from core-java/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java rename to core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java diff --git a/core-java/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java b/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java rename to core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java diff --git a/core-java/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java b/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java rename to core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java diff --git a/core-java/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java b/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java rename to core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java diff --git a/core-java/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java b/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java rename to core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java diff --git a/core-java/src/main/java/com/baeldung/comparable/Player.java b/core-java-lang/src/main/java/com/baeldung/comparable/Player.java similarity index 100% rename from core-java/src/main/java/com/baeldung/comparable/Player.java rename to core-java-lang/src/main/java/com/baeldung/comparable/Player.java diff --git a/core-java/src/main/java/com/baeldung/comparable/PlayerSorter.java b/core-java-lang/src/main/java/com/baeldung/comparable/PlayerSorter.java similarity index 100% rename from core-java/src/main/java/com/baeldung/comparable/PlayerSorter.java rename to core-java-lang/src/main/java/com/baeldung/comparable/PlayerSorter.java diff --git a/core-java/src/main/java/com/baeldung/comparator/Player.java b/core-java-lang/src/main/java/com/baeldung/comparator/Player.java similarity index 100% rename from core-java/src/main/java/com/baeldung/comparator/Player.java rename to core-java-lang/src/main/java/com/baeldung/comparator/Player.java diff --git a/core-java/src/main/java/com/baeldung/comparator/PlayerAgeComparator.java b/core-java-lang/src/main/java/com/baeldung/comparator/PlayerAgeComparator.java similarity index 100% rename from core-java/src/main/java/com/baeldung/comparator/PlayerAgeComparator.java rename to core-java-lang/src/main/java/com/baeldung/comparator/PlayerAgeComparator.java diff --git a/core-java/src/main/java/com/baeldung/comparator/PlayerAgeSorter.java b/core-java-lang/src/main/java/com/baeldung/comparator/PlayerAgeSorter.java similarity index 100% rename from core-java/src/main/java/com/baeldung/comparator/PlayerAgeSorter.java rename to core-java-lang/src/main/java/com/baeldung/comparator/PlayerAgeSorter.java diff --git a/core-java/src/main/java/com/baeldung/comparator/PlayerRankingComparator.java b/core-java-lang/src/main/java/com/baeldung/comparator/PlayerRankingComparator.java similarity index 100% rename from core-java/src/main/java/com/baeldung/comparator/PlayerRankingComparator.java rename to core-java-lang/src/main/java/com/baeldung/comparator/PlayerRankingComparator.java diff --git a/core-java/src/main/java/com/baeldung/comparator/PlayerRankingSorter.java b/core-java-lang/src/main/java/com/baeldung/comparator/PlayerRankingSorter.java similarity index 100% rename from core-java/src/main/java/com/baeldung/comparator/PlayerRankingSorter.java rename to core-java-lang/src/main/java/com/baeldung/comparator/PlayerRankingSorter.java diff --git a/core-java/src/main/java/com/baeldung/dynamicproxy/DynamicInvocationHandler.java b/core-java-lang/src/main/java/com/baeldung/dynamicproxy/DynamicInvocationHandler.java similarity index 100% rename from core-java/src/main/java/com/baeldung/dynamicproxy/DynamicInvocationHandler.java rename to core-java-lang/src/main/java/com/baeldung/dynamicproxy/DynamicInvocationHandler.java diff --git a/core-java/src/main/java/com/baeldung/dynamicproxy/TimingDynamicInvocationHandler.java b/core-java-lang/src/main/java/com/baeldung/dynamicproxy/TimingDynamicInvocationHandler.java similarity index 100% rename from core-java/src/main/java/com/baeldung/dynamicproxy/TimingDynamicInvocationHandler.java rename to core-java-lang/src/main/java/com/baeldung/dynamicproxy/TimingDynamicInvocationHandler.java diff --git a/core-java/src/main/java/com/baeldung/equalshashcode/entities/ComplexClass.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/ComplexClass.java similarity index 100% rename from core-java/src/main/java/com/baeldung/equalshashcode/entities/ComplexClass.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/ComplexClass.java diff --git a/core-java/src/main/java/com/baeldung/equalshashcode/entities/PrimitiveClass.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/PrimitiveClass.java similarity index 100% rename from core-java/src/main/java/com/baeldung/equalshashcode/entities/PrimitiveClass.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/PrimitiveClass.java diff --git a/core-java/src/main/java/com/baeldung/equalshashcode/entities/Rectangle.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/Rectangle.java similarity index 100% rename from core-java/src/main/java/com/baeldung/equalshashcode/entities/Rectangle.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/Rectangle.java diff --git a/core-java/src/main/java/com/baeldung/equalshashcode/entities/Shape.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/Shape.java similarity index 100% rename from core-java/src/main/java/com/baeldung/equalshashcode/entities/Shape.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/Shape.java diff --git a/core-java/src/main/java/com/baeldung/equalshashcode/entities/Square.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/Square.java similarity index 100% rename from core-java/src/main/java/com/baeldung/equalshashcode/entities/Square.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/entities/Square.java diff --git a/core-java/src/main/java/com/baeldung/generics/Building.java b/core-java-lang/src/main/java/com/baeldung/generics/Building.java similarity index 100% rename from core-java/src/main/java/com/baeldung/generics/Building.java rename to core-java-lang/src/main/java/com/baeldung/generics/Building.java diff --git a/core-java/src/main/java/com/baeldung/generics/Generics.java b/core-java-lang/src/main/java/com/baeldung/generics/Generics.java similarity index 100% rename from core-java/src/main/java/com/baeldung/generics/Generics.java rename to core-java-lang/src/main/java/com/baeldung/generics/Generics.java diff --git a/core-java/src/main/java/com/baeldung/generics/House.java b/core-java-lang/src/main/java/com/baeldung/generics/House.java similarity index 100% rename from core-java/src/main/java/com/baeldung/generics/House.java rename to core-java-lang/src/main/java/com/baeldung/generics/House.java diff --git a/core-java/src/main/java/com/baeldung/hashcode/entities/User.java b/core-java-lang/src/main/java/com/baeldung/hashcode/entities/User.java similarity index 100% rename from core-java/src/main/java/com/baeldung/hashcode/entities/User.java rename to core-java-lang/src/main/java/com/baeldung/hashcode/entities/User.java diff --git a/core-java/src/main/java/com/baeldung/initializationguide/User.java b/core-java-lang/src/main/java/com/baeldung/initializationguide/User.java similarity index 100% rename from core-java/src/main/java/com/baeldung/initializationguide/User.java rename to core-java-lang/src/main/java/com/baeldung/initializationguide/User.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Animal.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Animal.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Animal.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Animal.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Bird.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Bird.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Bird.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Bird.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/DynamicGreeter.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/DynamicGreeter.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/DynamicGreeter.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/DynamicGreeter.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Eating.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Eating.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Eating.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Eating.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Goat.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Goat.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Goat.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Goat.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Greeter.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Greeter.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Greeter.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Greeter.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/GreetingAnnotation.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/GreetingAnnotation.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/GreetingAnnotation.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/GreetingAnnotation.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Greetings.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Greetings.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Greetings.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Greetings.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Locomotion.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Locomotion.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Locomotion.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Locomotion.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Operations.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Operations.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Operations.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Operations.java diff --git a/core-java/src/main/java/com/baeldung/java/reflection/Person.java b/core-java-lang/src/main/java/com/baeldung/java/reflection/Person.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/reflection/Person.java rename to core-java-lang/src/main/java/com/baeldung/java/reflection/Person.java diff --git a/core-java/src/main/java/com/baeldung/loops/InfiniteLoops.java b/core-java-lang/src/main/java/com/baeldung/loops/InfiniteLoops.java similarity index 100% rename from core-java/src/main/java/com/baeldung/loops/InfiniteLoops.java rename to core-java-lang/src/main/java/com/baeldung/loops/InfiniteLoops.java diff --git a/core-java/src/main/java/com/baeldung/loops/LoopsInJava.java b/core-java-lang/src/main/java/com/baeldung/loops/LoopsInJava.java similarity index 100% rename from core-java/src/main/java/com/baeldung/loops/LoopsInJava.java rename to core-java-lang/src/main/java/com/baeldung/loops/LoopsInJava.java diff --git a/core-java/src/main/java/com/baeldung/staticdemo/Car.java b/core-java-lang/src/main/java/com/baeldung/staticdemo/Car.java similarity index 100% rename from core-java/src/main/java/com/baeldung/staticdemo/Car.java rename to core-java-lang/src/main/java/com/baeldung/staticdemo/Car.java diff --git a/core-java/src/main/java/com/baeldung/staticdemo/Singleton.java b/core-java-lang/src/main/java/com/baeldung/staticdemo/Singleton.java similarity index 100% rename from core-java/src/main/java/com/baeldung/staticdemo/Singleton.java rename to core-java-lang/src/main/java/com/baeldung/staticdemo/Singleton.java diff --git a/core-java/src/main/java/com/baeldung/staticdemo/StaticBlock.java b/core-java-lang/src/main/java/com/baeldung/staticdemo/StaticBlock.java similarity index 100% rename from core-java/src/main/java/com/baeldung/staticdemo/StaticBlock.java rename to core-java-lang/src/main/java/com/baeldung/staticdemo/StaticBlock.java diff --git a/core-java/src/test/java/com/baeldung/breakcontinue/BreakContinueUnitTest.java b/core-java-lang/src/test/java/com/baeldung/breakcontinue/BreakContinueUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/breakcontinue/BreakContinueUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/breakcontinue/BreakContinueUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/comparable/ComparableUnitTest.java b/core-java-lang/src/test/java/com/baeldung/comparable/ComparableUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/comparable/ComparableUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/comparable/ComparableUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/comparator/ComparatorUnitTest.java b/core-java-lang/src/test/java/com/baeldung/comparator/ComparatorUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/comparator/ComparatorUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/comparator/ComparatorUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/comparator/Java8ComparatorUnitTest.java b/core-java-lang/src/test/java/com/baeldung/comparator/Java8ComparatorUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/comparator/Java8ComparatorUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/comparator/Java8ComparatorUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/dynamicproxy/DynamicProxyIntegrationTest.java b/core-java-lang/src/test/java/com/baeldung/dynamicproxy/DynamicProxyIntegrationTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/dynamicproxy/DynamicProxyIntegrationTest.java rename to core-java-lang/src/test/java/com/baeldung/dynamicproxy/DynamicProxyIntegrationTest.java diff --git a/core-java/src/test/java/org/baeldung/equalshashcode/entities/ComplexClassUnitTest.java b/core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/ComplexClassUnitTest.java similarity index 95% rename from core-java/src/test/java/org/baeldung/equalshashcode/entities/ComplexClassUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/ComplexClassUnitTest.java index 680a6d57b5..0cb4ace0ab 100644 --- a/core-java/src/test/java/org/baeldung/equalshashcode/entities/ComplexClassUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/ComplexClassUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.equalshashcode.entities; +package com.baeldung.equalshashcode.entities; import java.util.ArrayList; import java.util.HashSet; diff --git a/core-java/src/test/java/org/baeldung/equalshashcode/entities/PrimitiveClassUnitTest.java b/core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/PrimitiveClassUnitTest.java similarity index 85% rename from core-java/src/test/java/org/baeldung/equalshashcode/entities/PrimitiveClassUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/PrimitiveClassUnitTest.java index f4e9f2b99f..457d7a2b5e 100644 --- a/core-java/src/test/java/org/baeldung/equalshashcode/entities/PrimitiveClassUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/PrimitiveClassUnitTest.java @@ -1,10 +1,8 @@ -package org.baeldung.equalshashcode.entities; +package com.baeldung.equalshashcode.entities; import org.junit.Assert; import org.junit.Test; -import com.baeldung.equalshashcode.entities.PrimitiveClass; - public class PrimitiveClassUnitTest { @Test diff --git a/core-java/src/test/java/org/baeldung/equalshashcode/entities/SquareClassUnitTest.java b/core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/SquareClassUnitTest.java similarity index 93% rename from core-java/src/test/java/org/baeldung/equalshashcode/entities/SquareClassUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/SquareClassUnitTest.java index 5c860bd62d..a25e8bd486 100644 --- a/core-java/src/test/java/org/baeldung/equalshashcode/entities/SquareClassUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/equalshashcode/entities/SquareClassUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.equalshashcode.entities; +package com.baeldung.equalshashcode.entities; import java.awt.Color; diff --git a/core-java/src/test/java/com/baeldung/generics/GenericsUnitTest.java b/core-java-lang/src/test/java/com/baeldung/generics/GenericsUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/generics/GenericsUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/generics/GenericsUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java b/core-java-lang/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/hashcode/application/ApplicationUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java b/core-java-lang/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/hashcode/entities/UserUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/initializationguide/UserUnitTest.java b/core-java-lang/src/test/java/com/baeldung/initializationguide/UserUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/initializationguide/UserUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/initializationguide/UserUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/diamond/Car.java b/core-java-lang/src/test/java/com/baeldung/java/diamond/Car.java similarity index 64% rename from core-java/src/test/java/org/baeldung/java/diamond/Car.java rename to core-java-lang/src/test/java/com/baeldung/java/diamond/Car.java index 9f923e0f3b..a680c4e670 100644 --- a/core-java/src/test/java/org/baeldung/java/diamond/Car.java +++ b/core-java-lang/src/test/java/com/baeldung/java/diamond/Car.java @@ -1,4 +1,4 @@ -package org.baeldung.java.diamond; +package com.baeldung.java.diamond; public class Car implements Vehicle { diff --git a/core-java/src/test/java/org/baeldung/java/diamond/DiamondOperatorUnitTest.java b/core-java-lang/src/test/java/com/baeldung/java/diamond/DiamondOperatorUnitTest.java similarity index 88% rename from core-java/src/test/java/org/baeldung/java/diamond/DiamondOperatorUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/java/diamond/DiamondOperatorUnitTest.java index f6c7f7162f..ee5f639926 100644 --- a/core-java/src/test/java/org/baeldung/java/diamond/DiamondOperatorUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/java/diamond/DiamondOperatorUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.diamond; +package com.baeldung.java.diamond; import static org.junit.Assert.assertNotNull; diff --git a/core-java/src/test/java/org/baeldung/java/diamond/Diesel.java b/core-java-lang/src/test/java/com/baeldung/java/diamond/Diesel.java similarity index 78% rename from core-java/src/test/java/org/baeldung/java/diamond/Diesel.java rename to core-java-lang/src/test/java/com/baeldung/java/diamond/Diesel.java index dc4256cdae..90eb7d9340 100644 --- a/core-java/src/test/java/org/baeldung/java/diamond/Diesel.java +++ b/core-java-lang/src/test/java/com/baeldung/java/diamond/Diesel.java @@ -1,4 +1,4 @@ -package org.baeldung.java.diamond; +package com.baeldung.java.diamond; public class Diesel implements Engine { diff --git a/core-java/src/test/java/org/baeldung/java/diamond/Engine.java b/core-java-lang/src/test/java/com/baeldung/java/diamond/Engine.java similarity index 56% rename from core-java/src/test/java/org/baeldung/java/diamond/Engine.java rename to core-java-lang/src/test/java/com/baeldung/java/diamond/Engine.java index c18a8f64b5..746baf3254 100644 --- a/core-java/src/test/java/org/baeldung/java/diamond/Engine.java +++ b/core-java-lang/src/test/java/com/baeldung/java/diamond/Engine.java @@ -1,4 +1,4 @@ -package org.baeldung.java.diamond; +package com.baeldung.java.diamond; public interface Engine { diff --git a/core-java/src/test/java/org/baeldung/java/diamond/Vehicle.java b/core-java-lang/src/test/java/com/baeldung/java/diamond/Vehicle.java similarity index 58% rename from core-java/src/test/java/org/baeldung/java/diamond/Vehicle.java rename to core-java-lang/src/test/java/com/baeldung/java/diamond/Vehicle.java index f61cf59620..8395cdd970 100644 --- a/core-java/src/test/java/org/baeldung/java/diamond/Vehicle.java +++ b/core-java-lang/src/test/java/com/baeldung/java/diamond/Vehicle.java @@ -1,4 +1,4 @@ -package org.baeldung.java.diamond; +package com.baeldung.java.diamond; public interface Vehicle { diff --git a/core-java/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java b/core-java-lang/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java b/core-java-lang/src/test/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java rename to core-java-lang/src/test/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java diff --git a/core-java/src/main/java/com/baeldung/java/enumiteration/EnumIterationExamples.java b/core-java-lang/src/test/java/com/baeldung/java/enumiteration/EnumIterationExamples.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/enumiteration/EnumIterationExamples.java rename to core-java-lang/src/test/java/com/baeldung/java/enumiteration/EnumIterationExamples.java diff --git a/core-java/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java b/core-java-lang/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/java/reflection/ReflectionUnitTest.java b/core-java-lang/src/test/java/com/baeldung/java/reflection/ReflectionUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/reflection/ReflectionUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/java/reflection/ReflectionUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/loops/WhenUsingLoops.java b/core-java-lang/src/test/java/com/baeldung/loops/WhenUsingLoops.java similarity index 100% rename from core-java/src/test/java/com/baeldung/loops/WhenUsingLoops.java rename to core-java-lang/src/test/java/com/baeldung/loops/WhenUsingLoops.java diff --git a/core-java/src/test/java/com/baeldung/nestedclass/AnonymousInner.java b/core-java-lang/src/test/java/com/baeldung/nestedclass/AnonymousInner.java similarity index 100% rename from core-java/src/test/java/com/baeldung/nestedclass/AnonymousInner.java rename to core-java-lang/src/test/java/com/baeldung/nestedclass/AnonymousInner.java diff --git a/core-java/src/test/java/com/baeldung/nestedclass/Enclosing.java b/core-java-lang/src/test/java/com/baeldung/nestedclass/Enclosing.java similarity index 100% rename from core-java/src/test/java/com/baeldung/nestedclass/Enclosing.java rename to core-java-lang/src/test/java/com/baeldung/nestedclass/Enclosing.java diff --git a/core-java/src/test/java/com/baeldung/nestedclass/NewEnclosing.java b/core-java-lang/src/test/java/com/baeldung/nestedclass/NewEnclosing.java similarity index 100% rename from core-java/src/test/java/com/baeldung/nestedclass/NewEnclosing.java rename to core-java-lang/src/test/java/com/baeldung/nestedclass/NewEnclosing.java diff --git a/core-java/src/test/java/com/baeldung/nestedclass/NewOuter.java b/core-java-lang/src/test/java/com/baeldung/nestedclass/NewOuter.java similarity index 100% rename from core-java/src/test/java/com/baeldung/nestedclass/NewOuter.java rename to core-java-lang/src/test/java/com/baeldung/nestedclass/NewOuter.java diff --git a/core-java/src/test/java/com/baeldung/nestedclass/Outer.java b/core-java-lang/src/test/java/com/baeldung/nestedclass/Outer.java similarity index 100% rename from core-java/src/test/java/com/baeldung/nestedclass/Outer.java rename to core-java-lang/src/test/java/com/baeldung/nestedclass/Outer.java diff --git a/core-java/src/test/java/com/baeldung/PrimitiveConversionsJUnitTest.java b/core-java-lang/src/test/java/com/baeldung/primitiveconversion/PrimitiveConversionsJUnitTest.java similarity index 99% rename from core-java/src/test/java/com/baeldung/PrimitiveConversionsJUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/primitiveconversion/PrimitiveConversionsJUnitTest.java index 69a6c18dfd..cb83f4a5ed 100644 --- a/core-java/src/test/java/com/baeldung/PrimitiveConversionsJUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/primitiveconversion/PrimitiveConversionsJUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.primitiveconversion; import org.junit.Test; import org.slf4j.Logger; diff --git a/core-java/src/test/java/com/baeldung/staticdemo/CarIntegrationTest.java b/core-java-lang/src/test/java/com/baeldung/staticdemo/CarIntegrationTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/staticdemo/CarIntegrationTest.java rename to core-java-lang/src/test/java/com/baeldung/staticdemo/CarIntegrationTest.java diff --git a/core-java/src/test/java/com/baeldung/staticdemo/SingletonIntegrationTest.java b/core-java-lang/src/test/java/com/baeldung/staticdemo/SingletonIntegrationTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/staticdemo/SingletonIntegrationTest.java rename to core-java-lang/src/test/java/com/baeldung/staticdemo/SingletonIntegrationTest.java diff --git a/core-java/src/test/java/com/baeldung/staticdemo/StaticBlockIntegrationTest.java b/core-java-lang/src/test/java/com/baeldung/staticdemo/StaticBlockIntegrationTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/staticdemo/StaticBlockIntegrationTest.java rename to core-java-lang/src/test/java/com/baeldung/staticdemo/StaticBlockIntegrationTest.java diff --git a/core-java/src/test/java/com/baeldung/varargs/FormatterUnitTest.java b/core-java-lang/src/test/java/com/baeldung/varargs/FormatterUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/varargs/FormatterUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/varargs/FormatterUnitTest.java diff --git a/core-java/src/main/java/org/baeldung/equalshashcode/entities/ComplexClass.java b/core-java/src/main/java/org/baeldung/equalshashcode/entities/ComplexClass.java deleted file mode 100644 index 6329f41252..0000000000 --- a/core-java/src/main/java/org/baeldung/equalshashcode/entities/ComplexClass.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.baeldung.equalshashcode.entities; - -import java.util.List; -import java.util.Set; - -public class ComplexClass { - - private List genericList; - private Set integerSet; - - public ComplexClass(List genericArrayList, Set integerHashSet) { - super(); - this.genericList = genericArrayList; - this.integerSet = integerHashSet; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((genericList == null) ? 0 : genericList.hashCode()); - result = prime * result + ((integerSet == null) ? 0 : integerSet.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (!(obj instanceof ComplexClass)) - return false; - ComplexClass other = (ComplexClass) obj; - if (genericList == null) { - if (other.genericList != null) - return false; - } else if (!genericList.equals(other.genericList)) - return false; - if (integerSet == null) { - if (other.integerSet != null) - return false; - } else if (!integerSet.equals(other.integerSet)) - return false; - return true; - } - - protected List getGenericList() { - return genericList; - } - - protected void setGenericArrayList(List genericList) { - this.genericList = genericList; - } - - protected Set getIntegerSet() { - return integerSet; - } - - protected void setIntegerSet(Set integerSet) { - this.integerSet = integerSet; - } -} diff --git a/core-java/src/main/java/org/baeldung/equalshashcode/entities/PrimitiveClass.java b/core-java/src/main/java/org/baeldung/equalshashcode/entities/PrimitiveClass.java deleted file mode 100644 index ebe005688c..0000000000 --- a/core-java/src/main/java/org/baeldung/equalshashcode/entities/PrimitiveClass.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.baeldung.equalshashcode.entities; - -public class PrimitiveClass { - - private boolean primitiveBoolean; - private int primitiveInt; - - public PrimitiveClass(boolean primitiveBoolean, int primitiveInt) { - super(); - this.primitiveBoolean = primitiveBoolean; - this.primitiveInt = primitiveInt; - } - - protected boolean isPrimitiveBoolean() { - return primitiveBoolean; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (primitiveBoolean ? 1231 : 1237); - result = prime * result + primitiveInt; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - PrimitiveClass other = (PrimitiveClass) obj; - if (primitiveBoolean != other.primitiveBoolean) - return false; - if (primitiveInt != other.primitiveInt) - return false; - return true; - } - - protected void setPrimitiveBoolean(boolean primitiveBoolean) { - this.primitiveBoolean = primitiveBoolean; - } - - protected int getPrimitiveInt() { - return primitiveInt; - } - - protected void setPrimitiveInt(int primitiveInt) { - this.primitiveInt = primitiveInt; - } -} diff --git a/core-java/src/main/java/org/baeldung/equalshashcode/entities/Rectangle.java b/core-java/src/main/java/org/baeldung/equalshashcode/entities/Rectangle.java deleted file mode 100644 index 5e38eb6088..0000000000 --- a/core-java/src/main/java/org/baeldung/equalshashcode/entities/Rectangle.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.baeldung.equalshashcode.entities; - -public class Rectangle extends Shape { - private double width; - private double length; - - Rectangle(double width, double length) { - this.width = width; - this.length = length; - } - - @Override - public double area() { - return width * length; - } - - @Override - public double perimeter() { - return 2 * (width + length); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - long temp; - temp = Double.doubleToLongBits(length); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(width); - result = prime * result + (int) (temp ^ (temp >>> 32)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Rectangle other = (Rectangle) obj; - if (Double.doubleToLongBits(length) != Double.doubleToLongBits(other.length)) - return false; - if (Double.doubleToLongBits(width) != Double.doubleToLongBits(other.width)) - return false; - return true; - } - - protected double getWidth() { - return width; - } - - protected double getLength() { - return length; - } - -} \ No newline at end of file diff --git a/core-java/src/main/java/org/baeldung/equalshashcode/entities/Shape.java b/core-java/src/main/java/org/baeldung/equalshashcode/entities/Shape.java deleted file mode 100644 index 3bfc81da8f..0000000000 --- a/core-java/src/main/java/org/baeldung/equalshashcode/entities/Shape.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.baeldung.equalshashcode.entities; - -public abstract class Shape { - public abstract double area(); - - public abstract double perimeter(); -} diff --git a/core-java/src/main/java/org/baeldung/equalshashcode/entities/Square.java b/core-java/src/main/java/org/baeldung/equalshashcode/entities/Square.java deleted file mode 100644 index f11e34f0ba..0000000000 --- a/core-java/src/main/java/org/baeldung/equalshashcode/entities/Square.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.baeldung.equalshashcode.entities; - -import java.awt.Color; - -public class Square extends Rectangle { - - Color color; - - public Square(double width, Color color) { - super(width, width); - this.color = color; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((color == null) ? 0 : color.hashCode()); - return result; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (!(obj instanceof Square)) { - return false; - } - Square other = (Square) obj; - if (color == null) { - if (other.color != null) { - return false; - } - } else if (!color.equals(other.color)) { - return false; - } - return true; - } - - protected Color getColor() { - return color; - } - - protected void setColor(Color color) { - this.color = color; - } - -} diff --git a/core-java/src/test/java/com/baeldung/java/reflection/operations/MoreOperationsUnitTest.java b/core-java/src/test/java/com/baeldung/java/reflection/operations/MoreOperationsUnitTest.java deleted file mode 100644 index 2fe0a54664..0000000000 --- a/core-java/src/test/java/com/baeldung/java/reflection/operations/MoreOperationsUnitTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.baeldung.java.reflection.operations; - -import com.baeldung.java.reflection.*; -import static org.hamcrest.CoreMatchers.equalTo; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.junit.Test; -import static org.junit.Assert.assertThat; - -public class MoreOperationsUnitTest { - - public MoreOperationsUnitTest() { - } - - @Test(expected = IllegalAccessException.class) - public void givenObject_whenInvokeProtectedMethod_thenFail() throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method maxProtectedMethod = Operations.class.getDeclaredMethod("protectedMax", int.class, int.class); - - Operations operationsInstance = new Operations(); - Integer result = (Integer) maxProtectedMethod.invoke(operationsInstance, 2, 4); - - assertThat(result, equalTo(4)); - } - - @Test - public void givenObject_whenInvokeProtectedMethod_thenCorrect() throws Exception { - Method maxProtectedMethod = Operations.class.getDeclaredMethod("protectedMax", int.class, int.class); - maxProtectedMethod.setAccessible(true); - - Operations operationsInstance = new Operations(); - Integer result = (Integer) maxProtectedMethod.invoke(operationsInstance, 2, 4); - - assertThat(result, equalTo(4)); - } - -} diff --git a/pom.xml b/pom.xml index aa79dae1d5..f974e4c743 100644 --- a/pom.xml +++ b/pom.xml @@ -356,6 +356,7 @@ java-strings core-java + core-java-lang core-java-collections java-collections-conversions java-collections-maps From 64a22eec3155a000e15fad0065440e2b9851ec41 Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 00:37:39 -0200 Subject: [PATCH 340/546] 2 - Second commit for articles: * to core-java-lang: * https://www.baeldung.com/java-inner-interfaces * https://www.baeldung.com/java-polymorphism * https://www.baeldung.com/java-recursion * https://www.baeldung.com/java-finalize * https://www.baeldung.com/java-method-overload-override * https://www.baeldung.com/java-deep-copy * https://www.baeldung.com/java-inheritance * https://www.baeldung.com/java-type-casting * https://www.baeldung.com/java-final * https://www.baeldung.com/a-guide-to-java-enums --- .../src/main/java/com/baeldung/casting/Animal.java | 0 .../src/main/java/com/baeldung/casting/AnimalFeeder.java | 0 .../src/main/java/com/baeldung/casting/AnimalFeederGeneric.java | 0 .../src/main/java/com/baeldung/casting/Cat.java | 0 .../src/main/java/com/baeldung/casting/Dog.java | 0 .../src/main/java/com/baeldung/casting/Mew.java | 0 .../src/main/java/com/baeldung/deepcopy/Address.java | 0 .../src/main/java/com/baeldung/deepcopy/User.java | 0 .../src/main/java/com/baeldung/enums/Pizza.java | 0 .../src/main/java/com/baeldung/enums/PizzaDeliveryStrategy.java | 0 .../java/com/baeldung/enums/PizzaDeliverySystemConfiguration.java | 0 .../src/main/java/com/baeldung/enums/README.md | 0 .../src/main/java/com/baeldung/finalize/CloseableResource.java | 0 .../src/main/java/com/baeldung/finalize/Finalizable.java | 0 .../src/main/java/com/baeldung/finalkeyword/BlackCat.java | 0 .../src/main/java/com/baeldung/finalkeyword/BlackDog.java | 0 .../src/main/java/com/baeldung/finalkeyword/Cat.java | 0 .../src/main/java/com/baeldung/finalkeyword/Dog.java | 0 .../src/main/java/com/baeldung/inheritance/ArmoredCar.java | 0 .../src/main/java/com/baeldung/inheritance/BMW.java | 0 .../src/main/java/com/baeldung/inheritance/Car.java | 0 .../src/main/java/com/baeldung/inheritance/Employee.java | 0 .../src/main/java/com/baeldung/inheritance/Floatable.java | 0 .../src/main/java/com/baeldung/inheritance/Flyable.java | 0 .../src/main/java/com/baeldung/inheritance/SpaceCar.java | 0 .../src/main/java/com/baeldung/inheritance/SpaceTraveller.java | 0 .../java/com/baeldung/interfaces/CommaSeparatedCustomers.java | 0 .../src/main/java/com/baeldung/interfaces/Customer.java | 0 .../methodoverloadingoverriding/application/Application.java | 0 .../java/com/baeldung/methodoverloadingoverriding/model/Car.java | 0 .../com/baeldung/methodoverloadingoverriding/model/Vehicle.java | 0 .../com/baeldung/methodoverloadingoverriding/util/Multiplier.java | 0 .../src/main/java/com/baeldung/polymorphism/FileManager.java | 0 .../src/main/java/com/baeldung/polymorphism/GenericFile.java | 0 .../src/main/java/com/baeldung/polymorphism/ImageFile.java | 0 .../src/main/java/com/baeldung/polymorphism/TextFile.java | 0 .../src/main/java/com/baeldung/recursion/BinaryNode.java | 0 .../src/main/java/com/baeldung/recursion/RecursionExample.java | 0 .../src/test/java/com/baeldung/casting/CastingUnitTest.java | 0 .../src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java | 0 .../src/test/java/com/baeldung/deepcopy/ShallowCopyUnitTest.java | 0 .../src/test/java/com/baeldung/enums/PizzaUnitTest.java | 0 .../src/test/java/com/baeldung/finalize/FinalizeUnitTest.java | 0 .../src/test/java/com/baeldung/finalkeyword/FinalUnitTest.java | 0 .../src/test/java/com/baeldung/inheritance/AppUnitTest.java | 0 .../test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java | 0 .../test/MethodOverloadingUnitTest.java | 0 .../test/MethodOverridingUnitTest.java | 0 .../test/java/com/baeldung/polymorphism/PolymorphismUnitTest.java | 0 .../java/com/baeldung/recursion/RecursionExampleUnitTest.java | 0 50 files changed, 0 insertions(+), 0 deletions(-) rename {core-java => core-java-lang}/src/main/java/com/baeldung/casting/Animal.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/casting/AnimalFeeder.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/casting/AnimalFeederGeneric.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/casting/Cat.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/casting/Dog.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/casting/Mew.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/deepcopy/Address.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/deepcopy/User.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/enums/Pizza.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/enums/PizzaDeliveryStrategy.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/enums/PizzaDeliverySystemConfiguration.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/enums/README.md (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/finalize/CloseableResource.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/finalize/Finalizable.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/finalkeyword/BlackCat.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/finalkeyword/BlackDog.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/finalkeyword/Cat.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/finalkeyword/Dog.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/ArmoredCar.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/BMW.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/Car.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/Employee.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/Floatable.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/Flyable.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/SpaceCar.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritance/SpaceTraveller.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/interfaces/Customer.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/polymorphism/FileManager.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/polymorphism/GenericFile.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/polymorphism/ImageFile.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/polymorphism/TextFile.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/recursion/BinaryNode.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/recursion/RecursionExample.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/casting/CastingUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/deepcopy/ShallowCopyUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/enums/PizzaUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/finalize/FinalizeUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/finalkeyword/FinalUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/inheritance/AppUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/polymorphism/PolymorphismUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/recursion/RecursionExampleUnitTest.java (100%) diff --git a/core-java/src/main/java/com/baeldung/casting/Animal.java b/core-java-lang/src/main/java/com/baeldung/casting/Animal.java similarity index 100% rename from core-java/src/main/java/com/baeldung/casting/Animal.java rename to core-java-lang/src/main/java/com/baeldung/casting/Animal.java diff --git a/core-java/src/main/java/com/baeldung/casting/AnimalFeeder.java b/core-java-lang/src/main/java/com/baeldung/casting/AnimalFeeder.java similarity index 100% rename from core-java/src/main/java/com/baeldung/casting/AnimalFeeder.java rename to core-java-lang/src/main/java/com/baeldung/casting/AnimalFeeder.java diff --git a/core-java/src/main/java/com/baeldung/casting/AnimalFeederGeneric.java b/core-java-lang/src/main/java/com/baeldung/casting/AnimalFeederGeneric.java similarity index 100% rename from core-java/src/main/java/com/baeldung/casting/AnimalFeederGeneric.java rename to core-java-lang/src/main/java/com/baeldung/casting/AnimalFeederGeneric.java diff --git a/core-java/src/main/java/com/baeldung/casting/Cat.java b/core-java-lang/src/main/java/com/baeldung/casting/Cat.java similarity index 100% rename from core-java/src/main/java/com/baeldung/casting/Cat.java rename to core-java-lang/src/main/java/com/baeldung/casting/Cat.java diff --git a/core-java/src/main/java/com/baeldung/casting/Dog.java b/core-java-lang/src/main/java/com/baeldung/casting/Dog.java similarity index 100% rename from core-java/src/main/java/com/baeldung/casting/Dog.java rename to core-java-lang/src/main/java/com/baeldung/casting/Dog.java diff --git a/core-java/src/main/java/com/baeldung/casting/Mew.java b/core-java-lang/src/main/java/com/baeldung/casting/Mew.java similarity index 100% rename from core-java/src/main/java/com/baeldung/casting/Mew.java rename to core-java-lang/src/main/java/com/baeldung/casting/Mew.java diff --git a/core-java/src/main/java/com/baeldung/deepcopy/Address.java b/core-java-lang/src/main/java/com/baeldung/deepcopy/Address.java similarity index 100% rename from core-java/src/main/java/com/baeldung/deepcopy/Address.java rename to core-java-lang/src/main/java/com/baeldung/deepcopy/Address.java diff --git a/core-java/src/main/java/com/baeldung/deepcopy/User.java b/core-java-lang/src/main/java/com/baeldung/deepcopy/User.java similarity index 100% rename from core-java/src/main/java/com/baeldung/deepcopy/User.java rename to core-java-lang/src/main/java/com/baeldung/deepcopy/User.java diff --git a/core-java/src/main/java/com/baeldung/enums/Pizza.java b/core-java-lang/src/main/java/com/baeldung/enums/Pizza.java similarity index 100% rename from core-java/src/main/java/com/baeldung/enums/Pizza.java rename to core-java-lang/src/main/java/com/baeldung/enums/Pizza.java diff --git a/core-java/src/main/java/com/baeldung/enums/PizzaDeliveryStrategy.java b/core-java-lang/src/main/java/com/baeldung/enums/PizzaDeliveryStrategy.java similarity index 100% rename from core-java/src/main/java/com/baeldung/enums/PizzaDeliveryStrategy.java rename to core-java-lang/src/main/java/com/baeldung/enums/PizzaDeliveryStrategy.java diff --git a/core-java/src/main/java/com/baeldung/enums/PizzaDeliverySystemConfiguration.java b/core-java-lang/src/main/java/com/baeldung/enums/PizzaDeliverySystemConfiguration.java similarity index 100% rename from core-java/src/main/java/com/baeldung/enums/PizzaDeliverySystemConfiguration.java rename to core-java-lang/src/main/java/com/baeldung/enums/PizzaDeliverySystemConfiguration.java diff --git a/core-java/src/main/java/com/baeldung/enums/README.md b/core-java-lang/src/main/java/com/baeldung/enums/README.md similarity index 100% rename from core-java/src/main/java/com/baeldung/enums/README.md rename to core-java-lang/src/main/java/com/baeldung/enums/README.md diff --git a/core-java/src/main/java/com/baeldung/finalize/CloseableResource.java b/core-java-lang/src/main/java/com/baeldung/finalize/CloseableResource.java similarity index 100% rename from core-java/src/main/java/com/baeldung/finalize/CloseableResource.java rename to core-java-lang/src/main/java/com/baeldung/finalize/CloseableResource.java diff --git a/core-java/src/main/java/com/baeldung/finalize/Finalizable.java b/core-java-lang/src/main/java/com/baeldung/finalize/Finalizable.java similarity index 100% rename from core-java/src/main/java/com/baeldung/finalize/Finalizable.java rename to core-java-lang/src/main/java/com/baeldung/finalize/Finalizable.java diff --git a/core-java/src/main/java/com/baeldung/finalkeyword/BlackCat.java b/core-java-lang/src/main/java/com/baeldung/finalkeyword/BlackCat.java similarity index 100% rename from core-java/src/main/java/com/baeldung/finalkeyword/BlackCat.java rename to core-java-lang/src/main/java/com/baeldung/finalkeyword/BlackCat.java diff --git a/core-java/src/main/java/com/baeldung/finalkeyword/BlackDog.java b/core-java-lang/src/main/java/com/baeldung/finalkeyword/BlackDog.java similarity index 100% rename from core-java/src/main/java/com/baeldung/finalkeyword/BlackDog.java rename to core-java-lang/src/main/java/com/baeldung/finalkeyword/BlackDog.java diff --git a/core-java/src/main/java/com/baeldung/finalkeyword/Cat.java b/core-java-lang/src/main/java/com/baeldung/finalkeyword/Cat.java similarity index 100% rename from core-java/src/main/java/com/baeldung/finalkeyword/Cat.java rename to core-java-lang/src/main/java/com/baeldung/finalkeyword/Cat.java diff --git a/core-java/src/main/java/com/baeldung/finalkeyword/Dog.java b/core-java-lang/src/main/java/com/baeldung/finalkeyword/Dog.java similarity index 100% rename from core-java/src/main/java/com/baeldung/finalkeyword/Dog.java rename to core-java-lang/src/main/java/com/baeldung/finalkeyword/Dog.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/ArmoredCar.java b/core-java-lang/src/main/java/com/baeldung/inheritance/ArmoredCar.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/ArmoredCar.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/ArmoredCar.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/BMW.java b/core-java-lang/src/main/java/com/baeldung/inheritance/BMW.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/BMW.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/BMW.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/Car.java b/core-java-lang/src/main/java/com/baeldung/inheritance/Car.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/Car.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/Car.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/Employee.java b/core-java-lang/src/main/java/com/baeldung/inheritance/Employee.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/Employee.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/Employee.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/Floatable.java b/core-java-lang/src/main/java/com/baeldung/inheritance/Floatable.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/Floatable.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/Floatable.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/Flyable.java b/core-java-lang/src/main/java/com/baeldung/inheritance/Flyable.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/Flyable.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/Flyable.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/SpaceCar.java b/core-java-lang/src/main/java/com/baeldung/inheritance/SpaceCar.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/SpaceCar.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/SpaceCar.java diff --git a/core-java/src/main/java/com/baeldung/inheritance/SpaceTraveller.java b/core-java-lang/src/main/java/com/baeldung/inheritance/SpaceTraveller.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritance/SpaceTraveller.java rename to core-java-lang/src/main/java/com/baeldung/inheritance/SpaceTraveller.java diff --git a/core-java/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java b/core-java-lang/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java similarity index 100% rename from core-java/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java rename to core-java-lang/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java diff --git a/core-java/src/main/java/com/baeldung/interfaces/Customer.java b/core-java-lang/src/main/java/com/baeldung/interfaces/Customer.java similarity index 100% rename from core-java/src/main/java/com/baeldung/interfaces/Customer.java rename to core-java-lang/src/main/java/com/baeldung/interfaces/Customer.java diff --git a/core-java/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java b/core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java similarity index 100% rename from core-java/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java rename to core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/application/Application.java diff --git a/core-java/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java b/core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java similarity index 100% rename from core-java/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java rename to core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/model/Car.java diff --git a/core-java/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java b/core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java similarity index 100% rename from core-java/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java rename to core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/model/Vehicle.java diff --git a/core-java/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java b/core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java similarity index 100% rename from core-java/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java rename to core-java-lang/src/main/java/com/baeldung/methodoverloadingoverriding/util/Multiplier.java diff --git a/core-java/src/main/java/com/baeldung/polymorphism/FileManager.java b/core-java-lang/src/main/java/com/baeldung/polymorphism/FileManager.java similarity index 100% rename from core-java/src/main/java/com/baeldung/polymorphism/FileManager.java rename to core-java-lang/src/main/java/com/baeldung/polymorphism/FileManager.java diff --git a/core-java/src/main/java/com/baeldung/polymorphism/GenericFile.java b/core-java-lang/src/main/java/com/baeldung/polymorphism/GenericFile.java similarity index 100% rename from core-java/src/main/java/com/baeldung/polymorphism/GenericFile.java rename to core-java-lang/src/main/java/com/baeldung/polymorphism/GenericFile.java diff --git a/core-java/src/main/java/com/baeldung/polymorphism/ImageFile.java b/core-java-lang/src/main/java/com/baeldung/polymorphism/ImageFile.java similarity index 100% rename from core-java/src/main/java/com/baeldung/polymorphism/ImageFile.java rename to core-java-lang/src/main/java/com/baeldung/polymorphism/ImageFile.java diff --git a/core-java/src/main/java/com/baeldung/polymorphism/TextFile.java b/core-java-lang/src/main/java/com/baeldung/polymorphism/TextFile.java similarity index 100% rename from core-java/src/main/java/com/baeldung/polymorphism/TextFile.java rename to core-java-lang/src/main/java/com/baeldung/polymorphism/TextFile.java diff --git a/core-java/src/main/java/com/baeldung/recursion/BinaryNode.java b/core-java-lang/src/main/java/com/baeldung/recursion/BinaryNode.java similarity index 100% rename from core-java/src/main/java/com/baeldung/recursion/BinaryNode.java rename to core-java-lang/src/main/java/com/baeldung/recursion/BinaryNode.java diff --git a/core-java/src/main/java/com/baeldung/recursion/RecursionExample.java b/core-java-lang/src/main/java/com/baeldung/recursion/RecursionExample.java similarity index 100% rename from core-java/src/main/java/com/baeldung/recursion/RecursionExample.java rename to core-java-lang/src/main/java/com/baeldung/recursion/RecursionExample.java diff --git a/core-java/src/test/java/com/baeldung/casting/CastingUnitTest.java b/core-java-lang/src/test/java/com/baeldung/casting/CastingUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/casting/CastingUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/casting/CastingUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java b/core-java-lang/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/deepcopy/ShallowCopyUnitTest.java b/core-java-lang/src/test/java/com/baeldung/deepcopy/ShallowCopyUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/deepcopy/ShallowCopyUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/deepcopy/ShallowCopyUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/enums/PizzaUnitTest.java b/core-java-lang/src/test/java/com/baeldung/enums/PizzaUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/enums/PizzaUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/enums/PizzaUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/finalize/FinalizeUnitTest.java b/core-java-lang/src/test/java/com/baeldung/finalize/FinalizeUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/finalize/FinalizeUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/finalize/FinalizeUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/finalkeyword/FinalUnitTest.java b/core-java-lang/src/test/java/com/baeldung/finalkeyword/FinalUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/finalkeyword/FinalUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/finalkeyword/FinalUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/inheritance/AppUnitTest.java b/core-java-lang/src/test/java/com/baeldung/inheritance/AppUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/inheritance/AppUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/inheritance/AppUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java b/core-java-lang/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java b/core-java-lang/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverloadingUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java b/core-java-lang/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/methodoverloadingoverriding/test/MethodOverridingUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/polymorphism/PolymorphismUnitTest.java b/core-java-lang/src/test/java/com/baeldung/polymorphism/PolymorphismUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/polymorphism/PolymorphismUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/polymorphism/PolymorphismUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/recursion/RecursionExampleUnitTest.java b/core-java-lang/src/test/java/com/baeldung/recursion/RecursionExampleUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/recursion/RecursionExampleUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/recursion/RecursionExampleUnitTest.java From 61574b72284aa27770ffd7616df2a8c0cc9012bb Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 01:21:37 -0200 Subject: [PATCH 341/546] 3-Third commit for articles: * to core-java-lang: * https://www.baeldung.com/java-lang-system * https://www.baeldung.com/java-type-erasure * https://www.baeldung.com/java-assert * https://www.baeldung.com/java-pass-by-value-or-pass-by-reference * https://www.baeldung.com/java-variable-method-hiding * https://www.baeldung.com/java-access-modifiers * https://www.baeldung.com/java-super * https://www.baeldung.com/java-this * https://www.baeldung.com/java-immutable-object * https://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror * https://www.baeldung.com/infinite-loops-java (changes for this were included in commit 1, with other loop-related examples) --- .../src/main/java/com/baeldung/accessmodifiers/Public.java | 0 .../src/main/java/com/baeldung/accessmodifiers/SubClass.java | 0 .../src/main/java/com/baeldung/accessmodifiers/SuperPublic.java | 0 .../java/com/baeldung/accessmodifiers/another/AnotherPublic.java | 0 .../com/baeldung/accessmodifiers/another/AnotherSubClass.java | 0 .../com/baeldung/accessmodifiers/another/AnotherSuperPublic.java | 0 .../src/main/java/com/baeldung/assertion/Assertion.java | 0 .../src/main/java/com/baeldung/immutableobjects/Currency.java | 0 .../src/main/java/com/baeldung/immutableobjects/Money.java | 0 .../src/main/java/com/baeldung/keyword/KeywordDemo.java | 0 .../main/java/com/baeldung/keyword/superkeyword/SuperBase.java | 0 .../src/main/java/com/baeldung/keyword/superkeyword/SuperSub.java | 0 .../java/com/baeldung/keyword/thiskeyword/KeywordUnitTest.java | 0 .../com/baeldung/noclassdeffounderror/ClassWithInitErrors.java | 0 .../noclassdeffounderror/NoClassDefFoundErrorExample.java | 0 .../main/java/com/baeldung/parameterpassing/NonPrimitives.java | 0 .../src/main/java/com/baeldung/parameterpassing/Primitives.java | 0 .../src/main/java/com/baeldung/scope/method/BaseMethodClass.java | 0 .../src/main/java/com/baeldung/scope/method/ChildMethodClass.java | 0 .../src/main/java/com/baeldung/scope/method/MethodHidingDemo.java | 0 .../src/main/java/com/baeldung/scope/variable/ChildVariable.java | 0 .../src/main/java/com/baeldung/scope/variable/HideVariable.java | 0 .../src/main/java/com/baeldung/scope/variable/ParentVariable.java | 0 .../main/java/com/baeldung/scope/variable/VariableHidingDemo.java | 0 .../src/main/java/com/baeldung/system/ChatWindow.java | 0 .../src/main/java/com/baeldung/system/DateTimeService.java | 0 .../src/main/java/com/baeldung/system/EnvironmentVariables.java | 0 .../src/main/java/com/baeldung/system/SystemErrDemo.java | 0 .../src/main/java/com/baeldung/system/SystemExitDemo.java | 0 .../src/main/java/com/baeldung/system/SystemOutDemo.java | 0 .../src/main/java/com/baeldung/system/UserCredentials.java | 0 .../main/java/com/baeldung/typeerasure/ArrayContentPrintUtil.java | 0 .../src/main/java/com/baeldung/typeerasure/BoundStack.java | 0 .../src/main/java/com/baeldung/typeerasure/IntegerStack.java | 0 .../src/main/java/com/baeldung/typeerasure/Stack.java | 0 .../classnotfoundexception/ClassNotFoundExceptionUnitTest.java | 0 .../com/baeldung/immutableobjects/ImmutableObjectsUnitTest.java | 0 .../noclassdeffounderror/NoClassDefFoundErrorUnitTest.java | 0 .../java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java | 0 .../java/com/baeldung/parameterpassing/PrimitivesUnitTest.java | 0 .../test/java/com/baeldung/system/DateTimeServiceUnitTest.java | 0 .../java/com/baeldung/system/EnvironmentVariablesUnitTest.java | 0 .../test/java/com/baeldung/system/SystemArrayCopyUnitTest.java | 0 .../src/test/java/com/baeldung/system/SystemNanoUnitTest.java | 0 .../test/java/com/baeldung/system/SystemPropertiesUnitTest.java | 0 .../test/java/com/baeldung/typeerasure/TypeErasureUnitTest.java | 0 46 files changed, 0 insertions(+), 0 deletions(-) rename {core-java => core-java-lang}/src/main/java/com/baeldung/accessmodifiers/Public.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/accessmodifiers/SubClass.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/accessmodifiers/SuperPublic.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/accessmodifiers/another/AnotherPublic.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/accessmodifiers/another/AnotherSubClass.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/accessmodifiers/another/AnotherSuperPublic.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/assertion/Assertion.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/immutableobjects/Currency.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/immutableobjects/Money.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keyword/KeywordDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keyword/superkeyword/SuperBase.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keyword/superkeyword/SuperSub.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keyword/thiskeyword/KeywordUnitTest.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/parameterpassing/Primitives.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/scope/method/BaseMethodClass.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/scope/method/ChildMethodClass.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/scope/method/MethodHidingDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/scope/variable/ChildVariable.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/scope/variable/HideVariable.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/scope/variable/ParentVariable.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/scope/variable/VariableHidingDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/system/ChatWindow.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/system/DateTimeService.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/system/EnvironmentVariables.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/system/SystemErrDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/system/SystemExitDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/system/SystemOutDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/system/UserCredentials.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/typeerasure/ArrayContentPrintUtil.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/typeerasure/BoundStack.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/typeerasure/IntegerStack.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/typeerasure/Stack.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/immutableobjects/ImmutableObjectsUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/system/SystemNanoUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/typeerasure/TypeErasureUnitTest.java (100%) diff --git a/core-java/src/main/java/com/baeldung/accessmodifiers/Public.java b/core-java-lang/src/main/java/com/baeldung/accessmodifiers/Public.java similarity index 100% rename from core-java/src/main/java/com/baeldung/accessmodifiers/Public.java rename to core-java-lang/src/main/java/com/baeldung/accessmodifiers/Public.java diff --git a/core-java/src/main/java/com/baeldung/accessmodifiers/SubClass.java b/core-java-lang/src/main/java/com/baeldung/accessmodifiers/SubClass.java similarity index 100% rename from core-java/src/main/java/com/baeldung/accessmodifiers/SubClass.java rename to core-java-lang/src/main/java/com/baeldung/accessmodifiers/SubClass.java diff --git a/core-java/src/main/java/com/baeldung/accessmodifiers/SuperPublic.java b/core-java-lang/src/main/java/com/baeldung/accessmodifiers/SuperPublic.java similarity index 100% rename from core-java/src/main/java/com/baeldung/accessmodifiers/SuperPublic.java rename to core-java-lang/src/main/java/com/baeldung/accessmodifiers/SuperPublic.java diff --git a/core-java/src/main/java/com/baeldung/accessmodifiers/another/AnotherPublic.java b/core-java-lang/src/main/java/com/baeldung/accessmodifiers/another/AnotherPublic.java similarity index 100% rename from core-java/src/main/java/com/baeldung/accessmodifiers/another/AnotherPublic.java rename to core-java-lang/src/main/java/com/baeldung/accessmodifiers/another/AnotherPublic.java diff --git a/core-java/src/main/java/com/baeldung/accessmodifiers/another/AnotherSubClass.java b/core-java-lang/src/main/java/com/baeldung/accessmodifiers/another/AnotherSubClass.java similarity index 100% rename from core-java/src/main/java/com/baeldung/accessmodifiers/another/AnotherSubClass.java rename to core-java-lang/src/main/java/com/baeldung/accessmodifiers/another/AnotherSubClass.java diff --git a/core-java/src/main/java/com/baeldung/accessmodifiers/another/AnotherSuperPublic.java b/core-java-lang/src/main/java/com/baeldung/accessmodifiers/another/AnotherSuperPublic.java similarity index 100% rename from core-java/src/main/java/com/baeldung/accessmodifiers/another/AnotherSuperPublic.java rename to core-java-lang/src/main/java/com/baeldung/accessmodifiers/another/AnotherSuperPublic.java diff --git a/core-java/src/main/java/com/baeldung/assertion/Assertion.java b/core-java-lang/src/main/java/com/baeldung/assertion/Assertion.java similarity index 100% rename from core-java/src/main/java/com/baeldung/assertion/Assertion.java rename to core-java-lang/src/main/java/com/baeldung/assertion/Assertion.java diff --git a/core-java/src/main/java/com/baeldung/immutableobjects/Currency.java b/core-java-lang/src/main/java/com/baeldung/immutableobjects/Currency.java similarity index 100% rename from core-java/src/main/java/com/baeldung/immutableobjects/Currency.java rename to core-java-lang/src/main/java/com/baeldung/immutableobjects/Currency.java diff --git a/core-java/src/main/java/com/baeldung/immutableobjects/Money.java b/core-java-lang/src/main/java/com/baeldung/immutableobjects/Money.java similarity index 100% rename from core-java/src/main/java/com/baeldung/immutableobjects/Money.java rename to core-java-lang/src/main/java/com/baeldung/immutableobjects/Money.java diff --git a/core-java/src/main/java/com/baeldung/keyword/KeywordDemo.java b/core-java-lang/src/main/java/com/baeldung/keyword/KeywordDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keyword/KeywordDemo.java rename to core-java-lang/src/main/java/com/baeldung/keyword/KeywordDemo.java diff --git a/core-java/src/main/java/com/baeldung/keyword/superkeyword/SuperBase.java b/core-java-lang/src/main/java/com/baeldung/keyword/superkeyword/SuperBase.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keyword/superkeyword/SuperBase.java rename to core-java-lang/src/main/java/com/baeldung/keyword/superkeyword/SuperBase.java diff --git a/core-java/src/main/java/com/baeldung/keyword/superkeyword/SuperSub.java b/core-java-lang/src/main/java/com/baeldung/keyword/superkeyword/SuperSub.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keyword/superkeyword/SuperSub.java rename to core-java-lang/src/main/java/com/baeldung/keyword/superkeyword/SuperSub.java diff --git a/core-java/src/main/java/com/baeldung/keyword/thiskeyword/KeywordUnitTest.java b/core-java-lang/src/main/java/com/baeldung/keyword/thiskeyword/KeywordUnitTest.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keyword/thiskeyword/KeywordUnitTest.java rename to core-java-lang/src/main/java/com/baeldung/keyword/thiskeyword/KeywordUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java b/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java similarity index 100% rename from core-java/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java rename to core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java diff --git a/core-java/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java b/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java similarity index 100% rename from core-java/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java rename to core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java diff --git a/core-java/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java b/core-java-lang/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java similarity index 100% rename from core-java/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java rename to core-java-lang/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java diff --git a/core-java/src/main/java/com/baeldung/parameterpassing/Primitives.java b/core-java-lang/src/main/java/com/baeldung/parameterpassing/Primitives.java similarity index 100% rename from core-java/src/main/java/com/baeldung/parameterpassing/Primitives.java rename to core-java-lang/src/main/java/com/baeldung/parameterpassing/Primitives.java diff --git a/core-java/src/main/java/com/baeldung/scope/method/BaseMethodClass.java b/core-java-lang/src/main/java/com/baeldung/scope/method/BaseMethodClass.java similarity index 100% rename from core-java/src/main/java/com/baeldung/scope/method/BaseMethodClass.java rename to core-java-lang/src/main/java/com/baeldung/scope/method/BaseMethodClass.java diff --git a/core-java/src/main/java/com/baeldung/scope/method/ChildMethodClass.java b/core-java-lang/src/main/java/com/baeldung/scope/method/ChildMethodClass.java similarity index 100% rename from core-java/src/main/java/com/baeldung/scope/method/ChildMethodClass.java rename to core-java-lang/src/main/java/com/baeldung/scope/method/ChildMethodClass.java diff --git a/core-java/src/main/java/com/baeldung/scope/method/MethodHidingDemo.java b/core-java-lang/src/main/java/com/baeldung/scope/method/MethodHidingDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/scope/method/MethodHidingDemo.java rename to core-java-lang/src/main/java/com/baeldung/scope/method/MethodHidingDemo.java diff --git a/core-java/src/main/java/com/baeldung/scope/variable/ChildVariable.java b/core-java-lang/src/main/java/com/baeldung/scope/variable/ChildVariable.java similarity index 100% rename from core-java/src/main/java/com/baeldung/scope/variable/ChildVariable.java rename to core-java-lang/src/main/java/com/baeldung/scope/variable/ChildVariable.java diff --git a/core-java/src/main/java/com/baeldung/scope/variable/HideVariable.java b/core-java-lang/src/main/java/com/baeldung/scope/variable/HideVariable.java similarity index 100% rename from core-java/src/main/java/com/baeldung/scope/variable/HideVariable.java rename to core-java-lang/src/main/java/com/baeldung/scope/variable/HideVariable.java diff --git a/core-java/src/main/java/com/baeldung/scope/variable/ParentVariable.java b/core-java-lang/src/main/java/com/baeldung/scope/variable/ParentVariable.java similarity index 100% rename from core-java/src/main/java/com/baeldung/scope/variable/ParentVariable.java rename to core-java-lang/src/main/java/com/baeldung/scope/variable/ParentVariable.java diff --git a/core-java/src/main/java/com/baeldung/scope/variable/VariableHidingDemo.java b/core-java-lang/src/main/java/com/baeldung/scope/variable/VariableHidingDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/scope/variable/VariableHidingDemo.java rename to core-java-lang/src/main/java/com/baeldung/scope/variable/VariableHidingDemo.java diff --git a/core-java/src/main/java/com/baeldung/system/ChatWindow.java b/core-java-lang/src/main/java/com/baeldung/system/ChatWindow.java similarity index 100% rename from core-java/src/main/java/com/baeldung/system/ChatWindow.java rename to core-java-lang/src/main/java/com/baeldung/system/ChatWindow.java diff --git a/core-java/src/main/java/com/baeldung/system/DateTimeService.java b/core-java-lang/src/main/java/com/baeldung/system/DateTimeService.java similarity index 100% rename from core-java/src/main/java/com/baeldung/system/DateTimeService.java rename to core-java-lang/src/main/java/com/baeldung/system/DateTimeService.java diff --git a/core-java/src/main/java/com/baeldung/system/EnvironmentVariables.java b/core-java-lang/src/main/java/com/baeldung/system/EnvironmentVariables.java similarity index 100% rename from core-java/src/main/java/com/baeldung/system/EnvironmentVariables.java rename to core-java-lang/src/main/java/com/baeldung/system/EnvironmentVariables.java diff --git a/core-java/src/main/java/com/baeldung/system/SystemErrDemo.java b/core-java-lang/src/main/java/com/baeldung/system/SystemErrDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/system/SystemErrDemo.java rename to core-java-lang/src/main/java/com/baeldung/system/SystemErrDemo.java diff --git a/core-java/src/main/java/com/baeldung/system/SystemExitDemo.java b/core-java-lang/src/main/java/com/baeldung/system/SystemExitDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/system/SystemExitDemo.java rename to core-java-lang/src/main/java/com/baeldung/system/SystemExitDemo.java diff --git a/core-java/src/main/java/com/baeldung/system/SystemOutDemo.java b/core-java-lang/src/main/java/com/baeldung/system/SystemOutDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/system/SystemOutDemo.java rename to core-java-lang/src/main/java/com/baeldung/system/SystemOutDemo.java diff --git a/core-java/src/main/java/com/baeldung/system/UserCredentials.java b/core-java-lang/src/main/java/com/baeldung/system/UserCredentials.java similarity index 100% rename from core-java/src/main/java/com/baeldung/system/UserCredentials.java rename to core-java-lang/src/main/java/com/baeldung/system/UserCredentials.java diff --git a/core-java/src/main/java/com/baeldung/typeerasure/ArrayContentPrintUtil.java b/core-java-lang/src/main/java/com/baeldung/typeerasure/ArrayContentPrintUtil.java similarity index 100% rename from core-java/src/main/java/com/baeldung/typeerasure/ArrayContentPrintUtil.java rename to core-java-lang/src/main/java/com/baeldung/typeerasure/ArrayContentPrintUtil.java diff --git a/core-java/src/main/java/com/baeldung/typeerasure/BoundStack.java b/core-java-lang/src/main/java/com/baeldung/typeerasure/BoundStack.java similarity index 100% rename from core-java/src/main/java/com/baeldung/typeerasure/BoundStack.java rename to core-java-lang/src/main/java/com/baeldung/typeerasure/BoundStack.java diff --git a/core-java/src/main/java/com/baeldung/typeerasure/IntegerStack.java b/core-java-lang/src/main/java/com/baeldung/typeerasure/IntegerStack.java similarity index 100% rename from core-java/src/main/java/com/baeldung/typeerasure/IntegerStack.java rename to core-java-lang/src/main/java/com/baeldung/typeerasure/IntegerStack.java diff --git a/core-java/src/main/java/com/baeldung/typeerasure/Stack.java b/core-java-lang/src/main/java/com/baeldung/typeerasure/Stack.java similarity index 100% rename from core-java/src/main/java/com/baeldung/typeerasure/Stack.java rename to core-java-lang/src/main/java/com/baeldung/typeerasure/Stack.java diff --git a/core-java/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java b/core-java-lang/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/immutableobjects/ImmutableObjectsUnitTest.java b/core-java-lang/src/test/java/com/baeldung/immutableobjects/ImmutableObjectsUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/immutableobjects/ImmutableObjectsUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/immutableobjects/ImmutableObjectsUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java b/core-java-lang/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java b/core-java-lang/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java b/core-java-lang/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java b/core-java-lang/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java b/core-java-lang/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java b/core-java-lang/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/system/SystemNanoUnitTest.java b/core-java-lang/src/test/java/com/baeldung/system/SystemNanoUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/system/SystemNanoUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/system/SystemNanoUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java b/core-java-lang/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/typeerasure/TypeErasureUnitTest.java b/core-java-lang/src/test/java/com/baeldung/typeerasure/TypeErasureUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/typeerasure/TypeErasureUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/typeerasure/TypeErasureUnitTest.java From 52852b3a49a13dbfc15a5f16eac04a6855506595 Mon Sep 17 00:00:00 2001 From: gmconte <3528114+gmconte@users.noreply.github.com> Date: Sat, 10 Nov 2018 05:26:28 +0000 Subject: [PATCH 342/546] BAEL-2302 UPDATED Spring Data REST HTTP Method customization example (#5594) * BAEL-2302 Spring Data REST HTTP Method customization example * BAEL-2302 Spring Data REST - granular HTTP Methods control * BAEL-2302 Spring Data REST - fixed parent pom file version error * BAEL-2302 Fixing thymeleaf dependencies * BAEL-2302 Spring Data REST - fixed netty bootstrap * BAEL-2302 Spring Data REST - fixed netty test * BAEL-2302 Spring Data REST - fixed spring security oauth2 * BAEL-2302 - Fix oauth2 server deps --- parent-boot-2/pom.xml | 3 +- .../security/SpringSecurity5Application.java | 11 +++-- ...g5ReactiveServerClientIntegrationTest.java | 18 ++++---- spring-5-security/pom.xml | 15 ++++--- .../java/com/baeldung/config/RestConfig.java | 14 ++++--- .../baeldung/repositories/UserRepository.java | 22 +++++++++- ...pringDataRestValidatorIntegrationTest.java | 42 +++++++++++++++---- spring-security-mvc-boot/pom.xml | 2 +- spring-security-sso/pom.xml | 2 - .../spring-security-sso-auth-server/pom.xml | 7 ++-- .../spring-security-sso-ui-2/pom.xml | 2 +- .../java/org/baeldung/config/UiWebConfig.java | 9 +--- .../spring-security-sso-ui/pom.xml | 2 +- .../java/org/baeldung/config/UiWebConfig.java | 9 +--- spring-security-thymeleaf/pom.xml | 2 +- 15 files changed, 95 insertions(+), 65 deletions(-) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index 47d382f58d..bb89cb2729 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -77,6 +77,7 @@ 3.1.0 1.0.11.RELEASE - 2.0.5.RELEASE + 2.1.0.RELEASE + 2.1.0.RELEASE diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java index f2963c4fa5..ba913bc2d7 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java @@ -8,8 +8,8 @@ import org.springframework.http.server.reactive.HttpHandler; import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter; import org.springframework.web.reactive.config.EnableWebFlux; import org.springframework.web.server.adapter.WebHttpHandlerBuilder; -import reactor.ipc.netty.NettyContext; -import reactor.ipc.netty.http.server.HttpServer; +import reactor.netty.DisposableServer; +import reactor.netty.http.server.HttpServer; @ComponentScan(basePackages = {"com.baeldung.reactive.security"}) @EnableWebFlux @@ -18,17 +18,16 @@ public class SpringSecurity5Application { public static void main(String[] args) { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringSecurity5Application.class)) { - context.getBean(NettyContext.class).onClose().block(); + context.getBean(DisposableServer.class).onDispose().block(); } } @Bean - public NettyContext nettyContext(ApplicationContext context) { + public DisposableServer nettyContext(ApplicationContext context) { HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context) .build(); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler); - HttpServer httpServer = HttpServer.create("localhost", 8080); - return httpServer.newHandler(adapter).block(); + return HttpServer.create().host("localhost").port(8080).handle(adapter).bind().block(); } } diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java index 8707c27fb3..384600994e 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java +++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java @@ -1,5 +1,6 @@ package com.baeldung.reactive; +import com.baeldung.web.reactive.Task; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.springframework.http.server.reactive.HttpHandler; @@ -7,13 +8,10 @@ import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter; import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.RouterFunctions; import org.springframework.web.reactive.function.server.ServerResponse; - -import com.baeldung.web.reactive.Task; - import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import reactor.ipc.netty.NettyContext; -import reactor.ipc.netty.http.server.HttpServer; +import reactor.netty.DisposableServer; +import reactor.netty.http.server.HttpServer; import java.time.Duration; @@ -21,12 +19,11 @@ import static org.springframework.web.reactive.function.server.RequestPredicates import static org.springframework.web.reactive.function.server.RequestPredicates.POST; public class Spring5ReactiveServerClientIntegrationTest { - - private static NettyContext nettyContext; + private static DisposableServer nettyServer; @BeforeAll public static void setUp() throws Exception { - HttpServer server = HttpServer.create("localhost", 8080); + HttpServer server = HttpServer.create().host("localhost").port(8080); RouterFunction route = RouterFunctions.route(POST("/task/process"), request -> ServerResponse.ok() .body(request.bodyToFlux(Task.class) .map(ll -> new Task("TaskName", 1)), Task.class)) @@ -34,13 +31,12 @@ public class Spring5ReactiveServerClientIntegrationTest { .body(Mono.just("server is alive"), String.class))); HttpHandler httpHandler = RouterFunctions.toHttpHandler(route); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler); - nettyContext = server.newHandler(adapter) - .block(); + nettyServer = server.handle(adapter).bind().block(); } @AfterAll public static void shutDown() { - nettyContext.dispose(); + nettyServer.dispose(); } // @Test diff --git a/spring-5-security/pom.xml b/spring-5-security/pom.xml index 1435019c24..da62f39fa9 100644 --- a/spring-5-security/pom.xml +++ b/spring-5-security/pom.xml @@ -31,10 +31,15 @@
org.thymeleaf.extras - thymeleaf-extras-springsecurity4 + thymeleaf-extras-springsecurity5 + + org.springframework.security.oauth.boot + spring-security-oauth2-autoconfigure + ${oauth-auto.version} + org.springframework.security spring-security-oauth2-client @@ -58,12 +63,6 @@ spring-security-test test - - - org.springframework.security.oauth.boot - spring-security-oauth2-autoconfigure - 2.0.1.RELEASE -
@@ -79,4 +78,4 @@ - \ No newline at end of file + diff --git a/spring-data-rest/src/main/java/com/baeldung/config/RestConfig.java b/spring-data-rest/src/main/java/com/baeldung/config/RestConfig.java index 7434dde394..39f90e867b 100644 --- a/spring-data-rest/src/main/java/com/baeldung/config/RestConfig.java +++ b/spring-data-rest/src/main/java/com/baeldung/config/RestConfig.java @@ -1,17 +1,21 @@ package com.baeldung.config; +import com.baeldung.models.WebsiteUser; +import com.baeldung.projections.CustomBook; import org.springframework.context.annotation.Configuration; import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; - -import com.baeldung.projections.CustomBook; - +import org.springframework.data.rest.core.mapping.ExposureConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; +import org.springframework.http.HttpMethod; @Configuration -public class RestConfig extends RepositoryRestConfigurerAdapter{ +public class RestConfig implements RepositoryRestConfigurer { @Override public void configureRepositoryRestConfiguration(RepositoryRestConfiguration repositoryRestConfiguration){ repositoryRestConfiguration.getProjectionConfiguration().addProjection(CustomBook.class); + ExposureConfiguration config = repositoryRestConfiguration.getExposureConfiguration(); + config.forDomainType(WebsiteUser.class).withItemExposure((metadata, httpMethods) -> + httpMethods.disable(HttpMethod.PATCH)); } } diff --git a/spring-data-rest/src/main/java/com/baeldung/repositories/UserRepository.java b/spring-data-rest/src/main/java/com/baeldung/repositories/UserRepository.java index 2bd9c025dd..a3fed1c318 100644 --- a/spring-data-rest/src/main/java/com/baeldung/repositories/UserRepository.java +++ b/spring-data-rest/src/main/java/com/baeldung/repositories/UserRepository.java @@ -1,12 +1,32 @@ package com.baeldung.repositories; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.web.bind.annotation.CrossOrigin; import com.baeldung.models.WebsiteUser; @CrossOrigin @RepositoryRestResource(collectionResourceRel = "users", path = "users") public interface UserRepository extends CrudRepository { - + + @Override + @RestResource(exported = false) + void delete(WebsiteUser entity); + + @Override + @RestResource(exported = false) + void deleteAll(); + + @Override + @RestResource(exported = false) + void deleteAll(Iterable entities); + + @Override + @RestResource(exported = false) + void deleteById(Long aLong); + + @RestResource(path = "byEmail", rel = "customFindMethod") + WebsiteUser findByEmail(@Param("email") String email); } diff --git a/spring-data-rest/src/test/java/com/baeldung/validator/SpringDataRestValidatorIntegrationTest.java b/spring-data-rest/src/test/java/com/baeldung/validator/SpringDataRestValidatorIntegrationTest.java index 4c936ffc1c..d41736e434 100644 --- a/spring-data-rest/src/test/java/com/baeldung/validator/SpringDataRestValidatorIntegrationTest.java +++ b/spring-data-rest/src/test/java/com/baeldung/validator/SpringDataRestValidatorIntegrationTest.java @@ -1,11 +1,8 @@ package com.baeldung.validator; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup; - +import com.baeldung.SpringDataRestApplication; +import com.baeldung.models.WebsiteUser; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,9 +14,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.web.context.WebApplicationContext; -import com.baeldung.SpringDataRestApplication; -import com.baeldung.models.WebsiteUser; -import com.fasterxml.jackson.databind.ObjectMapper; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup; @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = SpringDataRestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.MOCK) @@ -84,4 +82,30 @@ public class SpringDataRestValidatorIntegrationTest { mockMvc.perform(post("/users", user).contentType(MediaType.APPLICATION_JSON).content(new ObjectMapper().writeValueAsString(user))).andExpect(status().isNotAcceptable()).andExpect(redirectedUrl(null)); } + @Test + public void whenDeletingCorrectUser_thenCorrectStatusCodeAndResponse() throws Exception { + WebsiteUser user = new WebsiteUser(); + user.setEmail("john.doe@john.com"); + user.setName("John Doe"); + mockMvc.perform(post("/users", user).contentType(MediaType.APPLICATION_JSON).content(new ObjectMapper().writeValueAsString(user))).andExpect(status().is2xxSuccessful()).andExpect(redirectedUrl("http://localhost/users/1")); + mockMvc.perform(delete("/users/1").contentType(MediaType.APPLICATION_JSON).content(new ObjectMapper().writeValueAsString(user))).andExpect(status().isMethodNotAllowed()); + } + + @Test + public void whenSearchingByEmail_thenCorrectStatusCodeAndResponse() throws Exception { + WebsiteUser user = new WebsiteUser(); + user.setEmail("john.doe@john.com"); + user.setName("John Doe"); + mockMvc.perform(post("/users", user).contentType(MediaType.APPLICATION_JSON).content(new ObjectMapper().writeValueAsString(user))).andExpect(status().is2xxSuccessful()).andExpect(redirectedUrl("http://localhost/users/1")); + mockMvc.perform(get("/users/search/byEmail").param("email", user.getEmail()).contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); + } + + @Test + public void whenSearchingByEmailWithOriginalMethodName_thenErrorStatusCodeAndResponse() throws Exception { + WebsiteUser user = new WebsiteUser(); + user.setEmail("john.doe@john.com"); + user.setName("John Doe"); + mockMvc.perform(post("/users", user).contentType(MediaType.APPLICATION_JSON).content(new ObjectMapper().writeValueAsString(user))).andExpect(status().is2xxSuccessful()).andExpect(redirectedUrl("http://localhost/users/1")); + mockMvc.perform(get("/users/search/findByEmail").param("email", user.getEmail()).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); + } } diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-mvc-boot/pom.xml index 2427d0de1a..0a40b0b324 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-mvc-boot/pom.xml @@ -36,7 +36,7 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity4 + thymeleaf-extras-springsecurity5 org.springframework.boot diff --git a/spring-security-sso/pom.xml b/spring-security-sso/pom.xml index 764e899640..7761919ca7 100644 --- a/spring-security-sso/pom.xml +++ b/spring-security-sso/pom.xml @@ -23,8 +23,6 @@ 3.1.0 - 2.3.3.RELEASE - 2.0.1.RELEASE \ No newline at end of file diff --git a/spring-security-sso/spring-security-sso-auth-server/pom.xml b/spring-security-sso/spring-security-sso-auth-server/pom.xml index 1d57248b30..c0ad6dee2e 100644 --- a/spring-security-sso/spring-security-sso-auth-server/pom.xml +++ b/spring-security-sso/spring-security-sso-auth-server/pom.xml @@ -20,11 +20,10 @@ - org.springframework.security.oauth - spring-security-oauth2 - ${oauth.version} + org.springframework.security.oauth.boot + spring-security-oauth2-autoconfigure + ${oauth-auto.version} - \ No newline at end of file diff --git a/spring-security-sso/spring-security-sso-ui-2/pom.xml b/spring-security-sso/spring-security-sso-ui-2/pom.xml index afe7b59822..5881409c3a 100644 --- a/spring-security-sso/spring-security-sso-ui-2/pom.xml +++ b/spring-security-sso/spring-security-sso-ui-2/pom.xml @@ -37,7 +37,7 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity4 + thymeleaf-extras-springsecurity5 diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java b/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java index 24d6c9b5d8..c17bb85173 100644 --- a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java +++ b/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java @@ -3,15 +3,11 @@ package org.baeldung.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.*; @Configuration @EnableWebMvc -public class UiWebConfig extends WebMvcConfigurerAdapter { +public class UiWebConfig implements WebMvcConfigurer { @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { @@ -25,7 +21,6 @@ public class UiWebConfig extends WebMvcConfigurerAdapter { @Override public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); registry.addViewController("/") .setViewName("forward:/index"); registry.addViewController("/index"); diff --git a/spring-security-sso/spring-security-sso-ui/pom.xml b/spring-security-sso/spring-security-sso-ui/pom.xml index deb0e081be..3e85eb4737 100644 --- a/spring-security-sso/spring-security-sso-ui/pom.xml +++ b/spring-security-sso/spring-security-sso-ui/pom.xml @@ -38,7 +38,7 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity4 + thymeleaf-extras-springsecurity5 diff --git a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java b/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java index 24d6c9b5d8..c17bb85173 100644 --- a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java +++ b/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java @@ -3,15 +3,11 @@ package org.baeldung.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.*; @Configuration @EnableWebMvc -public class UiWebConfig extends WebMvcConfigurerAdapter { +public class UiWebConfig implements WebMvcConfigurer { @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { @@ -25,7 +21,6 @@ public class UiWebConfig extends WebMvcConfigurerAdapter { @Override public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); registry.addViewController("/") .setViewName("forward:/index"); registry.addViewController("/index"); diff --git a/spring-security-thymeleaf/pom.xml b/spring-security-thymeleaf/pom.xml index 5b7715bdeb..d8b476683a 100644 --- a/spring-security-thymeleaf/pom.xml +++ b/spring-security-thymeleaf/pom.xml @@ -43,7 +43,7 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity4 + thymeleaf-extras-springsecurity5 From 8232be4841e2ddee8cbecbfe14a9996c030e6936 Mon Sep 17 00:00:00 2001 From: Rokon Uddin Ahmed Date: Sat, 10 Nov 2018 15:59:58 +0600 Subject: [PATCH 343/546] Update README.md (#5653) --- rxjava-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/rxjava-2/README.md b/rxjava-2/README.md index 78eb6e6428..f9528bb1d5 100644 --- a/rxjava-2/README.md +++ b/rxjava-2/README.md @@ -5,3 +5,4 @@ - [RxJava 2 - Completable](http://www.baeldung.com/rxjava-completable) - [RxJava Maybe](http://www.baeldung.com/rxjava-maybe) - [Introduction to RxRelay for RxJava](http://www.baeldung.com/rx-relay) +- [Combining RxJava Completables](https://www.baeldung.com/rxjava-completable) From 03f530126fe7bfb146d3e95ba9dd1c5f1626cc5b Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sat, 10 Nov 2018 12:22:48 +0100 Subject: [PATCH 344/546] Multiple threads odd-even refactor (#5617) * encoding * Converting synchronous and asynchronous API to observables * Adding different ways of converting sync/async APIs to observalbles. * Replace anonymous class with lambda * update based on comment from Grzegorz Piwowarek * Refactor even-odd semaphore demo * Remove unrelated files --- ...reDemo.java => PrintEvenOddSemaphore.java} | 38 ++++++++----------- ...enOdd.java => PrintEvenOddWaitNotify.java} | 32 +++++++--------- 2 files changed, 29 insertions(+), 41 deletions(-) rename core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/{SemaphoreDemo.java => PrintEvenOddSemaphore.java} (60%) rename core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/{PrintEvenOdd.java => PrintEvenOddWaitNotify.java} (64%) diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/SemaphoreDemo.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddSemaphore.java similarity index 60% rename from core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/SemaphoreDemo.java rename to core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddSemaphore.java index c3afba1f68..8b58916707 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/SemaphoreDemo.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddSemaphore.java @@ -2,55 +2,47 @@ package com.baeldung.concurrent.evenandodd; import java.util.concurrent.Semaphore; -public class SemaphoreDemo { +public class PrintEvenOddSemaphore { public static void main(String[] args) { - SharedPrinter sp = new SharedPrinter(); - Thread odd = new Thread(new Odd(sp, 10)); - odd.setName("Odd"); - Thread even = new Thread(new Even(sp, 10)); - even.setName("Even"); + Thread odd = new Thread(new Odd(sp, 10), "Odd"); + Thread even = new Thread(new Even(sp, 10), "Even"); odd.start(); even.start(); - } - } class SharedPrinter { - Semaphore semEven = new Semaphore(0); - Semaphore semOdd = new Semaphore(1); + private final Semaphore semEven = new Semaphore(0); + private final Semaphore semOdd = new Semaphore(1); - public void printEvenNum(int num) { + void printEvenNum(int num) { try { semEven.acquire(); } catch (InterruptedException e) { - e.printStackTrace(); + Thread.currentThread().interrupt(); } - System.out.println(Thread.currentThread() - .getName() + ":"+num); + System.out.println(Thread.currentThread().getName() + ":"+num); semOdd.release(); } - public void printOddNum(int num) { + void printOddNum(int num) { try { semOdd.acquire(); } catch (InterruptedException e) { - e.printStackTrace(); + Thread.currentThread().interrupt(); } - System.out.println(Thread.currentThread() - .getName() + ":"+ num); + System.out.println(Thread.currentThread().getName() + ":"+ num); semEven.release(); - } } class Even implements Runnable { - SharedPrinter sp; - int max; + private final SharedPrinter sp; + private final int max; Even(SharedPrinter sp, int max) { this.sp = sp; @@ -66,8 +58,8 @@ class Even implements Runnable { } class Odd implements Runnable { - SharedPrinter sp; - int max; + private SharedPrinter sp; + private int max; Odd(SharedPrinter sp, int max) { this.sp = sp; diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOdd.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddWaitNotify.java similarity index 64% rename from core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOdd.java rename to core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddWaitNotify.java index 54d89382b9..2b59f22a6e 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOdd.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddWaitNotify.java @@ -1,22 +1,20 @@ package com.baeldung.concurrent.evenandodd; -public class PrintEvenOdd { +public class PrintEvenOddWaitNotify { public static void main(String... args) { Printer print = new Printer(); - Thread t1 = new Thread(new TaskEvenOdd(print, 10, false)); - t1.setName("Odd"); - Thread t2 = new Thread(new TaskEvenOdd(print, 10, true)); - t2.setName("Even"); + Thread t1 = new Thread(new TaskEvenOdd(print, 10, false), "Odd"); + Thread t2 = new Thread(new TaskEvenOdd(print, 10, true), "Even"); t1.start(); t2.start(); } } class TaskEvenOdd implements Runnable { - private int max; - private Printer print; - private boolean isEvenNumber; + private final int max; + private final Printer print; + private final boolean isEvenNumber; TaskEvenOdd(Printer print, int max, boolean isEvenNumber) { this.print = print; @@ -26,7 +24,7 @@ class TaskEvenOdd implements Runnable { @Override public void run() { - int number = isEvenNumber == true ? 2 : 1; + int number = isEvenNumber ? 2 : 1; while (number <= max) { if (isEvenNumber) { print.printEven(number); @@ -39,32 +37,30 @@ class TaskEvenOdd implements Runnable { } class Printer { - boolean isOdd = false; + private volatile boolean isOdd; synchronized void printEven(int number) { - while (isOdd == false) { + while (!isOdd) { try { wait(); } catch (InterruptedException e) { - e.printStackTrace(); + Thread.currentThread().interrupt(); } } - System.out.println(Thread.currentThread() - .getName() + ":" + number); + System.out.println(Thread.currentThread().getName() + ":" + number); isOdd = false; notify(); } synchronized void printOdd(int number) { - while (isOdd == true) { + while (isOdd) { try { wait(); } catch (InterruptedException e) { - e.printStackTrace(); + Thread.currentThread().interrupt(); } } - System.out.println(Thread.currentThread() - .getName() + ":" + number); + System.out.println(Thread.currentThread().getName() + ":" + number); isOdd = true; notify(); } From 6d1e1647d511378028adcc26f5f9bcb1d7a766a6 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sat, 10 Nov 2018 12:45:08 +0100 Subject: [PATCH 345/546] Core scala refactor (#5654) * encoding * Converting synchronous and asynchronous API to observables * Adding different ways of converting sync/async APIs to observalbles. * Replace anonymous class with lambda * update based on comment from Grzegorz Piwowarek * Refactor core-scala examples * Cleanup --- .../scala/com/baeldung/scala/Employee.scala | 2 +- .../baeldung/scala/HigherOrderFunctions.scala | 2 +- .../main/scala/com/baeldung/scala/Utils.scala | 4 ++-- .../scala/ControlStructuresDemoUnitTest.scala | 12 ++++++------ .../com/baeldung/scala/EmployeeUnitTest.scala | 6 +++--- .../scala/HigherOrderFunctionsUnitTest.scala | 9 ++++----- .../com/baeldung/scala/IntSetUnitTest.scala | 4 +--- .../com/baeldung/scala/UtilsUnitTest.scala | 17 ++++++----------- 8 files changed, 24 insertions(+), 32 deletions(-) diff --git a/core-scala/src/main/scala/com/baeldung/scala/Employee.scala b/core-scala/src/main/scala/com/baeldung/scala/Employee.scala index 397f166aa7..9291d958b3 100644 --- a/core-scala/src/main/scala/com/baeldung/scala/Employee.scala +++ b/core-scala/src/main/scala/com/baeldung/scala/Employee.scala @@ -22,6 +22,6 @@ class Employee(val name : String, * A Trait which will make the toString return upper case value. */ trait UpperCasePrinter { - override def toString = super.toString toUpperCase + override def toString: String = super.toString toUpperCase } diff --git a/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala b/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala index df97013206..02c41a5f8c 100644 --- a/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala +++ b/core-scala/src/main/scala/com/baeldung/scala/HigherOrderFunctions.scala @@ -11,7 +11,7 @@ object HigherOrderFunctions { def mapReduce(r : (Int, Int) => Int, i : Int, m : Int => Int, - a : Int, b : Int) = { + a : Int, b : Int): Int = { def iter(a : Int, result : Int) : Int = { if (a > b) result else iter(a + 1, r(m(a), result)) diff --git a/core-scala/src/main/scala/com/baeldung/scala/Utils.scala b/core-scala/src/main/scala/com/baeldung/scala/Utils.scala index 93cd3e697e..20bc413646 100644 --- a/core-scala/src/main/scala/com/baeldung/scala/Utils.scala +++ b/core-scala/src/main/scala/com/baeldung/scala/Utils.scala @@ -7,9 +7,9 @@ package com.baeldung.scala * */ object Utils { - def average(x : Double, y : Double) = (x + y) / 2 + def average(x : Double, y : Double): Double = (x + y) / 2 - def randomLessThan(d : Double) = { + def randomLessThan(d : Double): Double = { var random = 0d do { random = Math.random() diff --git a/core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala index 71422a8b4f..584038ee2c 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/ControlStructuresDemoUnitTest.scala @@ -1,32 +1,32 @@ package com.baeldung.scala import com.baeldung.scala.ControlStructuresDemo._ -import org.junit.Test import org.junit.Assert.assertEquals +import org.junit.Test class ControlStructuresDemoUnitTest { @Test - def givenTwoIntegers_whenGcdCalled_thenCorrectValueReturned = { + def givenTwoIntegers_whenGcdCalled_thenCorrectValueReturned() = { assertEquals(3, gcd(15, 27)) } @Test - def givenTwoIntegers_whenGcdIterCalled_thenCorrectValueReturned = { + def givenTwoIntegers_whenGcdIterCalled_thenCorrectValueReturned() = { assertEquals(3, gcdIter(15, 27)) } @Test - def givenTwoIntegers_whenRangeSumcalled_thenCorrectValueReturned = { + def givenTwoIntegers_whenRangeSumcalled_thenCorrectValueReturned() = { assertEquals(55, rangeSum(1, 10)) } @Test - def givenPositiveInteger_whenFactorialInvoked_thenCorrectValueReturned = { + def givenPositiveInteger_whenFactorialInvoked_thenCorrectValueReturned() = { assertEquals(720, factorial(6)) } @Test - def whenFactorialOf0Invoked_then1Returned = { + def whenFactorialOf0Invoked_then1Returned() = { assertEquals(1, factorial(0)) } diff --git a/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala index c51631dd2c..0828752a8a 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/EmployeeUnitTest.scala @@ -6,20 +6,20 @@ import org.junit.Test class EmployeeUnitTest { @Test - def whenEmployeeSalaryIncremented_thenCorrectSalary = { + def whenEmployeeSalaryIncremented_thenCorrectSalary() = { val employee = new Employee("John Doe", 1000) employee.incrementSalary() assertEquals(1020, employee.salary) } @Test - def givenEmployee_whenToStringCalled_thenCorrectStringReturned = { + def givenEmployee_whenToStringCalled_thenCorrectStringReturned() = { val employee = new Employee("John Doe", 1000) assertEquals("Employee(name=John Doe, salary=1000)", employee.toString) } @Test - def givenEmployeeWithTrait_whenToStringCalled_thenCorrectStringReturned = { + def givenEmployeeWithTrait_whenToStringCalled_thenCorrectStringReturned() = { val employee = new Employee("John Doe", 1000) with UpperCasePrinter assertEquals("EMPLOYEE(NAME=JOHN DOE, SALARY=1000)", employee.toString) diff --git a/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala index 63530ecaf4..240c879d7f 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/HigherOrderFunctionsUnitTest.scala @@ -1,14 +1,13 @@ package com.baeldung.scala +import com.baeldung.scala.HigherOrderFunctions.mapReduce import org.junit.Assert.assertEquals import org.junit.Test -import HigherOrderFunctions.mapReduce - class HigherOrderFunctionsUnitTest { @Test - def whenCalledWithSumAndSquareFunctions_thenCorrectValueReturned = { + def whenCalledWithSumAndSquareFunctions_thenCorrectValueReturned() = { def square(x : Int) = x * x def sum(x : Int, y : Int) = x + y @@ -20,7 +19,7 @@ class HigherOrderFunctionsUnitTest { } @Test - def whenComputingSumOfSquaresWithAnonymousFunctions_thenCorrectValueReturned = { + def whenComputingSumOfSquaresWithAnonymousFunctions_thenCorrectValueReturned() = { def sumSquares(a : Int, b : Int) = mapReduce((x, y) => x + y, 0, x => x * x, a, b) @@ -28,7 +27,7 @@ class HigherOrderFunctionsUnitTest { } @Test - def givenCurriedFunctions_whenInvoked_thenCorrectValueReturned = { + def givenCurriedFunctions_whenInvoked_thenCorrectValueReturned() = { // a curried function def sum(f : Int => Int)(a : Int, b : Int) : Int = diff --git a/core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala index 5cc19e9215..ac27389d70 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/IntSetUnitTest.scala @@ -1,14 +1,12 @@ package com.baeldung.scala -import scala.Range - import org.junit.Assert.assertFalse import org.junit.Test class IntSetUnitTest { @Test - def givenSetof1To10_whenContains11Called_thenFalse = { + def givenSetof1To10_whenContains11Called_thenFalse() = { // Set up a set containing integers 1 to 10. val set1To10 = diff --git a/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala b/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala index 47f9873aad..e4995201d8 100644 --- a/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala +++ b/core-scala/src/test/scala/com/baeldung/scala/UtilsUnitTest.scala @@ -1,34 +1,29 @@ package com.baeldung.scala -import org.junit.Assert.assertEquals -import org.junit.Assert.assertTrue +import com.baeldung.scala.Utils.{average, fibonacci, power, randomLessThan} +import org.junit.Assert.{assertEquals, assertTrue} import org.junit.Test -import Utils.average -import Utils.fibonacci -import Utils.power -import Utils.randomLessThan - class UtilsUnitTest { @Test - def whenAverageCalled_thenCorrectValueReturned() = { + def whenAverageCalled_thenCorrectValueReturned(): Unit = { assertEquals(15.0, average(10, 20), 1e-5) } @Test - def whenRandomLessThanInvokedWithANumber_thenARandomLessThanItReturned = { + def whenRandomLessThanInvokedWithANumber_thenARandomLessThanItReturned: Unit = { val d = 0.1 assertTrue(randomLessThan(d) < d) } @Test - def whenPowerInvokedWith2And3_then8Returned = { + def whenPowerInvokedWith2And3_then8Returned: Unit = { assertEquals(8, power(2, 3)) } @Test - def whenFibonacciCalled_thenCorrectValueReturned = { + def whenFibonacciCalled_thenCorrectValueReturned: Unit = { assertEquals(1, fibonacci(0)) assertEquals(1, fibonacci(1)) assertEquals(fibonacci(6), From 55c49b25f1376dbf433fc2aa0c200879399abf8f Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 10:29:12 -0200 Subject: [PATCH 346/546] 4- Fourth commit for core-java module splitting. This commit includes: * to core-java-lang: * https://www.baeldung.com/java-stack-overflow-error * https://www.baeldung.com/java-new-custom-exception * https://www.baeldung.com/java-exceptions * https://www.baeldung.com/java-final-finally-finalize * https://www.baeldung.com/java-static-dynamic-binding * https://www.baeldung.com/java-throw-throws * https://www.baeldung.com/java-synthetic * https://www.baeldung.com/java-switch * https://www.baeldung.com/modulo-java * https://www.baeldung.com/java-ternary-operator --- .../src/main/java/com/baeldung/binding/Animal.java | 0 .../src/main/java/com/baeldung/binding/AnimalActivity.java | 0 .../src/main/java/com/baeldung/binding/Cat.java | 0 .../src/main/java/com/baeldung/customexception/FileManager.java | 0 .../baeldung/customexception/IncorrectFileExtensionException.java | 0 .../com/baeldung/customexception/IncorrectFileNameException.java | 0 .../src/main/java/com/baeldung/exceptionhandling/Exceptions.java | 0 .../src/main/java/com/baeldung/exceptionhandling/MyException.java | 0 .../src/main/java/com/baeldung/exceptionhandling/Player.java | 0 .../java/com/baeldung/exceptionhandling/PlayerLoadException.java | 0 .../java/com/baeldung/exceptionhandling/PlayerScoreException.java | 0 .../java/com/baeldung/exceptionhandling/TimeoutException.java | 0 .../main/java/com/baeldung/keywords/finalize/FinalizeObject.java | 0 .../src/main/java/com/baeldung/keywords/finalkeyword/Child.java | 0 .../main/java/com/baeldung/keywords/finalkeyword/GrandChild.java | 0 .../src/main/java/com/baeldung/keywords/finalkeyword/Parent.java | 0 .../java/com/baeldung/keywords/finallykeyword/FinallyExample.java | 0 .../main/java/com/baeldung/stackoverflowerror/AccountHolder.java | 0 .../src/main/java/com/baeldung/stackoverflowerror/ClassOne.java | 0 .../src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java | 0 .../InfiniteRecursionWithTerminationCondition.java | 0 .../RecursionWithCorrectTerminationCondition.java | 0 .../baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java | 0 .../main/java/com/baeldung/switchstatement/SwitchStatement.java | 0 .../src/main/java/com/baeldung/synthetic/BridgeMethodDemo.java | 0 .../java/com/baeldung/synthetic/SyntheticConstructorDemo.java | 0 .../src/main/java/com/baeldung/synthetic/SyntheticFieldDemo.java | 0 .../src/main/java/com/baeldung/synthetic/SyntheticMethodDemo.java | 0 .../java/com/baeldung/throwsexception/DataAccessException.java | 0 .../src/main/java/com/baeldung/throwsexception/Main.java | 0 .../main/java/com/baeldung/throwsexception/PersonRepository.java | 0 .../src/main/java/com/baeldung/throwsexception/SimpleService.java | 0 .../src/main/java/com/baeldung/throwsexception/TryCatch.java | 0 .../test/java/com/baeldung/binding/AnimalActivityUnitTest.java | 0 .../src/test/java/com/baeldung/binding/AnimalUnitTest.java | 0 .../src/test/java/com/baeldung/binding/CatUnitTest.java | 0 .../customexception/IncorrectFileExtensionExceptionUnitTest.java | 0 .../customexception/IncorrectFileNameExceptionUnitTest.java | 0 .../java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java | 0 .../src/test/java/com/baeldung/modulo/ModuloUnitTest.java | 0 .../com/baeldung/stackoverflowerror/AccountHolderManualTest.java | 0 .../baeldung/stackoverflowerror/CyclicDependancyManualTest.java | 0 .../InfiniteRecursionWithTerminationConditionManualTest.java | 0 .../RecursionWithCorrectTerminationConditionManualTest.java | 0 .../stackoverflowerror/UnintendedInfiniteRecursionManualTest.java | 0 .../com/baeldung/switchstatement/SwitchStatementUnitTest.java | 0 .../src/test/java/com/baeldung/synthetic/SyntheticUnitTest.java | 0 .../com/baeldung/ternaryoperator/TernaryOperatorUnitTest.java | 0 .../java/com/baeldung/throwsexception/SimpleServiceUnitTest.java | 0 49 files changed, 0 insertions(+), 0 deletions(-) rename {core-java => core-java-lang}/src/main/java/com/baeldung/binding/Animal.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/binding/AnimalActivity.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/binding/Cat.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/customexception/FileManager.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/exceptionhandling/Exceptions.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/exceptionhandling/MyException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/exceptionhandling/Player.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keywords/finalkeyword/Child.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/switchstatement/SwitchStatement.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/synthetic/BridgeMethodDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/synthetic/SyntheticConstructorDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/synthetic/SyntheticFieldDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/synthetic/SyntheticMethodDemo.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/throwsexception/DataAccessException.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/throwsexception/Main.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/throwsexception/PersonRepository.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/throwsexception/SimpleService.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/throwsexception/TryCatch.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/binding/AnimalUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/binding/CatUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/modulo/ModuloUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/switchstatement/SwitchStatementUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/synthetic/SyntheticUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/ternaryoperator/TernaryOperatorUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java (100%) diff --git a/core-java/src/main/java/com/baeldung/binding/Animal.java b/core-java-lang/src/main/java/com/baeldung/binding/Animal.java similarity index 100% rename from core-java/src/main/java/com/baeldung/binding/Animal.java rename to core-java-lang/src/main/java/com/baeldung/binding/Animal.java diff --git a/core-java/src/main/java/com/baeldung/binding/AnimalActivity.java b/core-java-lang/src/main/java/com/baeldung/binding/AnimalActivity.java similarity index 100% rename from core-java/src/main/java/com/baeldung/binding/AnimalActivity.java rename to core-java-lang/src/main/java/com/baeldung/binding/AnimalActivity.java diff --git a/core-java/src/main/java/com/baeldung/binding/Cat.java b/core-java-lang/src/main/java/com/baeldung/binding/Cat.java similarity index 100% rename from core-java/src/main/java/com/baeldung/binding/Cat.java rename to core-java-lang/src/main/java/com/baeldung/binding/Cat.java diff --git a/core-java/src/main/java/com/baeldung/customexception/FileManager.java b/core-java-lang/src/main/java/com/baeldung/customexception/FileManager.java similarity index 100% rename from core-java/src/main/java/com/baeldung/customexception/FileManager.java rename to core-java-lang/src/main/java/com/baeldung/customexception/FileManager.java diff --git a/core-java/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java b/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java rename to core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java diff --git a/core-java/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java b/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java rename to core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java diff --git a/core-java/src/main/java/com/baeldung/exceptionhandling/Exceptions.java b/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Exceptions.java similarity index 100% rename from core-java/src/main/java/com/baeldung/exceptionhandling/Exceptions.java rename to core-java-lang/src/main/java/com/baeldung/exceptionhandling/Exceptions.java diff --git a/core-java/src/main/java/com/baeldung/exceptionhandling/MyException.java b/core-java-lang/src/main/java/com/baeldung/exceptionhandling/MyException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/exceptionhandling/MyException.java rename to core-java-lang/src/main/java/com/baeldung/exceptionhandling/MyException.java diff --git a/core-java/src/main/java/com/baeldung/exceptionhandling/Player.java b/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Player.java similarity index 100% rename from core-java/src/main/java/com/baeldung/exceptionhandling/Player.java rename to core-java-lang/src/main/java/com/baeldung/exceptionhandling/Player.java diff --git a/core-java/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java b/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java rename to core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java diff --git a/core-java/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java b/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java rename to core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java diff --git a/core-java/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java b/core-java-lang/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java rename to core-java-lang/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java diff --git a/core-java/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java b/core-java-lang/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java rename to core-java-lang/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java diff --git a/core-java/src/main/java/com/baeldung/keywords/finalkeyword/Child.java b/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Child.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keywords/finalkeyword/Child.java rename to core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Child.java diff --git a/core-java/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java b/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java rename to core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java diff --git a/core-java/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java b/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java rename to core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java diff --git a/core-java/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java b/core-java-lang/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java similarity index 100% rename from core-java/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java rename to core-java-lang/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java diff --git a/core-java/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java b/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java rename to core-java-lang/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java diff --git a/core-java/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java b/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java rename to core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java diff --git a/core-java/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java b/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java rename to core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java diff --git a/core-java/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java b/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java rename to core-java-lang/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java diff --git a/core-java/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java b/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java rename to core-java-lang/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java diff --git a/core-java/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java b/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java similarity index 100% rename from core-java/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java rename to core-java-lang/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java diff --git a/core-java/src/main/java/com/baeldung/switchstatement/SwitchStatement.java b/core-java-lang/src/main/java/com/baeldung/switchstatement/SwitchStatement.java similarity index 100% rename from core-java/src/main/java/com/baeldung/switchstatement/SwitchStatement.java rename to core-java-lang/src/main/java/com/baeldung/switchstatement/SwitchStatement.java diff --git a/core-java/src/main/java/com/baeldung/synthetic/BridgeMethodDemo.java b/core-java-lang/src/main/java/com/baeldung/synthetic/BridgeMethodDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/synthetic/BridgeMethodDemo.java rename to core-java-lang/src/main/java/com/baeldung/synthetic/BridgeMethodDemo.java diff --git a/core-java/src/main/java/com/baeldung/synthetic/SyntheticConstructorDemo.java b/core-java-lang/src/main/java/com/baeldung/synthetic/SyntheticConstructorDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/synthetic/SyntheticConstructorDemo.java rename to core-java-lang/src/main/java/com/baeldung/synthetic/SyntheticConstructorDemo.java diff --git a/core-java/src/main/java/com/baeldung/synthetic/SyntheticFieldDemo.java b/core-java-lang/src/main/java/com/baeldung/synthetic/SyntheticFieldDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/synthetic/SyntheticFieldDemo.java rename to core-java-lang/src/main/java/com/baeldung/synthetic/SyntheticFieldDemo.java diff --git a/core-java/src/main/java/com/baeldung/synthetic/SyntheticMethodDemo.java b/core-java-lang/src/main/java/com/baeldung/synthetic/SyntheticMethodDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/synthetic/SyntheticMethodDemo.java rename to core-java-lang/src/main/java/com/baeldung/synthetic/SyntheticMethodDemo.java diff --git a/core-java/src/main/java/com/baeldung/throwsexception/DataAccessException.java b/core-java-lang/src/main/java/com/baeldung/throwsexception/DataAccessException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/throwsexception/DataAccessException.java rename to core-java-lang/src/main/java/com/baeldung/throwsexception/DataAccessException.java diff --git a/core-java/src/main/java/com/baeldung/throwsexception/Main.java b/core-java-lang/src/main/java/com/baeldung/throwsexception/Main.java similarity index 100% rename from core-java/src/main/java/com/baeldung/throwsexception/Main.java rename to core-java-lang/src/main/java/com/baeldung/throwsexception/Main.java diff --git a/core-java/src/main/java/com/baeldung/throwsexception/PersonRepository.java b/core-java-lang/src/main/java/com/baeldung/throwsexception/PersonRepository.java similarity index 100% rename from core-java/src/main/java/com/baeldung/throwsexception/PersonRepository.java rename to core-java-lang/src/main/java/com/baeldung/throwsexception/PersonRepository.java diff --git a/core-java/src/main/java/com/baeldung/throwsexception/SimpleService.java b/core-java-lang/src/main/java/com/baeldung/throwsexception/SimpleService.java similarity index 100% rename from core-java/src/main/java/com/baeldung/throwsexception/SimpleService.java rename to core-java-lang/src/main/java/com/baeldung/throwsexception/SimpleService.java diff --git a/core-java/src/main/java/com/baeldung/throwsexception/TryCatch.java b/core-java-lang/src/main/java/com/baeldung/throwsexception/TryCatch.java similarity index 100% rename from core-java/src/main/java/com/baeldung/throwsexception/TryCatch.java rename to core-java-lang/src/main/java/com/baeldung/throwsexception/TryCatch.java diff --git a/core-java/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java b/core-java-lang/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/binding/AnimalUnitTest.java b/core-java-lang/src/test/java/com/baeldung/binding/AnimalUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/binding/AnimalUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/binding/AnimalUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/binding/CatUnitTest.java b/core-java-lang/src/test/java/com/baeldung/binding/CatUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/binding/CatUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/binding/CatUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java b/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java b/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java b/core-java-lang/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/modulo/ModuloUnitTest.java b/core-java-lang/src/test/java/com/baeldung/modulo/ModuloUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/modulo/ModuloUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/modulo/ModuloUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java b/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java rename to core-java-lang/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java b/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java rename to core-java-lang/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java b/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java rename to core-java-lang/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java b/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java rename to core-java-lang/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java diff --git a/core-java/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java b/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java rename to core-java-lang/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java diff --git a/core-java/src/test/java/com/baeldung/switchstatement/SwitchStatementUnitTest.java b/core-java-lang/src/test/java/com/baeldung/switchstatement/SwitchStatementUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/switchstatement/SwitchStatementUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/switchstatement/SwitchStatementUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/synthetic/SyntheticUnitTest.java b/core-java-lang/src/test/java/com/baeldung/synthetic/SyntheticUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/synthetic/SyntheticUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/synthetic/SyntheticUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/ternaryoperator/TernaryOperatorUnitTest.java b/core-java-lang/src/test/java/com/baeldung/ternaryoperator/TernaryOperatorUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/ternaryoperator/TernaryOperatorUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/ternaryoperator/TernaryOperatorUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java b/core-java-lang/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java From 7249a2c88db3ed8233cdaea25f064d1228d7b0bd Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 11:13:04 -0200 Subject: [PATCH 347/546] 5 - Fifth commit to split core-java. This one includes: * to core-java-lang: * https://www.baeldung.com/java-separate-double-into-integer-decimal-parts * https://www.baeldung.com/java-sneaky-throws * https://www.baeldung.com/java-inheritance-composition * to core-java-array: * https://www.baeldung.com/java-array-copy * https://www.baeldung.com/java-initialize-array * https://www.baeldung.com/java-array-contains-value * https://www.baeldung.com/java-invert-array * https://www.baeldung.com/java-array-sum-average * https://www.baeldung.com/java-jagged-arrays * https://www.baeldung.com/java-util-arrays * https://www.baeldung.com/java-common-array-operations (from core-java-collections) --- core-java-arrays/.gitignore | 25 + core-java-arrays/pom.xml | 547 ++++++++++++++++++ .../baeldung/array/ArrayBenchmarkRunner.java | 0 .../com/baeldung/array/ArrayInitializer.java | 0 .../com/baeldung/array/ArrayInverter.java | 0 .../baeldung/array/ArrayReferenceGuide.java | 0 .../baeldung/array/Find2ndLargestInArray.java | 0 .../baeldung/array/FindElementInArray.java | 0 .../java/com/baeldung/array/JaggedArray.java | 0 .../baeldung/array/SearchArrayUnitTest.java | 0 .../baeldung/array/SumAndAverageInArray.java | 0 .../array/operations/ArrayOperations.java | 0 .../com/baeldung/arraycopy/model/Address.java | 0 .../baeldung/arraycopy/model/Employee.java | 0 .../array/ArrayInitializerUnitTest.java | 0 .../baeldung/array/ArrayInverterUnitTest.java | 0 .../array/Find2ndLargestInArrayUnitTest.java | 0 .../array/FindElementInArrayUnitTest.java | 0 .../baeldung/array/JaggedArrayUnitTest.java | 0 .../array/SumAndAverageInArrayUnitTest.java | 0 .../operations/ArrayOperationsUnitTest.java | 0 .../arraycopy/ArrayCopyUtilUnitTest.java | 0 .../com/baeldung/arrays/ArraysUnitTest.java | 0 .../doubles/SplitFloatingPointNumbers.java | 0 .../application/Application.java | 0 .../inheritancecomposition/model/Actress.java | 0 .../model/Computer.java | 0 .../inheritancecomposition/model/Memory.java | 0 .../inheritancecomposition/model/Person.java | 0 .../model/Processor.java | 0 .../model/SoundCard.java | 0 .../model/StandardMemory.java | 0 .../model/StandardProcessor.java | 0 .../model/StandardSoundCard.java | 0 .../model/Waitress.java | 0 .../baeldung/sneakythrows/SneakyRunnable.java | 0 .../baeldung/sneakythrows/SneakyThrows.java | 0 .../test/ActressUnitTest.java | 0 .../test/CompositionUnitTest.java | 0 .../test/InheritanceUnitTest.java | 0 .../test/PersonUnitTest.java | 0 .../test/WaitressUnitTest.java | 0 .../sneakythrows/SneakyRunnableUnitTest.java | 0 .../sneakythrows/SneakyThrowsUnitTest.java | 0 44 files changed, 572 insertions(+) create mode 100644 core-java-arrays/.gitignore create mode 100644 core-java-arrays/pom.xml rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/ArrayBenchmarkRunner.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/ArrayInitializer.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/ArrayInverter.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/ArrayReferenceGuide.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/Find2ndLargestInArray.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/FindElementInArray.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/JaggedArray.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/SearchArrayUnitTest.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/array/SumAndAverageInArray.java (100%) rename {core-java-collections => core-java-arrays}/src/main/java/com/baeldung/array/operations/ArrayOperations.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/arraycopy/model/Address.java (100%) rename {core-java => core-java-arrays}/src/main/java/com/baeldung/arraycopy/model/Employee.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/array/ArrayInitializerUnitTest.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/array/ArrayInverterUnitTest.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/array/Find2ndLargestInArrayUnitTest.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/array/FindElementInArrayUnitTest.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/array/JaggedArrayUnitTest.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/array/SumAndAverageInArrayUnitTest.java (100%) rename {core-java-collections => core-java-arrays}/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java (100%) rename {core-java => core-java-arrays}/src/test/java/com/baeldung/arrays/ArraysUnitTest.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/application/Application.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/Actress.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/Computer.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/Memory.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/Person.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/Processor.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/SoundCard.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/StandardMemory.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/StandardProcessor.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/StandardSoundCard.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/inheritancecomposition/model/Waitress.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/inheritancecomposition/test/ActressUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/inheritancecomposition/test/CompositionUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/inheritancecomposition/test/InheritanceUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/inheritancecomposition/test/PersonUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/inheritancecomposition/test/WaitressUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java (100%) diff --git a/core-java-arrays/.gitignore b/core-java-arrays/.gitignore new file mode 100644 index 0000000000..374c8bf907 --- /dev/null +++ b/core-java-arrays/.gitignore @@ -0,0 +1,25 @@ +*.class + +0.* + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* +.resourceCache + +# Packaged files # +*.jar +*.war +*.ear + +# Files generated by integration tests +backup-pom.xml +/bin/ +/temp + +#IntelliJ specific +.idea/ +*.iml \ No newline at end of file diff --git a/core-java-arrays/pom.xml b/core-java-arrays/pom.xml new file mode 100644 index 0000000000..36dcc09341 --- /dev/null +++ b/core-java-arrays/pom.xml @@ -0,0 +1,547 @@ + + 4.0.0 + com.baeldung + core-java-arrays + 0.1.0-SNAPSHOT + jar + core-java-arrays + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.bouncycastle + bcprov-jdk15on + ${bouncycastle.version} + + + org.unix4j + unix4j-command + ${unix4j.version} + + + com.googlecode.grep4j + grep4j + ${grep4j.version} + + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.google.code.gson + gson + ${gson.version} + + + + log4j + log4j + ${log4j.version} + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.javamoney + moneta + ${javamoney.moneta.version} + + + org.owasp.esapi + esapi + ${esapi.version} + + + com.sun.messaging.mq + fscontext + ${fscontext.version} + + + com.codepoetics + protonpack + ${protonpack.version} + + + one.util + streamex + ${streamex.version} + + + io.vavr + vavr + ${vavr.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator-annprocess.version} + + + org.springframework + spring-web + ${springframework.spring-web.version} + + + com.h2database + h2 + ${h2database.version} + + + javax.mail + mail + ${javax.mail.version} + + + + org.apache.tika + tika-core + ${tika.version} + + + net.sf.jmimemagic + jmimemagic + ${jmime-magic.version} + + + + org.javassist + javassist + ${javaassist.version} + + + com.sun + tools + 1.8.0 + system + ${java.home}/../lib/tools.jar + + + + + core-java-arrays + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + **/*LongRunningUnitTest.java + **/*ManualTest.java + + true + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + + true + libs/ + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + package + + single + + + ${project.basedir} + + + org.baeldung.executable.ExecutableMavenJar + + + + jar-with-dependencies + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven-shade-plugin.version} + + + + shade + + + true + + + org.baeldung.executable.ExecutableMavenJar + + + + + + + + + com.jolira + onejar-maven-plugin + ${onejar-maven-plugin.version} + + + + org.baeldung.executable.ExecutableMavenJar + true + ${project.build.finalName}-onejar.${project.packaging} + + + one-jar + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot-maven-plugin.version} + + + + repackage + + + spring-boot + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + java + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + -Xmx300m + -XX:+UseParallelGC + -classpath + + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + 1.8 + 1.8 + + + + + + + + integration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*ManualTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + json + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + run-benchmarks + + none + + exec + + + test + java + + -classpath + + org.openjdk.jmh.Main + .* + + + + + + + + + + + + buildAgentLoader + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + agentLoader + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/application/AgentLoader.class + com/baeldung/instrumentation/application/Launcher.class + + + + + + + + + + buildApplication + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + application + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/application/MyAtm.class + com/baeldung/instrumentation/application/MyAtmApplication.class + com/baeldung/instrumentation/application/Launcher.class + + + + + + + + + + buildAgent + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + agent + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/agent/AtmTransformer.class + com/baeldung/instrumentation/agent/MyInstrumentationAgent.class + + + + + + + + + + + + + + 2.8.5 + 2.8.2 + + + 3.8.1 + 1.55 + 1.10 + 2.5 + 3.6.1 + 1.0.3 + 0.4 + 1.8.7 + 1.16.12 + 4.6-b01 + 1.13 + 0.6.5 + 0.9.0 + + + 3.10.0 + + + 2.21.0 + 4.3.4.RELEASE + + 1.1 + 1.4.197 + 2.1.0.1 + 1.19 + + 1.19 + 3.0.0-M1 + 1.5.0-b01 + 3.0.2 + 1.4.4 + 3.1.1 + 2.0.3.RELEASE + 1.6.0 + 61.1 + + 1.18 + 0.1.5 + + 3.21.0-GA + + + diff --git a/core-java/src/main/java/com/baeldung/array/ArrayBenchmarkRunner.java b/core-java-arrays/src/main/java/com/baeldung/array/ArrayBenchmarkRunner.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/ArrayBenchmarkRunner.java rename to core-java-arrays/src/main/java/com/baeldung/array/ArrayBenchmarkRunner.java diff --git a/core-java/src/main/java/com/baeldung/array/ArrayInitializer.java b/core-java-arrays/src/main/java/com/baeldung/array/ArrayInitializer.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/ArrayInitializer.java rename to core-java-arrays/src/main/java/com/baeldung/array/ArrayInitializer.java diff --git a/core-java/src/main/java/com/baeldung/array/ArrayInverter.java b/core-java-arrays/src/main/java/com/baeldung/array/ArrayInverter.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/ArrayInverter.java rename to core-java-arrays/src/main/java/com/baeldung/array/ArrayInverter.java diff --git a/core-java/src/main/java/com/baeldung/array/ArrayReferenceGuide.java b/core-java-arrays/src/main/java/com/baeldung/array/ArrayReferenceGuide.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/ArrayReferenceGuide.java rename to core-java-arrays/src/main/java/com/baeldung/array/ArrayReferenceGuide.java diff --git a/core-java/src/main/java/com/baeldung/array/Find2ndLargestInArray.java b/core-java-arrays/src/main/java/com/baeldung/array/Find2ndLargestInArray.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/Find2ndLargestInArray.java rename to core-java-arrays/src/main/java/com/baeldung/array/Find2ndLargestInArray.java diff --git a/core-java/src/main/java/com/baeldung/array/FindElementInArray.java b/core-java-arrays/src/main/java/com/baeldung/array/FindElementInArray.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/FindElementInArray.java rename to core-java-arrays/src/main/java/com/baeldung/array/FindElementInArray.java diff --git a/core-java/src/main/java/com/baeldung/array/JaggedArray.java b/core-java-arrays/src/main/java/com/baeldung/array/JaggedArray.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/JaggedArray.java rename to core-java-arrays/src/main/java/com/baeldung/array/JaggedArray.java diff --git a/core-java/src/main/java/com/baeldung/array/SearchArrayUnitTest.java b/core-java-arrays/src/main/java/com/baeldung/array/SearchArrayUnitTest.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/SearchArrayUnitTest.java rename to core-java-arrays/src/main/java/com/baeldung/array/SearchArrayUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/array/SumAndAverageInArray.java b/core-java-arrays/src/main/java/com/baeldung/array/SumAndAverageInArray.java similarity index 100% rename from core-java/src/main/java/com/baeldung/array/SumAndAverageInArray.java rename to core-java-arrays/src/main/java/com/baeldung/array/SumAndAverageInArray.java diff --git a/core-java-collections/src/main/java/com/baeldung/array/operations/ArrayOperations.java b/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java similarity index 100% rename from core-java-collections/src/main/java/com/baeldung/array/operations/ArrayOperations.java rename to core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java diff --git a/core-java/src/main/java/com/baeldung/arraycopy/model/Address.java b/core-java-arrays/src/main/java/com/baeldung/arraycopy/model/Address.java similarity index 100% rename from core-java/src/main/java/com/baeldung/arraycopy/model/Address.java rename to core-java-arrays/src/main/java/com/baeldung/arraycopy/model/Address.java diff --git a/core-java/src/main/java/com/baeldung/arraycopy/model/Employee.java b/core-java-arrays/src/main/java/com/baeldung/arraycopy/model/Employee.java similarity index 100% rename from core-java/src/main/java/com/baeldung/arraycopy/model/Employee.java rename to core-java-arrays/src/main/java/com/baeldung/arraycopy/model/Employee.java diff --git a/core-java/src/test/java/com/baeldung/array/ArrayInitializerUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/ArrayInitializerUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/array/ArrayInitializerUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/array/ArrayInitializerUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/array/ArrayInverterUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/ArrayInverterUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/array/ArrayInverterUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/array/ArrayInverterUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/array/Find2ndLargestInArrayUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/Find2ndLargestInArrayUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/array/Find2ndLargestInArrayUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/array/Find2ndLargestInArrayUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/array/FindElementInArrayUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/FindElementInArrayUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/array/FindElementInArrayUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/array/FindElementInArrayUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/array/JaggedArrayUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/JaggedArrayUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/array/JaggedArrayUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/array/JaggedArrayUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/array/SumAndAverageInArrayUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/SumAndAverageInArrayUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/array/SumAndAverageInArrayUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/array/SumAndAverageInArrayUnitTest.java diff --git a/core-java-collections/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java similarity index 100% rename from core-java-collections/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/arraycopy/ArrayCopyUtilUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/arrays/ArraysUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/arrays/ArraysUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/arrays/ArraysUnitTest.java rename to core-java-arrays/src/test/java/com/baeldung/arrays/ArraysUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java b/core-java-lang/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java similarity index 100% rename from core-java/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java rename to core-java-lang/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/application/Application.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/application/Application.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/application/Application.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/application/Application.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/Actress.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Actress.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/Actress.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Actress.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/Computer.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Computer.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/Computer.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Computer.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/Memory.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Memory.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/Memory.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Memory.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/Person.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Person.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/Person.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Person.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/Processor.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Processor.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/Processor.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Processor.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/SoundCard.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/SoundCard.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/SoundCard.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/SoundCard.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/StandardMemory.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/StandardMemory.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/StandardMemory.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/StandardMemory.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/StandardProcessor.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/StandardProcessor.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/StandardProcessor.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/StandardProcessor.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/StandardSoundCard.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/StandardSoundCard.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/StandardSoundCard.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/StandardSoundCard.java diff --git a/core-java/src/main/java/com/baeldung/inheritancecomposition/model/Waitress.java b/core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Waitress.java similarity index 100% rename from core-java/src/main/java/com/baeldung/inheritancecomposition/model/Waitress.java rename to core-java-lang/src/main/java/com/baeldung/inheritancecomposition/model/Waitress.java diff --git a/core-java/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java b/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java similarity index 100% rename from core-java/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java rename to core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java diff --git a/core-java/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java b/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java similarity index 100% rename from core-java/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java rename to core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java diff --git a/core-java/src/test/java/com/baeldung/inheritancecomposition/test/ActressUnitTest.java b/core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/ActressUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/inheritancecomposition/test/ActressUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/ActressUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/inheritancecomposition/test/CompositionUnitTest.java b/core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/CompositionUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/inheritancecomposition/test/CompositionUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/CompositionUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/inheritancecomposition/test/InheritanceUnitTest.java b/core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/InheritanceUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/inheritancecomposition/test/InheritanceUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/InheritanceUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/inheritancecomposition/test/PersonUnitTest.java b/core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/PersonUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/inheritancecomposition/test/PersonUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/PersonUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/inheritancecomposition/test/WaitressUnitTest.java b/core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/WaitressUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/inheritancecomposition/test/WaitressUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/inheritancecomposition/test/WaitressUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java b/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java b/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java From c5d39535c688200588c4575487b18333ddd38381 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 10 Nov 2018 15:36:47 +0200 Subject: [PATCH 348/546] maven testing cleanup --- pom.xml | 716 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 358 insertions(+), 358 deletions(-) diff --git a/pom.xml b/pom.xml index aa79dae1d5..f4338bf995 100644 --- a/pom.xml +++ b/pom.xml @@ -545,7 +545,7 @@ **/*IntTest.java **/*LongRunningUnitTest.java **/*ManualTest.java - **/JdbcTest.java + **/*JdbcTest.java **/*LiveTest.java @@ -898,37 +898,25 @@ integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - json - - - - - + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + @@ -1213,39 +1201,26 @@ - integration-lite + integration-lite-test - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - json - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + parent-boot-1 @@ -1254,270 +1229,305 @@ parent-spring-5 parent-java parent-kotlin - asm - atomix - persistence-modules/apache-cayenne - aws - aws-lambda - akka-streams - algorithms-genetic - algorithms-miscellaneous-1 - algorithms-miscellaneous-2 - algorithms-sorting - annotations - apache-cxf - apache-fop - apache-poi - apache-tika - apache-thrift - apache-curator - apache-zookeeper - apache-opennlp - autovalue - axon - azure - bootique - cdi - java-strings - - core-java-collections - java-collections-conversions - java-collections-maps - core-java-io - core-java-8 - java-streams - core-groovy - - couchbase - persistence-modules/deltaspike - dozer - ethereum - feign - flips - testing-modules/groovy-spock - google-cloud - gson - guava - guava-collections - guava-modules/guava-18 - guava-modules/guava-19 - guava-modules/guava-21 - guice - disruptor - spring-static-resources - hazelcast - persistence-modules/hbase - - hystrix - image-processing - immutables - persistence-modules/influxdb - jackson - vavr - java-lite - java-numbers - java-rmi - java-vavr-stream - javax-servlets - javaxval - jaxb - javafx - jgroups - jee-7 - jee-7-security - jjwt - jsf - json-path - json - jsoup - jta - testing-modules/junit-5 - testing-modules/junit5-migration - jws - libraries-data - linkrest - logging-modules/log-mdc - logging-modules/log4j - - logging-modules/logback - lombok - mapstruct - - maven - mesos-marathon - msf4j - testing-modules/mockito - testing-modules/mockito-2 - testing-modules/mocks - mustache - mvn-wrapper - noexception - persistence-modules/orientdb - osgi - orika - patterns - pdf - protobuffer - persistence-modules/querydsl - reactor-core - persistence-modules/redis - testing-modules/rest-assured - testing-modules/rest-testing - resteasy - rxjava - rxjava-2 - spring-swagger-codegen - testing-modules/selenium-junit-testng - persistence-modules/solr - spark-java + spring-4 - spring-5-data-reactive - spring-5-reactive - spring-5-reactive-security - spring-5-reactive-client - spring-5-mvc - spring-5-security - spring-activiti - spring-akka - spring-amqp - spring-all - spring-amqp-simple - spring-apache-camel - spring-batch - spring-bom - spring-boot-keycloak - spring-boot-bootstrap - spring-boot-admin - spring-boot-camel - persistence-modules/spring-boot-persistence - spring-boot-security - spring-boot-mvc - spring-boot-logging-log4j2 - spring-boot-disable-console-logging - spring-cloud-data-flow - spring-cloud - spring-cloud-bus - spring-core - spring-cucumber - spring-ejb - spring-aop + - persistence-modules/spring-data-dynamodb - persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb - persistence-modules/spring-data-neo4j + - spring-data-rest - persistence-modules/spring-data-solr - spring-dispatcher-servlet - spring-exceptions - spring-freemarker - persistence-modules/spring-hibernate-3 + + integration-lite - persistence-modules/spring-hibernate-5 - persistence-modules/spring-data-eclipselink - spring-integration - spring-jenkins-pipeline - spring-jersey + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + - spring-jms - spring-jooq - persistence-modules/spring-jpa - spring-kafka - spring-katharsis - spring-ldap - spring-mockito - spring-mvc-forms-jsp - spring-mvc-forms-thymeleaf - spring-mvc-java - spring-mvc-velocity - spring-mvc-webflow - spring-mvc-xml - spring-mvc-kotlin - spring-protobuf - spring-quartz - spring-rest-angular - spring-rest-full - spring-rest-query-language - spring-rest - spring-resttemplate - spring-rest-simple - spring-security-acl - spring-security-cache-control - spring-security-client/spring-security-jsp-authentication - spring-security-client/spring-security-jsp-authorize - spring-security-client/spring-security-jsp-config - spring-security-client/spring-security-mvc - spring-security-client/spring-security-thymeleaf-authentication - spring-security-client/spring-security-thymeleaf-authorize - spring-security-client/spring-security-thymeleaf-config - spring-security-core - spring-security-mvc-boot - spring-security-mvc-digest-auth - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc-session - spring-security-mvc-socket - spring-security-openid - - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-rest - spring-security-sso - spring-security-x509 - spring-session - spring-sleuth - spring-social-login - spring-spel - spring-state-machine - spring-thymeleaf - spring-userservice - spring-zuul - spring-remoting - spring-reactor - spring-vertx - spring-vault - spring-jinq - spring-rest-embedded-tomcat - testing-modules/testing - testing-modules/testng - video-tutorials + + parent-boot-1 + parent-boot-2 + parent-spring-4 + parent-spring-5 + parent-java + parent-kotlin + asm + atomix + persistence-modules/apache-cayenne + aws + aws-lambda + akka-streams + algorithms-genetic + algorithms-miscellaneous-1 + algorithms-miscellaneous-2 + algorithms-sorting + annotations + apache-cxf + apache-fop + apache-poi + apache-tika + apache-thrift + apache-curator + apache-zookeeper + apache-opennlp + autovalue + axon + azure + bootique + cdi + java-strings + + core-java-collections + java-collections-conversions + java-collections-maps + core-java-io + core-java-8 + java-streams + core-groovy - xmlunit-2 - struts-2 - apache-velocity - apache-solrj - rabbitmq + couchbase + persistence-modules/deltaspike + dozer + ethereum + feign + flips + testing-modules/groovy-spock + google-cloud + gson + guava + guava-collections + guava-modules/guava-18 + guava-modules/guava-19 + guava-modules/guava-21 + guice + disruptor + spring-static-resources + hazelcast + persistence-modules/hbase - persistence-modules/spring-data-gemfire - mybatis - spring-drools - drools - persistence-modules/liquibase - spring-boot-property-exp - testing-modules/mockserver - testing-modules/test-containers - undertow - vaadin - vertx-and-rxjava - saas - deeplearning4j - lucene - vraptor - persistence-modules/java-cockroachdb - spring-security-thymeleaf - persistence-modules/java-jdbi - jersey - java-spi - performance-tests - twilio - spring-boot-ctx-fluent - java-ee-8-security-api - spring-webflux-amqp - antlr - maven-archetype - apache-meecrowave + hystrix + image-processing + immutables + persistence-modules/influxdb + jackson + vavr + java-lite + java-numbers + java-rmi + java-vavr-stream + javax-servlets + javaxval + jaxb + javafx + jgroups + jee-7 + jee-7-security + jjwt + jsf + json-path + json + jsoup + jta + testing-modules/junit-5 + testing-modules/junit5-migration + jws + libraries-data + linkrest + logging-modules/log-mdc + logging-modules/log4j + + logging-modules/logback + lombok + mapstruct + + maven + mesos-marathon + msf4j + testing-modules/mockito + testing-modules/mockito-2 + testing-modules/mocks + mustache + mvn-wrapper + noexception + persistence-modules/orientdb + osgi + orika + patterns + pdf + protobuffer + persistence-modules/querydsl + reactor-core + persistence-modules/redis + testing-modules/rest-assured + testing-modules/rest-testing + resteasy + rxjava + rxjava-2 + spring-swagger-codegen + testing-modules/selenium-junit-testng + persistence-modules/solr + spark-java + spring-4 + spring-5-data-reactive + spring-5-reactive + spring-5-reactive-security + spring-5-reactive-client + spring-5-mvc + spring-5-security + spring-activiti + spring-akka + spring-amqp + spring-all + spring-amqp-simple + spring-apache-camel + spring-batch + spring-bom + spring-boot-keycloak + spring-boot-bootstrap + spring-boot-admin + spring-boot-camel + persistence-modules/spring-boot-persistence + spring-boot-security + spring-boot-mvc + spring-boot-logging-log4j2 + spring-boot-disable-console-logging + spring-cloud-data-flow + spring-cloud + spring-cloud-bus + spring-core + spring-cucumber + spring-ejb + spring-aop + + persistence-modules/spring-data-dynamodb + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-mongodb + persistence-modules/spring-data-neo4j + + spring-data-rest + persistence-modules/spring-data-solr + spring-dispatcher-servlet + spring-exceptions + spring-freemarker + persistence-modules/spring-hibernate-3 + + persistence-modules/spring-hibernate-5 + persistence-modules/spring-data-eclipselink + spring-integration + spring-jenkins-pipeline + spring-jersey + + spring-jms + spring-jooq + persistence-modules/spring-jpa + spring-kafka + spring-katharsis + spring-ldap + spring-mockito + spring-mvc-forms-jsp + spring-mvc-forms-thymeleaf + spring-mvc-java + spring-mvc-velocity + spring-mvc-webflow + spring-mvc-xml + spring-mvc-kotlin + spring-protobuf + spring-quartz + spring-rest-angular + spring-rest-full + spring-rest-query-language + spring-rest + spring-resttemplate + spring-rest-simple + spring-security-acl + spring-security-cache-control + spring-security-client/spring-security-jsp-authentication + spring-security-client/spring-security-jsp-authorize + spring-security-client/spring-security-jsp-config + spring-security-client/spring-security-mvc + spring-security-client/spring-security-thymeleaf-authentication + spring-security-client/spring-security-thymeleaf-authorize + spring-security-client/spring-security-thymeleaf-config + spring-security-core + spring-security-mvc-boot + spring-security-mvc-digest-auth + spring-security-mvc-ldap + spring-security-mvc-login + spring-security-mvc-persisted-remember-me + spring-security-mvc-session + spring-security-mvc-socket + spring-security-openid + + spring-security-rest-basic-auth + spring-security-rest-custom + spring-security-rest + spring-security-sso + spring-security-x509 + spring-session + spring-sleuth + spring-social-login + spring-spel + spring-state-machine + spring-thymeleaf + spring-userservice + spring-zuul + spring-remoting + spring-reactor + spring-vertx + spring-vault + spring-jinq + spring-rest-embedded-tomcat + testing-modules/testing + testing-modules/testng + video-tutorials + + xmlunit-2 + struts-2 + apache-velocity + apache-solrj + rabbitmq + + persistence-modules/spring-data-gemfire + mybatis + spring-drools + drools + persistence-modules/liquibase + spring-boot-property-exp + testing-modules/mockserver + testing-modules/test-containers + undertow + vaadin + vertx-and-rxjava + saas + deeplearning4j + lucene + vraptor + persistence-modules/java-cockroachdb + spring-security-thymeleaf + persistence-modules/java-jdbi + jersey + java-spi + performance-tests + twilio + spring-boot-ctx-fluent + java-ee-8-security-api + spring-webflux-amqp + antlr + maven-archetype + apache-meecrowave persistence-modules/spring-hibernate4 xml @@ -1535,28 +1545,28 @@ persistence-modules/spring-data-redis jmeter - --> + --> - - + + --> - + - + integration-heavy @@ -1566,28 +1576,15 @@ org.apache.maven.plugins maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - json - + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + @@ -1641,12 +1638,15 @@ false false + 4.12 1.3 2.21.0 + 1.7.21 1.1.7 + 2.21.0 3.7.0 From 6634c0e100736c18d8c355692b42e2245883c324 Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 12:55:07 -0200 Subject: [PATCH 349/546] 6 - Sixth commit to split core-java module. This commit includes: * fixiing failing unit tests, moving required resources to new modules --- {core-java => core-java-lang}/src/main/resources/file.txt | 0 .../src/test/resources/correctFileNameWithoutProperExtension | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {core-java => core-java-lang}/src/main/resources/file.txt (100%) rename {core-java => core-java-lang}/src/test/resources/correctFileNameWithoutProperExtension (100%) diff --git a/core-java/src/main/resources/file.txt b/core-java-lang/src/main/resources/file.txt similarity index 100% rename from core-java/src/main/resources/file.txt rename to core-java-lang/src/main/resources/file.txt diff --git a/core-java/src/test/resources/correctFileNameWithoutProperExtension b/core-java-lang/src/test/resources/correctFileNameWithoutProperExtension similarity index 100% rename from core-java/src/test/resources/correctFileNameWithoutProperExtension rename to core-java-lang/src/test/resources/correctFileNameWithoutProperExtension From 2380a4abaddf7e48113320ea95edcbbc69b52be9 Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 13:25:10 -0200 Subject: [PATCH 350/546] 7- Seventh commit for splitting core-java module task. This commit includes: * Cleaning core-java-lang pom * Cleaning core-java-arrays pom * Fixing core-java artifact version, not using property --- core-java-arrays/pom.xml | 143 +----------------- .../com/baeldung/array/ArrayInitializer.java | 2 +- core-java-lang/pom.xml | 126 +-------------- .../baeldung/deepcopy/DeepCopyUnitTest.java | 2 +- core-java/pom.xml | 4 +- 5 files changed, 13 insertions(+), 264 deletions(-) diff --git a/core-java-arrays/pom.xml b/core-java-arrays/pom.xml index 36dcc09341..d2d0453e87 100644 --- a/core-java-arrays/pom.xml +++ b/core-java-arrays/pom.xml @@ -15,44 +15,11 @@ - - commons-io - commons-io - ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - - org.bouncycastle - bcprov-jdk15on - ${bouncycastle.version} - - - org.unix4j - unix4j-command - ${unix4j.version} - - - com.googlecode.grep4j - grep4j - ${grep4j.version} - - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - com.google.code.gson - gson - ${gson.version} - - log4j log4j @@ -63,12 +30,6 @@ log4j-over-slf4j ${org.slf4j.version} - - org.projectlombok - lombok - ${lombok.version} - provided - org.assertj @@ -76,42 +37,6 @@ ${assertj-core.version} test - - - commons-codec - commons-codec - ${commons-codec.version} - - - org.javamoney - moneta - ${javamoney.moneta.version} - - - org.owasp.esapi - esapi - ${esapi.version} - - - com.sun.messaging.mq - fscontext - ${fscontext.version} - - - com.codepoetics - protonpack - ${protonpack.version} - - - one.util - streamex - ${streamex.version} - - - io.vavr - vavr - ${vavr.version} - org.openjdk.jmh jmh-core @@ -127,40 +52,6 @@ spring-web ${springframework.spring-web.version} - - com.h2database - h2 - ${h2database.version} - - - javax.mail - mail - ${javax.mail.version} - - - - org.apache.tika - tika-core - ${tika.version} - - - net.sf.jmimemagic - jmimemagic - ${jmime-magic.version} - - - - org.javassist - javassist - ${javaassist.version} - - - com.sun - tools - 1.8.0 - system - ${java.home}/../lib/tools.jar - @@ -496,52 +387,26 @@ - - - 2.8.5 - 2.8.2 3.8.1 - 1.55 - 1.10 - 2.5 - 3.6.1 - 1.0.3 - 0.4 - 1.8.7 1.16.12 - 4.6-b01 - 1.13 - 0.6.5 - 0.9.0 + + 1.19 + 1.19 3.10.0 - + 2.21.0 4.3.4.RELEASE - - 1.1 - 1.4.197 - 2.1.0.1 - 1.19 - - 1.19 3.0.0-M1 - 1.5.0-b01 3.0.2 1.4.4 3.1.1 2.0.3.RELEASE 1.6.0 - 61.1 - - 1.18 - 0.1.5 - - 3.21.0-GA diff --git a/core-java-arrays/src/main/java/com/baeldung/array/ArrayInitializer.java b/core-java-arrays/src/main/java/com/baeldung/array/ArrayInitializer.java index 0ba6c342d9..d2b0428904 100644 --- a/core-java-arrays/src/main/java/com/baeldung/array/ArrayInitializer.java +++ b/core-java-arrays/src/main/java/com/baeldung/array/ArrayInitializer.java @@ -2,7 +2,7 @@ package com.baeldung.array; import java.util.Arrays; -import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang3.ArrayUtils; public class ArrayInitializer { diff --git a/core-java-lang/pom.xml b/core-java-lang/pom.xml index b13b279a03..ace39de274 100644 --- a/core-java-lang/pom.xml +++ b/core-java-lang/pom.xml @@ -15,31 +15,11 @@ - - commons-io - commons-io - ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - - org.bouncycastle - bcprov-jdk15on - ${bouncycastle.version} - - - org.unix4j - unix4j-command - ${unix4j.version} - - - com.googlecode.grep4j - grep4j - ${grep4j.version} - @@ -76,91 +56,16 @@ ${assertj-core.version} test - - - commons-codec - commons-codec - ${commons-codec.version} - - - org.javamoney - moneta - ${javamoney.moneta.version} - - - org.owasp.esapi - esapi - ${esapi.version} - - - com.sun.messaging.mq - fscontext - ${fscontext.version} - - - com.codepoetics - protonpack - ${protonpack.version} - - - one.util - streamex - ${streamex.version} - - - io.vavr - vavr - ${vavr.version} - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator-annprocess.version} - org.springframework spring-web ${springframework.spring-web.version} - - com.h2database - h2 - ${h2database.version} - javax.mail mail ${javax.mail.version} - - - org.apache.tika - tika-core - ${tika.version} - - - net.sf.jmimemagic - jmimemagic - ${jmime-magic.version} - - - - org.javassist - javassist - ${javaassist.version} - - - com.sun - tools - 1.8.0 - system - ${java.home}/../lib/tools.jar - @@ -503,45 +408,22 @@ 3.5 - 1.55 - 1.10 - 2.5 - 3.6.1 - 1.0.3 - 0.4 - 1.8.7 1.16.12 - 4.6-b01 - 1.13 - 0.6.5 - 0.9.0 - + + 1.5.0-b01 + 3.10.0 - + 2.21.0 4.3.4.RELEASE - - 1.1 - 1.4.197 - 2.1.0.1 - 1.19 - - 1.19 3.0.0-M1 - 1.5.0-b01 3.0.2 1.4.4 3.1.1 2.0.3.RELEASE 1.6.0 - 61.1 - - 1.18 - 0.1.5 - - 3.21.0-GA diff --git a/core-java-lang/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java b/core-java-lang/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java index 196b69fbf7..d6b1cd90b9 100644 --- a/core-java-lang/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java @@ -4,7 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; -import org.apache.commons.lang.SerializationUtils; +import org.apache.commons.lang3.SerializationUtils; import org.junit.Ignore; import org.junit.Test; diff --git a/core-java/pom.xml b/core-java/pom.xml index 477a01375d..2106b45fab 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -157,7 +157,7 @@ com.sun tools - 1.8.0 + ${sun.tools.version} system ${java.home}/../lib/tools.jar @@ -542,6 +542,8 @@ 0.1.5 3.21.0-GA + + 1.8.0 From 4e5302ddf52b5d44a077317cc6121699c648cf33 Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 15:59:49 -0200 Subject: [PATCH 351/546] 8- Eighth commit to split core-java. This commit includes: * Creating core-java-lang and core-java-arrays README files * Cleaning core-java README file --- core-java-arrays/README.md | 15 +++++++++ core-java-lang/README.md | 59 +++++++++++++++++++++++++++++++++ core-java/README.md | 67 -------------------------------------- 3 files changed, 74 insertions(+), 67 deletions(-) create mode 100644 core-java-arrays/README.md create mode 100644 core-java-lang/README.md diff --git a/core-java-arrays/README.md b/core-java-arrays/README.md new file mode 100644 index 0000000000..bda2cf90bf --- /dev/null +++ b/core-java-arrays/README.md @@ -0,0 +1,15 @@ +========= + +## Core Java Arrays Cookbooks and Examples + +### Relevant Articles: +- [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) +- [Check if a Java Array Contains a Value](http://www.baeldung.com/java-array-contains-value) +- [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array) +- [Guide to the java.util.Arrays Class](http://www.baeldung.com/java-util-arrays) +- [Jagged Arrays In Java](http://www.baeldung.com/java-jagged-arrays) +- [Find Sum and Average in a Java Array](http://www.baeldung.com/java-array-sum-average) +- [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide) +- [How to Invert an Array in Java](http://www.baeldung.com/java-invert-array) +- [Array Operations in Java](http://www.baeldung.com/java-common-array-operations) + diff --git a/core-java-lang/README.md b/core-java-lang/README.md new file mode 100644 index 0000000000..85312cba68 --- /dev/null +++ b/core-java-lang/README.md @@ -0,0 +1,59 @@ +========= + +## Core Java Lang Cookbooks and Examples + +### Relevant Articles: +- [Guide to Java Reflection](http://www.baeldung.com/java-reflection) +- [Introduction to Java Generics](http://www.baeldung.com/java-generics) +- [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode) +- [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) +- [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) +- [Call Methods at Runtime Using Java Reflection](http://www.baeldung.com/java-method-reflection) +- [Iterating Over Enum Values in Java](http://www.baeldung.com/java-enum-iteration) +- [Changing Annotation Parameters At Runtime](http://www.baeldung.com/java-reflection-change-annotation-params) +- [Dynamic Proxies in Java](http://www.baeldung.com/java-dynamic-proxies) +- [Java Double Brace Initialization](http://www.baeldung.com/java-double-brace-initialization) +- [Guide to hashCode() in Java](http://www.baeldung.com/java-hashcode) +- [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) +- [A Guide to the Static Keyword in Java](http://www.baeldung.com/java-static) +- [Quick Example - Comparator vs Comparable in Java](http://www.baeldung.com/java-comparator-comparable) +- [The Java continue and break Keywords](http://www.baeldung.com/java-continue-and-break) +- [A Guide to Java Initialization](http://www.baeldung.com/java-initialization) +- [Nested Classes in Java](http://www.baeldung.com/java-nested-classes) +- [A Guide to Java Loops](http://www.baeldung.com/java-loops) +- [Varargs in Java](http://www.baeldung.com/java-varargs) +- [A Guide to Inner Interfaces in Java](http://www.baeldung.com/java-inner-interfaces) +- [Polymorphism in Java](http://www.baeldung.com/java-polymorphism) +- [Recursion In Java](http://www.baeldung.com/java-recursion) +- [A Guide to the finalize Method in Java](http://www.baeldung.com/java-finalize) +- [Method Overloading and Overriding in Java](http://www.baeldung.com/java-method-overload-override) +- [How to Make a Deep Copy of an Object in Java](http://www.baeldung.com/java-deep-copy) +- [Guide to Inheritance in Java](http://www.baeldung.com/java-inheritance) +- [Object Type Casting in Java](http://www.baeldung.com/java-type-casting) +- [The "final" Keyword in Java](http://www.baeldung.com/java-final) +- [A Guide to Java Enums](http://www.baeldung.com/a-guide-to-java-enums) +- [Infinite Loops in Java](http://www.baeldung.com/infinite-loops-java) +- [Quick Guide to java.lang.System](http://www.baeldung.com/java-lang-system) +- [Type Erasure in Java Explained](http://www.baeldung.com/java-type-erasure) +- [Using Java Assertions](http://www.baeldung.com/java-assert) +- [Pass-By-Value as a Parameter Passing Mechanism in Java](http://www.baeldung.com/java-pass-by-value-or-pass-by-reference) +- [Variable and Method Hiding in Java](http://www.baeldung.com/java-variable-method-hiding) +- [Access Modifiers in Java](http://www.baeldung.com/java-access-modifiers) +- [Guide to the super Java Keyword](http://www.baeldung.com/java-super) +- [Guide to the this Java Keyword](http://www.baeldung.com/java-this) +- [Immutable Objects in Java](http://www.baeldung.com/java-immutable-object) +- [ClassNotFoundException vs NoClassDefFoundError](http://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror) +- [The StackOverflowError in Java](http://www.baeldung.com/java-stack-overflow-error) +- [Create a Custom Exception in Java](http://www.baeldung.com/java-new-custom-exception) +- [Exception Handling in Java](http://www.baeldung.com/java-exceptions) +- [Differences Between Final, Finally and Finalize in Java](https://www.baeldung.com/java-final-finally-finalize) +- [Static and Dynamic Binding in Java](https://www.baeldung.com/java-static-dynamic-binding) +- [Difference Between Throw and Throws in Java](https://www.baeldung.com/java-throw-throws) +- [Synthetic Constructs in Java](https://www.baeldung.com/java-synthetic) +- [Java Switch Statement](https://www.baeldung.com/java-switch) +- [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) +- [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) +- [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) +- [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) +- [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) + diff --git a/core-java/README.md b/core-java/README.md index 10fbdb87a7..2be137add6 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -6,101 +6,56 @@ - [Java Timer](http://www.baeldung.com/java-timer-and-timertask) - [How to Run a Shell Command in Java](http://www.baeldung.com/run-shell-command-in-java) - [MD5 Hashing in Java](http://www.baeldung.com/java-md5) -- [Guide to Java Reflection](http://www.baeldung.com/java-reflection) - [A Guide to Java Sockets](http://www.baeldung.com/a-guide-to-java-sockets) -- [Java – Try with Resources](http://www.baeldung.com/java-try-with-resources) - [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) - [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) -- [Introduction to Java Generics](http://www.baeldung.com/java-generics) -- [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode) - [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java) - [Sorting in Java](http://www.baeldung.com/java-sorting) - [Getting Started with Java Properties](http://www.baeldung.com/java-properties) -- [Grep in Java](http://www.baeldung.com/grep-in-java) - [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) - [URL Encoding and Decoding in Java](http://www.baeldung.com/java-url-encoding-decoding) -- [The Basics of Java Generics](http://www.baeldung.com/java-generics) - [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) - [How to Design a Genetic Algorithm in Java](http://www.baeldung.com/java-genetic-algorithm) - [Basic Introduction to JMX](http://www.baeldung.com/java-management-extensions) - [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) - [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) -- [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) -- [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) - [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) - [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) - [Guide to sun.misc.Unsafe](http://www.baeldung.com/java-unsafe) - [How to Perform a Simple HTTP Request in Java](http://www.baeldung.com/java-http-request) -- [Call Methods at Runtime Using Java Reflection](http://www.baeldung.com/java-method-reflection) - [How to Add a Single Element to a Stream](http://www.baeldung.com/java-stream-append-prepend) -- [Iterating Over Enum Values in Java](http://www.baeldung.com/java-enum-iteration) - [Kotlin Java Interoperability](http://www.baeldung.com/kotlin-java-interoperability) -- [Changing Annotation Parameters At Runtime](http://www.baeldung.com/java-reflection-change-annotation-params) - [How to Find all Getters Returning Null](http://www.baeldung.com/java-getters-returning-null) -- [Changing the Order in a Sum Operation Can Produce Different Results?](http://www.baeldung.com/java-floating-point-sum-order) - [How to Get a Name of a Method Being Executed?](http://www.baeldung.com/java-name-of-executing-method) -- [Dynamic Proxies in Java](http://www.baeldung.com/java-dynamic-proxies) -- [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) - [Converting a Stack Trace to a String in Java](http://www.baeldung.com/java-stacktrace-to-string) -- [Java Double Brace Initialization](http://www.baeldung.com/java-double-brace-initialization) -- [The StackOverflowError in Java](http://www.baeldung.com/java-stack-overflow-error) - [Introduction to Java Serialization](http://www.baeldung.com/java-serialization) -- [ClassNotFoundException vs NoClassDefFoundError](http://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror) - [Guide to UUID in Java](http://www.baeldung.com/java-uuid) - [Guide to Escaping Characters in Java RegExps](http://www.baeldung.com/java-regexp-escape-char) -- [Guide to hashCode() in Java](http://www.baeldung.com/java-hashcode) - [Difference between URL and URI](http://www.baeldung.com/java-url-vs-uri) - [Broadcasting and Multicasting in Java](http://www.baeldung.com/java-broadcast-multicast) - [Period and Duration in Java](http://www.baeldung.com/java-period-duration) -- [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) -- [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) - [OutOfMemoryError: GC Overhead Limit Exceeded](http://www.baeldung.com/java-gc-overhead-limit-exceeded) - [Creating a Java Compiler Plugin](http://www.baeldung.com/java-build-compiler-plugin) -- [A Guide to the Static Keyword in Java](http://www.baeldung.com/java-static) -- [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array) -- [Quick Example - Comparator vs Comparable in Java](http://www.baeldung.com/java-comparator-comparable) - [Quick Guide to Java Stack](http://www.baeldung.com/java-stack) -- [The Java continue and break Keywords](http://www.baeldung.com/java-continue-and-break) - [Guide to java.util.Formatter](http://www.baeldung.com/java-string-formatter) -- [Check if a Java Array Contains a Value](http://www.baeldung.com/java-array-contains-value) -- [How to Invert an Array in Java](http://www.baeldung.com/java-invert-array) - [Guide to the Cipher Class](http://www.baeldung.com/java-cipher-class) -- [A Guide to Java Initialization](http://www.baeldung.com/java-initialization) - [Implementing a Binary Tree in Java](http://www.baeldung.com/java-binary-tree) - [A Guide to ThreadLocalRandom in Java](http://www.baeldung.com/java-thread-local-random) -- [Nested Classes in Java](http://www.baeldung.com/java-nested-classes) -- [A Guide to Java Loops](http://www.baeldung.com/java-loops) -- [Varargs in Java](http://www.baeldung.com/java-varargs) -- [A Guide to Inner Interfaces in Java](http://www.baeldung.com/java-inner-interfaces) -- [Polymorphism in Java](http://www.baeldung.com/java-polymorphism) -- [Recursion In Java](http://www.baeldung.com/java-recursion) -- [A Guide to the finalize Method in Java](http://www.baeldung.com/java-finalize) - [Compiling Java *.class Files with javac](http://www.baeldung.com/javac) -- [Method Overloading and Overriding in Java](http://www.baeldung.com/java-method-overload-override) -- [Guide to ThreadLocalRandom in Java](http://www.baeldung.com/java-thread-local-random) - [A Guide to Iterator in Java](http://www.baeldung.com/java-iterator) - [The Trie Data Structure in Java](http://www.baeldung.com/trie-java) - [Introduction to Javadoc](http://www.baeldung.com/javadoc) -- [How to Make a Deep Copy of an Object in Java](http://www.baeldung.com/java-deep-copy) -- [Guide to Inheritance in Java](http://www.baeldung.com/java-inheritance) - [Guide to Externalizable Interface in Java](http://www.baeldung.com/java-externalizable) -- [Object Type Casting in Java](http://www.baeldung.com/java-type-casting) - [A Practical Guide to DecimalFormat](http://www.baeldung.com/java-decimalformat) - [How to Detect the OS Using Java](http://www.baeldung.com/java-detect-os) - [ASCII Art in Java](http://www.baeldung.com/ascii-art-in-java) -- [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max) -- [The "final" Keyword in Java](http://www.baeldung.com/java-final) - [What is the serialVersionUID?](http://www.baeldung.com/java-serial-version-uid) - [A Guide To UDP In Java](http://www.baeldung.com/udp-in-java) - [A Guide to the Java LinkedList](http://www.baeldung.com/java-linkedlist) -- [A Guide to Java Enums](http://www.baeldung.com/a-guide-to-java-enums) - [A Guide to the ResourceBundle](http://www.baeldung.com/java-resourcebundle) -- [Quick Guide to java.lang.System](http://www.baeldung.com/java-lang-system) - [Class Loaders in Java](http://www.baeldung.com/java-classloaders) -- [Find Sum and Average in a Java Array](http://www.baeldung.com/java-array-sum-average) - [Java List UnsupportedOperationException](http://www.baeldung.com/java-list-unsupported-operation-exception) -- [Type Erasure in Java Explained](http://www.baeldung.com/java-type-erasure) - [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split) - [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) - [Sending Emails with Java](http://www.baeldung.com/java-email) @@ -108,12 +63,6 @@ - [Java KeyStore API](http://www.baeldung.com/java-keystore) - [Double-Checked Locking with Singleton](http://www.baeldung.com/java-singleton-double-checked-locking) - [Guide to Java Clock Class](http://www.baeldung.com/java-clock) -- [Infinite Loops in Java](http://www.baeldung.com/infinite-loops-java) -- [Using Java Assertions](http://www.baeldung.com/java-assert) -- [Pass-By-Value as a Parameter Passing Mechanism in Java](http://www.baeldung.com/java-pass-by-value-or-pass-by-reference) -- [Variable and Method Hiding in Java](http://www.baeldung.com/java-variable-method-hiding) -- [Access Modifiers in Java](http://www.baeldung.com/java-access-modifiers) -- [Infinite Loops in Java](http://www.baeldung.com/infinite-loops-java) - [Introduction to Creational Design Patterns](http://www.baeldung.com/creational-design-patterns) - [Proxy, Decorator, Adapter and Bridge Patterns](http://www.baeldung.com/java-structural-design-patterns) - [Singletons in Java](http://www.baeldung.com/java-singleton) @@ -121,42 +70,26 @@ - [The Observer Pattern in Java](http://www.baeldung.com/java-observer-pattern) - [Service Locator Pattern](http://www.baeldung.com/java-service-locator-pattern) - [The Thread.join() Method in Java](http://www.baeldung.com/java-thread-join) -- [Guide to the super Java Keyword](http://www.baeldung.com/java-super) -- [Guide to the this Java Keyword](http://www.baeldung.com/java-this) -- [Jagged Arrays In Java](http://www.baeldung.com/java-jagged-arrays) - [Importance of Main Manifest Attribute in a Self-Executing JAR](http://www.baeldung.com/java-jar-executable-manifest-main-class) - [How to Get the File Extension of a File in Java](http://www.baeldung.com/java-file-extension) -- [Immutable Objects in Java](http://www.baeldung.com/java-immutable-object) - [Console I/O in Java](http://www.baeldung.com/java-console-input-output) -- [Guide to the java.util.Arrays Class](http://www.baeldung.com/java-util-arrays) -- [Create a Custom Exception in Java](http://www.baeldung.com/java-new-custom-exception) - [Java Global Exception Handler](http://www.baeldung.com/java-global-exception-handler) - [Encrypting and Decrypting Files in Java](http://www.baeldung.com/java-cipher-input-output-stream) - [How to Get the Size of an Object in Java](http://www.baeldung.com/java-size-of-object) -- [Exception Handling in Java](http://www.baeldung.com/java-exceptions) - [Guide to Java Instrumentation](http://www.baeldung.com/java-instrumentation) - [Getting a File’s Mime Type in Java](http://www.baeldung.com/java-file-mime-type) - [Common Java Exceptions](http://www.baeldung.com/java-common-exceptions) - [Java Constructors vs Static Factory Methods](https://www.baeldung.com/java-constructors-vs-static-factory-methods) -- [Differences Between Final, Finally and Finalize in Java](https://www.baeldung.com/java-final-finally-finalize) -- [Static and Dynamic Binding in Java](https://www.baeldung.com/java-static-dynamic-binding) - [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line) -- [Difference Between Throw and Throws in Java](https://www.baeldung.com/java-throw-throws) - [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist) - [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception) - [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) -- [Synthetic Constructs in Java](https://www.baeldung.com/java-synthetic) - [Calculating the nth Root in Java](https://www.baeldung.com/java-nth-root) - [Convert Double to String, Removing Decimal Places](https://www.baeldung.com/java-double-to-string) - [Different Ways to Capture Java Heap Dumps](https://www.baeldung.com/java-heap-dump-capture) -- [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) - [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset) - [Hashing a Password in Java](https://www.baeldung.com/java-password-hashing) -- [Java Switch Statement](https://www.baeldung.com/java-switch) -- [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) -- [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) - [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) - [Understanding Memory Leaks in Java](https://www.baeldung.com/java-memory-leaks) -- [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide) - [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) From f3e5bc6ee3139b10c5c4bed519ab8f1f4f574e2b Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Sat, 10 Nov 2018 19:16:23 +0100 Subject: [PATCH 352/546] persistence unit name --- persistence-modules/java-jpa/src/test/resources/persistence.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistence-modules/java-jpa/src/test/resources/persistence.xml b/persistence-modules/java-jpa/src/test/resources/persistence.xml index f65f2c7c62..8d744556cd 100644 --- a/persistence-modules/java-jpa/src/test/resources/persistence.xml +++ b/persistence-modules/java-jpa/src/test/resources/persistence.xml @@ -18,7 +18,7 @@ - + org.hibernate.jpa.HibernatePersistenceProvider com.baeldung.jpa.stringcast.DummyEntity From 917ab19240c749107de839382e5cfb41edc4de5c Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Sat, 10 Nov 2018 19:17:23 +0100 Subject: [PATCH 353/546] code cleaning --- .../src/test/resources/persistence.xml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/persistence-modules/java-jpa/src/test/resources/persistence.xml b/persistence-modules/java-jpa/src/test/resources/persistence.xml index 8d744556cd..b6cc51c3b3 100644 --- a/persistence-modules/java-jpa/src/test/resources/persistence.xml +++ b/persistence-modules/java-jpa/src/test/resources/persistence.xml @@ -33,24 +33,5 @@ - - - - com.baeldung.jpa.stringcast.DummyEntity - - - - - - - - - - - - - - - From 4a130b57a7fbdead4c9a09d1eab8fe6a935adbc5 Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 10 Nov 2018 16:18:46 -0200 Subject: [PATCH 354/546] 9 - ninth commit to split core-java. In this commit: * added core-java-arrays module to the root pom --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index f974e4c743..8af1408de3 100644 --- a/pom.xml +++ b/pom.xml @@ -357,6 +357,7 @@ core-java core-java-lang + core-java-arrays core-java-collections java-collections-conversions java-collections-maps From b286e140b4ce73eafbf6fdc9f508e011c33a7f7d Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 11 Nov 2018 01:07:32 +0530 Subject: [PATCH 355/546] [BAEL-10234] - Move spring-rest-... modules to Boot 2 --- spring-rest-angular/pom.xml | 4 ++-- spring-rest-query-language/pom.xml | 10 ++++++---- .../persistence/dao/MyUserRepository.java | 10 +++++----- .../java/org/baeldung/spring/Application.java | 2 +- spring-rest-shell/pom.xml | 4 ++-- spring-rest-simple/pom.xml | 4 ++-- .../java/org/baeldung/config/Application.java | 2 +- .../java/org/baeldung/config/WebConfig.java | 5 ++--- spring-resttemplate/pom.xml | 4 ++-- .../client/TestRestTemplateBasicLiveTest.java | 19 ++++++++++++------- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/spring-rest-angular/pom.xml b/spring-rest-angular/pom.xml index 7aedfa486b..5240ae24e7 100644 --- a/spring-rest-angular/pom.xml +++ b/spring-rest-angular/pom.xml @@ -8,10 +8,10 @@ war - parent-boot-1 + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-1 + ../parent-boot-2 diff --git a/spring-rest-query-language/pom.xml b/spring-rest-query-language/pom.xml index 8b24c7b8fb..a06b1a7fc1 100644 --- a/spring-rest-query-language/pom.xml +++ b/spring-rest-query-language/pom.xml @@ -8,10 +8,10 @@ war - parent-boot-1 + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-1 + ../parent-boot-2 @@ -149,6 +149,7 @@ org.javassist javassist + ${javassist.version} mysql @@ -349,11 +350,12 @@ 1.4.9 - + 3.21.0-GA + 19.0 3.5 - + 1.6.1 1.1.3 diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserRepository.java b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserRepository.java index 82ae1ee841..327d17e25a 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserRepository.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserRepository.java @@ -1,17 +1,17 @@ package org.baeldung.persistence.dao; -import com.querydsl.core.types.dsl.StringExpression; import org.baeldung.persistence.model.MyUser; import org.baeldung.persistence.model.QMyUser; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.querydsl.QueryDslPredicateExecutor; +import org.springframework.data.querydsl.QuerydslPredicateExecutor; import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; import org.springframework.data.querydsl.binding.QuerydslBindings; - -import com.querydsl.core.types.dsl.StringPath; import org.springframework.data.querydsl.binding.SingleValueBinding; -public interface MyUserRepository extends JpaRepository, QueryDslPredicateExecutor, QuerydslBinderCustomizer { +import com.querydsl.core.types.dsl.StringExpression; +import com.querydsl.core.types.dsl.StringPath; + +public interface MyUserRepository extends JpaRepository, QuerydslPredicateExecutor, QuerydslBinderCustomizer { @Override default public void customize(final QuerydslBindings bindings, final QMyUser root) { bindings.bind(String.class) diff --git a/spring-rest-query-language/src/main/java/org/baeldung/spring/Application.java b/spring-rest-query-language/src/main/java/org/baeldung/spring/Application.java index 7aa9ea5bc3..4a914d947e 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/spring/Application.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/spring/Application.java @@ -7,7 +7,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.context.request.RequestContextListener; diff --git a/spring-rest-shell/pom.xml b/spring-rest-shell/pom.xml index 7a604946b6..540b3d08eb 100644 --- a/spring-rest-shell/pom.xml +++ b/spring-rest-shell/pom.xml @@ -8,10 +8,10 @@ A simple project to demonstrate Spring REST Shell features. - parent-boot-1 + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-1 + ../parent-boot-2 diff --git a/spring-rest-simple/pom.xml b/spring-rest-simple/pom.xml index d39e3a43c1..f592fef237 100644 --- a/spring-rest-simple/pom.xml +++ b/spring-rest-simple/pom.xml @@ -8,10 +8,10 @@ war - parent-boot-1 + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-1 + ../parent-boot-2 diff --git a/spring-rest-simple/src/main/java/org/baeldung/config/Application.java b/spring-rest-simple/src/main/java/org/baeldung/config/Application.java index 3a98da82c9..5c9a186619 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/config/Application.java +++ b/spring-rest-simple/src/main/java/org/baeldung/config/Application.java @@ -3,7 +3,7 @@ package org.baeldung.config; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.ComponentScan; @EnableAutoConfiguration diff --git a/spring-rest-simple/src/main/java/org/baeldung/config/WebConfig.java b/spring-rest-simple/src/main/java/org/baeldung/config/WebConfig.java index 309a36609a..191b87a8f2 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/config/WebConfig.java +++ b/spring-rest-simple/src/main/java/org/baeldung/config/WebConfig.java @@ -14,7 +14,7 @@ import org.springframework.http.converter.xml.MarshallingHttpMessageConverter; import org.springframework.oxm.xstream.XStreamMarshaller; import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import java.text.SimpleDateFormat; import java.util.List; @@ -25,7 +25,7 @@ import java.util.List; @Configuration @EnableWebMvc @ComponentScan({ "org.baeldung.web" }) -public class WebConfig extends WebMvcConfigurerAdapter { +public class WebConfig implements WebMvcConfigurer { public WebConfig() { super(); @@ -48,7 +48,6 @@ public class WebConfig extends WebMvcConfigurerAdapter { messageConverters.add(new ProtobufHttpMessageConverter()); messageConverters.add(new KryoHttpMessageConverter()); messageConverters.add(new StringHttpMessageConverter()); - super.configureMessageConverters(messageConverters); } private HttpMessageConverter createXmlHttpMessageConverter() { diff --git a/spring-resttemplate/pom.xml b/spring-resttemplate/pom.xml index 481104372a..9a0978f120 100644 --- a/spring-resttemplate/pom.xml +++ b/spring-resttemplate/pom.xml @@ -8,10 +8,10 @@ war - parent-boot-1 + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../parent-boot-1 + ../parent-boot-2 diff --git a/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java b/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java index 012221efb7..03a76aca74 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java @@ -1,7 +1,9 @@ package org.baeldung.client; -import okhttp3.Request; -import okhttp3.RequestBody; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertTrue; + import org.junit.Before; import org.junit.Test; import org.springframework.boot.test.web.client.TestRestTemplate; @@ -12,9 +14,8 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import okhttp3.Request; +import okhttp3.RequestBody; public class TestRestTemplateBasicLiveTest { @@ -39,7 +40,9 @@ public class TestRestTemplateBasicLiveTest { @Test public void givenRestTemplateWrapper_whenSendGetForEntity_thenStatusOk() { - TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplate); + RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); + restTemplateBuilder.configure(restTemplate); + TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder); ResponseEntity response = testRestTemplate.getForEntity(FOO_RESOURCE_URL + "/1", String.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); } @@ -55,7 +58,9 @@ public class TestRestTemplateBasicLiveTest { @Test public void givenRestTemplateWrapperWithCredentials_whenSendGetForEntity_thenStatusOk() { - TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplate, "user", "passwd"); + RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder().basicAuthentication("user", "passwd"); + restTemplateBuilder.configure(restTemplate); + TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder); ResponseEntity response = testRestTemplate.getForEntity(URL_SECURED_BY_AUTHENTICATION, String.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); From 84029b02816c8c76b1a0c69bae2fc20670e7ee64 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Sat, 10 Nov 2018 21:05:53 -0600 Subject: [PATCH 356/546] Fixed Balance < 0 for Insufficient funds --- .../java/com/baeldung/jtademo/services/TellerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jta/src/main/java/com/baeldung/jtademo/services/TellerService.java b/jta/src/main/java/com/baeldung/jtademo/services/TellerService.java index d3bd80a2ee..f79238e66a 100644 --- a/jta/src/main/java/com/baeldung/jtademo/services/TellerService.java +++ b/jta/src/main/java/com/baeldung/jtademo/services/TellerService.java @@ -25,7 +25,7 @@ public class TellerService { bankAccountService.transfer(fromAccontId, toAccountId, amount); auditService.log(fromAccontId, toAccountId, amount); BigDecimal balance = bankAccountService.balanceOf(fromAccontId); - if (balance.compareTo(BigDecimal.ZERO) <= 0) { + if (balance.compareTo(BigDecimal.ZERO) < 0) { throw new RuntimeException("Insufficient fund."); } } @@ -35,7 +35,7 @@ public class TellerService { bankAccountService.transfer(fromAccontId, toAccountId, amount); auditService.log(fromAccontId, toAccountId, amount); BigDecimal balance = bankAccountService.balanceOf(fromAccontId); - if (balance.compareTo(BigDecimal.ZERO) <= 0) { + if (balance.compareTo(BigDecimal.ZERO) < 0) { userTransaction.rollback(); throw new RuntimeException("Insufficient fund."); } else { From e7d145e4f9b6b8b1f0a656682d35ea7af63107fc Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 11 Nov 2018 09:28:06 +0200 Subject: [PATCH 357/546] Update and rename SpringCastTest.java to SpringCastTestUnit.java --- .../stringcast/{SpringCastTest.java => SpringCastTestUnit.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/{SpringCastTest.java => SpringCastTestUnit.java} (98%) diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTestUnit.java similarity index 98% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java rename to persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTestUnit.java index ffe8da9bec..d9c3adef26 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTestUnit.java @@ -11,7 +11,7 @@ import java.util.List; import static org.junit.Assert.assertEquals; -public class SpringCastTest { +public class SpringCastUnitTest { private static EntityManager em; private static EntityManagerFactory emFactory; From f7135b4a403b723017bbd4c4fafbccc182c380be Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 11 Nov 2018 09:34:07 +0200 Subject: [PATCH 358/546] Rename SpringCastTestUnit.java to SpringCastUnitTest.java --- .../{SpringCastTestUnit.java => SpringCastUnitTest.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/{SpringCastTestUnit.java => SpringCastUnitTest.java} (100%) diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTestUnit.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastUnitTest.java similarity index 100% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastTestUnit.java rename to persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastUnitTest.java From 1d14598c0daddfd504807686f6b19e3af18dec62 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 11 Nov 2018 11:43:51 +0200 Subject: [PATCH 359/546] Update README.md --- spring-rest-angular/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-rest-angular/README.md b/spring-rest-angular/README.md index 7ead9442fd..d2c2879649 100644 --- a/spring-rest-angular/README.md +++ b/spring-rest-angular/README.md @@ -2,5 +2,4 @@ ### Relevant Articles: -- [Spring’s RequestBody and ResponseBody Annotations](http://www.baeldung.com/spring-request-response-body) - [Pagination with Spring REST and AngularJS table](http://www.baeldung.com/pagination-with-a-spring-rest-api-and-an-angularjs-table) From a15a0809ec071dfc804fdf13c139ea7b1ec9a8c7 Mon Sep 17 00:00:00 2001 From: "nnhai1991@gmail.com" Date: Sun, 11 Nov 2018 18:24:01 +0800 Subject: [PATCH 360/546] fix java code --- .../src/test/kotlin/com/baeldung/random/RandomStringTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt index b47a6ac455..0795cd2a5b 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -1,5 +1,6 @@ import org.apache.commons.lang3.RandomStringUtils import org.junit.jupiter.api.Test +import java.util.concurrent.ThreadLocalRandom import kotlin.streams.asSequence import kotlin.test.assertEquals @@ -15,7 +16,8 @@ class RandomStringTest { charPool.addAll('A'..'Z'); charPool.addAll('0'..'9'); - var randomString = java.util.Random().ints(STRING_LENGTH.toLong(), 0, charPool.size) + var randomString = ThreadLocalRandom.current() + .ints(STRING_LENGTH.toLong(), 0, charPool.size) .asSequence() .map(charPool::get) .joinToString("") From 129aa9ddc9e71e1845e4ff5d6199a8bc0d01a2d0 Mon Sep 17 00:00:00 2001 From: cror Date: Sun, 11 Nov 2018 16:18:36 +0100 Subject: [PATCH 361/546] BAEL-2365: added 2 further examples with substring and indexOf --- .../java/com/baeldung/string/SubstringUnitTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/java-strings/src/test/java/com/baeldung/string/SubstringUnitTest.java b/java-strings/src/test/java/com/baeldung/string/SubstringUnitTest.java index 3a4e231828..eb397f2a3f 100644 --- a/java-strings/src/test/java/com/baeldung/string/SubstringUnitTest.java +++ b/java-strings/src/test/java/com/baeldung/string/SubstringUnitTest.java @@ -59,4 +59,14 @@ public class SubstringUnitTest { Assert.assertEquals("United States of America", text.substring(text.indexOf('(') + 1, text.indexOf(')'))); } + @Test + public void givenAString_whenUsedSubstringWithLastIndexOf_ShouldReturnProperSubstring() { + Assert.assertEquals("1984", text.substring(text.lastIndexOf('-') + 1, text.indexOf('.'))); + } + + @Test + public void givenAString_whenUsedSubstringWithIndexOfAString_ShouldReturnProperSubstring() { + Assert.assertEquals("USA (United States of America)", text.substring(text.indexOf("USA"), text.indexOf(')') + 1)); + } + } From b590fe4a4fbe3b5e280d5939503f771aae5c37d3 Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Sun, 11 Nov 2018 16:20:16 +0100 Subject: [PATCH 362/546] added link --- kotlin-libraries/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/kotlin-libraries/README.md b/kotlin-libraries/README.md index 30c4d03ded..b9611043c8 100644 --- a/kotlin-libraries/README.md +++ b/kotlin-libraries/README.md @@ -7,3 +7,4 @@ - [Processing JSON with Kotlin and Klaxson](http://www.baeldung.com/kotlin-json-klaxson) - [Kotlin with Ktor](http://www.baeldung.com/kotlin-ktor) - [Guide to the Kotlin Exposed Framework](https://www.baeldung.com/kotlin-exposed-persistence) +- [Working with Dates in Kotlin](https://www.baeldung.com/kotlin-dates) From a9a50b79f592474c32825ad1f56d99ec6fa13978 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Mon, 12 Nov 2018 01:16:00 +0530 Subject: [PATCH 363/546] [BAEL-10234] - Removed deprecated properties --- spring-rest-full/src/main/resources/application.properties | 2 +- .../src/main/java/org/baeldung/spring/WebConfig.java | 5 ++--- .../src/main/resources/application.properties | 2 +- spring-rest-simple/pom.xml | 4 ++++ spring-rest-simple/src/main/resources/application.properties | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spring-rest-full/src/main/resources/application.properties b/spring-rest-full/src/main/resources/application.properties index 6c7461f12c..52d93b4cff 100644 --- a/spring-rest-full/src/main/resources/application.properties +++ b/spring-rest-full/src/main/resources/application.properties @@ -1,3 +1,3 @@ server.port=8082 -server.context-path=/spring-rest-full +server.servlet.context-path=/spring-rest-full endpoints.metrics.enabled=true \ No newline at end of file diff --git a/spring-rest-query-language/src/main/java/org/baeldung/spring/WebConfig.java b/spring-rest-query-language/src/main/java/org/baeldung/spring/WebConfig.java index 41711ee1ad..4139c69f95 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/spring/WebConfig.java +++ b/spring-rest-query-language/src/main/java/org/baeldung/spring/WebConfig.java @@ -6,13 +6,13 @@ import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.view.InternalResourceViewResolver; @Configuration @ComponentScan("org.baeldung.web") @EnableWebMvc -public class WebConfig extends WebMvcConfigurerAdapter { +public class WebConfig implements WebMvcConfigurer { public WebConfig() { super(); @@ -29,7 +29,6 @@ public class WebConfig extends WebMvcConfigurerAdapter { // API @Override public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); registry.addViewController("/homepage.html"); } diff --git a/spring-rest-query-language/src/main/resources/application.properties b/spring-rest-query-language/src/main/resources/application.properties index 01eaee7040..4bbf3ed4fc 100644 --- a/spring-rest-query-language/src/main/resources/application.properties +++ b/spring-rest-query-language/src/main/resources/application.properties @@ -1,2 +1,2 @@ server.port=8082 -server.context-path=/spring-rest-query-language \ No newline at end of file +server.servlet.context-path=/spring-rest-query-language \ No newline at end of file diff --git a/spring-rest-simple/pom.xml b/spring-rest-simple/pom.xml index f592fef237..d301957eb9 100644 --- a/spring-rest-simple/pom.xml +++ b/spring-rest-simple/pom.xml @@ -34,6 +34,10 @@ spring-boot-starter-test test + + org.springframework.boot + spring-boot-starter-web + diff --git a/spring-rest-simple/src/main/resources/application.properties b/spring-rest-simple/src/main/resources/application.properties index 300589f561..dd7e4e2f2d 100644 --- a/spring-rest-simple/src/main/resources/application.properties +++ b/spring-rest-simple/src/main/resources/application.properties @@ -1,2 +1,2 @@ server.port= 8082 -server.context-path=/spring-rest \ No newline at end of file +server.servlet.context-path=/spring-rest \ No newline at end of file From 412136b8dbd85b768c19a2a5fdaf749c96474ecf Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 11 Nov 2018 23:33:13 +0200 Subject: [PATCH 364/546] fix boot 2 upgrade, rename package --- .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../dao/GenericSpecificationsBuilder.java | 17 ++++++----- .../baeldung/persistence/dao/IUserDAO.java | 6 ++-- .../persistence/dao/MyUserPredicate.java | 7 ++--- .../dao/MyUserPredicatesBuilder.java | 5 ++-- .../persistence/dao/MyUserRepository.java | 4 +-- .../baeldung/persistence/dao/UserDAO.java | 7 +++-- .../persistence/dao/UserRepository.java | 5 ++-- .../dao/UserSearchQueryCriteriaConsumer.java | 4 +-- .../persistence/dao/UserSpecification.java | 7 +++-- .../dao/UserSpecificationsBuilder.java | 15 +++++----- .../dao/rsql/CustomRsqlVisitor.java | 2 +- .../dao/rsql/GenericRsqlSpecBuilder.java | 20 ++++++------- .../dao/rsql/GenericRsqlSpecification.java | 2 +- .../dao/rsql/RsqlSearchOperation.java | 2 +- .../baeldung/persistence/model/MyUser.java | 2 +- .../baeldung/persistence/model/User.java | 2 +- .../baeldung/persistence/model/User_.java | 2 +- .../baeldung/spring/Application.java | 2 +- .../baeldung/spring/PersistenceConfig.java | 2 +- .../baeldung/spring/WebConfig.java | 6 +--- .../web/controller/HomeController.java | 2 +- .../web/controller/UserController.java | 28 ++++++++--------- .../RestResponseEntityExceptionHandler.java | 5 ++-- .../MyResourceNotFoundException.java | 2 +- .../baeldung/web/util/CriteriaParser.java | 2 +- .../baeldung/web/util/SearchCriteria.java | 2 +- .../baeldung/web/util/SearchOperation.java | 2 +- .../baeldung/web/util/SpecSearchCriteria.java | 2 +- .../SpringContextIntegrationTest.java | 5 ++-- .../JPACriteriaQueryIntegrationTest.java | 11 +++---- .../query/JPAQuerydslIntegrationTest.java | 11 +++---- .../JPASpecificationIntegrationTest.java | 30 +++++++++---------- .../query/JPASpecificationLiveTest.java | 5 ++-- .../query/RsqlIntegrationTest.java | 11 +++---- .../baeldung/web/MyUserLiveTest.java | 5 ++-- 37 files changed, 125 insertions(+), 121 deletions(-) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/GenericSpecificationsBuilder.java (86%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/IUserDAO.java (52%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/MyUserPredicate.java (92%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/MyUserPredicatesBuilder.java (95%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/MyUserRepository.java (91%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/UserDAO.java (90%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/UserRepository.java (74%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java (94%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/UserSpecification.java (92%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/UserSpecificationsBuilder.java (81%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/rsql/CustomRsqlVisitor.java (95%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java (59%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java (98%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/dao/rsql/RsqlSearchOperation.java (95%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/model/MyUser.java (98%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/model/User.java (97%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/persistence/model/User_.java (92%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/spring/Application.java (98%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/spring/PersistenceConfig.java (99%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/spring/WebConfig.java (93%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/controller/HomeController.java (87%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/controller/UserController.java (87%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/error/RestResponseEntityExceptionHandler.java (97%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/exception/MyResourceNotFoundException.java (92%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/util/CriteriaParser.java (98%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/util/SearchCriteria.java (96%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/util/SearchOperation.java (93%) rename spring-rest-query-language/src/main/java/{org => com}/baeldung/web/util/SpecSearchCriteria.java (95%) rename spring-rest-query-language/src/test/java/{org => com}/baeldung/SpringContextIntegrationTest.java (85%) rename spring-rest-query-language/src/test/java/{org => com}/baeldung/persistence/query/JPACriteriaQueryIntegrationTest.java (93%) rename spring-rest-query-language/src/test/java/{org => com}/baeldung/persistence/query/JPAQuerydslIntegrationTest.java (93%) rename spring-rest-query-language/src/test/java/{org => com}/baeldung/persistence/query/JPASpecificationIntegrationTest.java (89%) rename spring-rest-query-language/src/test/java/{org => com}/baeldung/persistence/query/JPASpecificationLiveTest.java (95%) rename spring-rest-query-language/src/test/java/{org => com}/baeldung/persistence/query/RsqlIntegrationTest.java (93%) rename spring-rest-query-language/src/test/java/{org => com}/baeldung/web/MyUserLiveTest.java (95%) diff --git a/spring-rest-angular/src/main/resources/application.properties b/spring-rest-angular/src/main/resources/application.properties index e24db89c8f..2571d286a3 100644 --- a/spring-rest-angular/src/main/resources/application.properties +++ b/spring-rest-angular/src/main/resources/application.properties @@ -1,4 +1,4 @@ -server.contextPath=/ +server.servlet.contextPath=/ spring.h2.console.enabled=true logging.level.org.hibernate.SQL=info spring.jpa.hibernate.ddl-auto=none \ No newline at end of file diff --git a/spring-rest-full/src/main/resources/application.properties b/spring-rest-full/src/main/resources/application.properties index 52d93b4cff..6c7461f12c 100644 --- a/spring-rest-full/src/main/resources/application.properties +++ b/spring-rest-full/src/main/resources/application.properties @@ -1,3 +1,3 @@ server.port=8082 -server.servlet.context-path=/spring-rest-full +server.context-path=/spring-rest-full endpoints.metrics.enabled=true \ No newline at end of file diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/GenericSpecificationsBuilder.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/GenericSpecificationsBuilder.java similarity index 86% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/GenericSpecificationsBuilder.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/GenericSpecificationsBuilder.java index 64bab9a435..75fb4456c4 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/GenericSpecificationsBuilder.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/GenericSpecificationsBuilder.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; import java.util.ArrayList; import java.util.Collections; @@ -8,10 +8,10 @@ import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; -import org.baeldung.web.util.SearchOperation; -import org.baeldung.web.util.SpecSearchCriteria; import org.springframework.data.jpa.domain.Specification; -import org.springframework.data.jpa.domain.Specifications; + +import com.baeldung.web.util.SearchOperation; +import com.baeldung.web.util.SpecSearchCriteria; public class GenericSpecificationsBuilder { @@ -61,11 +61,12 @@ public class GenericSpecificationsBuilder { for (int idx = 1; idx < specs.size(); idx++) { result = params.get(idx) .isOrPredicate() - ? Specifications.where(result) + ? Specification.where(result) .or(specs.get(idx)) - : Specifications.where(result) + : Specification.where(result) .and(specs.get(idx)); } + return result; } @@ -84,10 +85,10 @@ public class GenericSpecificationsBuilder { Specification operand1 = specStack.pop(); Specification operand2 = specStack.pop(); if (mayBeOperand.equals(SearchOperation.AND_OPERATOR)) - specStack.push(Specifications.where(operand1) + specStack.push(Specification.where(operand1) .and(operand2)); else if (mayBeOperand.equals(SearchOperation.OR_OPERATOR)) - specStack.push(Specifications.where(operand1) + specStack.push(Specification.where(operand1) .or(operand2)); } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/IUserDAO.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/IUserDAO.java similarity index 52% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/IUserDAO.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/IUserDAO.java index 4e74e94925..4837795792 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/IUserDAO.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/IUserDAO.java @@ -1,9 +1,9 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; import java.util.List; -import org.baeldung.persistence.model.User; -import org.baeldung.web.util.SearchCriteria; +import com.baeldung.persistence.model.User; +import com.baeldung.web.util.SearchCriteria; public interface IUserDAO { List searchUser(List params); diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicate.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserPredicate.java similarity index 92% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicate.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserPredicate.java index 5dd4cdd17e..0c3a4a51f9 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicate.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserPredicate.java @@ -1,8 +1,7 @@ -package org.baeldung.persistence.dao; - -import org.baeldung.persistence.model.MyUser; -import org.baeldung.web.util.SearchCriteria; +package com.baeldung.persistence.dao; +import com.baeldung.persistence.model.MyUser; +import com.baeldung.web.util.SearchCriteria; import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.NumberPath; import com.querydsl.core.types.dsl.PathBuilder; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserPredicatesBuilder.java similarity index 95% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserPredicatesBuilder.java index 7be37c7155..6aad1a3bab 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserPredicatesBuilder.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserPredicatesBuilder.java @@ -1,12 +1,11 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import org.baeldung.web.util.SearchCriteria; - +import com.baeldung.web.util.SearchCriteria; import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.Expressions; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserRepository.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserRepository.java similarity index 91% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserRepository.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserRepository.java index 327d17e25a..0f04d084c3 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/MyUserRepository.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserRepository.java @@ -1,6 +1,5 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; -import org.baeldung.persistence.model.MyUser; import org.baeldung.persistence.model.QMyUser; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.querydsl.QuerydslPredicateExecutor; @@ -8,6 +7,7 @@ import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; import org.springframework.data.querydsl.binding.QuerydslBindings; import org.springframework.data.querydsl.binding.SingleValueBinding; +import com.baeldung.persistence.model.MyUser; import com.querydsl.core.types.dsl.StringExpression; import com.querydsl.core.types.dsl.StringPath; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserDAO.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserDAO.java similarity index 90% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserDAO.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserDAO.java index 4f2f6003e4..6bc899176a 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserDAO.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserDAO.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; import java.util.List; @@ -9,10 +9,11 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; -import org.baeldung.persistence.model.User; -import org.baeldung.web.util.SearchCriteria; import org.springframework.stereotype.Repository; +import com.baeldung.persistence.model.User; +import com.baeldung.web.util.SearchCriteria; + @Repository public class UserDAO implements IUserDAO { diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserRepository.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserRepository.java similarity index 74% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserRepository.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserRepository.java index de7acf60d5..1a7eda07ed 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserRepository.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserRepository.java @@ -1,9 +1,10 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; -import org.baeldung.persistence.model.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import com.baeldung.persistence.model.User; + public interface UserRepository extends JpaRepository, JpaSpecificationExecutor { } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java similarity index 94% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java index 8b15ef1605..a3e619ad21 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSearchQueryCriteriaConsumer.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; import java.util.function.Consumer; @@ -6,7 +6,7 @@ import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; -import org.baeldung.web.util.SearchCriteria; +import com.baeldung.web.util.SearchCriteria; public class UserSearchQueryCriteriaConsumer implements Consumer{ diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecification.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSpecification.java similarity index 92% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecification.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSpecification.java index b2d9394500..928e75aea7 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecification.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSpecification.java @@ -1,9 +1,10 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; -import org.baeldung.persistence.model.User; -import org.baeldung.web.util.SpecSearchCriteria; import org.springframework.data.jpa.domain.Specification; +import com.baeldung.persistence.model.User; +import com.baeldung.web.util.SpecSearchCriteria; + import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSpecificationsBuilder.java similarity index 81% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSpecificationsBuilder.java index 28097d500a..72d7274226 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/UserSpecificationsBuilder.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/UserSpecificationsBuilder.java @@ -1,14 +1,13 @@ -package org.baeldung.persistence.dao; +package com.baeldung.persistence.dao; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; -import org.baeldung.persistence.model.User; -import org.baeldung.web.util.SearchOperation; -import org.baeldung.web.util.SpecSearchCriteria; import org.springframework.data.jpa.domain.Specification; -import org.springframework.data.jpa.domain.Specifications; + +import com.baeldung.persistence.model.User; +import com.baeldung.web.util.SearchOperation; +import com.baeldung.web.util.SpecSearchCriteria; public final class UserSpecificationsBuilder { @@ -52,8 +51,8 @@ public final class UserSpecificationsBuilder { for (int i = 1; i < params.size(); i++) { result = params.get(i).isOrPredicate() - ? Specifications.where(result).or(new UserSpecification(params.get(i))) - : Specifications.where(result).and(new UserSpecification(params.get(i))); + ? Specification.where(result).or(new UserSpecification(params.get(i))) + : Specification.where(result).and(new UserSpecification(params.get(i))); } return result; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/CustomRsqlVisitor.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/CustomRsqlVisitor.java similarity index 95% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/CustomRsqlVisitor.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/CustomRsqlVisitor.java index 89cec89951..9c399e97ed 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/CustomRsqlVisitor.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/CustomRsqlVisitor.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.dao.rsql; +package com.baeldung.persistence.dao.rsql; import org.springframework.data.jpa.domain.Specification; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java similarity index 59% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java index ce5a4410b9..e81e9ab916 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/GenericRsqlSpecBuilder.java @@ -1,10 +1,10 @@ -package org.baeldung.persistence.dao.rsql; +package com.baeldung.persistence.dao.rsql; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import org.springframework.data.jpa.domain.Specifications; +import org.springframework.data.jpa.domain.Specification; import cz.jirutka.rsql.parser.ast.ComparisonNode; import cz.jirutka.rsql.parser.ast.LogicalNode; @@ -13,7 +13,7 @@ import cz.jirutka.rsql.parser.ast.Node; public class GenericRsqlSpecBuilder { - public Specifications createSpecification(final Node node) { + public Specification createSpecification(final Node node) { if (node instanceof LogicalNode) { return createSpecification((LogicalNode) node); } @@ -23,31 +23,31 @@ public class GenericRsqlSpecBuilder { return null; } - public Specifications createSpecification(final LogicalNode logicalNode) { + public Specification createSpecification(final LogicalNode logicalNode) { - List> specs = logicalNode.getChildren() + List> specs = logicalNode.getChildren() .stream() .map(node -> createSpecification(node)) .filter(Objects::nonNull) .collect(Collectors.toList()); - Specifications result = specs.get(0); + Specification result = specs.get(0); if (logicalNode.getOperator() == LogicalOperator.AND) { for (int i = 1; i < specs.size(); i++) { - result = Specifications.where(result).and(specs.get(i)); + result = Specification.where(result).and(specs.get(i)); } } else if (logicalNode.getOperator() == LogicalOperator.OR) { for (int i = 1; i < specs.size(); i++) { - result = Specifications.where(result).or(specs.get(i)); + result = Specification.where(result).or(specs.get(i)); } } return result; } - public Specifications createSpecification(final ComparisonNode comparisonNode) { - return Specifications.where(new GenericRsqlSpecification(comparisonNode.getSelector(), comparisonNode.getOperator(), comparisonNode.getArguments())); + public Specification createSpecification(final ComparisonNode comparisonNode) { + return Specification.where(new GenericRsqlSpecification(comparisonNode.getSelector(), comparisonNode.getOperator(), comparisonNode.getArguments())); } } diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java similarity index 98% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java index 8055e959a6..87a46d4a85 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/GenericRsqlSpecification.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.dao.rsql; +package com.baeldung.persistence.dao.rsql; import java.util.List; import java.util.stream.Collectors; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/RsqlSearchOperation.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/RsqlSearchOperation.java similarity index 95% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/RsqlSearchOperation.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/RsqlSearchOperation.java index 673e78fbb4..81441fa609 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/dao/rsql/RsqlSearchOperation.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/rsql/RsqlSearchOperation.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.dao.rsql; +package com.baeldung.persistence.dao.rsql; import cz.jirutka.rsql.parser.ast.ComparisonOperator; import cz.jirutka.rsql.parser.ast.RSQLOperators; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/model/MyUser.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/model/MyUser.java similarity index 98% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/model/MyUser.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/model/MyUser.java index 9a7bb4da3d..f3b9dc3810 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/model/MyUser.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/model/MyUser.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.model; +package com.baeldung.persistence.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/model/User.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/model/User.java similarity index 97% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/model/User.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/model/User.java index 670d4a2e74..dbc2b9360f 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/model/User.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/model/User.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.model; +package com.baeldung.persistence.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/persistence/model/User_.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/model/User_.java similarity index 92% rename from spring-rest-query-language/src/main/java/org/baeldung/persistence/model/User_.java rename to spring-rest-query-language/src/main/java/com/baeldung/persistence/model/User_.java index b705c51ff8..c101b1d9b3 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/persistence/model/User_.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/model/User_.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.model; +package com.baeldung.persistence.model; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/spring/Application.java b/spring-rest-query-language/src/main/java/com/baeldung/spring/Application.java similarity index 98% rename from spring-rest-query-language/src/main/java/org/baeldung/spring/Application.java rename to spring-rest-query-language/src/main/java/com/baeldung/spring/Application.java index 4a914d947e..83b3795084 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/spring/Application.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/spring/Application.java @@ -1,4 +1,4 @@ -package org.baeldung.spring; +package com.baeldung.spring; import javax.servlet.ServletContext; import javax.servlet.ServletException; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/spring/PersistenceConfig.java b/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java similarity index 99% rename from spring-rest-query-language/src/main/java/org/baeldung/spring/PersistenceConfig.java rename to spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java index f3a87b189e..ea64cfae50 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/spring/PersistenceConfig.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.spring; +package com.baeldung.spring; import java.util.Properties; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/spring/WebConfig.java b/spring-rest-query-language/src/main/java/com/baeldung/spring/WebConfig.java similarity index 93% rename from spring-rest-query-language/src/main/java/org/baeldung/spring/WebConfig.java rename to spring-rest-query-language/src/main/java/com/baeldung/spring/WebConfig.java index 4139c69f95..2fac559ada 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/spring/WebConfig.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/spring/WebConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.spring; +package com.baeldung.spring; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -14,10 +14,6 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver; @EnableWebMvc public class WebConfig implements WebMvcConfigurer { - public WebConfig() { - super(); - } - @Bean public ViewResolver viewResolver() { final InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/HomeController.java b/spring-rest-query-language/src/main/java/com/baeldung/web/controller/HomeController.java similarity index 87% rename from spring-rest-query-language/src/main/java/org/baeldung/web/controller/HomeController.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/controller/HomeController.java index 9c4d14cae3..c82911211a 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/HomeController.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/controller/HomeController.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package com.baeldung.web.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java b/spring-rest-query-language/src/main/java/com/baeldung/web/controller/UserController.java similarity index 87% rename from spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/controller/UserController.java index 8953a52a1b..101231c7ab 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/controller/UserController.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/controller/UserController.java @@ -1,23 +1,10 @@ -package org.baeldung.web.controller; +package com.baeldung.web.controller; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.baeldung.persistence.dao.GenericSpecificationsBuilder; -import org.baeldung.persistence.dao.IUserDAO; -import org.baeldung.persistence.dao.MyUserPredicatesBuilder; -import org.baeldung.persistence.dao.MyUserRepository; -import org.baeldung.persistence.dao.UserRepository; -import org.baeldung.persistence.dao.UserSpecification; -import org.baeldung.persistence.dao.UserSpecificationsBuilder; -import org.baeldung.persistence.dao.rsql.CustomRsqlVisitor; -import org.baeldung.persistence.model.MyUser; -import org.baeldung.persistence.model.User; -import org.baeldung.web.util.CriteriaParser; -import org.baeldung.web.util.SearchCriteria; -import org.baeldung.web.util.SearchOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.jpa.domain.Specification; import org.springframework.data.querydsl.binding.QuerydslPredicate; @@ -31,6 +18,19 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; +import com.baeldung.persistence.dao.GenericSpecificationsBuilder; +import com.baeldung.persistence.dao.IUserDAO; +import com.baeldung.persistence.dao.MyUserPredicatesBuilder; +import com.baeldung.persistence.dao.MyUserRepository; +import com.baeldung.persistence.dao.UserRepository; +import com.baeldung.persistence.dao.UserSpecification; +import com.baeldung.persistence.dao.UserSpecificationsBuilder; +import com.baeldung.persistence.dao.rsql.CustomRsqlVisitor; +import com.baeldung.persistence.model.MyUser; +import com.baeldung.persistence.model.User; +import com.baeldung.web.util.CriteriaParser; +import com.baeldung.web.util.SearchCriteria; +import com.baeldung.web.util.SearchOperation; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.querydsl.core.types.Predicate; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java b/spring-rest-query-language/src/main/java/com/baeldung/web/error/RestResponseEntityExceptionHandler.java similarity index 97% rename from spring-rest-query-language/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/error/RestResponseEntityExceptionHandler.java index b593116c4a..b30f435ee4 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/error/RestResponseEntityExceptionHandler.java @@ -1,8 +1,7 @@ -package org.baeldung.web.error; +package com.baeldung.web.error; import javax.persistence.EntityNotFoundException; -import org.baeldung.web.exception.MyResourceNotFoundException; import org.hibernate.exception.ConstraintViolationException; import org.springframework.dao.DataAccessException; import org.springframework.dao.DataIntegrityViolationException; @@ -17,6 +16,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; +import com.baeldung.web.exception.MyResourceNotFoundException; + @ControllerAdvice public class RestResponseEntityExceptionHandler extends ResponseEntityExceptionHandler { diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java b/spring-rest-query-language/src/main/java/com/baeldung/web/exception/MyResourceNotFoundException.java similarity index 92% rename from spring-rest-query-language/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/exception/MyResourceNotFoundException.java index 14b61f9832..fd002efc28 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/exception/MyResourceNotFoundException.java @@ -1,4 +1,4 @@ -package org.baeldung.web.exception; +package com.baeldung.web.exception; public final class MyResourceNotFoundException extends RuntimeException { diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/util/CriteriaParser.java b/spring-rest-query-language/src/main/java/com/baeldung/web/util/CriteriaParser.java similarity index 98% rename from spring-rest-query-language/src/main/java/org/baeldung/web/util/CriteriaParser.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/util/CriteriaParser.java index a72d07f440..26bfb7a78d 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/util/CriteriaParser.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/util/CriteriaParser.java @@ -1,4 +1,4 @@ -package org.baeldung.web.util; +package com.baeldung.web.util; import java.util.Arrays; import java.util.Collections; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/util/SearchCriteria.java b/spring-rest-query-language/src/main/java/com/baeldung/web/util/SearchCriteria.java similarity index 96% rename from spring-rest-query-language/src/main/java/org/baeldung/web/util/SearchCriteria.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/util/SearchCriteria.java index cbe1fe539e..75ecefb653 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/util/SearchCriteria.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/util/SearchCriteria.java @@ -1,4 +1,4 @@ -package org.baeldung.web.util; +package com.baeldung.web.util; public class SearchCriteria { diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/util/SearchOperation.java b/spring-rest-query-language/src/main/java/com/baeldung/web/util/SearchOperation.java similarity index 93% rename from spring-rest-query-language/src/main/java/org/baeldung/web/util/SearchOperation.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/util/SearchOperation.java index db2c0133cf..acc9e0c0a8 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/util/SearchOperation.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/util/SearchOperation.java @@ -1,4 +1,4 @@ -package org.baeldung.web.util; +package com.baeldung.web.util; public enum SearchOperation { EQUALITY, NEGATION, GREATER_THAN, LESS_THAN, LIKE, STARTS_WITH, ENDS_WITH, CONTAINS; diff --git a/spring-rest-query-language/src/main/java/org/baeldung/web/util/SpecSearchCriteria.java b/spring-rest-query-language/src/main/java/com/baeldung/web/util/SpecSearchCriteria.java similarity index 95% rename from spring-rest-query-language/src/main/java/org/baeldung/web/util/SpecSearchCriteria.java rename to spring-rest-query-language/src/main/java/com/baeldung/web/util/SpecSearchCriteria.java index 3435ff3342..73b690673b 100644 --- a/spring-rest-query-language/src/main/java/org/baeldung/web/util/SpecSearchCriteria.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/web/util/SpecSearchCriteria.java @@ -1,4 +1,4 @@ -package org.baeldung.web.util; +package com.baeldung.web.util; public class SpecSearchCriteria { diff --git a/spring-rest-query-language/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-rest-query-language/src/test/java/com/baeldung/SpringContextIntegrationTest.java similarity index 85% rename from spring-rest-query-language/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to spring-rest-query-language/src/test/java/com/baeldung/SpringContextIntegrationTest.java index 35939c992f..18fabce5ca 100644 --- a/spring-rest-query-language/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ b/spring-rest-query-language/src/test/java/com/baeldung/SpringContextIntegrationTest.java @@ -1,11 +1,12 @@ -package org.baeldung; +package com.baeldung; -import org.baeldung.spring.Application; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import com.baeldung.spring.Application; + @RunWith(SpringRunner.class) @SpringBootTest(classes = Application.class) public class SpringContextIntegrationTest { diff --git a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPACriteriaQueryIntegrationTest.java b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPACriteriaQueryIntegrationTest.java similarity index 93% rename from spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPACriteriaQueryIntegrationTest.java rename to spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPACriteriaQueryIntegrationTest.java index e8e98074c6..6caabef628 100644 --- a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPACriteriaQueryIntegrationTest.java +++ b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPACriteriaQueryIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.query; +package com.baeldung.persistence.query; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.collection.IsIn.isIn; @@ -7,10 +7,6 @@ import static org.hamcrest.core.IsNot.not; import java.util.ArrayList; import java.util.List; -import org.baeldung.persistence.dao.IUserDAO; -import org.baeldung.persistence.model.User; -import org.baeldung.spring.PersistenceConfig; -import org.baeldung.web.util.SearchCriteria; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -20,6 +16,11 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import com.baeldung.persistence.dao.IUserDAO; +import com.baeldung.persistence.model.User; +import com.baeldung.spring.PersistenceConfig; +import com.baeldung.web.util.SearchCriteria; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { PersistenceConfig.class }) @Transactional diff --git a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPAQuerydslIntegrationTest.java b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPAQuerydslIntegrationTest.java similarity index 93% rename from spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPAQuerydslIntegrationTest.java rename to spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPAQuerydslIntegrationTest.java index d397c3aac4..c4c5d23ab5 100644 --- a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPAQuerydslIntegrationTest.java +++ b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPAQuerydslIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.query; +package com.baeldung.persistence.query; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.collection.IsEmptyIterable.emptyIterable; @@ -6,10 +6,6 @@ import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInA import static org.hamcrest.collection.IsIterableContainingInOrder.contains; import static org.hamcrest.core.IsNot.not; -import org.baeldung.persistence.dao.MyUserPredicatesBuilder; -import org.baeldung.persistence.dao.MyUserRepository; -import org.baeldung.persistence.model.MyUser; -import org.baeldung.spring.PersistenceConfig; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,6 +15,11 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import com.baeldung.persistence.dao.MyUserPredicatesBuilder; +import com.baeldung.persistence.dao.MyUserRepository; +import com.baeldung.persistence.model.MyUser; +import com.baeldung.spring.PersistenceConfig; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { PersistenceConfig.class }) @Transactional diff --git a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPASpecificationIntegrationTest.java b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPASpecificationIntegrationTest.java similarity index 89% rename from spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPASpecificationIntegrationTest.java rename to spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPASpecificationIntegrationTest.java index d9ae95c876..707426769e 100644 --- a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPASpecificationIntegrationTest.java +++ b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPASpecificationIntegrationTest.java @@ -1,25 +1,25 @@ -package org.baeldung.persistence.query; +package com.baeldung.persistence.query; -import org.baeldung.persistence.dao.GenericSpecificationsBuilder; -import org.baeldung.persistence.dao.UserRepository; -import org.baeldung.persistence.dao.UserSpecification; -import org.baeldung.persistence.dao.UserSpecificationsBuilder; -import org.baeldung.persistence.model.User; -import org.baeldung.spring.PersistenceConfig; -import org.baeldung.web.util.CriteriaParser; -import org.baeldung.web.util.SearchOperation; -import org.baeldung.web.util.SpecSearchCriteria; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.jpa.domain.Specification; -import org.springframework.data.jpa.domain.Specifications; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import com.baeldung.persistence.dao.GenericSpecificationsBuilder; +import com.baeldung.persistence.dao.UserRepository; +import com.baeldung.persistence.dao.UserSpecification; +import com.baeldung.persistence.dao.UserSpecificationsBuilder; +import com.baeldung.persistence.model.User; +import com.baeldung.spring.PersistenceConfig; +import com.baeldung.web.util.CriteriaParser; +import com.baeldung.web.util.SearchOperation; +import com.baeldung.web.util.SpecSearchCriteria; + import java.util.List; import java.util.function.Function; @@ -71,7 +71,7 @@ public class JPASpecificationIntegrationTest { public void givenFirstAndLastName_whenGettingListOfUsers_thenCorrect() { final UserSpecification spec = new UserSpecification(new SpecSearchCriteria("firstName", SearchOperation.EQUALITY, "john")); final UserSpecification spec1 = new UserSpecification(new SpecSearchCriteria("lastName", SearchOperation.EQUALITY, "doe")); - final List results = repository.findAll(Specifications + final List results = repository.findAll(Specification .where(spec) .and(spec1)); @@ -127,7 +127,7 @@ public class JPASpecificationIntegrationTest { @Test public void givenFirstNameInverse_whenGettingListOfUsers_thenCorrect() { final UserSpecification spec = new UserSpecification(new SpecSearchCriteria("firstName", SearchOperation.NEGATION, "john")); - final List results = repository.findAll(Specifications.where(spec)); + final List results = repository.findAll(Specification.where(spec)); assertThat(userTom, isIn(results)); assertThat(userJohn, not(isIn(results))); @@ -136,7 +136,7 @@ public class JPASpecificationIntegrationTest { @Test public void givenMinAge_whenGettingListOfUsers_thenCorrect() { final UserSpecification spec = new UserSpecification(new SpecSearchCriteria("age", SearchOperation.GREATER_THAN, "25")); - final List results = repository.findAll(Specifications.where(spec)); + final List results = repository.findAll(Specification.where(spec)); assertThat(userTom, isIn(results)); assertThat(userJohn, not(isIn(results))); } @@ -170,7 +170,7 @@ public class JPASpecificationIntegrationTest { public void givenAgeRange_whenGettingListOfUsers_thenCorrect() { final UserSpecification spec = new UserSpecification(new SpecSearchCriteria("age", SearchOperation.GREATER_THAN, "20")); final UserSpecification spec1 = new UserSpecification(new SpecSearchCriteria("age", SearchOperation.LESS_THAN, "25")); - final List results = repository.findAll(Specifications + final List results = repository.findAll(Specification .where(spec) .and(spec1)); diff --git a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPASpecificationLiveTest.java b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPASpecificationLiveTest.java similarity index 95% rename from spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPASpecificationLiveTest.java rename to spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPASpecificationLiveTest.java index 044029c679..ad6a4259e7 100644 --- a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/JPASpecificationLiveTest.java +++ b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/JPASpecificationLiveTest.java @@ -1,15 +1,16 @@ -package org.baeldung.persistence.query; +package com.baeldung.persistence.query; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import io.restassured.RestAssured; import io.restassured.response.Response; -import org.baeldung.persistence.model.User; import org.junit.Before; import org.junit.Test; import org.springframework.test.context.ActiveProfiles; +import com.baeldung.persistence.model.User; + //@RunWith(SpringJUnit4ClassRunner.class) //@ContextConfiguration(classes = { ConfigTest.class, // PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class) diff --git a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/RsqlIntegrationTest.java b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/RsqlIntegrationTest.java similarity index 93% rename from spring-rest-query-language/src/test/java/org/baeldung/persistence/query/RsqlIntegrationTest.java rename to spring-rest-query-language/src/test/java/com/baeldung/persistence/query/RsqlIntegrationTest.java index 16dfa8a12f..b7b454892a 100644 --- a/spring-rest-query-language/src/test/java/org/baeldung/persistence/query/RsqlIntegrationTest.java +++ b/spring-rest-query-language/src/test/java/com/baeldung/persistence/query/RsqlIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.query; +package com.baeldung.persistence.query; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.collection.IsIn.isIn; @@ -6,10 +6,6 @@ import static org.hamcrest.core.IsNot.not; import java.util.List; -import org.baeldung.persistence.dao.UserRepository; -import org.baeldung.persistence.dao.rsql.CustomRsqlVisitor; -import org.baeldung.persistence.model.User; -import org.baeldung.spring.PersistenceConfig; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -20,6 +16,11 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import com.baeldung.persistence.dao.UserRepository; +import com.baeldung.persistence.dao.rsql.CustomRsqlVisitor; +import com.baeldung.persistence.model.User; +import com.baeldung.spring.PersistenceConfig; + import cz.jirutka.rsql.parser.RSQLParser; import cz.jirutka.rsql.parser.ast.Node; diff --git a/spring-rest-query-language/src/test/java/org/baeldung/web/MyUserLiveTest.java b/spring-rest-query-language/src/test/java/com/baeldung/web/MyUserLiveTest.java similarity index 95% rename from spring-rest-query-language/src/test/java/org/baeldung/web/MyUserLiveTest.java rename to spring-rest-query-language/src/test/java/com/baeldung/web/MyUserLiveTest.java index a478016280..1d74ff1982 100644 --- a/spring-rest-query-language/src/test/java/org/baeldung/web/MyUserLiveTest.java +++ b/spring-rest-query-language/src/test/java/com/baeldung/web/MyUserLiveTest.java @@ -1,14 +1,15 @@ -package org.baeldung.web; +package com.baeldung.web; import static org.junit.Assert.assertEquals; import io.restassured.RestAssured; import io.restassured.response.Response; import io.restassured.specification.RequestSpecification; -import org.baeldung.persistence.model.MyUser; import org.junit.Test; import org.springframework.test.context.ActiveProfiles; +import com.baeldung.persistence.model.MyUser; + @ActiveProfiles("test") public class MyUserLiveTest { From 31db2a41ec84abe6130954a1103928f9ebd98d26 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 11 Nov 2018 23:46:12 +0200 Subject: [PATCH 365/546] fix package modif --- spring-rest-query-language/pom.xml | 1 - .../java/com/baeldung/persistence/dao/MyUserRepository.java | 2 +- .../src/main/java/com/baeldung/spring/Application.java | 2 +- .../main/java/com/baeldung/spring/PersistenceConfig.java | 6 +++--- .../src/main/java/com/baeldung/spring/WebConfig.java | 2 +- .../src/main/resources/springDataPersistenceConfig.xml | 2 +- spring-rest-query-language/src/main/webapp/WEB-INF/web.xml | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/spring-rest-query-language/pom.xml b/spring-rest-query-language/pom.xml index a06b1a7fc1..792af328ce 100644 --- a/spring-rest-query-language/pom.xml +++ b/spring-rest-query-language/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung spring-rest-query-language 0.1-SNAPSHOT spring-rest-query-language diff --git a/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserRepository.java b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserRepository.java index 0f04d084c3..3be361e85a 100644 --- a/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserRepository.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/persistence/dao/MyUserRepository.java @@ -1,6 +1,6 @@ package com.baeldung.persistence.dao; -import org.baeldung.persistence.model.QMyUser; +import com.baeldung.persistence.model.QMyUser; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.querydsl.QuerydslPredicateExecutor; import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; diff --git a/spring-rest-query-language/src/main/java/com/baeldung/spring/Application.java b/spring-rest-query-language/src/main/java/com/baeldung/spring/Application.java index 83b3795084..371377021a 100644 --- a/spring-rest-query-language/src/main/java/com/baeldung/spring/Application.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/spring/Application.java @@ -19,7 +19,7 @@ import org.springframework.web.context.request.RequestContextListener; */ @EnableScheduling @EnableAutoConfiguration -@ComponentScan("org.baeldung") +@ComponentScan("com.baeldung") @SpringBootApplication public class Application extends SpringBootServletInitializer { diff --git a/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java b/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java index ea64cfae50..4a4b9eee3f 100644 --- a/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java @@ -24,9 +24,9 @@ import com.google.common.base.Preconditions; @Configuration @EnableTransactionManagement @PropertySource({ "classpath:persistence-${envTarget:h2}.properties" }) -@ComponentScan({ "org.baeldung.persistence" }) +@ComponentScan({ "com.baeldung.persistence" }) // @ImportResource("classpath*:springDataPersistenceConfig.xml") -@EnableJpaRepositories(basePackages = "org.baeldung.persistence.dao") +@EnableJpaRepositories(basePackages = "com.baeldung.persistence.dao") public class PersistenceConfig { @Autowired @@ -40,7 +40,7 @@ public class PersistenceConfig { public LocalContainerEntityManagerFactoryBean entityManagerFactory() { final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); - em.setPackagesToScan(new String[] { "org.baeldung.persistence.model" }); + em.setPackagesToScan(new String[] { "com.baeldung.persistence.model" }); final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); // vendorAdapter.set diff --git a/spring-rest-query-language/src/main/java/com/baeldung/spring/WebConfig.java b/spring-rest-query-language/src/main/java/com/baeldung/spring/WebConfig.java index 2fac559ada..f5a5bc4b5e 100644 --- a/spring-rest-query-language/src/main/java/com/baeldung/spring/WebConfig.java +++ b/spring-rest-query-language/src/main/java/com/baeldung/spring/WebConfig.java @@ -10,7 +10,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.view.InternalResourceViewResolver; @Configuration -@ComponentScan("org.baeldung.web") +@ComponentScan("com.baeldung.web") @EnableWebMvc public class WebConfig implements WebMvcConfigurer { diff --git a/spring-rest-query-language/src/main/resources/springDataPersistenceConfig.xml b/spring-rest-query-language/src/main/resources/springDataPersistenceConfig.xml index d6d0ec6e47..5ea2d9c05b 100644 --- a/spring-rest-query-language/src/main/resources/springDataPersistenceConfig.xml +++ b/spring-rest-query-language/src/main/resources/springDataPersistenceConfig.xml @@ -7,6 +7,6 @@ http://www.springframework.org/schema/data/jpa/spring-jpa.xsd" > - + \ No newline at end of file diff --git a/spring-rest-query-language/src/main/webapp/WEB-INF/web.xml b/spring-rest-query-language/src/main/webapp/WEB-INF/web.xml index 4472afd112..23869f5e4e 100644 --- a/spring-rest-query-language/src/main/webapp/WEB-INF/web.xml +++ b/spring-rest-query-language/src/main/webapp/WEB-INF/web.xml @@ -16,7 +16,7 @@ contextConfigLocation - org.baeldung.spring + com.baeldung.spring From d0b060a1dc0b460beb9f108344aa7773c6495dd4 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 11 Nov 2018 23:52:52 +0200 Subject: [PATCH 366/546] update cargo --- spring-rest-query-language/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-rest-query-language/pom.xml b/spring-rest-query-language/pom.xml index 792af328ce..70fea91f31 100644 --- a/spring-rest-query-language/pom.xml +++ b/spring-rest-query-language/pom.xml @@ -356,7 +356,7 @@ 3.5 - 1.6.1 + 1.7.0 1.1.3 From c0a5e019189f805fe069039c84755c03e0927fb5 Mon Sep 17 00:00:00 2001 From: cdjole Date: Mon, 12 Nov 2018 04:44:35 +0100 Subject: [PATCH 367/546] Pad string. (#5669) --- .../string/padding/StringPaddingUtil.java | 34 +++++++++++++ .../padding/StringPaddingUtilUnitTest.java | 50 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 java-strings/src/main/java/com/baeldung/string/padding/StringPaddingUtil.java create mode 100644 java-strings/src/test/java/com/baeldung/string/padding/StringPaddingUtilUnitTest.java diff --git a/java-strings/src/main/java/com/baeldung/string/padding/StringPaddingUtil.java b/java-strings/src/main/java/com/baeldung/string/padding/StringPaddingUtil.java new file mode 100644 index 0000000000..80d05bb42a --- /dev/null +++ b/java-strings/src/main/java/com/baeldung/string/padding/StringPaddingUtil.java @@ -0,0 +1,34 @@ +package com.baeldung.string.padding; + +public class StringPaddingUtil { + + public static String padLeftSpaces(String inputString, int length) { + if (inputString.length() >= length) { + return inputString; + } + StringBuilder sb = new StringBuilder(); + while (sb.length() < length - inputString.length()) { + sb.append(' '); + } + sb.append(inputString); + + return sb.toString(); + } + + public static String padLeft(String inputString, int length) { + if (inputString.length() >= length) { + return inputString; + } + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < length; i++) { + sb.append(' '); + } + return sb.substring(inputString.length()) + inputString; + } + + public static String padLeftZeros(String inputString, int length) { + return String + .format("%1$" + length + "s", inputString) + .replace(' ', '0'); + } +} diff --git a/java-strings/src/test/java/com/baeldung/string/padding/StringPaddingUtilUnitTest.java b/java-strings/src/test/java/com/baeldung/string/padding/StringPaddingUtilUnitTest.java new file mode 100644 index 0000000000..f6a077a88e --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/string/padding/StringPaddingUtilUnitTest.java @@ -0,0 +1,50 @@ +package com.baeldung.string.padding; + +import com.google.common.base.Strings; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class StringPaddingUtilUnitTest { + + String inputString = "123456"; + String expectedPaddedStringSpaces = " 123456"; + String expectedPaddedStringZeros = "0000123456"; + int minPaddedStringLength = 10; + + @Test + public void givenString_whenPaddingWithSpaces_thenStringPaddedMatches() { + assertEquals(expectedPaddedStringSpaces, StringPaddingUtil.padLeftSpaces(inputString, minPaddedStringLength)); + } + + @Test + public void givenString_whenPaddingWithSpacesUsingSubstring_thenStringPaddedMatches() { + assertEquals(expectedPaddedStringSpaces, StringPaddingUtil.padLeft(inputString, minPaddedStringLength)); + } + + @Test + public void givenString_whenPaddingWithZeros_thenStringPaddedMatches() { + assertEquals(expectedPaddedStringZeros, StringPaddingUtil.padLeftZeros(inputString, minPaddedStringLength)); + } + + @Test + public void givenString_whenPaddingWithSpacesUsingStringUtils_thenStringPaddedMatches() { + assertEquals(expectedPaddedStringSpaces, StringUtils.leftPad(inputString, minPaddedStringLength)); + } + + @Test + public void givenString_whenPaddingWithZerosUsingStringUtils_thenStringPaddedMatches() { + assertEquals(expectedPaddedStringZeros, StringUtils.leftPad(inputString, minPaddedStringLength, "0")); + } + + @Test + public void givenString_whenPaddingWithSpacesUsingGuavaStrings_thenStringPaddedMatches() { + assertEquals(expectedPaddedStringSpaces, Strings.padStart(inputString, minPaddedStringLength, ' ')); + } + + @Test + public void givenString_whenPaddingWithZerosUsingGuavaStrings_thenStringPaddedMatches() { + assertEquals(expectedPaddedStringZeros, Strings.padStart(inputString, minPaddedStringLength, '0')); + } +} From d81cb4a874a7c3ce8dfbb288bf08ae4c460912f7 Mon Sep 17 00:00:00 2001 From: Ekaterina Galkina Date: Mon, 12 Nov 2018 14:57:44 +0500 Subject: [PATCH 368/546] renaming interface --- .../PublishSubscibeChannelExample.java | 27 ++++++------------ .../RouteToRecipientsExample.java | 16 ++--------- .../separateflows/SeparateFlowsExample.java | 28 ++++--------------- .../subflowchannel/FilterExample.java | 25 ++++------------- .../subflowmapping/RouterExample.java | 21 ++++---------- 5 files changed, 29 insertions(+), 88 deletions(-) diff --git a/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java b/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java index ad1535da6f..e26f938632 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java @@ -16,13 +16,10 @@ import org.springframework.integration.dsl.IntegrationFlow; @EnableIntegration @IntegrationComponentScan public class PublishSubscibeChannelExample { - @MessagingGateway - public interface I { - + public interface NumbersClassifier { @Gateway(requestChannel = "flow.input") - void flow(Collection is); - + void flow(Collection numbers); } @Bean @@ -43,30 +40,24 @@ public class PublishSubscibeChannelExample { @Bean public IntegrationFlow flow() { return flow -> flow.split() - .publishSubscribeChannel(s -> - s.subscribe(f -> f. filter(p -> p % 3 == 0).channel("multipleof3Channel")) - .subscribe(f -> f. filter(p -> p % 3 == 1).channel("remainderIs1Channel")) - .subscribe(f -> f. filter(p -> p % 3 == 2).channel("remainderIs2Channel")) - ); + .publishSubscribeChannel(s -> s.subscribe(f -> f. filter(p -> p % 3 == 0) + .channel("multipleof3Channel")) + .subscribe(f -> f. filter(p -> p % 3 == 1) + .channel("remainderIs1Channel")) + .subscribe(f -> f. filter(p -> p % 3 == 2) + .channel("remainderIs2Channel"))); } public static void main(String[] args) { final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(PublishSubscibeChannelExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - - ctx.getBean(I.class) + ctx.getBean(NumbersClassifier.class) .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } - } diff --git a/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java b/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java index c22072b1ff..04fdb87dfa 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java @@ -16,13 +16,10 @@ import org.springframework.integration.dsl.IntegrationFlow; @EnableIntegration @IntegrationComponentScan public class RouteToRecipientsExample { - @MessagingGateway - public interface I { - + public interface NumbersClassifier { @Gateway(requestChannel = "flow.input") - void flow(Collection is); - + void flow(Collection numbers); } @Bean @@ -43,7 +40,6 @@ public class RouteToRecipientsExample { @Bean public IntegrationFlow flow() { return flow -> flow.split() - .routeToRecipients(r -> r. recipient("multipleof3Channel", p -> p % 3 == 0)// filter . recipient("remainderIs1Channel", p -> p % 3 == 1) .recipientFlow(sf -> sf. filter(p -> p % 3 == 2) @@ -52,20 +48,14 @@ public class RouteToRecipientsExample { public static void main(String[] args) { final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(RouteToRecipientsExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - - ctx.getBean(I.class) + ctx.getBean(NumbersClassifier.class) .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } } \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java b/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java index ccd49affd0..8ed46ead87 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java @@ -16,10 +16,8 @@ import org.springframework.integration.dsl.IntegrationFlow; @EnableIntegration @IntegrationComponentScan public class SeparateFlowsExample { - @MessagingGateway - public interface I { - + public interface NumbersClassifier { @Gateway(requestChannel = "multipleof3Flow.input") void multipleof3(Collection is); @@ -27,8 +25,7 @@ public class SeparateFlowsExample { void remainderIs1(Collection is); @Gateway(requestChannel = "remainderIs2Flow.input") - void remainderIs2(Collection is); - + void remainderIs2(Collection numbers); } @Bean @@ -51,7 +48,6 @@ public class SeparateFlowsExample { return f -> f.split() . filter(p -> p % 3 == 0) .channel("multipleof3Channel"); - } @Bean @@ -59,7 +55,6 @@ public class SeparateFlowsExample { return f -> f.split() . filter(p -> p % 3 == 1) .channel("remainderIs1Channel"); - } @Bean @@ -67,33 +62,22 @@ public class SeparateFlowsExample { return f -> f.split() . filter(p -> p % 3 == 2) .channel("remainderIs2Channel"); - } public static void main(String[] args) { - final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(SeparateFlowsExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - - ctx.getBean(I.class) + ctx.getBean(NumbersClassifier.class) .multipleof3(Arrays.asList(1, 2, 3, 4, 5, 6)); - - ctx.getBean(I.class) + ctx.getBean(NumbersClassifier.class) .remainderIs1(Arrays.asList(1, 2, 3, 4, 5, 6)); - - ctx.getBean(I.class) + ctx.getBean(NumbersClassifier.class) .remainderIs2(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } - -} +} \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java b/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java index f8034ab5bd..6db3741523 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java @@ -16,13 +16,10 @@ import org.springframework.integration.dsl.IntegrationFlow; @EnableIntegration @IntegrationComponentScan public class FilterExample { - @MessagingGateway - public interface I { - + public interface NumbersClassifier { @Gateway(requestChannel = "flow.input") - void flow(Collection is); - + void flow(Collection numbers); } @Bean @@ -43,33 +40,21 @@ public class FilterExample { @Bean public IntegrationFlow flow() { return flow -> flow.split() - - . filter(x -> x % 3 == 0, sf -> sf.discardFlow(subf -> subf - - . filter(x -> x % 3 == 1, ssf -> ssf.discardChannel("remainderIs2Channel")) - .channel("remainderIs1Channel") - - )) - + . filter(x -> x % 3 == 0, sf -> sf.discardFlow(subf -> subf. filter(x -> x % 3 == 1, ssf -> ssf.discardChannel("remainderIs2Channel")) + .channel("remainderIs1Channel"))) .channel("multipleof3Channel"); } public static void main(String[] args) { final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(FilterExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - - ctx.getBean(I.class) + ctx.getBean(NumbersClassifier.class) .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } } \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java b/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java index cbef3ca219..de1f11cf70 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java @@ -17,11 +17,9 @@ import org.springframework.integration.dsl.IntegrationFlow; @IntegrationComponentScan public class RouterExample { @MessagingGateway - public interface I { - + public interface NumbersClassifier { @Gateway(requestChannel = "flow.input") - void flow(Collection is); - + void flow(Collection numbers); } @Bean @@ -43,28 +41,21 @@ public class RouterExample { public IntegrationFlow flow() { return f -> f.split() . route(p -> p % 3, m -> m.channelMapping(0, "multipleof3Channel") - .subFlowMapping(1, sf -> sf .channel("remainderIs1Channel")) - .subFlowMapping(2, sf -> sf. handle((p,h)->p))) + .subFlowMapping(1, sf -> sf.channel("remainderIs1Channel")) + .subFlowMapping(2, sf -> sf. handle((p, h) -> p))) .channel("remainderIs2Channel"); } public static void main(String[] args) { final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(RouterExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - - ctx.getBean(I.class) + ctx.getBean(NumbersClassifier.class) .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } - -} +} \ No newline at end of file From d69f3fee277c79d771626c8308f83e018dfeb2ee Mon Sep 17 00:00:00 2001 From: DOHA Date: Mon, 12 Nov 2018 17:54:01 +0200 Subject: [PATCH 369/546] RequestParam annotation --- .../springbootmvc/RequestParamController.java | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java new file mode 100644 index 0000000000..7a262edd16 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java @@ -0,0 +1,86 @@ +package com.baeldung.springbootmvc; + +import java.util.List; +import java.util.Map; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + + +@Controller +public class RequestParamController { + + @GetMapping("/api/foos") + @ResponseBody + public String getFoos(@RequestParam int limit){ + return "Limit: " + limit; + } + + @GetMapping("/api/bars") + @ResponseBody + public String getBars(@RequestParam(name = "query") String searchQuery){ + return "Query: " + searchQuery; + } + + @GetMapping("/api/users") + @ResponseBody + public String getUsers(@RequestParam(required = false) String query){ + return "Query: " + query; + } + + @GetMapping("/api/products") + @ResponseBody + public String getProducts(@RequestParam(defaultValue = "20") int limit){ + return "Limit: " + limit; + } + + @PostMapping("/api/foos") + @ResponseBody + public String updateFoos(@RequestParam Map allParams){ + return "Parameters are " + allParams.entrySet(); + } + + @PostMapping("/api/posts") + @ResponseBody + public String createPost(@RequestParam String content, @RequestParam MultipartFile file){ + return "File size in bytes: " + file.getSize(); + } + + @GetMapping("/api/posts") + @ResponseBody + public String getPosts(@RequestParam List id){ + return "ID are " + id; + } + + @GetMapping("/foos/{id}") + @ResponseBody + public String getFooById(@PathVariable String id){ + return "ID: " + id; + } + + @GetMapping("/foos") + @ResponseBody + public String getFooByIdUsingQueryParam(@RequestParam String id){ + return "ID: " + id; + } + + @GetMapping({"/myfoos/optional", "/myfoos/optional/{id}"}) + @ResponseBody + public String getFooByOptionalId(@PathVariable(required = false) String id){ + return "ID: " + id; + } + + @GetMapping("/myfoos/optionalParam") + @ResponseBody + public String getFooByOptionalIdUsingQueryParam(@RequestParam(required = false) String id){ + return "ID: " + id; + } + + + +} From 8d745e684e6c40e425ddcc6e509e1d15584764c0 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Mon, 12 Nov 2018 19:54:39 +0100 Subject: [PATCH 370/546] DummyEntity renamed to Message --- .../{DummyEntity.java => Message.java} | 9 ++++----- .../src/main/resources/META-INF/persistence.xml | 2 +- .../jpa/stringcast/SpringCastUnitTest.java | 17 +++++++---------- .../java-jpa/src/test/resources/persistence.xml | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-) rename persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/{DummyEntity.java => Message.java} (76%) diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/DummyEntity.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/Message.java similarity index 76% rename from persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/DummyEntity.java rename to persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/Message.java index 12b57ff112..fb521cfea6 100644 --- a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/DummyEntity.java +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/stringcast/Message.java @@ -3,13 +3,12 @@ package com.baeldung.jpa.stringcast; import javax.persistence.*; @SqlResultSetMapping(name = "textQueryMapping", classes = { - @ConstructorResult(targetClass = DummyEntity.class, columns = { + @ConstructorResult(targetClass = Message.class, columns = { @ColumnResult(name = "text") }) }) @Entity -@Table(name = "dummy") -public class DummyEntity { +public class Message { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -17,11 +16,11 @@ public class DummyEntity { private String text; - public DummyEntity() { + public Message() { } - public DummyEntity(String text) { + public Message(String text) { this.text = text; } diff --git a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml index 6345e7f364..3fdc8ce27c 100644 --- a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml @@ -23,7 +23,7 @@ org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.jpa.stringcast.DummyEntity + com.baeldung.jpa.stringcast.Message diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastUnitTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastUnitTest.java index d9c3adef26..0a11725fc3 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastUnitTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/stringcast/SpringCastUnitTest.java @@ -3,10 +3,7 @@ package com.baeldung.jpa.stringcast; import org.junit.BeforeClass; import org.junit.Test; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.EntityTransaction; -import javax.persistence.Persistence; +import javax.persistence.*; import java.util.List; import static org.junit.Assert.assertEquals; @@ -22,18 +19,18 @@ public class SpringCastUnitTest { em = emFactory.createEntityManager(); // insert an object into the db - DummyEntity dummyEntity = new DummyEntity(); - dummyEntity.setText("text"); + Message message = new Message(); + message.setText("text"); EntityTransaction tr = em.getTransaction(); tr.begin(); - em.persist(dummyEntity); + em.persist(message); tr.commit(); } @Test(expected = ClassCastException.class) public void givenExecutorNoCastCheck_whenQueryReturnsOneColumn_thenClassCastThrown() { - List results = QueryExecutor.executeNativeQueryNoCastCheck("select text from dummy", em); + List results = QueryExecutor.executeNativeQueryNoCastCheck("select text from message", em); // fails for (String[] row : results) { @@ -43,13 +40,13 @@ public class SpringCastUnitTest { @Test public void givenExecutorWithCastCheck_whenQueryReturnsOneColumn_thenNoClassCastThrown() { - List results = QueryExecutor.executeNativeQueryWithCastCheck("select text from dummy", em); + List results = QueryExecutor.executeNativeQueryWithCastCheck("select text from message", em); assertEquals("text", results.get(0)[0]); } @Test public void givenExecutorGeneric_whenQueryReturnsOneColumn_thenNoClassCastThrown() { - List results = QueryExecutor.executeNativeQueryGeneric("select text from dummy", "textQueryMapping", em); + List results = QueryExecutor.executeNativeQueryGeneric("select text from message", "textQueryMapping", em); assertEquals("text", results.get(0).getText()); } diff --git a/persistence-modules/java-jpa/src/test/resources/persistence.xml b/persistence-modules/java-jpa/src/test/resources/persistence.xml index b6cc51c3b3..c902e0a320 100644 --- a/persistence-modules/java-jpa/src/test/resources/persistence.xml +++ b/persistence-modules/java-jpa/src/test/resources/persistence.xml @@ -20,7 +20,7 @@ org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.jpa.stringcast.DummyEntity + com.baeldung.jpa.stringcast.Message From c7402e379cb78f26830dac3930464b3bf72c6a81 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Mon, 12 Nov 2018 17:11:58 -0500 Subject: [PATCH 371/546] BAEL-2272 Persisting DDD Aggregates Add readme --- ddd/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ddd/README.md diff --git a/ddd/README.md b/ddd/README.md new file mode 100644 index 0000000000..60f3a43086 --- /dev/null +++ b/ddd/README.md @@ -0,0 +1,3 @@ +### Relevant articles + +- [Persisting DDD Aggregates](https://www.baeldung.com/spring-persisting-ddd-aggregates) From 6557cf256408722e6b7e019cb3e314151d86742d Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Tue, 13 Nov 2018 09:43:13 +0800 Subject: [PATCH 372/546] add performance test --- .../com/baeldung/random/RandomStringTest.kt | 58 ++++++++++++------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt index 0795cd2a5b..0715870403 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -1,52 +1,70 @@ import org.apache.commons.lang3.RandomStringUtils +import org.junit.Before +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test +import java.security.SecureRandom import java.util.concurrent.ThreadLocalRandom +import kotlin.experimental.and import kotlin.streams.asSequence import kotlin.test.assertEquals -const val STRING_LENGTH = 10; -const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+"; +const val STRING_LENGTH = 10 +const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+" class RandomStringTest { - @Test - fun generateRandomString_useJava_returnString() { - val charPool = ArrayList(); + val charPool = ArrayList() + + @BeforeEach + fun charPool() { charPool.addAll('a'..'z'); charPool.addAll('A'..'Z'); charPool.addAll('0'..'9'); + } + @Test + fun givenAStringLength_whenUsingJava_thenReturnAlphanumericString() { var randomString = ThreadLocalRandom.current() .ints(STRING_LENGTH.toLong(), 0, charPool.size) .asSequence() .map(charPool::get) .joinToString("") - assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))); - assertEquals(STRING_LENGTH, randomString.length); + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) } @Test - fun generateRandomString_useKotlin_returnString() { - val charPool = ArrayList(); - charPool.addAll('a'..'z'); - charPool.addAll('A'..'Z'); - charPool.addAll('0'..'9'); - + fun givenAStringLength_whenUsingKotlin_thenReturnAlphanumericString() { var randomString = (1..STRING_LENGTH).map { i -> kotlin.random.Random.nextInt(0, charPool.size) } .map(charPool::get) - .joinToString(""); + .joinToString("") - assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))); - assertEquals(STRING_LENGTH, randomString.length); + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) } @Test - fun generateRandomString_useApacheCommon_returnString() { - var randomString = RandomStringUtils.randomAlphanumeric(STRING_LENGTH); + fun givenAStringLength_whenUsingApacheCommon_thenReturnAlphanumericString() { + var randomString = RandomStringUtils.randomAlphanumeric(STRING_LENGTH) - assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))); - assertEquals(STRING_LENGTH, randomString.length); + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) + } + + @Test + fun givenAStringLength_whenUsingRandomForBytes_thenReturnAlphanumericString() { + val random = SecureRandom() + val bytes = ByteArray(STRING_LENGTH) + random.nextBytes(bytes) + + var randomString = (0..bytes.size - 1).map { i -> + charPool.get((bytes[i] and 0xFF.toByte() and charPool.size.toByte()).toInt()) + }.joinToString("") + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) } } \ No newline at end of file From 55ba7955f9d02fca9ac2f84227e2e6a54a1d4e20 Mon Sep 17 00:00:00 2001 From: geroza Date: Tue, 13 Nov 2018 00:36:08 -0200 Subject: [PATCH 373/546] Fixed: * SimpleDateFormatUnitTest test, which relied on the system locale, thus making it platform dependent * UppercaseFileReaderUnitTest, LowercaseFileReaderUnitTest and StandardFileReaderUnitTest, which were using an approach that seems to be efficient only on Windows; on Linux it raises an exception. The new approach should be good for all cases, but we need testing on a Windows environment --- .../LowercaseFileReaderUnitTest.java | 11 ++++++++--- .../StandardFileReaderUnitTest.java | 15 +++++++++++---- .../UppercaseFileReaderUnitTest.java | 7 ++++++- .../SimpleDateFormatUnitTest.java | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java index 4058f6f03b..a97a68e0bd 100644 --- a/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java +++ b/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java @@ -2,17 +2,22 @@ package com.baeldung.abstractclasses; import com.baeldung.abstractclasses.filereaders.BaseFileReader; import com.baeldung.abstractclasses.filereaders.LowercaseFileReader; + +import java.net.URL; +import java.nio.file.Paths; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; public class LowercaseFileReaderUnitTest { - + @Test public void givenLowercaseFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { - String filePath = getClass().getClassLoader().getResource("files/test.txt").getPath().substring(1); + // We'll transform the resource URL path to URI to load the file correctly in Windows + URL url = getClass().getClassLoader().getResource("files/test.txt"); + String filePath = Paths.get(url.toURI()).toString(); BaseFileReader lowercaseFileReader = new LowercaseFileReader(filePath); - + assertThat(lowercaseFileReader.readFile()).isInstanceOf(List.class); } } diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java index e1c1435ef4..348b0f0366 100644 --- a/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java +++ b/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java @@ -1,16 +1,23 @@ package com.baeldung.abstractclasses; +import static org.assertj.core.api.Assertions.assertThat; + +import java.net.URL; +import java.nio.file.Paths; +import java.util.List; + +import org.junit.Test; + import com.baeldung.abstractclasses.filereaders.BaseFileReader; import com.baeldung.abstractclasses.filereaders.StandardFileReader; -import java.util.List; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; public class StandardFileReaderUnitTest { @Test public void givenStandardFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { - String filePath = getClass().getClassLoader().getResource("files/test.txt").getPath().substring(1); + // We'll transform the resource URL path to URI to load the file correctly in Windows + URL url = getClass().getClassLoader().getResource("files/test.txt"); + String filePath = Paths.get(url.toURI()).toString(); BaseFileReader standardFileReader = new StandardFileReader(filePath); assertThat(standardFileReader.readFile()).isInstanceOf(List.class); diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java index f9c5fbf94d..d698cfe038 100644 --- a/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java +++ b/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java @@ -2,6 +2,9 @@ package com.baeldung.abstractclasses; import com.baeldung.abstractclasses.filereaders.BaseFileReader; import com.baeldung.abstractclasses.filereaders.UppercaseFileReader; + +import java.net.URL; +import java.nio.file.Paths; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; @@ -10,7 +13,9 @@ public class UppercaseFileReaderUnitTest { @Test public void givenUppercaseFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { - String filePath = getClass().getClassLoader().getResource("files/test.txt").getPath().substring(1); + // We'll transform the resource URL path to URI to load the file correctly in Windows + URL url = getClass().getClassLoader().getResource("files/test.txt"); + String filePath = Paths.get(url.toURI()).toString(); BaseFileReader uppercaseFileReader = new UppercaseFileReader(filePath); assertThat(uppercaseFileReader.readFile()).isInstanceOf(List.class); diff --git a/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java index 4ae7b77089..7e1fcd9b3d 100644 --- a/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java +++ b/core-java/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java @@ -25,7 +25,7 @@ public class SimpleDateFormatUnitTest { @Test public void givenSpecificDate_whenFormattedUsingDateFormat_thenCheckFormatCorrect() throws Exception { - DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT); + DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US); assertEquals("5/24/77", formatter.format(new Date(233345223232L))); } From 93f505f9a995c5cfa6a11d6c47ffa07a2485626d Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 13 Nov 2018 19:45:52 +0530 Subject: [PATCH 374/546] BAEL-8874 Merge ejb projects -Merged ejb and spring-ejb modules into spring-ejb --- ejb/README.md | 6 -- ejb/ejb-client/pom.xml | 26 ----- .../src/main/resources/META-INF/ejb-jar.xml | 7 -- ejb/ejb-session-beans/pom.xml | 83 ---------------- ejb/pom.xml | 97 ------------------- .../src/main/resources/logback.xml | 13 --- .../src/main/resources/logback.xml | 13 --- spring-ejb/README.md | 4 + spring-ejb/ejb-beans/pom.xml | 57 ++++++++++- .../com/baeldung/ejb/stateful/EJBClient1.java | 0 .../com/baeldung/ejb/stateful/EJBClient2.java | 0 .../baeldung/ejb/stateful/StatefulEJB.java | 0 .../baeldung/ejb/stateless/EJBClient1.java | 0 .../baeldung/ejb/stateless/EJBClient2.java | 0 .../baeldung/ejb/stateless/StatelessEJB.java | 0 .../stateful/StatefulEJBIntegrationTest.java | 2 +- .../StatelessEJBIntegrationTest.java | 2 +- .../CountryStateCacheBeanUnitTest.java | 2 - spring-ejb/ejb-remote-for-spring/pom.xml | 75 -------------- .../src/main/resources/logback.xml | 13 --- spring-ejb/pom.xml | 10 +- spring-ejb/spring-ejb-client/pom.xml | 11 +-- .../com/baeldung/ejb/client/EJBClient.java | 2 +- .../baeldung/ejb/wildfly/TextApplication.java | 2 +- .../SpringEjbClientApplication.java | 2 +- .../resources/jboss-ejb-client.properties | 0 .../setup/test/EJBSetupIntegrationTest.java | 0 .../TextApplicationIntegrationTest.java | 0 .../spring-ejb-remote}/pom.xml | 24 +++-- .../ejb/tutorial/HelloStatefulWorld.java | 0 .../ejb/tutorial/HelloStatefulWorldBean.java | 0 .../ejb/tutorial/HelloStatelessWorld.java | 0 .../ejb/tutorial/HelloStatelessWorldBean.java | 0 .../com/baeldung/ejb/tutorial/HelloWorld.java | 0 .../baeldung/ejb/tutorial/HelloWorldBean.java | 0 .../ejb/wildfly/TextProcessorBean.java | 0 .../ejb/wildfly/TextProcessorRemote.java | 0 .../src/main/resources/META-INF/ejb-jar.xml | 2 +- .../src/main/resources/logback.xml | 0 .../HelloStatefulWorldTestUnitTest.java | 0 .../HelloStatelessWorldTestUnitTest.java | 0 {ejb => spring-ejb}/wildfly/pom.xml | 10 +- .../wildfly/widlfly-web/pom.xml | 0 .../src/main/java/TestEJBServlet.java | 0 .../src/main/java/TestJPAServlet.java | 0 .../src/main/resources/logback.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../wildfly/wildfly-ear/pom.xml | 0 .../wildfly/wildfly-ejb-interfaces/pom.xml | 0 .../java/wildfly/beans/UserBeanLocal.java | 0 .../java/wildfly/beans/UserBeanRemote.java | 0 .../src/main/resources/logback.xml | 0 .../wildfly/wildfly-ejb/pom.xml | 0 .../src/main/java/wildfly/beans/UserBean.java | 0 .../src/main/resources/logback.xml | 0 .../wildfly/wildfly-jpa/pom.xml | 0 .../wildfly-jpa/src/main/java/model/User.java | 0 .../main/resources/META-INF/persistence.xml | 0 .../wildfly-jpa/src/main/resources/data.sql | 0 .../src/main/resources/logback.xml | 0 .../wildfly/wildfly-mdb/pom.xml | 0 .../baeldung/wildfly/mdb/ReadMessageMDB.java | 0 .../wildfly/mdb/SendMessageServlet.java | 0 63 files changed, 91 insertions(+), 372 deletions(-) delete mode 100644 ejb/README.md delete mode 100755 ejb/ejb-client/pom.xml delete mode 100755 ejb/ejb-remote/src/main/resources/META-INF/ejb-jar.xml delete mode 100644 ejb/ejb-session-beans/pom.xml delete mode 100755 ejb/pom.xml delete mode 100644 ejb/wildfly/wildfly-ejb/src/main/resources/logback.xml delete mode 100644 ejb/wildfly/wildfly-jpa/src/main/resources/logback.xml rename {ejb/ejb-session-beans => spring-ejb/ejb-beans}/src/main/java/com/baeldung/ejb/stateful/EJBClient1.java (100%) rename {ejb/ejb-session-beans => spring-ejb/ejb-beans}/src/main/java/com/baeldung/ejb/stateful/EJBClient2.java (100%) rename {ejb/ejb-session-beans => spring-ejb/ejb-beans}/src/main/java/com/baeldung/ejb/stateful/StatefulEJB.java (100%) rename {ejb/ejb-session-beans => spring-ejb/ejb-beans}/src/main/java/com/baeldung/ejb/stateless/EJBClient1.java (100%) rename {ejb/ejb-session-beans => spring-ejb/ejb-beans}/src/main/java/com/baeldung/ejb/stateless/EJBClient2.java (100%) rename {ejb/ejb-session-beans => spring-ejb/ejb-beans}/src/main/java/com/baeldung/ejb/stateless/StatelessEJB.java (100%) rename {ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test => spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb}/stateful/StatefulEJBIntegrationTest.java (97%) rename {ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test => spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb}/stateless/StatelessEJBIntegrationTest.java (97%) delete mode 100755 spring-ejb/ejb-remote-for-spring/pom.xml delete mode 100644 spring-ejb/ejb-remote-for-spring/src/main/resources/logback.xml rename {ejb/ejb-client => spring-ejb/spring-ejb-client}/src/main/java/com/baeldung/ejb/client/EJBClient.java (97%) mode change 100755 => 100644 rename {ejb/ejb-client => spring-ejb/spring-ejb-client}/src/main/java/com/baeldung/ejb/wildfly/TextApplication.java (96%) rename {ejb/ejb-client => spring-ejb/spring-ejb-client}/src/main/resources/jboss-ejb-client.properties (100%) mode change 100755 => 100644 rename {ejb/ejb-client => spring-ejb/spring-ejb-client}/src/test/java/com/baeldung/ejb/setup/test/EJBSetupIntegrationTest.java (100%) mode change 100755 => 100644 rename {ejb/ejb-client => spring-ejb/spring-ejb-client}/src/test/java/com/baeldung/ejb/wildfly/TextApplicationIntegrationTest.java (100%) rename {ejb/ejb-remote => spring-ejb/spring-ejb-remote}/pom.xml (80%) mode change 100755 => 100644 rename spring-ejb/{ejb-remote-for-spring => spring-ejb-remote}/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorld.java (100%) rename spring-ejb/{ejb-remote-for-spring => spring-ejb-remote}/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorldBean.java (100%) rename spring-ejb/{ejb-remote-for-spring => spring-ejb-remote}/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorld.java (100%) mode change 100755 => 100644 rename spring-ejb/{ejb-remote-for-spring => spring-ejb-remote}/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorldBean.java (100%) mode change 100755 => 100644 rename {ejb/ejb-remote => spring-ejb/spring-ejb-remote}/src/main/java/com/baeldung/ejb/tutorial/HelloWorld.java (100%) mode change 100755 => 100644 rename {ejb/ejb-remote => spring-ejb/spring-ejb-remote}/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java (100%) mode change 100755 => 100644 rename {ejb/ejb-remote => spring-ejb/spring-ejb-remote}/src/main/java/com/baeldung/ejb/wildfly/TextProcessorBean.java (100%) rename {ejb/ejb-remote => spring-ejb/spring-ejb-remote}/src/main/java/com/baeldung/ejb/wildfly/TextProcessorRemote.java (100%) rename spring-ejb/{ejb-remote-for-spring => spring-ejb-remote}/src/main/resources/META-INF/ejb-jar.xml (84%) mode change 100755 => 100644 rename {ejb/ejb-client => spring-ejb/spring-ejb-remote}/src/main/resources/logback.xml (100%) rename spring-ejb/{ejb-remote-for-spring => spring-ejb-remote}/src/test/java/com/baeldung/ejb/tutorial/HelloStatefulWorldTestUnitTest.java (100%) rename spring-ejb/{ejb-remote-for-spring => spring-ejb-remote}/src/test/java/com/baeldung/ejb/tutorial/HelloStatelessWorldTestUnitTest.java (100%) rename {ejb => spring-ejb}/wildfly/pom.xml (94%) rename {ejb => spring-ejb}/wildfly/widlfly-web/pom.xml (100%) rename {ejb => spring-ejb}/wildfly/widlfly-web/src/main/java/TestEJBServlet.java (100%) rename {ejb => spring-ejb}/wildfly/widlfly-web/src/main/java/TestJPAServlet.java (100%) rename {ejb/ejb-remote => spring-ejb/wildfly/widlfly-web}/src/main/resources/logback.xml (100%) rename {ejb => spring-ejb}/wildfly/widlfly-web/src/main/webapp/WEB-INF/web.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-ear/pom.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-ejb-interfaces/pom.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanLocal.java (100%) rename {ejb => spring-ejb}/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanRemote.java (100%) rename {ejb/ejb-session-beans => spring-ejb/wildfly/wildfly-ejb-interfaces}/src/main/resources/logback.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-ejb/pom.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-ejb/src/main/java/wildfly/beans/UserBean.java (100%) rename {ejb/wildfly/widlfly-web => spring-ejb/wildfly/wildfly-ejb}/src/main/resources/logback.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-jpa/pom.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-jpa/src/main/java/model/User.java (100%) rename {ejb => spring-ejb}/wildfly/wildfly-jpa/src/main/resources/META-INF/persistence.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-jpa/src/main/resources/data.sql (100%) rename {ejb/wildfly/wildfly-ejb-interfaces => spring-ejb/wildfly/wildfly-jpa}/src/main/resources/logback.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-mdb/pom.xml (100%) rename {ejb => spring-ejb}/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/ReadMessageMDB.java (100%) rename {ejb => spring-ejb}/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/SendMessageServlet.java (100%) diff --git a/ejb/README.md b/ejb/README.md deleted file mode 100644 index f47277bf8f..0000000000 --- a/ejb/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Relevant articles: - -- [Guide to EJB Set-up](http://www.baeldung.com/ejb-intro) -- [Java EE Session Beans](http://www.baeldung.com/ejb-session-beans) -- [Introduction to EJB JNDI Lookup on WildFly Application Server](http://www.baeldung.com/wildfly-ejb-jndi) -- [A Guide to Message Driven Beans in EJB](http://www.baeldung.com/ejb-message-driven-beans) diff --git a/ejb/ejb-client/pom.xml b/ejb/ejb-client/pom.xml deleted file mode 100755 index 6231030cec..0000000000 --- a/ejb/ejb-client/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - 4.0.0 - ejb-client - EJB3 Client Maven - - - com.baeldung.ejb - ejb - 1.0-SNAPSHOT - - - - - org.wildfly - wildfly-ejb-client-bom - pom - - - com.baeldung.ejb - ejb-remote - ejb - - - \ No newline at end of file diff --git a/ejb/ejb-remote/src/main/resources/META-INF/ejb-jar.xml b/ejb/ejb-remote/src/main/resources/META-INF/ejb-jar.xml deleted file mode 100755 index d6c2200198..0000000000 --- a/ejb/ejb-remote/src/main/resources/META-INF/ejb-jar.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - remote - - diff --git a/ejb/ejb-session-beans/pom.xml b/ejb/ejb-session-beans/pom.xml deleted file mode 100644 index da76169729..0000000000 --- a/ejb/ejb-session-beans/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - 4.0.0 - ejb-session-beans - - - com.baeldung.ejb - ejb - 1.0-SNAPSHOT - - - - - - org.jboss.arquillian - arquillian-bom - ${arquillian-bom.version} - import - pom - - - - - - - javax - javaee-api - provided - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - - - - arquillian-glassfish-embedded - - true - - - - org.jboss.arquillian.container - arquillian-glassfish-embedded-3.1 - ${arquillian-glassfish-embedded-3.1.version} - test - - - org.glassfish.main.extras - glassfish-embedded-all - ${glassfish-embedded-all.version} - test - - - - - - - - - maven-war-plugin - ${maven-war-plugin.version} - - false - - - - - - - UTF-8 - 1.1.13.Final - 2.2.6 - 1.1.12.Final - 1.0.0.Final - 4.12 - 7.0 - 1.0.0.CR4 - 3.1.2 - - - \ No newline at end of file diff --git a/ejb/pom.xml b/ejb/pom.xml deleted file mode 100755 index 4cb700d087..0000000000 --- a/ejb/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - 4.0.0 - com.baeldung.ejb - ejb - 1.0-SNAPSHOT - pom - ejb - EJB Tutorial - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - ejb-remote - ejb-session-beans - - - - - - com.baeldung.ejb - ejb-remote - ${ejb-remote.version} - ejb - - - com.baeldung.ejb - ejb-session-beans - ${ejb-session-beans.version} - ejb - - - javax - javaee-api - ${javaee-api.version} - provided - - - org.wildfly - wildfly-ejb-client-bom - ${wildfly-ejb-client-bom.version} - pom - import - - - - - - - - - maven-ejb-plugin - ${maven-ejb-plugin.version} - - ${ejbVersion} - - - - - - - - - jboss-public-repository-group - JBoss Public Maven Repository Group - http://repository.jboss.org/nexus/content/groups/public/ - default - - true - never - - - true - never - - - - - - 2.5.7 - 3.4.11 - 0.10 - 2.19.1 - 1.0-SNAPSHOT - 1.0-SNAPSHOT - 7.0 - 2.4 - 3.2 - 10.1.0.Final - - - \ No newline at end of file diff --git a/ejb/wildfly/wildfly-ejb/src/main/resources/logback.xml b/ejb/wildfly/wildfly-ejb/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/ejb/wildfly/wildfly-ejb/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/ejb/wildfly/wildfly-jpa/src/main/resources/logback.xml b/ejb/wildfly/wildfly-jpa/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/ejb/wildfly/wildfly-jpa/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-ejb/README.md b/spring-ejb/README.md index d09b27db27..7b8696597d 100644 --- a/spring-ejb/README.md +++ b/spring-ejb/README.md @@ -1,4 +1,8 @@ ### Relevant Articles +- [Guide to EJB Set-up](http://www.baeldung.com/ejb-intro) +- [Java EE Session Beans](http://www.baeldung.com/ejb-session-beans) +- [Introduction to EJB JNDI Lookup on WildFly Application Server](http://www.baeldung.com/wildfly-ejb-jndi) +- [A Guide to Message Driven Beans in EJB](http://www.baeldung.com/ejb-message-driven-beans) - [Integration Guide for Spring and EJB](http://www.baeldung.com/spring-ejb) - [Singleton Session Bean in Java EE](http://www.baeldung.com/java-ee-singleton-session-bean) diff --git a/spring-ejb/ejb-beans/pom.xml b/spring-ejb/ejb-beans/pom.xml index 76c0afadee..168809ee6d 100644 --- a/spring-ejb/ejb-beans/pom.xml +++ b/spring-ejb/ejb-beans/pom.xml @@ -3,21 +3,31 @@ 4.0.0 com.baeldung.singletonsession ejb-beans - 1.0.0-SNAPSHOT - EJB Beans + spring-ejb-beans com.baeldung.spring.ejb spring-ejb - 1.0.1 + 1.0.0-SNAPSHOT + + + + org.jboss.arquillian + arquillian-bom + ${arquillian-bom.version} + import + pom + + + + javax javaee-api - ${javaee.version} provided @@ -26,10 +36,49 @@ tomee-embedded ${tomee-embedded.version} + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + + arquillian-glassfish-embedded + + + org.jboss.arquillian.container + arquillian-glassfish-embedded-3.1 + ${arquillian-glassfish-embedded-3.1.version} + test + + + org.glassfish.main.extras + glassfish-embedded-all + ${glassfish-embedded-all.version} + test + + + + + + + + + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + + 1.1.13.Final 1.7.5 + 3.1.2 + 1.0.0.CR4 diff --git a/ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient1.java b/spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient1.java similarity index 100% rename from ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient1.java rename to spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient1.java diff --git a/ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient2.java b/spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient2.java similarity index 100% rename from ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient2.java rename to spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateful/EJBClient2.java diff --git a/ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateful/StatefulEJB.java b/spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateful/StatefulEJB.java similarity index 100% rename from ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateful/StatefulEJB.java rename to spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateful/StatefulEJB.java diff --git a/ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient1.java b/spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient1.java similarity index 100% rename from ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient1.java rename to spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient1.java diff --git a/ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient2.java b/spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient2.java similarity index 100% rename from ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient2.java rename to spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateless/EJBClient2.java diff --git a/ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateless/StatelessEJB.java b/spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateless/StatelessEJB.java similarity index 100% rename from ejb/ejb-session-beans/src/main/java/com/baeldung/ejb/stateless/StatelessEJB.java rename to spring-ejb/ejb-beans/src/main/java/com/baeldung/ejb/stateless/StatelessEJB.java diff --git a/ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test/stateful/StatefulEJBIntegrationTest.java b/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateful/StatefulEJBIntegrationTest.java similarity index 97% rename from ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test/stateful/StatefulEJBIntegrationTest.java rename to spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateful/StatefulEJBIntegrationTest.java index cc35921e45..75f7132c62 100644 --- a/ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test/stateful/StatefulEJBIntegrationTest.java +++ b/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateful/StatefulEJBIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.ejb.test.stateful; +package com.baeldung.ejb.stateful; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; diff --git a/ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test/stateless/StatelessEJBIntegrationTest.java b/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateless/StatelessEJBIntegrationTest.java similarity index 97% rename from ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test/stateless/StatelessEJBIntegrationTest.java rename to spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateless/StatelessEJBIntegrationTest.java index c80ca93c0d..a970ef90ae 100644 --- a/ejb/ejb-session-beans/src/test/java/com/baeldung/ejb/test/stateless/StatelessEJBIntegrationTest.java +++ b/spring-ejb/ejb-beans/src/test/java/com/baeldung/ejb/stateless/StatelessEJBIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.ejb.test.stateless; +package com.baeldung.ejb.stateless; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; diff --git a/spring-ejb/ejb-beans/src/test/java/com/baeldung/singletonbean/CountryStateCacheBeanUnitTest.java b/spring-ejb/ejb-beans/src/test/java/com/baeldung/singletonbean/CountryStateCacheBeanUnitTest.java index 4cec01a4f7..615ddd1422 100644 --- a/spring-ejb/ejb-beans/src/test/java/com/baeldung/singletonbean/CountryStateCacheBeanUnitTest.java +++ b/spring-ejb/ejb-beans/src/test/java/com/baeldung/singletonbean/CountryStateCacheBeanUnitTest.java @@ -4,7 +4,6 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertNotNull; import java.util.Arrays; -import java.util.Collections; import java.util.List; import javax.ejb.embeddable.EJBContainer; @@ -22,7 +21,6 @@ public class CountryStateCacheBeanUnitTest { @Before public void init() { - ejbContainer = EJBContainer.createEJBContainer(); context = ejbContainer.getContext(); } diff --git a/spring-ejb/ejb-remote-for-spring/pom.xml b/spring-ejb/ejb-remote-for-spring/pom.xml deleted file mode 100755 index 21256fa801..0000000000 --- a/spring-ejb/ejb-remote-for-spring/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - ejb-remote-for-spring - ejb - - - com.baeldung.spring.ejb - spring-ejb - 1.0.1 - - - - - javax - javaee-api - provided - - - org.assertj - assertj-core - ${assertj.version} - test - - - - - - - - wildfly-standalone - - false - - - - - org.codehaus.cargo - cargo-maven2-plugin - ${cargo-maven2-plugin.version} - - - - - wildfly10x - - http://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.zip - - - - - - 127.0.0.1 - standalone-full - 9990 - testUser:admin1234! - - - - - - - - - - - - 3.9.0 - 1.6.1 - - - - - diff --git a/spring-ejb/ejb-remote-for-spring/src/main/resources/logback.xml b/spring-ejb/ejb-remote-for-spring/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-ejb/ejb-remote-for-spring/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-ejb/pom.xml b/spring-ejb/pom.xml index 055df9ea04..688f692757 100755 --- a/spring-ejb/pom.xml +++ b/spring-ejb/pom.xml @@ -4,7 +4,6 @@ 4.0.0 com.baeldung.spring.ejb spring-ejb - 1.0.1 pom spring-ejb Spring EJB Tutorial @@ -36,8 +35,8 @@ com.baeldung.spring.ejb - ejb-remote-for-spring - ${ejb-remote-for-spring.version} + spring-ejb-remote + ${spring-ejb-remote.version} ejb @@ -71,13 +70,14 @@ - ejb-remote-for-spring + spring-ejb-remote ejb-beans spring-ejb-client + wildfly - 1.0.1 + 1.0.0-SNAPSHOT 8.0 12.0.0.Final 2.4 diff --git a/spring-ejb/spring-ejb-client/pom.xml b/spring-ejb/spring-ejb-client/pom.xml index 50337e8b21..3d8003cbba 100644 --- a/spring-ejb/spring-ejb-client/pom.xml +++ b/spring-ejb/spring-ejb-client/pom.xml @@ -12,7 +12,7 @@ com.baeldung.spring.ejb spring-ejb - 1.0.1 + 1.0.0-SNAPSHOT @@ -36,14 +36,12 @@ org.wildfly wildfly-ejb-client-bom - ${wildfly-ejb.version} pom com.baeldung.spring.ejb - ejb-remote-for-spring - ${ejb-remote-for-spring.version} + spring-ejb-remote ejb @@ -70,9 +68,4 @@ - - 1.0.1 - 12.0.0.Final - - diff --git a/ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java b/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java old mode 100755 new mode 100644 similarity index 97% rename from ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java rename to spring-ejb/spring-ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java index ebd6ef1b97..0c87e927a6 --- a/ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java +++ b/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java @@ -41,7 +41,7 @@ public class EJBClient { // Since we haven't deployed the application as a .ear, the app name for // us will be an empty string final String appName = ""; - final String moduleName = "remote"; + final String moduleName = "spring-ejb-remote"; final String distinctName = ""; final String beanName = "HelloWorld"; final String viewClassName = HelloWorld.class.getName(); diff --git a/ejb/ejb-client/src/main/java/com/baeldung/ejb/wildfly/TextApplication.java b/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/ejb/wildfly/TextApplication.java similarity index 96% rename from ejb/ejb-client/src/main/java/com/baeldung/ejb/wildfly/TextApplication.java rename to spring-ejb/spring-ejb-client/src/main/java/com/baeldung/ejb/wildfly/TextApplication.java index 3b63761c73..40264ff5e2 100644 --- a/ejb/ejb-client/src/main/java/com/baeldung/ejb/wildfly/TextApplication.java +++ b/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/ejb/wildfly/TextApplication.java @@ -21,7 +21,7 @@ public class TextApplication { private static TextProcessorRemote lookupTextProcessorBean(String namespace) throws NamingException { Context ctx = createInitialContext(); final String appName = ""; - final String moduleName = "EJBModule"; + final String moduleName = "spring-ejb-remote"; final String distinctName = ""; final String beanName = TextProcessorBean.class.getSimpleName(); final String viewClassName = TextProcessorRemote.class.getName(); diff --git a/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/springejbclient/SpringEjbClientApplication.java b/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/springejbclient/SpringEjbClientApplication.java index 0a1e389113..554fac3417 100644 --- a/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/springejbclient/SpringEjbClientApplication.java +++ b/spring-ejb/spring-ejb-client/src/main/java/com/baeldung/springejbclient/SpringEjbClientApplication.java @@ -37,7 +37,7 @@ public class SpringEjbClientApplication { @SuppressWarnings("rawtypes") private String getFullName(Class classType) { - String moduleName = "ejb-remote-for-spring/"; + String moduleName = "spring-ejb-remote/"; String beanName = classType.getSimpleName(); String viewClassName = classType.getName(); diff --git a/ejb/ejb-client/src/main/resources/jboss-ejb-client.properties b/spring-ejb/spring-ejb-client/src/main/resources/jboss-ejb-client.properties old mode 100755 new mode 100644 similarity index 100% rename from ejb/ejb-client/src/main/resources/jboss-ejb-client.properties rename to spring-ejb/spring-ejb-client/src/main/resources/jboss-ejb-client.properties diff --git a/ejb/ejb-client/src/test/java/com/baeldung/ejb/setup/test/EJBSetupIntegrationTest.java b/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/setup/test/EJBSetupIntegrationTest.java old mode 100755 new mode 100644 similarity index 100% rename from ejb/ejb-client/src/test/java/com/baeldung/ejb/setup/test/EJBSetupIntegrationTest.java rename to spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/setup/test/EJBSetupIntegrationTest.java diff --git a/ejb/ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationIntegrationTest.java b/spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationIntegrationTest.java similarity index 100% rename from ejb/ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationIntegrationTest.java rename to spring-ejb/spring-ejb-client/src/test/java/com/baeldung/ejb/wildfly/TextApplicationIntegrationTest.java diff --git a/ejb/ejb-remote/pom.xml b/spring-ejb/spring-ejb-remote/pom.xml old mode 100755 new mode 100644 similarity index 80% rename from ejb/ejb-remote/pom.xml rename to spring-ejb/spring-ejb-remote/pom.xml index dac2fefb84..4756846cc8 --- a/ejb/ejb-remote/pom.xml +++ b/spring-ejb/spring-ejb-remote/pom.xml @@ -2,13 +2,13 @@ 4.0.0 - ejb-remote + spring-ejb-remote ejb - com.baeldung.ejb - ejb - 1.0-SNAPSHOT + com.baeldung.spring.ejb + spring-ejb + 1.0.0-SNAPSHOT @@ -17,14 +17,21 @@ javaee-api provided + + org.assertj + assertj-core + ${assertj.version} + test + + - + wildfly-standalone - true + false @@ -38,13 +45,14 @@ wildfly10x - http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip + http://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.zip 127.0.0.1 + standalone-full 9990 testUser:admin1234! @@ -82,7 +90,7 @@ - 7.0 + 3.9.0 1.6.1 1.1.0.Alpha5 diff --git a/spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorld.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorld.java similarity index 100% rename from spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorld.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorld.java diff --git a/spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorldBean.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorldBean.java similarity index 100% rename from spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorldBean.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatefulWorldBean.java diff --git a/spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorld.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorld.java old mode 100755 new mode 100644 similarity index 100% rename from spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorld.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorld.java diff --git a/spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorldBean.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorldBean.java old mode 100755 new mode 100644 similarity index 100% rename from spring-ejb/ejb-remote-for-spring/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorldBean.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloStatelessWorldBean.java diff --git a/ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorld.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorld.java old mode 100755 new mode 100644 similarity index 100% rename from ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorld.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorld.java diff --git a/ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java old mode 100755 new mode 100644 similarity index 100% rename from ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java diff --git a/ejb/ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorBean.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorBean.java similarity index 100% rename from ejb/ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorBean.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorBean.java diff --git a/ejb/ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorRemote.java b/spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorRemote.java similarity index 100% rename from ejb/ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorRemote.java rename to spring-ejb/spring-ejb-remote/src/main/java/com/baeldung/ejb/wildfly/TextProcessorRemote.java diff --git a/spring-ejb/ejb-remote-for-spring/src/main/resources/META-INF/ejb-jar.xml b/spring-ejb/spring-ejb-remote/src/main/resources/META-INF/ejb-jar.xml old mode 100755 new mode 100644 similarity index 84% rename from spring-ejb/ejb-remote-for-spring/src/main/resources/META-INF/ejb-jar.xml rename to spring-ejb/spring-ejb-remote/src/main/resources/META-INF/ejb-jar.xml index f51523ac14..e53ed00e98 --- a/spring-ejb/ejb-remote-for-spring/src/main/resources/META-INF/ejb-jar.xml +++ b/spring-ejb/spring-ejb-remote/src/main/resources/META-INF/ejb-jar.xml @@ -2,6 +2,6 @@ - ejb-remote-for-spring + spring-ejb-remote diff --git a/ejb/ejb-client/src/main/resources/logback.xml b/spring-ejb/spring-ejb-remote/src/main/resources/logback.xml similarity index 100% rename from ejb/ejb-client/src/main/resources/logback.xml rename to spring-ejb/spring-ejb-remote/src/main/resources/logback.xml diff --git a/spring-ejb/ejb-remote-for-spring/src/test/java/com/baeldung/ejb/tutorial/HelloStatefulWorldTestUnitTest.java b/spring-ejb/spring-ejb-remote/src/test/java/com/baeldung/ejb/tutorial/HelloStatefulWorldTestUnitTest.java similarity index 100% rename from spring-ejb/ejb-remote-for-spring/src/test/java/com/baeldung/ejb/tutorial/HelloStatefulWorldTestUnitTest.java rename to spring-ejb/spring-ejb-remote/src/test/java/com/baeldung/ejb/tutorial/HelloStatefulWorldTestUnitTest.java diff --git a/spring-ejb/ejb-remote-for-spring/src/test/java/com/baeldung/ejb/tutorial/HelloStatelessWorldTestUnitTest.java b/spring-ejb/spring-ejb-remote/src/test/java/com/baeldung/ejb/tutorial/HelloStatelessWorldTestUnitTest.java similarity index 100% rename from spring-ejb/ejb-remote-for-spring/src/test/java/com/baeldung/ejb/tutorial/HelloStatelessWorldTestUnitTest.java rename to spring-ejb/spring-ejb-remote/src/test/java/com/baeldung/ejb/tutorial/HelloStatelessWorldTestUnitTest.java diff --git a/ejb/wildfly/pom.xml b/spring-ejb/wildfly/pom.xml similarity index 94% rename from ejb/wildfly/pom.xml rename to spring-ejb/wildfly/pom.xml index 53d10a90ed..8f7d4c287a 100644 --- a/ejb/wildfly/pom.xml +++ b/spring-ejb/wildfly/pom.xml @@ -2,15 +2,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.wildfly - wildfly + wildfly-example 0.0.1-SNAPSHOT pom - wildfly + wildfly-example - com.baeldung.ejb - ejb - 1.0-SNAPSHOT + com.baeldung.spring.ejb + spring-ejb + 1.0.0-SNAPSHOT diff --git a/ejb/wildfly/widlfly-web/pom.xml b/spring-ejb/wildfly/widlfly-web/pom.xml similarity index 100% rename from ejb/wildfly/widlfly-web/pom.xml rename to spring-ejb/wildfly/widlfly-web/pom.xml diff --git a/ejb/wildfly/widlfly-web/src/main/java/TestEJBServlet.java b/spring-ejb/wildfly/widlfly-web/src/main/java/TestEJBServlet.java similarity index 100% rename from ejb/wildfly/widlfly-web/src/main/java/TestEJBServlet.java rename to spring-ejb/wildfly/widlfly-web/src/main/java/TestEJBServlet.java diff --git a/ejb/wildfly/widlfly-web/src/main/java/TestJPAServlet.java b/spring-ejb/wildfly/widlfly-web/src/main/java/TestJPAServlet.java similarity index 100% rename from ejb/wildfly/widlfly-web/src/main/java/TestJPAServlet.java rename to spring-ejb/wildfly/widlfly-web/src/main/java/TestJPAServlet.java diff --git a/ejb/ejb-remote/src/main/resources/logback.xml b/spring-ejb/wildfly/widlfly-web/src/main/resources/logback.xml similarity index 100% rename from ejb/ejb-remote/src/main/resources/logback.xml rename to spring-ejb/wildfly/widlfly-web/src/main/resources/logback.xml diff --git a/ejb/wildfly/widlfly-web/src/main/webapp/WEB-INF/web.xml b/spring-ejb/wildfly/widlfly-web/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from ejb/wildfly/widlfly-web/src/main/webapp/WEB-INF/web.xml rename to spring-ejb/wildfly/widlfly-web/src/main/webapp/WEB-INF/web.xml diff --git a/ejb/wildfly/wildfly-ear/pom.xml b/spring-ejb/wildfly/wildfly-ear/pom.xml similarity index 100% rename from ejb/wildfly/wildfly-ear/pom.xml rename to spring-ejb/wildfly/wildfly-ear/pom.xml diff --git a/ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml similarity index 100% rename from ejb/wildfly/wildfly-ejb-interfaces/pom.xml rename to spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml diff --git a/ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanLocal.java b/spring-ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanLocal.java similarity index 100% rename from ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanLocal.java rename to spring-ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanLocal.java diff --git a/ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanRemote.java b/spring-ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanRemote.java similarity index 100% rename from ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanRemote.java rename to spring-ejb/wildfly/wildfly-ejb-interfaces/src/main/java/wildfly/beans/UserBeanRemote.java diff --git a/ejb/ejb-session-beans/src/main/resources/logback.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/src/main/resources/logback.xml similarity index 100% rename from ejb/ejb-session-beans/src/main/resources/logback.xml rename to spring-ejb/wildfly/wildfly-ejb-interfaces/src/main/resources/logback.xml diff --git a/ejb/wildfly/wildfly-ejb/pom.xml b/spring-ejb/wildfly/wildfly-ejb/pom.xml similarity index 100% rename from ejb/wildfly/wildfly-ejb/pom.xml rename to spring-ejb/wildfly/wildfly-ejb/pom.xml diff --git a/ejb/wildfly/wildfly-ejb/src/main/java/wildfly/beans/UserBean.java b/spring-ejb/wildfly/wildfly-ejb/src/main/java/wildfly/beans/UserBean.java similarity index 100% rename from ejb/wildfly/wildfly-ejb/src/main/java/wildfly/beans/UserBean.java rename to spring-ejb/wildfly/wildfly-ejb/src/main/java/wildfly/beans/UserBean.java diff --git a/ejb/wildfly/widlfly-web/src/main/resources/logback.xml b/spring-ejb/wildfly/wildfly-ejb/src/main/resources/logback.xml similarity index 100% rename from ejb/wildfly/widlfly-web/src/main/resources/logback.xml rename to spring-ejb/wildfly/wildfly-ejb/src/main/resources/logback.xml diff --git a/ejb/wildfly/wildfly-jpa/pom.xml b/spring-ejb/wildfly/wildfly-jpa/pom.xml similarity index 100% rename from ejb/wildfly/wildfly-jpa/pom.xml rename to spring-ejb/wildfly/wildfly-jpa/pom.xml diff --git a/ejb/wildfly/wildfly-jpa/src/main/java/model/User.java b/spring-ejb/wildfly/wildfly-jpa/src/main/java/model/User.java similarity index 100% rename from ejb/wildfly/wildfly-jpa/src/main/java/model/User.java rename to spring-ejb/wildfly/wildfly-jpa/src/main/java/model/User.java diff --git a/ejb/wildfly/wildfly-jpa/src/main/resources/META-INF/persistence.xml b/spring-ejb/wildfly/wildfly-jpa/src/main/resources/META-INF/persistence.xml similarity index 100% rename from ejb/wildfly/wildfly-jpa/src/main/resources/META-INF/persistence.xml rename to spring-ejb/wildfly/wildfly-jpa/src/main/resources/META-INF/persistence.xml diff --git a/ejb/wildfly/wildfly-jpa/src/main/resources/data.sql b/spring-ejb/wildfly/wildfly-jpa/src/main/resources/data.sql similarity index 100% rename from ejb/wildfly/wildfly-jpa/src/main/resources/data.sql rename to spring-ejb/wildfly/wildfly-jpa/src/main/resources/data.sql diff --git a/ejb/wildfly/wildfly-ejb-interfaces/src/main/resources/logback.xml b/spring-ejb/wildfly/wildfly-jpa/src/main/resources/logback.xml similarity index 100% rename from ejb/wildfly/wildfly-ejb-interfaces/src/main/resources/logback.xml rename to spring-ejb/wildfly/wildfly-jpa/src/main/resources/logback.xml diff --git a/ejb/wildfly/wildfly-mdb/pom.xml b/spring-ejb/wildfly/wildfly-mdb/pom.xml similarity index 100% rename from ejb/wildfly/wildfly-mdb/pom.xml rename to spring-ejb/wildfly/wildfly-mdb/pom.xml diff --git a/ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/ReadMessageMDB.java b/spring-ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/ReadMessageMDB.java similarity index 100% rename from ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/ReadMessageMDB.java rename to spring-ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/ReadMessageMDB.java diff --git a/ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/SendMessageServlet.java b/spring-ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/SendMessageServlet.java similarity index 100% rename from ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/SendMessageServlet.java rename to spring-ejb/wildfly/wildfly-mdb/src/com/baeldung/wildfly/mdb/SendMessageServlet.java From 2801a4093878ddb5041b378a92dac5bc9a0aa199 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 13 Nov 2018 20:03:07 +0530 Subject: [PATCH 375/546] BAEL-8874 Merge ejb projects -Removed reference of ejb projects from parent pom.xml --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9526158656..109a49d985 100644 --- a/pom.xml +++ b/pom.xml @@ -374,8 +374,6 @@ persistence-modules/deltaspike dozer ethereum - ejb - ejb/ejb-client feign flips testing-modules/gatling From 9b809fcc6205852c136cce4d7124a33dc917e661 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 13 Nov 2018 21:06:36 +0530 Subject: [PATCH 376/546] BAEL-10313 Help with test fixes in Abstract Classes and SimpleDateFormat -Removed corrupted surefire config from core-java module --- core-java/pom.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/core-java/pom.xml b/core-java/pom.xml index 2106b45fab..fc2d44e233 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java 0.1.0-SNAPSHOT jar @@ -173,21 +172,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*IntTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - - true - - - org.apache.maven.plugins maven-dependency-plugin From 43483cfecadead1303f3087c16d6422528d5ce5a Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Tue, 13 Nov 2018 23:52:32 +0200 Subject: [PATCH 377/546] Update pom.xml --- core-java/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/core-java/pom.xml b/core-java/pom.xml index fc2d44e233..9fbc8f6810 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -529,5 +529,4 @@ 1.8.0 - From 99c3e0b207759792fbd5a235db15f5873d4f273b Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 14 Nov 2018 19:05:27 +0200 Subject: [PATCH 378/546] Update README.md --- spring-rest-simple/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-rest-simple/README.md b/spring-rest-simple/README.md index 57d6f50887..179e556202 100644 --- a/spring-rest-simple/README.md +++ b/spring-rest-simple/README.md @@ -2,7 +2,6 @@ - [Guide to UriComponentsBuilder in Spring](http://www.baeldung.com/spring-uricomponentsbuilder) - [Returning Custom Status Codes from Spring Controllers](http://www.baeldung.com/spring-mvc-controller-custom-http-status-code) -- [The Guide to RestTemplate](http://www.baeldung.com/rest-template) - [Spring RequestMapping](http://www.baeldung.com/spring-requestmapping) - [ETags for REST with Spring](http://www.baeldung.com/etags-for-rest-with-spring) - [Spring and Apache FileUpload](http://www.baeldung.com/spring-apache-file-upload) From d2dcc13054cea67ba4f1a786c3fccd82581d32a5 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 14 Nov 2018 19:08:22 +0200 Subject: [PATCH 379/546] Update README.md --- spring-ejb/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-ejb/README.md b/spring-ejb/README.md index 7b8696597d..58ccb20e70 100644 --- a/spring-ejb/README.md +++ b/spring-ejb/README.md @@ -6,3 +6,4 @@ - [A Guide to Message Driven Beans in EJB](http://www.baeldung.com/ejb-message-driven-beans) - [Integration Guide for Spring and EJB](http://www.baeldung.com/spring-ejb) - [Singleton Session Bean in Java EE](http://www.baeldung.com/java-ee-singleton-session-bean) + From 42fac5dbcfa362e13b6322c98a4e58595b40a59a Mon Sep 17 00:00:00 2001 From: freddyaott Date: Thu, 15 Nov 2018 03:54:16 +0100 Subject: [PATCH 380/546] Java Math (#5684) --- .../com/baeldung/java/math/MathUnitTest.java | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 core-java/src/test/java/com/baeldung/java/math/MathUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/java/math/MathUnitTest.java b/core-java/src/test/java/com/baeldung/java/math/MathUnitTest.java new file mode 100644 index 0000000000..6d1872f05f --- /dev/null +++ b/core-java/src/test/java/com/baeldung/java/math/MathUnitTest.java @@ -0,0 +1,175 @@ +package com.baeldung.java.math; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class MathUnitTest { + + @Test + public void whenAbsInteger_thenReturnAbsoluteValue() { + assertEquals(5,Math.abs(-5)); + } + + @Test + public void whenMaxBetweenTwoValue_thenReturnMaximum() { + assertEquals(10, Math.max(5,10)); + } + + @Test + public void whenMinBetweenTwoValue_thenReturnMinimum() { + assertEquals(5, Math.min(5,10)); + } + + @Test + public void whenSignumWithNegativeNumber_thenReturnMinusOne() { + assertEquals(-1, Math.signum(-5), 0); + } + + @Test + public void whenCopySignWithNegativeSign_thenReturnNegativeArgument() { + assertEquals(-5, Math.copySign(5,-1), 0); + } + + @Test + public void whenPow_thenReturnPoweredValue() { + assertEquals(25, Math.pow(5,2),0); + } + + @Test + public void whenSqrt_thenReturnSquareRoot() { + assertEquals(5, Math.sqrt(25),0); + } + + @Test + public void whenCbrt_thenReturnCubeRoot() { + assertEquals(5, Math.cbrt(125),0); + } + + @Test + public void whenExp_thenReturnEulerNumberRaised() { + assertEquals(2.718, Math.exp(1),0.1); + } + + @Test + public void whenExpm1_thenReturnEulerNumberMinusOne() { + assertEquals(1.718, Math.expm1(1),0.1); + } + + @Test + public void whenGetExponent_thenReturnUnbiasedExponent() { + assertEquals(8, Math.getExponent(333.3),0); + assertEquals(7, Math.getExponent(222.2f),0); + } + + @Test + public void whenLog_thenReturnValue() { + assertEquals(1, Math.log(Math.E),0); + } + + @Test + public void whenLog10_thenReturnValue() { + assertEquals(1, Math.log10(10),0); + } + + @Test + public void whenLog1p_thenReturnValue() { + assertEquals(1.31, Math.log1p(Math.E),0.1); + } + + @Test + public void whenSin_thenReturnValue() { + assertEquals(1, Math.sin(Math.PI/2),0); + } + + @Test + public void whenCos_thenReturnValue() { + assertEquals(1, Math.cos(0),0); + } + + @Test + public void whenTan_thenReturnValue() { + assertEquals(1, Math.tan(Math.PI/4),0.1); + } + + @Test + public void whenAsin_thenReturnValue() { + assertEquals(Math.PI/2, Math.asin(1),0); + } + + @Test + public void whenAcos_thenReturnValue() { + assertEquals(Math.PI/2, Math.acos(0),0); + } + + @Test + public void whenAtan_thenReturnValue() { + assertEquals(Math.PI/4, Math.atan(1),0); + } + + @Test + public void whenAtan2_thenReturnValue() { + assertEquals(Math.PI/4, Math.atan2(1,1),0); + } + + @Test + public void whenToDegrees_thenReturnValue() { + assertEquals(180, Math.toDegrees(Math.PI),0); + } + + @Test + public void whenToRadians_thenReturnValue() { + assertEquals(Math.PI, Math.toRadians(180),0); + } + + @Test + public void whenCeil_thenReturnValue() { + assertEquals(4, Math.ceil(Math.PI),0); + } + + @Test + public void whenFloor_thenReturnValue() { + assertEquals(3, Math.floor(Math.PI),0); + } + + @Test + public void whenGetExponent_thenReturnValue() { + assertEquals(8, Math.getExponent(333.3),0); + } + + @Test + public void whenIEEERemainder_thenReturnValue() { + assertEquals(1.0, Math.IEEEremainder(5,2),0); + } + + @Test + public void whenNextAfter_thenReturnValue() { + assertEquals(1.9499999284744263, Math.nextAfter(1.95f,1),0.0000001); + } + + @Test + public void whenNextUp_thenReturnValue() { + assertEquals(1.9500002, Math.nextUp(1.95f),0.0000001); + } + + @Test + public void whenRint_thenReturnValue() { + assertEquals(2.0, Math.rint(1.95f),0.0); + } + + @Test + public void whenRound_thenReturnValue() { + assertEquals(2.0, Math.round(1.95f),0.0); + } + + @Test + public void whenScalb_thenReturnValue() { + assertEquals(48, Math.scalb(3, 4),0.0); + } + + @Test + public void whenHypot_thenReturnValue() { + assertEquals(5, Math.hypot(4, 3),0.0); + } + +} From de3a7e4727aeb0b454d5ff7947fe19cb645017af Mon Sep 17 00:00:00 2001 From: thoughtscript Date: Wed, 14 Nov 2018 20:39:48 -0800 Subject: [PATCH 381/546] support for swagger 2 boot 2.x --- spring-boot-mvc/README.md | 1 + spring-boot-mvc/pom.xml | 27 +++++-- .../com/baeldung/swaggerboot/Application.java | 15 ++++ .../com/baeldung/swaggerboot/Constants.java | 16 ++++ .../configuration/SpringFoxConfig.java | 73 +++++++++++++++++++ .../controller/RegularRestController.java | 22 ++++++ .../services/RegularWebService.java | 20 +++++ .../swaggerboot/transfer/CustomResponse.java | 31 ++++++++ 8 files changed, 200 insertions(+), 5 deletions(-) create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java create mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java diff --git a/spring-boot-mvc/README.md b/spring-boot-mvc/README.md index e7b42f8f50..bf32e4fc7c 100644 --- a/spring-boot-mvc/README.md +++ b/spring-boot-mvc/README.md @@ -9,3 +9,4 @@ - [Display RSS Feed with Spring MVC](http://www.baeldung.com/spring-mvc-rss-feed) - [A Controller, Service and DAO Example with Spring Boot and JSF](https://www.baeldung.com/jsf-spring-boot-controller-service-dao) - [Cache Eviction in Spring Boot](https://www.baeldung.com/spring-boot-evict-cache) +- [Setting Up Swagger 2 with a Spring REST API](http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api) \ No newline at end of file diff --git a/spring-boot-mvc/pom.xml b/spring-boot-mvc/pom.xml index 5f6cdff85b..b219e53431 100644 --- a/spring-boot-mvc/pom.xml +++ b/spring-boot-mvc/pom.xml @@ -15,6 +15,7 @@ + org.springframework.boot spring-boot-starter-web @@ -23,6 +24,7 @@ org.apache.tomcat.embed tomcat-embed-jasper + org.glassfish @@ -30,17 +32,13 @@ 2.3.7 + org.springframework.boot spring-boot-starter-test test - - org.springframework.boot - spring-boot-starter-validation - - com.rometools @@ -48,6 +46,7 @@ ${rome.version} + org.hibernate.validator hibernate-validator @@ -56,6 +55,23 @@ javax.validation validation-api + + org.springframework.boot + spring-boot-starter-validation + + + + + io.springfox + springfox-swagger2 + ${spring.fox.version} + + + io.springfox + springfox-swagger-ui + ${spring.fox.version} + + @@ -72,6 +88,7 @@ + 2.9.2 1.10.0 com.baeldung.springbootmvc.SpringBootMvcApplication diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java new file mode 100644 index 0000000000..2161597c4e --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java @@ -0,0 +1,15 @@ +package com.baeldung.swaggerboot; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = {"com.baeldung"}) +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} \ No newline at end of file diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java new file mode 100644 index 0000000000..14b4162713 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java @@ -0,0 +1,16 @@ +package com.baeldung.swaggerboot; + +public class Constants { + + public static final String DEFAULT_GREETING = "Howdy Cosmic Spheroid!"; + public static final String DEFAULT_ERROR = "Fail!"; + + /** + * API Endpoint. + */ + + public static final String REACTIVE_REST_URL = "/reactiverest"; + public static final String FUNCTIONAL_URL = "/functional"; + public static final String REGULAR_REST_URL = "/regularrest"; + +} \ No newline at end of file diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java new file mode 100644 index 0000000000..babe70580c --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java @@ -0,0 +1,73 @@ +package com.baeldung.swaggerboot.configuration; + +import com.fasterxml.classmate.TypeResolver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger.web.*; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.Collections; + +@Configuration +@EnableSwagger2 +@ComponentScan("com.baeldung.swaggerboot.controller") +public class SpringFoxConfig { + + @Autowired + private TypeResolver typeResolver; + + private ApiInfo apiInfo() { + return new ApiInfo( + "My REST API", + "Some custom description of API.", + "API TOS", + "Terms of service", + new Contact("John Doe", "www.example.com", "myeaddress@company.com"), + "License of API", + "API license URL", + Collections.emptyList()); + } + + @Bean + public Docket api() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build(); + } + + /** + * SwaggerUI information + */ + + @Bean + UiConfiguration uiConfig() { + return UiConfigurationBuilder.builder() + .deepLinking(true) + .displayOperationId(false) + .defaultModelsExpandDepth(1) + .defaultModelExpandDepth(1) + .defaultModelRendering(ModelRendering.EXAMPLE) + .displayRequestDuration(false) + .docExpansion(DocExpansion.NONE) + .filter(false) + .maxDisplayedTags(null) + .operationsSorter(OperationsSorter.ALPHA) + .showExtensions(false) + .tagsSorter(TagsSorter.ALPHA) + .supportedSubmitMethods(UiConfiguration.Constants.DEFAULT_SUBMIT_METHODS) + .validatorUrl(null) + .build(); + } + +} diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java new file mode 100644 index 0000000000..537e16d146 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java @@ -0,0 +1,22 @@ +package com.baeldung.swaggerboot.controller; + +import com.baeldung.swaggerboot.services.RegularWebService; +import com.baeldung.swaggerboot.transfer.CustomResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static com.baeldung.swaggerboot.Constants.REGULAR_REST_URL; + +@RestController +public class RegularRestController { + + @Autowired + RegularWebService regularWebService; + + @GetMapping(REGULAR_REST_URL) + public CustomResponse getSession() { + return regularWebService.example(); + } + +} \ No newline at end of file diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java new file mode 100644 index 0000000000..d13ed7a6a9 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java @@ -0,0 +1,20 @@ +package com.baeldung.swaggerboot.services; + +import com.baeldung.swaggerboot.transfer.CustomResponse; +import org.springframework.stereotype.Service; + +import static com.baeldung.swaggerboot.Constants.DEFAULT_ERROR; +import static com.baeldung.swaggerboot.Constants.DEFAULT_GREETING; + +@Service +public class RegularWebService { + + public CustomResponse example() { + try { + return new CustomResponse(0, DEFAULT_GREETING); + } catch (Exception ex) { + return new CustomResponse(0, DEFAULT_ERROR); + } + } + +} \ No newline at end of file diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java new file mode 100644 index 0000000000..d09e9f935e --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java @@ -0,0 +1,31 @@ +package com.baeldung.swaggerboot.transfer; + +public class CustomResponse { + + private int id; + private String note; + + public CustomResponse() {} + + public CustomResponse(int id, String note) { + this.id = id; + this.note = note; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + +} From 1f7c33145f4b58a5c24de43853975fe8a25e17e6 Mon Sep 17 00:00:00 2001 From: DOHA Date: Thu, 15 Nov 2018 13:32:01 +0200 Subject: [PATCH 382/546] change naming convention --- .../springbootmvc/RequestParamController.java | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java index 7a262edd16..d35f837c26 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java +++ b/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java @@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; @Controller @@ -17,43 +16,37 @@ public class RequestParamController { @GetMapping("/api/foos") @ResponseBody - public String getFoos(@RequestParam int limit){ - return "Limit: " + limit; - } - - @GetMapping("/api/bars") - @ResponseBody - public String getBars(@RequestParam(name = "query") String searchQuery){ - return "Query: " + searchQuery; - } - - @GetMapping("/api/users") - @ResponseBody - public String getUsers(@RequestParam(required = false) String query){ - return "Query: " + query; - } - - @GetMapping("/api/products") - @ResponseBody - public String getProducts(@RequestParam(defaultValue = "20") int limit){ - return "Limit: " + limit; + public String getFoos(@RequestParam String id){ + return "ID: " + id; } @PostMapping("/api/foos") @ResponseBody + public String addFoo(@RequestParam(name = "id") String fooId, @RequestParam String name){ + return "ID: " + fooId; + } + + @GetMapping("/api/foos2") + @ResponseBody + public String getFoos2(@RequestParam(required = false) String id){ + return "ID: " + id; + } + + @GetMapping("/api/foos3") + @ResponseBody + public String getFoos3(@RequestParam(defaultValue = "test") String id){ + return "ID: " + id; + } + + @PostMapping("/api/foos1") + @ResponseBody public String updateFoos(@RequestParam Map allParams){ return "Parameters are " + allParams.entrySet(); } - @PostMapping("/api/posts") + @GetMapping("/api/foos4") @ResponseBody - public String createPost(@RequestParam String content, @RequestParam MultipartFile file){ - return "File size in bytes: " + file.getSize(); - } - - @GetMapping("/api/posts") - @ResponseBody - public String getPosts(@RequestParam List id){ + public String getFoos4(@RequestParam List id){ return "ID are " + id; } From 927a8851aea72c2e0098845f70e2ffc05d6b3345 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 15 Nov 2018 21:27:02 +0330 Subject: [PATCH 383/546] BAEL-2374: Added a simple reified generic example. --- core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt b/core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt new file mode 100644 index 0000000000..37a632fe41 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt @@ -0,0 +1,6 @@ +inline fun Iterable<*>.filterIsInstance() = filter { it is T } + +fun main(args: Array) { + val set = setOf("1984", 2, 3, "Brave new world", 11) + println(set.filterIsInstance()) +} \ No newline at end of file From f0f1eba7b91e9743f15fd4e7b5d53bbccd5bac41 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 16 Nov 2018 10:04:48 +0800 Subject: [PATCH 384/546] change from @before to init --- .../test/kotlin/com/baeldung/random/RandomStringTest.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt index 0715870403..f44b0cd437 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -16,11 +16,10 @@ class RandomStringTest { val charPool = ArrayList() - @BeforeEach - fun charPool() { - charPool.addAll('a'..'z'); - charPool.addAll('A'..'Z'); - charPool.addAll('0'..'9'); + init { + charPool.addAll('a'..'z') + charPool.addAll('A'..'Z') + charPool.addAll('0'..'9') } @Test From e27d5f4f1f81c5f3f0e9c69175d2bc21b751350e Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 16 Nov 2018 10:05:09 +0800 Subject: [PATCH 385/546] change from @before to init --- .../src/test/kotlin/com/baeldung/random/RandomStringTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt index f44b0cd437..a2a1ac58e3 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -14,7 +14,7 @@ const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+" class RandomStringTest { - val charPool = ArrayList() + private val charPool = ArrayList() init { charPool.addAll('a'..'z') From 3ee9050138e10a087562d4b410d9d9eb7de158b4 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 16 Nov 2018 10:18:14 +0800 Subject: [PATCH 386/546] change from @before to init --- .../test/kotlin/com/baeldung/random/RandomStringTest.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt index a2a1ac58e3..3c7bc44ea8 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -13,14 +13,7 @@ const val STRING_LENGTH = 10 const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+" class RandomStringTest { - - private val charPool = ArrayList() - - init { - charPool.addAll('a'..'z') - charPool.addAll('A'..'Z') - charPool.addAll('0'..'9') - } + private val charPool : List = ('a'..'z') + ('A'..'Z') + ('0'..'9') @Test fun givenAStringLength_whenUsingJava_thenReturnAlphanumericString() { From 0b15affd0ecd22ba7fbd16d74da14dd707144c6a Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 16 Nov 2018 13:46:14 +0800 Subject: [PATCH 387/546] rename to RandomStringUnitTest --- .../random/{RandomStringTest.kt => RandomStringUnitTest.kt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-kotlin/src/test/kotlin/com/baeldung/random/{RandomStringTest.kt => RandomStringUnitTest.kt} (98%) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt similarity index 98% rename from core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt rename to core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt index 3c7bc44ea8..74085367e8 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt @@ -12,7 +12,7 @@ import kotlin.test.assertEquals const val STRING_LENGTH = 10 const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+" -class RandomStringTest { +class RandomStringUnitTest { private val charPool : List = ('a'..'z') + ('A'..'Z') + ('0'..'9') @Test From 007aa9b66eee29634b454279b42eda79708d054d Mon Sep 17 00:00:00 2001 From: Rahul Srivastava Date: Fri, 16 Nov 2018 11:22:18 +0530 Subject: [PATCH 388/546] Changing para to rhyme --- .../string/AddingNewLineToString.java | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java b/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java index 0b3fd2ca92..b522f7337b 100644 --- a/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java +++ b/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java @@ -5,65 +5,65 @@ public class AddingNewLineToString { public static void main(String[] args) { String line1 = "Humpty Dumpty sat on a wall."; String line2 = "Humpty Dumpty had a great fall."; - String para = ""; + String rhyme = ""; System.out.println("***New Line in a String in Java***"); //1. Using "\n" System.out.println("1. Using \\n"); - para = line1 + "\n" + line2; - System.out.println(para); + rhyme = line1 + "\n" + line2; + System.out.println(rhyme); //2. Using "\r\n" System.out.println("2. Using \\r\\n"); - para = line1 + "\r\n" + line2; - System.out.println(para); + rhyme = line1 + "\r\n" + line2; + System.out.println(rhyme); //3. Using "\r" System.out.println("3. Using \\r"); - para = line1 + "\r" + line2; - System.out.println(para); + rhyme = line1 + "\r" + line2; + System.out.println(rhyme); //4. Using "\n\r" Note that this is not same as "\r\n" // Using "\n\r" is equivalent to adding two lines System.out.println("4. Using \\n\\r"); - para = line1 + "\n\r" + line2; - System.out.println(para); + rhyme = line1 + "\n\r" + line2; + System.out.println(rhyme); //5. Using System.lineSeparator() System.out.println("5. Using System.lineSeparator()"); - para = line1 + System.lineSeparator() + line2; - System.out.println(para); + rhyme = line1 + System.lineSeparator() + line2; + System.out.println(rhyme); //6. Using System.getProperty("line.separator") System.out.println("6. Using System.getProperty(\"line.separator\")"); - para = line1 + System.getProperty("line.separator") + line2; - System.out.println(para); + rhyme = line1 + System.getProperty("line.separator") + line2; + System.out.println(rhyme); System.out.println("***HTML to rendered in a browser***"); //1. Line break for HTML using
System.out.println("1. Line break for HTML using
"); - para = line1 + "
" + line2; - System.out.println(para); + rhyme = line1 + "
" + line2; + System.out.println(rhyme); //2. Line break for HTML using “ ” System.out.println("2. Line break for HTML using "); - para = line1 + " " + line2; - System.out.println(para); + rhyme = line1 + " " + line2; + System.out.println(rhyme); //3. Line break for HTML using “ ” System.out.println("3. Line break for HTML using "); - para = line1 + " " + line2; - System.out.println(para); + rhyme = line1 + " " + line2; + System.out.println(rhyme); //4. Line break for HTML using “ ;” System.out.println("4. Line break for HTML using "); - para = line1 + " " + line2; - System.out.println(para); + rhyme = line1 + " " + line2; + System.out.println(rhyme); //5. Line break for HTML using \n” System.out.println("5. Line break for HTML using \\n"); - para = line1 + "\n" + line2; - System.out.println(para); + rhyme = line1 + "\n" + line2; + System.out.println(rhyme); } } \ No newline at end of file From 99b8077bba5017fdcececd07f809b7d9be363dc2 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Fri, 16 Nov 2018 16:06:20 +0530 Subject: [PATCH 389/546] [BAEL-10302] - Moved articles to core-java-collections --- core-java-collections/README.md | 7 +++++++ core-java-collections/pom.xml | 7 +++++++ .../baeldung/classcastexception/ClassCastException.java | 0 .../listInitialization/ListInitializationUnitTest.java | 0 .../test/java/org/baeldung/java/sorting/Employee.java | 0 .../org/baeldung/java/sorting/JavaSortingUnitTest.java | 0 core-java/README.md | 9 --------- 7 files changed, 14 insertions(+), 9 deletions(-) rename {core-java => core-java-collections}/src/main/java/com/baeldung/classcastexception/ClassCastException.java (100%) rename {core-java => core-java-collections}/src/test/java/com/baeldung/java/listInitialization/ListInitializationUnitTest.java (100%) rename {core-java => core-java-collections}/src/test/java/org/baeldung/java/sorting/Employee.java (100%) rename {core-java => core-java-collections}/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java (100%) diff --git a/core-java-collections/README.md b/core-java-collections/README.md index fbc8144954..0fcf7367c7 100644 --- a/core-java-collections/README.md +++ b/core-java-collections/README.md @@ -43,3 +43,10 @@ - [Converting a Collection to ArrayList in Java](https://www.baeldung.com/java-convert-collection-arraylist) - [Java 8 Streams: Find Items From One List Based On Values From Another List](https://www.baeldung.com/java-streams-find-list-items) - [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections) +- [Sorting in Java](http://www.baeldung.com/java-sorting) +- [A Guide to the Java LinkedList](http://www.baeldung.com/java-linkedlist) +- [Java List UnsupportedOperationException](http://www.baeldung.com/java-list-unsupported-operation-exception) +- [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split) +- [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) +- [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line) +- [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist) diff --git a/core-java-collections/pom.xml b/core-java-collections/pom.xml index 31f0d7419f..2201ee8b15 100644 --- a/core-java-collections/pom.xml +++ b/core-java-collections/pom.xml @@ -56,6 +56,12 @@ commons-exec 1.3 + + org.projectlombok + lombok + ${lombok.version} + provided + @@ -67,5 +73,6 @@ 1.7.0 3.11.1 7.1.0 + 1.16.12 diff --git a/core-java/src/main/java/com/baeldung/classcastexception/ClassCastException.java b/core-java-collections/src/main/java/com/baeldung/classcastexception/ClassCastException.java similarity index 100% rename from core-java/src/main/java/com/baeldung/classcastexception/ClassCastException.java rename to core-java-collections/src/main/java/com/baeldung/classcastexception/ClassCastException.java diff --git a/core-java/src/test/java/com/baeldung/java/listInitialization/ListInitializationUnitTest.java b/core-java-collections/src/test/java/com/baeldung/java/listInitialization/ListInitializationUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/listInitialization/ListInitializationUnitTest.java rename to core-java-collections/src/test/java/com/baeldung/java/listInitialization/ListInitializationUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/sorting/Employee.java b/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/sorting/Employee.java rename to core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java diff --git a/core-java/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java diff --git a/core-java/README.md b/core-java/README.md index 2be137add6..035efc673c 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -10,7 +10,6 @@ - [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) - [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) - [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java) -- [Sorting in Java](http://www.baeldung.com/java-sorting) - [Getting Started with Java Properties](http://www.baeldung.com/java-properties) - [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) - [URL Encoding and Decoding in Java](http://www.baeldung.com/java-url-encoding-decoding) @@ -39,7 +38,6 @@ - [Quick Guide to Java Stack](http://www.baeldung.com/java-stack) - [Guide to java.util.Formatter](http://www.baeldung.com/java-string-formatter) - [Guide to the Cipher Class](http://www.baeldung.com/java-cipher-class) -- [Implementing a Binary Tree in Java](http://www.baeldung.com/java-binary-tree) - [A Guide to ThreadLocalRandom in Java](http://www.baeldung.com/java-thread-local-random) - [Compiling Java *.class Files with javac](http://www.baeldung.com/javac) - [A Guide to Iterator in Java](http://www.baeldung.com/java-iterator) @@ -49,15 +47,10 @@ - [A Practical Guide to DecimalFormat](http://www.baeldung.com/java-decimalformat) - [How to Detect the OS Using Java](http://www.baeldung.com/java-detect-os) - [ASCII Art in Java](http://www.baeldung.com/ascii-art-in-java) -- [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max) - [What is the serialVersionUID?](http://www.baeldung.com/java-serial-version-uid) - [A Guide To UDP In Java](http://www.baeldung.com/udp-in-java) -- [A Guide to the Java LinkedList](http://www.baeldung.com/java-linkedlist) - [A Guide to the ResourceBundle](http://www.baeldung.com/java-resourcebundle) - [Class Loaders in Java](http://www.baeldung.com/java-classloaders) -- [Java List UnsupportedOperationException](http://www.baeldung.com/java-list-unsupported-operation-exception) -- [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split) -- [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) - [Sending Emails with Java](http://www.baeldung.com/java-email) - [Introduction to SSL in Java](http://www.baeldung.com/java-ssl) - [Java KeyStore API](http://www.baeldung.com/java-keystore) @@ -80,8 +73,6 @@ - [Getting a File’s Mime Type in Java](http://www.baeldung.com/java-file-mime-type) - [Common Java Exceptions](http://www.baeldung.com/java-common-exceptions) - [Java Constructors vs Static Factory Methods](https://www.baeldung.com/java-constructors-vs-static-factory-methods) -- [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line) -- [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist) - [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception) - [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) - [Calculating the nth Root in Java](https://www.baeldung.com/java-nth-root) From a0a80af9d0c7ec9cd5a244efd4b294bf9c06c232 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 16 Nov 2018 23:39:40 +0800 Subject: [PATCH 390/546] Generate a random alphanumeric string in Kotlin Issue: BAEL-1913 --- core-kotlin/pom.xml | 6 ++ .../baeldung/random/RandomStringUnitTest.kt | 62 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml index 5cdb5f700e..2b559b19e0 100644 --- a/core-kotlin/pom.xml +++ b/core-kotlin/pom.xml @@ -18,6 +18,11 @@ commons-math3 ${commons-math3.version} + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + org.junit.platform junit-platform-runner @@ -70,6 +75,7 @@ 3.6.1 + 3.8.1 1.1.1 5.2.0 3.10.0 diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt new file mode 100644 index 0000000000..74085367e8 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt @@ -0,0 +1,62 @@ +import org.apache.commons.lang3.RandomStringUtils +import org.junit.Before +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test +import java.security.SecureRandom +import java.util.concurrent.ThreadLocalRandom +import kotlin.experimental.and +import kotlin.streams.asSequence +import kotlin.test.assertEquals + +const val STRING_LENGTH = 10 +const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+" + +class RandomStringUnitTest { + private val charPool : List = ('a'..'z') + ('A'..'Z') + ('0'..'9') + + @Test + fun givenAStringLength_whenUsingJava_thenReturnAlphanumericString() { + var randomString = ThreadLocalRandom.current() + .ints(STRING_LENGTH.toLong(), 0, charPool.size) + .asSequence() + .map(charPool::get) + .joinToString("") + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) + } + + @Test + fun givenAStringLength_whenUsingKotlin_thenReturnAlphanumericString() { + var randomString = (1..STRING_LENGTH).map { i -> kotlin.random.Random.nextInt(0, charPool.size) } + .map(charPool::get) + .joinToString("") + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) + } + + @Test + fun givenAStringLength_whenUsingApacheCommon_thenReturnAlphanumericString() { + var randomString = RandomStringUtils.randomAlphanumeric(STRING_LENGTH) + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) + } + + @Test + fun givenAStringLength_whenUsingRandomForBytes_thenReturnAlphanumericString() { + val random = SecureRandom() + val bytes = ByteArray(STRING_LENGTH) + random.nextBytes(bytes) + + var randomString = (0..bytes.size - 1).map { i -> + charPool.get((bytes[i] and 0xFF.toByte() and charPool.size.toByte()).toInt()) + }.joinToString("") + + assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) + assertEquals(STRING_LENGTH, randomString.length) + } + +} \ No newline at end of file From 47735dcd70a428659b27ab46fa86b4f65bf4c4c1 Mon Sep 17 00:00:00 2001 From: geroza Date: Fri, 16 Nov 2018 14:34:48 -0200 Subject: [PATCH 391/546] Fixed issues due to parent-boot-2 migration (migration to Spring-boot 2): * Configured Hiberante 5 correctly * Configured Git plugin correctly * Changed hibernate methods to comply with new method naming conventions * Removed and replaced deprecated properties * Updated Actuator test to use new response structure * Using random port in Mongo integration test, to avoid clashing with a potential instance using the mongo default port --- spring-boot/.attach_pid12812 | 0 spring-boot/pom.xml | 41 ++++++++++-- .../ContactInfoValidator.java | 2 +- .../DynamicValidationApp.java | 3 +- .../dao/ContactInfoExpressionRepository.java | 2 +- .../FailureAnalyzerApplication.java | 1 - .../InternationalizationApp.java | 1 - .../main/java/com/baeldung/rss/RssApp.java | 5 +- .../baeldung/toggle/ToggleApplication.java | 1 - .../session/exception/Application.java | 7 -- .../repository/FooRepositoryImpl.java | 9 +-- .../src/main/resources/application.properties | 3 +- ...otWithServletComponentIntegrationTest.java | 1 - ...ithoutServletComponentIntegrationTest.java | 1 - .../DisplayBeanIntegrationTest.java | 65 +++++++++++++------ .../baeldung/git/CommitIdIntegrationTest.java | 6 +- .../java/com/baeldung/intro/AppLiveTest.java | 1 - .../ManualEmbeddedMongoDbIntegrationTest.java | 7 +- .../src/test/resources/application.properties | 14 ++-- .../src/test/resources/exception.properties | 4 +- 20 files changed, 109 insertions(+), 65 deletions(-) create mode 100644 spring-boot/.attach_pid12812 diff --git a/spring-boot/.attach_pid12812 b/spring-boot/.attach_pid12812 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index f16460b7c3..dbb098ccc2 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -1,4 +1,5 @@ - 4.0.0 spring-boot @@ -55,6 +56,14 @@ org.springframework.boot spring-boot-starter-data-jpa + + org.ehcache + ehcache + + + org.hibernate + hibernate-ehcache + org.springframework.boot spring-boot-starter-actuator @@ -143,10 +152,10 @@ chaos-monkey-spring-boot ${chaos.monkey.version} - + - javax.validation - validation-api + javax.validation + validation-api @@ -170,6 +179,28 @@ pl.project13.maven git-commit-id-plugin ${git-commit-id-plugin.version} + + + + get-the-git-infos + + revision + + initialize + + + validate-the-git-infos + + validateRevision + + package + + + + + true + ${project.build.outputDirectory}/git.properties + @@ -223,7 +254,7 @@ 3.6.0 3.2.0 18.0 - 2.2.4 + 2.2.4
diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java b/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java index e079b9a665..cc05fd4fbd 100644 --- a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java +++ b/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java @@ -30,7 +30,7 @@ public class ContactInfoValidator implements ConstraintValidator { - Optional findOne(String id); + Optional findById(String id); } diff --git a/spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java b/spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java index 3489732b6f..7bd5c36786 100644 --- a/spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java +++ b/spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java @@ -9,7 +9,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class FailureAnalyzerApplication { @RolesAllowed("*") public static void main(String[] args) { - System.setProperty("security.basic.enabled", "false"); SpringApplication.run(FailureAnalyzerApplication.class, args); } } diff --git a/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java b/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java index c92d1c32e6..c3af611f3b 100644 --- a/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java +++ b/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java @@ -9,7 +9,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class InternationalizationApp { @RolesAllowed("*") public static void main(String[] args) { - System.setProperty("security.basic.enabled", "false"); SpringApplication.run(InternationalizationApp.class, args); } } diff --git a/spring-boot/src/main/java/com/baeldung/rss/RssApp.java b/spring-boot/src/main/java/com/baeldung/rss/RssApp.java index d3d3d0241f..e067d3cfd1 100644 --- a/spring-boot/src/main/java/com/baeldung/rss/RssApp.java +++ b/spring-boot/src/main/java/com/baeldung/rss/RssApp.java @@ -1,18 +1,17 @@ package com.baeldung.rss; +import javax.annotation.security.RolesAllowed; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; -import javax.annotation.security.RolesAllowed; - @SpringBootApplication @ComponentScan(basePackages = "com.baeldung.rss") public class RssApp { @RolesAllowed("*") public static void main(String[] args) { - System.setProperty("security.basic.enabled", "false"); SpringApplication.run(RssApp.class, args); } diff --git a/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java b/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java index 27be6b7cca..fa84cf0d9b 100644 --- a/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java +++ b/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java @@ -9,7 +9,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class ToggleApplication { @RolesAllowed("*") public static void main(String[] args) { - System.setProperty("security.basic.enabled", "false"); SpringApplication.run(ToggleApplication.class, args); } } diff --git a/spring-boot/src/main/java/org/baeldung/session/exception/Application.java b/spring-boot/src/main/java/org/baeldung/session/exception/Application.java index 9132e710d1..354c64c258 100644 --- a/spring-boot/src/main/java/org/baeldung/session/exception/Application.java +++ b/spring-boot/src/main/java/org/baeldung/session/exception/Application.java @@ -4,8 +4,6 @@ import org.baeldung.demo.model.Foo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; -import org.springframework.orm.jpa.vendor.HibernateJpaSessionFactoryBean; @EntityScan(basePackageClasses = Foo.class) @SpringBootApplication @@ -15,9 +13,4 @@ public class Application { System.setProperty("spring.profiles.active", "exception"); SpringApplication.run(Application.class, args); } - - @Bean - public HibernateJpaSessionFactoryBean sessionFactory() { - return new HibernateJpaSessionFactoryBean(); - } } diff --git a/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java b/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java index 52407a2117..607bae83ba 100644 --- a/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java +++ b/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java @@ -1,5 +1,7 @@ package org.baeldung.session.exception.repository; +import javax.persistence.EntityManagerFactory; + import org.baeldung.demo.model.Foo; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -10,16 +12,15 @@ import org.springframework.stereotype.Repository; @Repository public class FooRepositoryImpl implements FooRepository { @Autowired - private SessionFactory sessionFactory; + private EntityManagerFactory emf; @Override public void save(Foo foo) { - sessionFactory.getCurrentSession().saveOrUpdate(foo); + emf.unwrap(SessionFactory.class).getCurrentSession().saveOrUpdate(foo); } @Override public Foo get(Integer id) { - return sessionFactory.getCurrentSession().get(Foo.class, id); + return emf.unwrap(SessionFactory.class).getCurrentSession().get(Foo.class, id); } - } \ No newline at end of file diff --git a/spring-boot/src/main/resources/application.properties b/spring-boot/src/main/resources/application.properties index 629e880940..6a52dd1f70 100644 --- a/spring-boot/src/main/resources/application.properties +++ b/spring-boot/src/main/resources/application.properties @@ -7,7 +7,7 @@ spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto = update management.endpoints.jmx.domain=Spring Sample Application -management.endpoints.jmx.uniqueNames=true +spring.jmx.unique-names=true management.endpoints.web.exposure.include=* management.endpoint.shutdown.enabled=true @@ -17,7 +17,6 @@ management.endpoint.shutdown.enabled=true ##endpoints.jolokia.path=jolokia spring.jmx.enabled=true -management.endpoints.jmx.enabled=true ## for pretty printing of json when endpoints accessed over HTTP http.mappers.jsonPrettyPrint=true diff --git a/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java index 2c3ac2e159..8c85934fac 100644 --- a/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java +++ b/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java @@ -20,7 +20,6 @@ import static org.junit.Assert.assertTrue; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootAnnotatedApp.class) -@TestPropertySource(properties = { "security.basic.enabled=false" }) public class SpringBootWithServletComponentIntegrationTest { @Autowired diff --git a/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java index a30d3ed3f2..c29cd75e9d 100644 --- a/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java +++ b/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java @@ -19,7 +19,6 @@ import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootPlainApp.class) -@TestPropertySource(properties = { "security.basic.enabled=false" }) public class SpringBootWithoutServletComponentIntegrationTest { @Autowired diff --git a/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java index aab4836b6f..e933920a96 100644 --- a/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java +++ b/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java @@ -1,31 +1,34 @@ package com.baeldung.displayallbeans; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.BDDAssertions.then; + +import java.net.URI; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; + 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.actuate.beans.BeansEndpoint.ContextBeans; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.context.WebApplicationContext; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static org.assertj.core.api.BDDAssertions.then; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - @RunWith(SpringRunner.class) @SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@TestPropertySource(properties = { "management.port=0", "endpoints.beans.id=springbeans", "endpoints.beans.sensitive=false" }) +@TestPropertySource(properties = { "management.port=0", "management.endpoints.web.exposure.include=*" }) public class DisplayBeanIntegrationTest { @LocalServerPort @@ -40,6 +43,8 @@ public class DisplayBeanIntegrationTest { @Autowired private WebApplicationContext context; + private static final String ACTUATOR_PATH = "/actuator"; + @Test public void givenRestTemplate_whenAccessServerUrl_thenHttpStatusOK() throws Exception { ResponseEntity entity = this.testRestTemplate.getForEntity("http://localhost:" + this.port + "/displayallbeans", String.class); @@ -49,22 +54,27 @@ public class DisplayBeanIntegrationTest { @Test public void givenRestTemplate_whenAccessEndpointUrl_thenHttpStatusOK() throws Exception { - @SuppressWarnings("rawtypes") - ResponseEntity entity = this.testRestTemplate.getForEntity("http://localhost:" + this.mgt + "/springbeans", List.class); + ParameterizedTypeReference> responseType = new ParameterizedTypeReference>() { + }; + RequestEntity requestEntity = RequestEntity.get(new URI("http://localhost:" + this.mgt + ACTUATOR_PATH + "/beans")) + .accept(MediaType.APPLICATION_JSON) + .build(); + ResponseEntity> entity = this.testRestTemplate.exchange(requestEntity, responseType); then(entity.getStatusCode()).isEqualTo(HttpStatus.OK); } @Test public void givenRestTemplate_whenAccessEndpointUrl_thenReturnsBeanNames() throws Exception { - @SuppressWarnings("rawtypes") - ResponseEntity entity = this.testRestTemplate.getForEntity("http://localhost:" + this.mgt + "/springbeans", List.class); + RequestEntity requestEntity = RequestEntity.get(new URI("http://localhost:" + this.mgt + ACTUATOR_PATH + "/beans")) + .accept(MediaType.APPLICATION_JSON) + .build(); + ResponseEntity entity = this.testRestTemplate.exchange(requestEntity, BeanActuatorResponse.class); - List> allBeans = (List) ((Map) entity.getBody().get(0)).get("beans"); - List beanNamesList = allBeans.stream().map(x -> (String) x.get("bean")).collect(Collectors.toList()); + Collection beanNamesList = entity.getBody() + .getBeans(); - assertThat(beanNamesList, hasItem("fooController")); - assertThat(beanNamesList, hasItem("fooService")); + assertThat(beanNamesList).contains("fooController", "fooService"); } @Test @@ -72,7 +82,20 @@ public class DisplayBeanIntegrationTest { String[] beanNames = context.getBeanDefinitionNames(); List beanNamesList = Arrays.asList(beanNames); - assertTrue(beanNamesList.contains("fooController")); - assertTrue(beanNamesList.contains("fooService")); + assertThat(beanNamesList).contains("fooController", "fooService"); + } + + private static class BeanActuatorResponse { + private Map>>> contexts; + + public Collection getBeans() { + return this.contexts.get("application") + .get("beans") + .keySet(); + } + + public Map>>> getContexts() { + return contexts; + } } } diff --git a/spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java index 348d594c05..d7399a4ff5 100644 --- a/spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java +++ b/spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java @@ -1,17 +1,19 @@ package com.baeldung.git; +import static org.assertj.core.api.Assertions.assertThat; + import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; -import static org.assertj.core.api.Assertions.assertThat; - @RunWith(SpringRunner.class) @ContextConfiguration(classes = CommitIdApplication.class) +@TestPropertySource(properties = { "spring.jmx.default-domain=test" }) public class CommitIdIntegrationTest { private static final Logger LOG = LoggerFactory.getLogger(CommitIdIntegrationTest.class); diff --git a/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java b/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java index 83b893ae5c..44461c0cf6 100644 --- a/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java +++ b/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java @@ -18,7 +18,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) @AutoConfigureMockMvc -@TestPropertySource(properties = { "security.basic.enabled=false" }) public class AppLiveTest { @Autowired diff --git a/spring-boot/src/test/java/com/baeldung/mongodb/ManualEmbeddedMongoDbIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/mongodb/ManualEmbeddedMongoDbIntegrationTest.java index 30a4d61fbd..c49b99ed99 100644 --- a/spring-boot/src/test/java/com/baeldung/mongodb/ManualEmbeddedMongoDbIntegrationTest.java +++ b/spring-boot/src/test/java/com/baeldung/mongodb/ManualEmbeddedMongoDbIntegrationTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.util.SocketUtils; import com.mongodb.BasicDBObjectBuilder; import com.mongodb.DBObject; @@ -32,16 +33,16 @@ class ManualEmbeddedMongoDbIntegrationTest { @BeforeEach void setup() throws Exception { String ip = "localhost"; - int port = 27017; + int randomPort = SocketUtils.findAvailableTcpPort(); IMongodConfig mongodConfig = new MongodConfigBuilder().version(Version.Main.PRODUCTION) - .net(new Net(ip, port, Network.localhostIsIPv6())) + .net(new Net(ip, randomPort, Network.localhostIsIPv6())) .build(); MongodStarter starter = MongodStarter.getDefaultInstance(); mongodExecutable = starter.prepare(mongodConfig); mongodExecutable.start(); - mongoTemplate = new MongoTemplate(new MongoClient(ip, port), "test"); + mongoTemplate = new MongoTemplate(new MongoClient(ip, randomPort), "test"); } @DisplayName("Given object When save object using MongoDB template Then object can be found") diff --git a/spring-boot/src/test/resources/application.properties b/spring-boot/src/test/resources/application.properties index 85e4e6e66f..9ad65e1815 100644 --- a/spring-boot/src/test/resources/application.properties +++ b/spring-boot/src/test/resources/application.properties @@ -2,7 +2,6 @@ spring.mail.host=localhost spring.mail.port=8025 spring.mail.properties.mail.smtp.auth=false -security.basic.enabled=false # spring.datasource.x spring.datasource.driver-class-name=org.h2.Driver @@ -11,9 +10,10 @@ spring.datasource.username=sa spring.datasource.password=sa # hibernate.X -hibernate.dialect=org.hibernate.dialect.H2Dialect -hibernate.show_sql=true -hibernate.hbm2ddl.auto=create-drop -hibernate.cache.use_second_level_cache=true -hibernate.cache.use_query_cache=true -hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory \ No newline at end of file +spring.jpa.hibernate.dialect=org.hibernate.dialect.H2Dialect +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.hibernate.show_sql=true +spring.jpa.hibernate.hbm2ddl.auto=create-drop +spring.jpa.hibernate.cache.use_second_level_cache=true +spring.jpa.hibernate.cache.use_query_cache=true +spring.jpa.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory diff --git a/spring-boot/src/test/resources/exception.properties b/spring-boot/src/test/resources/exception.properties index c55e415a3a..e82a482968 100644 --- a/spring-boot/src/test/resources/exception.properties +++ b/spring-boot/src/test/resources/exception.properties @@ -1,6 +1,6 @@ # Security -security.user.name=admin -security.user.password=password +spring.security.user.name=admin +spring.security.user.password=password spring.dao.exceptiontranslation.enabled=false spring.profiles.active=exception \ No newline at end of file From 7d5d9b3eb7aadd78768770bb131f397b3e539fbe Mon Sep 17 00:00:00 2001 From: Loredana Date: Fri, 16 Nov 2018 18:40:42 +0200 Subject: [PATCH 392/546] update eureka code to boot 2 --- spring-cloud/pom.xml | 4 ++-- spring-cloud/spring-cloud-eureka/pom.xml | 3 ++- .../spring-cloud-eureka-client/pom.xml | 18 +++--------------- .../eureka/client/EurekaClientApplication.java | 3 --- .../spring-cloud-eureka-feign-client/pom.xml | 14 +++++++------- .../feign/client/FeignClientApplication.java | 4 +--- .../cloud/feign/client/GreetingClient.java | 8 +++++--- .../spring-cloud-eureka-server/pom.xml | 2 +- .../eureka-client/pom.xml | 2 +- .../src/main/resources/application.yml | 2 +- .../eureka-server/pom.xml | 2 +- .../pom.xml | 4 +++- .../zuul-server/pom.xml | 8 ++------ .../src/main/resources/application.properties | 5 +---- 14 files changed, 30 insertions(+), 49 deletions(-) diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index 2fd15202e6..28db4a7a3d 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -57,8 +57,8 @@ Brixton.SR7 1.2.2.RELEASE 1.2.2.RELEASE - 1.2.3.RELEASE - 1.2.3.RELEASE + 2.0.2.RELEASE + 1.4.6.RELEASE 1.2.3.RELEASE 1.3.0.RELEASE 1.4.2.RELEASE diff --git a/spring-cloud/spring-cloud-eureka/pom.xml b/spring-cloud/spring-cloud-eureka/pom.xml index 37571bc29a..7f7e2650d5 100644 --- a/spring-cloud/spring-cloud-eureka/pom.xml +++ b/spring-cloud/spring-cloud-eureka/pom.xml @@ -23,7 +23,8 @@ - 1.4.2.RELEASE + 2.0.1.RELEASE + Finchley.SR2 diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml index 8bc51adcab..0bf9547aff 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml @@ -20,32 +20,20 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client ${spring-cloud-starter-eureka.version} org.springframework.boot spring-boot-starter-web - ${spring-boot-starter-web.version} + ${spring-boot.version} org.springframework.boot spring-boot-starter-test - 1.5.10.RELEASE + ${spring-boot.version} test - - org.springframework.boot - spring-boot-test - 1.5.10.RELEASE - test - - - org.springframework - spring-test - 4.0.5.RELEASE - test - diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/src/main/java/com/baeldung/spring/cloud/eureka/client/EurekaClientApplication.java b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/src/main/java/com/baeldung/spring/cloud/eureka/client/EurekaClientApplication.java index 48099eeaa2..82b5f6acb1 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/src/main/java/com/baeldung/spring/cloud/eureka/client/EurekaClientApplication.java +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/src/main/java/com/baeldung/spring/cloud/eureka/client/EurekaClientApplication.java @@ -5,13 +5,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.context.annotation.Lazy; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication -@EnableEurekaClient @RestController public class EurekaClientApplication implements GreetingController { @Autowired diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml index 4552c458ec..d572b10d40 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml @@ -16,25 +16,25 @@ - - com.baeldung.spring.cloud - spring-cloud-eureka-client - ${spring-cloud-eureka-client.version} - org.springframework.cloud spring-cloud-starter-feign ${spring-cloud-starter-feign.version} + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + ${spring-cloud-starter-eureka.version} + org.springframework.boot spring-boot-starter-web - ${spring-boot-starter-web.version} + ${spring-boot.version} org.springframework.boot spring-boot-starter-thymeleaf - ${spring-boot-starter-web.version} + ${spring-boot.version} diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/FeignClientApplication.java b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/FeignClientApplication.java index 7beb51d1ac..b8a6c8232d 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/FeignClientApplication.java +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/FeignClientApplication.java @@ -3,14 +3,12 @@ package com.baeldung.spring.cloud.feign.client; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.EnableEurekaClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; @SpringBootApplication -@EnableEurekaClient @EnableFeignClients @Controller public class FeignClientApplication { diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/GreetingClient.java b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/GreetingClient.java index 6bd444b347..a9977d86d6 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/GreetingClient.java +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/src/main/java/com/baeldung/spring/cloud/feign/client/GreetingClient.java @@ -1,8 +1,10 @@ package com.baeldung.spring.cloud.feign.client; -import com.baeldung.spring.cloud.eureka.client.GreetingController; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestMapping; @FeignClient("spring-cloud-eureka-client") -public interface GreetingClient extends GreetingController { +public interface GreetingClient { + @RequestMapping("/greeting") + String greeting(); } diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml index 8082b30c33..da2c50d3c7 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml @@ -18,7 +18,7 @@ org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server ${spring-cloud-starter-eureka.version} diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml index 9c27affb8b..6a5b7ddb55 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml @@ -17,7 +17,7 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client ${spring-cloud-starter-eureka.version} diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml index 9fa929e16b..903e34ce81 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml @@ -3,7 +3,7 @@ spring: name: spring-cloud-eureka-client server: - port: 8081 + port: 8082 eureka: client: diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml index d694c9058b..e3c5109a26 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml @@ -17,7 +17,7 @@ org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server ${spring-cloud-starter-eureka.version} diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml index f4166c7d34..4d3687134f 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml @@ -24,9 +24,11 @@
- 1.4.2.RELEASE + 2.0.1.RELEASE 1.10 1.2.10 + 2.0.1.RELEASE + Finchley.SR2 diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml index 103b8334d3..e64ceb501e 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml @@ -16,11 +16,11 @@ org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client commons-configuration @@ -32,10 +32,6 @@ rxjava ${rxjava.version} - - org.springframework.boot - spring-boot-starter-security - diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/src/main/resources/application.properties b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/src/main/resources/application.properties index cb1dca78c2..42b4f5eee4 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/src/main/resources/application.properties +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/src/main/resources/application.properties @@ -3,7 +3,4 @@ spring.application.name=zuul-server eureka.instance.preferIpAddress=true eureka.client.registerWithEureka=true eureka.client.fetchRegistry=true -eureka.serviceurl.defaultzone=http://localhost:8761/eureka/ -management.security.enabled=false -security.basic.enabled=false -hystrix.command.default.execution.timeout.enabled=false +eureka.client.serviceUrl.defaultZone=${EUREKA_URI:http://localhost:8761/eureka} \ No newline at end of file From 874a7ca051fedcaf4a0cb276eec510490e3d6bcd Mon Sep 17 00:00:00 2001 From: Loredana Date: Fri, 16 Nov 2018 18:58:12 +0200 Subject: [PATCH 393/546] fix port --- .../eureka-client/src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml index 903e34ce81..9fa929e16b 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/src/main/resources/application.yml @@ -3,7 +3,7 @@ spring: name: spring-cloud-eureka-client server: - port: 8082 + port: 8081 eureka: client: From ac570c2bcc442daa8f7ba26eb47d559cfda3ad36 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 16 Nov 2018 23:16:39 +0530 Subject: [PATCH 394/546] Updating the url of openliberty jar --- java-ee-8-security-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-ee-8-security-api/pom.xml b/java-ee-8-security-api/pom.xml index 3d235e10a8..7546839492 100644 --- a/java-ee-8-security-api/pom.xml +++ b/java-ee-8-security-api/pom.xml @@ -41,7 +41,7 @@ - https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/2018-05-25_1422/openliberty-all-20180525-1300.zip + https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/2018-09-05_2337/openliberty-18.0.0.3.zip true From b92af1b149d3e2ba50f7ee455883408b3c1bcb98 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sat, 17 Nov 2018 01:11:26 +0200 Subject: [PATCH 395/546] minor fix --- spring-mvc-simple/pom.xml | 4 ---- .../configuration/ApplicationConfiguration.java | 13 +++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/spring-mvc-simple/pom.xml b/spring-mvc-simple/pom.xml index bd63b5ed1c..e4e30183eb 100644 --- a/spring-mvc-simple/pom.xml +++ b/spring-mvc-simple/pom.xml @@ -20,10 +20,6 @@ spring-oxm ${spring-oxm.version} - - org.springframework - spring-context-support - com.sun.mail javax.mail diff --git a/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/ApplicationConfiguration.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/ApplicationConfiguration.java index 284be6c212..941a984684 100644 --- a/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/ApplicationConfiguration.java +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/ApplicationConfiguration.java @@ -1,7 +1,9 @@ package com.baeldung.spring.configuration; -import com.baeldung.spring.controller.rss.ArticleRssFeedViewResolver; -import com.baeldung.spring.controller.rss.JsonChannelHttpMessageConverter; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -21,13 +23,12 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.view.ContentNegotiatingViewResolver; import org.springframework.web.servlet.view.InternalResourceViewResolver; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; +import com.baeldung.spring.controller.rss.ArticleRssFeedViewResolver; +import com.baeldung.spring.controller.rss.JsonChannelHttpMessageConverter; @Configuration @EnableWebMvc -@ComponentScan(basePackages = { "com.baeldung.springmvcforms", "com.baeldung.spring.controller", "com.baeldung.spring.validator", "com.baeldung.spring.mail" }) +@ComponentScan(basePackages = { "com.baeldung.springmvcforms", "com.baeldung.spring.controller", "com.baeldung.spring.validator", "com.baeldung.spring.mail", "com.baeldung.spring.service" }) public class ApplicationConfiguration implements WebMvcConfigurer { @Override From 16da0e5a0b1ef997087025c3f121722e1fbffc22 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sat, 17 Nov 2018 01:11:51 +0200 Subject: [PATCH 396/546] minor cleanup --- .../com/baeldung/spring/configuration/PushConfiguration.java | 3 ++- .../{controller/push => push/controller}/PushController.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename spring-mvc-simple/src/main/java/com/baeldung/spring/{controller/push => push/controller}/PushController.java (92%) diff --git a/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/PushConfiguration.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/PushConfiguration.java index 3072501cfa..3aba7e9d89 100644 --- a/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/PushConfiguration.java +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/configuration/PushConfiguration.java @@ -8,9 +8,10 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.view.InternalResourceViewResolver; +// needs HTTP 2 https://github.com/spring-projects/spring-framework/wiki/HTTP-2-support @Configuration @EnableWebMvc -@ComponentScan(basePackages = "com.baeldung.spring.controller.push") +@ComponentScan(basePackages = "com.baeldung.spring.push.controller") public class PushConfiguration implements WebMvcConfigurer { @Bean diff --git a/spring-mvc-simple/src/main/java/com/baeldung/spring/controller/push/PushController.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/push/controller/PushController.java similarity index 92% rename from spring-mvc-simple/src/main/java/com/baeldung/spring/controller/push/PushController.java rename to spring-mvc-simple/src/main/java/com/baeldung/spring/push/controller/PushController.java index 88448d4885..e812e5df90 100644 --- a/spring-mvc-simple/src/main/java/com/baeldung/spring/controller/push/PushController.java +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/push/controller/PushController.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.controller.push; +package com.baeldung.spring.push.controller; import javax.servlet.http.PushBuilder; From d14662a9008a51f832651e0c410d6570b5433664 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sat, 17 Nov 2018 01:16:14 +0200 Subject: [PATCH 397/546] move RequestParam --- .../com/baeldung/spring/controller}/RequestParamController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {spring-boot-mvc/src/main/java/com/baeldung/springbootmvc => spring-mvc-simple/src/main/java/com/baeldung/spring/controller}/RequestParamController.java (98%) diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java b/spring-mvc-simple/src/main/java/com/baeldung/spring/controller/RequestParamController.java similarity index 98% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java rename to spring-mvc-simple/src/main/java/com/baeldung/spring/controller/RequestParamController.java index d35f837c26..a9846f1ba9 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/RequestParamController.java +++ b/spring-mvc-simple/src/main/java/com/baeldung/spring/controller/RequestParamController.java @@ -1,4 +1,4 @@ -package com.baeldung.springbootmvc; +package com.baeldung.spring.controller; import java.util.List; import java.util.Map; From de37cc8af1b08a62ac6936d1d4745c09d133e2d4 Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 17 Nov 2018 01:14:10 -0200 Subject: [PATCH 398/546] Fixed LiveTests for migration of spring-boot module to Spring Boot 2 --- .../baeldung/kong/KongAdminAPILiveTest.java | 14 +++++--- .../kong/KongLoadBalanceLiveTest.java | 32 +++++++++++-------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java b/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java index 5cf19dd1db..92d2286518 100644 --- a/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java +++ b/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java @@ -55,7 +55,7 @@ public class KongAdminAPILiveTest { public void givenKongAdminAPI_whenAddAPI_thenAPIAccessibleViaKong() throws Exception { restTemplate.delete("http://localhost:8001/apis/stock-api"); - APIObject stockAPI = new APIObject("stock-api", "stock.api", "http://localhost:8080", "/"); + APIObject stockAPI = new APIObject("stock-api", "stock.api", "http://localhost:9090", "/"); HttpEntity apiEntity = new HttpEntity<>(stockAPI); ResponseEntity addAPIResp = restTemplate.postForEntity("http://localhost:8001/apis", apiEntity, String.class); @@ -69,7 +69,7 @@ public class KongAdminAPILiveTest { HttpHeaders headers = new HttpHeaders(); headers.set("Host", "stock.api"); - RequestEntity requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/stock/btc")); + RequestEntity requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/springbootapp/stock/btc")); ResponseEntity stockPriceResp = restTemplate.exchange(requestEntity, String.class); assertEquals("10000", stockPriceResp.getBody()); @@ -126,22 +126,26 @@ public class KongAdminAPILiveTest { givenKongAdminAPI_whenAddAPIConsumer_thenAdded(); } + PluginObject authPlugin = new PluginObject("key-auth"); + ResponseEntity enableAuthResp = restTemplate.postForEntity("http://localhost:8001/apis/stock-api/plugins", new HttpEntity<>(authPlugin), String.class); + assertTrue(HttpStatus.CREATED == enableAuthResp.getStatusCode() || HttpStatus.CONFLICT == enableAuthResp.getStatusCode()); + final String consumerKey = "eugenp.pass"; KeyAuthObject keyAuth = new KeyAuthObject(consumerKey); ResponseEntity keyAuthResp = restTemplate.postForEntity("http://localhost:8001/consumers/eugenp/key-auth", new HttpEntity<>(keyAuth), String.class); - + assertTrue(HttpStatus.CREATED == keyAuthResp.getStatusCode() || HttpStatus.CONFLICT == keyAuthResp.getStatusCode()); HttpHeaders headers = new HttpHeaders(); headers.set("Host", "stock.api"); headers.set("apikey", consumerKey); - RequestEntity requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/stock/btc")); + RequestEntity requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/springbootapp/stock/btc")); ResponseEntity stockPriceResp = restTemplate.exchange(requestEntity, String.class); assertEquals("10000", stockPriceResp.getBody()); headers.set("apikey", "wrongpass"); - requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/stock/btc")); + requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/springbootapp/stock/btc")); stockPriceResp = restTemplate.exchange(requestEntity, String.class); assertEquals(HttpStatus.FORBIDDEN, stockPriceResp.getStatusCode()); } diff --git a/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java b/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java index abc7151720..7cf67453a6 100644 --- a/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java +++ b/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java @@ -1,28 +1,34 @@ package com.baeldung.kong; -import com.baeldung.kong.domain.APIObject; -import com.baeldung.kong.domain.TargetObject; -import com.baeldung.kong.domain.UpstreamObject; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT; + +import java.net.URI; + import org.junit.Before; 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.*; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.RequestEntity; +import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; -import java.net.URI; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT; +import com.baeldung.kong.domain.APIObject; +import com.baeldung.kong.domain.TargetObject; +import com.baeldung.kong.domain.UpstreamObject; /** * @author aiet */ @RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = DEFINED_PORT, classes = StockApp.class) +@SpringBootTest(webEnvironment = DEFINED_PORT, classes = StockApp.class, properties = "server.servlet.contextPath=/springbootapp") public class KongLoadBalanceLiveTest { @Before @@ -55,13 +61,13 @@ public class KongLoadBalanceLiveTest { HttpHeaders headers = new HttpHeaders(); headers.set("Host", "balanced.stock.api"); for (int i = 0; i < 1000; i++) { - RequestEntity requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/stock/btc")); + RequestEntity requestEntity = new RequestEntity<>(headers, HttpMethod.GET, new URI("http://localhost:8000/springbootapp/stock/btc")); ResponseEntity stockPriceResp = restTemplate.exchange(requestEntity, String.class); assertEquals("10000", stockPriceResp.getBody()); } - int releaseCount = restTemplate.getForObject("http://localhost:9090/stock/reqcount", Integer.class); - int testCount = restTemplate.getForObject("http://localhost:8080/stock/reqcount", Integer.class); + int releaseCount = restTemplate.getForObject("http://localhost:9090/springbootapp/stock/reqcount", Integer.class); + int testCount = restTemplate.getForObject("http://localhost:8080/springbootapp/stock/reqcount", Integer.class); assertTrue(Math.round(releaseCount * 1.0 / testCount) == 4); } From e4c7f7e72e650c7775f46b330b0db420d172b06c Mon Sep 17 00:00:00 2001 From: geroza Date: Sat, 17 Nov 2018 01:55:14 -0200 Subject: [PATCH 399/546] minor estetic changes --- spring-boot/pom.xml | 2 -- .../com/baeldung/dynamicvalidation/DynamicValidationApp.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index dbb098ccc2..1f6d39aabe 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -179,7 +179,6 @@ pl.project13.maven git-commit-id-plugin ${git-commit-id-plugin.version} - get-the-git-infos @@ -196,7 +195,6 @@ package - true ${project.build.outputDirectory}/git.properties diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java b/spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java index 78d5365047..6b04380ece 100644 --- a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java +++ b/spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java @@ -11,6 +11,4 @@ public class DynamicValidationApp { public static void main(String[] args) { SpringApplication.run(DynamicValidationApp.class, args); } - - } From 8967501aedf2ac3c887890c95f46804b754b70dd Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 17 Nov 2018 11:26:49 +0200 Subject: [PATCH 400/546] Update README.md --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index 035efc673c..11d9fd2ee0 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -84,3 +84,4 @@ - [Understanding Memory Leaks in Java](https://www.baeldung.com/java-memory-leaks) - [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) +- [Implementing a Binary Tree in Java](https://www.baeldung.com/java-binary-tree) From c7daccbe6ec8b3da5457e5f25f5ea247d843aae8 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 17 Nov 2018 12:59:25 +0200 Subject: [PATCH 401/546] temporarily removing modules with external repos --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index 109a49d985..5ebf7ba4f3 100644 --- a/pom.xml +++ b/pom.xml @@ -376,8 +376,6 @@ ethereum feign flips - testing-modules/gatling - geotools testing-modules/groovy-spock google-cloud google-web-toolkit From 331988e40785223d66a2ee15eeec5d564474dac9 Mon Sep 17 00:00:00 2001 From: Akash Pandey Date: Sat, 17 Nov 2018 21:26:22 +0530 Subject: [PATCH 402/546] Bael-2227 1 (#5707) * BAEL-2159: Mini Article on "Separate double into integer and decimal parts" * BAEL-2227: Refactor: Replace designation with title. --- .../hibernate/entities/DeptEmployee.java | 14 +++++++------- .../service/EmployeeSearchService.java | 4 ++-- .../service/EmployeeSearchServiceImpl.java | 14 +++++++------- .../EmployeeSearchServiceIntegrationTest.java | 17 ++++++++--------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java index 27fff147b6..8b5d9c41f3 100644 --- a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java @@ -10,7 +10,7 @@ public class DeptEmployee { private String employeeNumber; - private String designation; + private String title; private String name; @@ -23,11 +23,11 @@ public class DeptEmployee { this.department = department; } - public DeptEmployee(String name, String employeeNumber, String designation, Department department) { + public DeptEmployee(String name, String employeeNumber, String title, Department department) { super(); this.name = name; this.employeeNumber = employeeNumber; - this.designation = designation; + this.title = title; this.department = department; } @@ -63,11 +63,11 @@ public class DeptEmployee { this.department = department; } - public String getDesignation() { - return designation; + public String getTitle() { + return title; } - public void setDesignation(String designation) { - this.designation = designation; + public void setTitle(String title) { + this.title = title; } } diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java index 85cdffd54d..b7d1a537f0 100644 --- a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchService.java @@ -6,9 +6,9 @@ import com.baeldung.hibernate.entities.DeptEmployee; public interface EmployeeSearchService { - List filterbyDesignationUsingCriteriaBuilder(List designaitons); + List filterbyTitleUsingCriteriaBuilder(List titles); - List filterbyDesignationUsingExpression(List aurhors); + List filterbyTitleUsingExpression(List titles); List searchByDepartmentQuery(String query); diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java index a9981b8066..e79168a451 100644 --- a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/jpacriteriabuilder/service/EmployeeSearchServiceImpl.java @@ -25,12 +25,12 @@ public class EmployeeSearchServiceImpl implements EmployeeSearchService { } @Override - public List filterbyDesignationUsingCriteriaBuilder(List designations) { + public List filterbyTitleUsingCriteriaBuilder(List titles) { CriteriaQuery criteriaQuery = createCriteriaQuery(DeptEmployee.class); Root root = criteriaQuery.from(DeptEmployee.class); - In inClause = criteriaBuilder.in(root.get("designation")); - for (String designaiton : designations) { - inClause.value(designaiton); + In inClause = criteriaBuilder.in(root.get("title")); + for (String title : titles) { + inClause.value(title); } criteriaQuery.select(root) .where(inClause); @@ -39,12 +39,12 @@ public class EmployeeSearchServiceImpl implements EmployeeSearchService { } @Override - public List filterbyDesignationUsingExpression(List designations) { + public List filterbyTitleUsingExpression(List titles) { CriteriaQuery criteriaQuery = createCriteriaQuery(DeptEmployee.class); Root root = criteriaQuery.from(DeptEmployee.class); criteriaQuery.select(root) - .where(root.get("designation") - .in(designations)); + .where(root.get("title") + .in(titles)); TypedQuery query = entityManager.createQuery(criteriaQuery); return query.getResultList(); } diff --git a/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java index c7a1bc7b2a..2b12734a10 100644 --- a/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java +++ b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/jpacriteriabuilder/EmployeeSearchServiceIntegrationTest.java @@ -81,42 +81,41 @@ public class EmployeeSearchServiceIntegrationTest { @Test public final void givenCriteriaQuery_whenSearchedUsingCriteriaBuilderWithListofAuthors_thenResultIsFilteredByAuthorNames() { - List designations = new ArrayList() { + List titles = new ArrayList() { { add("Manager"); add("Senior Manager"); add("Director"); } }; - List result = searchService.filterbyDesignationUsingCriteriaBuilder(designations); + List result = searchService.filterbyTitleUsingCriteriaBuilder(titles); assertEquals("Number of Employees does not match with expected.", 6, result.size()); assertThat(result.stream() - .map(DeptEmployee::getDesignation) + .map(DeptEmployee::getTitle) .distinct() - .collect(Collectors.toList()), containsInAnyOrder(designations.toArray())); + .collect(Collectors.toList()), containsInAnyOrder(titles.toArray())); } @Test public final void givenCriteriaQuery_whenSearchedUsingExpressionWithListofAuthors_thenResultIsFilteredByAuthorNames() { - List designations = new ArrayList() { + List titles = new ArrayList() { { add("Manager"); add("Senior Manager"); add("Director"); } }; - List result = searchService.filterbyDesignationUsingExpression(designations); + List result = searchService.filterbyTitleUsingExpression(titles); assertEquals("Number of Employees does not match with expected.", 6, result.size()); assertThat(result.stream() - .map(DeptEmployee::getDesignation) + .map(DeptEmployee::getTitle) .distinct() - .collect(Collectors.toList()), containsInAnyOrder(designations.toArray())); + .collect(Collectors.toList()), containsInAnyOrder(titles.toArray())); } @Test public final void givenCriteriaQuery_whenSearchedDepartmentLike_thenResultIsFilteredByDepartment() { List result = searchService.searchByDepartmentQuery("Sales"); assertEquals("Number of Employees does not match with expected.", 7, result.size()); - // assertThat(result.stream().map(DeptEmployee::getDesignation).distinct().collect(Collectors.toList()), containsInAnyOrder(designations.toArray())); } } From d2d77c56f83868222a432a3c58a6c148efa42fea Mon Sep 17 00:00:00 2001 From: "nnhai1991@gmail.com" Date: Sun, 18 Nov 2018 00:16:35 +0800 Subject: [PATCH 403/546] BAEL-1913 fix possible index out of bound --- .../src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt index 74085367e8..62e8dfe720 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt @@ -52,7 +52,7 @@ class RandomStringUnitTest { random.nextBytes(bytes) var randomString = (0..bytes.size - 1).map { i -> - charPool.get((bytes[i] and 0xFF.toByte() and charPool.size.toByte()).toInt()) + charPool.get((bytes[i] and 0xFF.toByte() and (charPool.size-1).toByte()).toInt()) }.joinToString("") assert(randomString.matches(Regex(ALPHANUMERIC_REGEX))) From 3defeb3e9653555cef7c7b689d7ad8771e414ae5 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Sat, 17 Nov 2018 11:20:06 -0600 Subject: [PATCH 404/546] Moved AddingNewLineToString from core-java to java-strings --- .../src/main/java/com/baeldung/string/AddingNewLineToString.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {core-java => java-strings}/src/main/java/com/baeldung/string/AddingNewLineToString.java (100%) diff --git a/core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java b/java-strings/src/main/java/com/baeldung/string/AddingNewLineToString.java similarity index 100% rename from core-java/src/main/java/com/baeldung/string/AddingNewLineToString.java rename to java-strings/src/main/java/com/baeldung/string/AddingNewLineToString.java From 301ffdbc752c79c1f6e622dc76d21996dd412aa0 Mon Sep 17 00:00:00 2001 From: chrisoberle Date: Sat, 17 Nov 2018 13:24:21 -0500 Subject: [PATCH 405/546] BAEL-2174: proxies in core java (#5628) --- .../proxies/CommandLineProxyDemo.java | 17 ++++++++++ .../networking/proxies/DirectProxyDemo.java | 20 ++++++++++++ .../networking/proxies/SocksProxyDemo.java | 32 +++++++++++++++++++ .../proxies/SystemPropertyProxyDemo.java | 23 +++++++++++++ .../proxies/UrlConnectionUtils.java | 21 ++++++++++++ .../networking/proxies/WebProxyDemo.java | 23 +++++++++++++ 6 files changed, 136 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java create mode 100644 core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java create mode 100644 core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java create mode 100644 core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java create mode 100644 core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java create mode 100644 core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java b/core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java new file mode 100644 index 0000000000..bbc8a81c98 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java @@ -0,0 +1,17 @@ +package com.baeldung.networking.proxies; + +import java.net.URL; +import java.net.URLConnection; + +public class CommandLineProxyDemo { + + public static final String RESOURCE_URL = "http://www.google.com"; + + public static void main(String[] args) throws Exception { + + URL url = new URL(RESOURCE_URL); + URLConnection con = url.openConnection(); + System.out.println(UrlConnectionUtils.contentAsString(con)); + } + +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java b/core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java new file mode 100644 index 0000000000..07a7880886 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java @@ -0,0 +1,20 @@ +package com.baeldung.networking.proxies; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.Proxy; +import java.net.URL; + +public class DirectProxyDemo { + + private static final String URL_STRING = "http://www.google.com"; + + public static void main(String... args) throws IOException { + + URL weburl = new URL(URL_STRING); + HttpURLConnection directConnection + = (HttpURLConnection) weburl.openConnection(Proxy.NO_PROXY); + System.out.println(UrlConnectionUtils.contentAsString(directConnection)); + } + +} diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java b/core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java new file mode 100644 index 0000000000..e7ac3c0264 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java @@ -0,0 +1,32 @@ +package com.baeldung.networking.proxies; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.Socket; +import java.net.URL; + +public class SocksProxyDemo { + + private static final String URL_STRING = "http://www.google.com"; + private static final String SOCKET_SERVER_HOST = "someserver.baeldung.com"; + private static final int SOCKET_SERVER_PORT = 1111; + + public static void main(String... args) throws IOException { + + URL weburl = new URL(URL_STRING); + Proxy socksProxy + = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 1080)); + HttpURLConnection socksConnection + = (HttpURLConnection) weburl.openConnection(socksProxy); + System.out.println(UrlConnectionUtils.contentAsString(socksConnection)); + + Socket proxySocket = new Socket(socksProxy); + InetSocketAddress socketHost + = new InetSocketAddress(SOCKET_SERVER_HOST, SOCKET_SERVER_PORT); + proxySocket.connect(socketHost); + // do stuff with the socket + } + +} diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java b/core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java new file mode 100644 index 0000000000..1f589eac58 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java @@ -0,0 +1,23 @@ +package com.baeldung.networking.proxies; + +import java.net.URL; +import java.net.URLConnection; + +public class SystemPropertyProxyDemo { + + public static final String RESOURCE_URL = "http://www.google.com"; + + public static void main(String[] args) throws Exception { + + System.setProperty("http.proxyHost", "127.0.0.1"); + System.setProperty("http.proxyPort", "3128"); + + URL url = new URL(RESOURCE_URL); + URLConnection con = url.openConnection(); + System.out.println(UrlConnectionUtils.contentAsString(con)); + + System.setProperty("http.proxyHost", null); + // proxy will no longer be used for http connections + } + +} diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java b/core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java new file mode 100644 index 0000000000..aa12824a90 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java @@ -0,0 +1,21 @@ +package com.baeldung.networking.proxies; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URLConnection; + +class UrlConnectionUtils { + + public static String contentAsString(URLConnection con) throws IOException { + StringBuilder builder = new StringBuilder(); + try (BufferedReader reader + = new BufferedReader(new InputStreamReader(con.getInputStream()))){ + while (reader.ready()) { + builder.append(reader.readLine()); + } + } + return builder.toString(); + } + +} diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java b/core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java new file mode 100644 index 0000000000..41caaf3439 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java @@ -0,0 +1,23 @@ +package com.baeldung.networking.proxies; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.URL; + +public class WebProxyDemo { + + private static final String URL_STRING = "http://www.google.com"; + + public static void main(String... args) throws IOException { + + URL weburl = new URL(URL_STRING); + Proxy webProxy + = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 3128)); + HttpURLConnection webProxyConnection + = (HttpURLConnection) weburl.openConnection(webProxy); + System.out.println(UrlConnectionUtils.contentAsString(webProxyConnection)); + } + +} From 0cd4d76c15d35dfb2bfc6eaf05db86817cf056fd Mon Sep 17 00:00:00 2001 From: codehunter34 <31874661+codehunter34@users.noreply.github.com> Date: Sat, 17 Nov 2018 14:52:12 -0500 Subject: [PATCH 406/546] BAEL-2293: Guide to ReflectionTestUtils and uses in Unit Testing (#5681) * BAEL-2293: Guide to ReflectionTestUtils and uses in Unit Testing * BAEL-2293: Guide to ReflectionTestUtils and uses in Unit Testing * BAEL-2293: Guide to ReflectionTestUtils and uses in Unit Testing * Update ReflectionTestUtilsUnitTest.java --- .../repository/Employee.java | 23 ++++++++++ .../repository/EmployeeService.java | 14 ++++++ .../repository/HRService.java | 11 +++++ .../ReflectionTestUtilsUnitTest.java | 46 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/Employee.java create mode 100644 testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/EmployeeService.java create mode 100644 testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/HRService.java create mode 100644 testing-modules/spring-testing/src/test/java/org/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/Employee.java b/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/Employee.java new file mode 100644 index 0000000000..0677b05d66 --- /dev/null +++ b/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/Employee.java @@ -0,0 +1,23 @@ +package org.baeldung.reflectiontestutils.repository; + +public class Employee { + private Integer id; + private String name; + + public Integer getId() { + return id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + private String employeeToString() { + return "id: " + getId() + "; name: " + getName(); + } + +} diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/EmployeeService.java b/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/EmployeeService.java new file mode 100644 index 0000000000..699ec3236c --- /dev/null +++ b/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/EmployeeService.java @@ -0,0 +1,14 @@ +package org.baeldung.reflectiontestutils.repository; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class EmployeeService { + @Autowired + private HRService hrService; + + public String findEmployeeStatus(Integer employeeId) { + return "Employee " + employeeId + " status: " + hrService.getEmployeeStatus(employeeId); + } +} diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/HRService.java b/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/HRService.java new file mode 100644 index 0000000000..e693aca764 --- /dev/null +++ b/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/HRService.java @@ -0,0 +1,11 @@ +package org.baeldung.reflectiontestutils.repository; + +import org.springframework.stereotype.Component; + +@Component +public class HRService { + + public String getEmployeeStatus(Integer employeeId) { + return "Inactive"; + } +} diff --git a/testing-modules/spring-testing/src/test/java/org/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java b/testing-modules/spring-testing/src/test/java/org/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java new file mode 100644 index 0000000000..64c7ca19ef --- /dev/null +++ b/testing-modules/spring-testing/src/test/java/org/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java @@ -0,0 +1,46 @@ +package org.baeldung.reflectiontestutils; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; + +import org.baeldung.reflectiontestutils.repository.Employee; +import org.baeldung.reflectiontestutils.repository.EmployeeService; +import org.baeldung.reflectiontestutils.repository.HRService; +import org.junit.Test; +import org.springframework.test.util.ReflectionTestUtils; + +import static org.mockito.Mockito.when; + +public class ReflectionTestUtilsUnitTest { + + @Test + public void whenNonPublicField_thenReflectionTestUtilsSetField() { + Employee employee = new Employee(); + ReflectionTestUtils.setField(employee, "id", 1); + assertTrue(employee.getId().equals(1)); + + } + + @Test + public void whenNonPublicMethod_thenReflectionTestUtilsInvokeMethod() { + Employee employee = new Employee(); + ReflectionTestUtils.setField(employee, "id", 1); + employee.setName("Smith, John"); + assertTrue(ReflectionTestUtils.invokeMethod(employee, "employeeToString").equals("id: 1; name: Smith, John")); + } + + @Test + public void whenInjectingMockOfDependency_thenReflectionTestUtilsSetField() { + Employee employee = new Employee(); + ReflectionTestUtils.setField(employee, "id", 1); + employee.setName("Smith, John"); + + HRService hrService = mock(HRService.class); + when(hrService.getEmployeeStatus(employee.getId())).thenReturn("Active"); + EmployeeService employeeService = new EmployeeService(); + + // Inject mock into the private field + ReflectionTestUtils.setField(employeeService, "hrService", hrService); + assertEquals("Employee " + employee.getId() + " status: Active", employeeService.findEmployeeStatus(employee.getId())); + } +} From f9ae5001c1281ea0cd1835a3269fd55770791137 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 17 Nov 2018 22:12:10 +0200 Subject: [PATCH 407/546] Update README.MD --- spring-boot/README.MD | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot/README.MD b/spring-boot/README.MD index f09ab27fb5..016d2841d7 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -34,4 +34,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Introduction to Chaos Monkey](https://www.baeldung.com/spring-boot-chaos-monkey) - [Spring Component Scanning](https://www.baeldung.com/spring-component-scanning) - [Load Spring Boot Properties From a JSON File](https://www.baeldung.com/spring-boot-json-properties) -- [Display Auto-Configuration Report in Spring Boot](https://www.baeldung.com/spring-boot-auto-configuration-report) \ No newline at end of file +- [Display Auto-Configuration Report in Spring Boot](https://www.baeldung.com/spring-boot-auto-configuration-report) +- [Injecting Git Information Into Spring](https://www.baeldung.com/spring-git-information) From d10c8d012bfc8f1984a66d8e677f234434a0aea6 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 17 Nov 2018 22:12:53 +0200 Subject: [PATCH 408/546] Update demo.properties --- spring-boot/src/main/resources/demo.properties | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spring-boot/src/main/resources/demo.properties b/spring-boot/src/main/resources/demo.properties index 649b64f59b..6b4cbeb7a0 100644 --- a/spring-boot/src/main/resources/demo.properties +++ b/spring-boot/src/main/resources/demo.properties @@ -1,6 +1,2 @@ spring.output.ansi.enabled=never server.port=7070 - -# Security -security.user.name=admin -security.user.password=password \ No newline at end of file From 89fb5f39b8db7460f5716685120dca8efc00fd6e Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 17 Nov 2018 22:13:40 +0200 Subject: [PATCH 409/546] Update exception.properties --- spring-boot/src/test/resources/exception.properties | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spring-boot/src/test/resources/exception.properties b/spring-boot/src/test/resources/exception.properties index e82a482968..2d17b64a25 100644 --- a/spring-boot/src/test/resources/exception.properties +++ b/spring-boot/src/test/resources/exception.properties @@ -1,6 +1,2 @@ -# Security -spring.security.user.name=admin -spring.security.user.password=password - spring.dao.exceptiontranslation.enabled=false -spring.profiles.active=exception \ No newline at end of file +spring.profiles.active=exception From 7baa99bc34483f1d248ae21520590fdd938da9d5 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 18 Nov 2018 18:05:41 +0530 Subject: [PATCH 410/546] [BAEL-10135] - Updated graphql code with latest version --- spring-boot/pom.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index f16460b7c3..ac9873a770 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -70,6 +70,11 @@ graphql-java-tools ${graphql-java-tools.version} + + com.graphql-java + graphiql-spring-boot-starter + ${graphiql-spring-boot-starter.version} + org.springframework.boot @@ -220,8 +225,9 @@ 2.4.1.Final 1.9.0 2.0.0 - 3.6.0 - 3.2.0 + 5.0.2 + 5.0.2 + 5.2.4 18.0 2.2.4 From a98df2add7bb73f10d7a40253c24fe6d5a1ff96d Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 18 Nov 2018 20:09:03 +0530 Subject: [PATCH 411/546] [BAEL-10218] - Updated code to the latest version and modified code --- grpc/pom.xml | 6 +++--- grpc/src/main/java/org/baeldung/grpc/client/GrpcClient.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/grpc/pom.xml b/grpc/pom.xml index 949f26d376..bbdfe9bfb2 100644 --- a/grpc/pom.xml +++ b/grpc/pom.xml @@ -71,9 +71,9 @@ - 1.5.0 - 1.5.0.Final - 0.5.0 + 1.16.1 + 1.6.1 + 0.6.1 diff --git a/grpc/src/main/java/org/baeldung/grpc/client/GrpcClient.java b/grpc/src/main/java/org/baeldung/grpc/client/GrpcClient.java index 1a1809387f..f653e17910 100644 --- a/grpc/src/main/java/org/baeldung/grpc/client/GrpcClient.java +++ b/grpc/src/main/java/org/baeldung/grpc/client/GrpcClient.java @@ -10,7 +10,7 @@ import io.grpc.ManagedChannelBuilder; public class GrpcClient { public static void main(String[] args) throws InterruptedException { ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 8080) - .usePlaintext(true) + .usePlaintext() .build(); HelloServiceGrpc.HelloServiceBlockingStub stub From 9ec41d973b89f1542bf26c1b40c0f2daac0c142f Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 18 Nov 2018 17:12:59 +0200 Subject: [PATCH 412/546] simplify swagger ex, fix start --- .../com/baeldung/swaggerboot/Application.java | 2 -- .../com/baeldung/swaggerboot/Constants.java | 16 ---------- .../configuration/SpringFoxConfig.java | 5 --- .../controller/RegularRestController.java | 14 ++------- .../services/RegularWebService.java | 20 ------------ .../swaggerboot/transfer/CustomResponse.java | 31 ------------------- .../src/main/resources/application.properties | 1 + 7 files changed, 4 insertions(+), 85 deletions(-) delete mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java delete mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java delete mode 100644 spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java index 2161597c4e..14e46b2306 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java @@ -2,10 +2,8 @@ package com.baeldung.swaggerboot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; @SpringBootApplication -@ComponentScan(basePackages = {"com.baeldung"}) public class Application { public static void main(String[] args) { diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java deleted file mode 100644 index 14b4162713..0000000000 --- a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.swaggerboot; - -public class Constants { - - public static final String DEFAULT_GREETING = "Howdy Cosmic Spheroid!"; - public static final String DEFAULT_ERROR = "Fail!"; - - /** - * API Endpoint. - */ - - public static final String REACTIVE_REST_URL = "/reactiverest"; - public static final String FUNCTIONAL_URL = "/functional"; - public static final String REGULAR_REST_URL = "/regularrest"; - -} \ No newline at end of file diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java index babe70580c..3041dfdcc8 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java @@ -1,7 +1,5 @@ package com.baeldung.swaggerboot.configuration; -import com.fasterxml.classmate.TypeResolver; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -21,9 +19,6 @@ import java.util.Collections; @ComponentScan("com.baeldung.swaggerboot.controller") public class SpringFoxConfig { - @Autowired - private TypeResolver typeResolver; - private ApiInfo apiInfo() { return new ApiInfo( "My REST API", diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java index 537e16d146..676937f7d7 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java +++ b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/controller/RegularRestController.java @@ -1,22 +1,14 @@ package com.baeldung.swaggerboot.controller; -import com.baeldung.swaggerboot.services.RegularWebService; -import com.baeldung.swaggerboot.transfer.CustomResponse; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import static com.baeldung.swaggerboot.Constants.REGULAR_REST_URL; - @RestController public class RegularRestController { - @Autowired - RegularWebService regularWebService; - - @GetMapping(REGULAR_REST_URL) - public CustomResponse getSession() { - return regularWebService.example(); + @GetMapping("home") + public String getSession() { + return "Hello"; } } \ No newline at end of file diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java deleted file mode 100644 index d13ed7a6a9..0000000000 --- a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.swaggerboot.services; - -import com.baeldung.swaggerboot.transfer.CustomResponse; -import org.springframework.stereotype.Service; - -import static com.baeldung.swaggerboot.Constants.DEFAULT_ERROR; -import static com.baeldung.swaggerboot.Constants.DEFAULT_GREETING; - -@Service -public class RegularWebService { - - public CustomResponse example() { - try { - return new CustomResponse(0, DEFAULT_GREETING); - } catch (Exception ex) { - return new CustomResponse(0, DEFAULT_ERROR); - } - } - -} \ No newline at end of file diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java b/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java deleted file mode 100644 index d09e9f935e..0000000000 --- a/spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.baeldung.swaggerboot.transfer; - -public class CustomResponse { - - private int id; - private String note; - - public CustomResponse() {} - - public CustomResponse(int id, String note) { - this.id = id; - this.note = note; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getNote() { - return note; - } - - public void setNote(String note) { - this.note = note; - } - -} diff --git a/spring-boot-mvc/src/main/resources/application.properties b/spring-boot-mvc/src/main/resources/application.properties index e69de29bb2..709574239b 100644 --- a/spring-boot-mvc/src/main/resources/application.properties +++ b/spring-boot-mvc/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.main.allow-bean-definition-overriding=true \ No newline at end of file From 86184f827018900a34aae0c666e26a341d47b4dc Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Sun, 18 Nov 2018 12:54:57 -0300 Subject: [PATCH 413/546] BAEL-2312 - Abstract Classes in Java (#5704) * Initial Commit * Fixed project files * Update UppercaseFileReaderUnitTest.java * Update UppercaseFileReaderUnitTest.java * Refactored File Reader SubClasses * Update UppercaseFileReaderUnitTest.java --- .../application/Application.java | 27 +++++++++---------- .../filereaders/BaseFileReader.java | 16 ++++++++--- .../filereaders/LowercaseFileReader.java | 18 +++++-------- .../filereaders/StandardFileReader.java | 19 ------------- .../filereaders/UppercaseFileReader.java | 18 +++++-------- .../StandardFileReaderUnitTest.java | 25 ----------------- .../LowercaseFileReaderUnitTest.java | 15 +++++------ .../UppercaseFileReaderUnitTest.java | 13 ++++----- 8 files changed, 48 insertions(+), 103 deletions(-) delete mode 100644 core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java delete mode 100644 core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java rename core-java/src/test/java/com/baeldung/abstractclasses/{ => test}/LowercaseFileReaderUnitTest.java (63%) rename core-java/src/test/java/com/baeldung/abstractclasses/{ => test}/UppercaseFileReaderUnitTest.java (62%) diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java b/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java index fe30c66484..3180762227 100644 --- a/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java +++ b/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java @@ -2,29 +2,28 @@ package com.baeldung.abstractclasses.application; import com.baeldung.abstractclasses.filereaders.BaseFileReader; import com.baeldung.abstractclasses.filereaders.LowercaseFileReader; -import com.baeldung.abstractclasses.filereaders.StandardFileReader; import com.baeldung.abstractclasses.filereaders.UppercaseFileReader; import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; public class Application { - public static void main(String[] args) throws IOException { - + public static void main(String[] args) throws IOException, URISyntaxException { + Application application = new Application(); - String filePath = application.getFilePathFromResourcesFolder("files/test.txt"); - - BaseFileReader lowercaseFileReader = new LowercaseFileReader(filePath); + Path path = application.getPathFromResourcesFile("files/test.txt"); + BaseFileReader lowercaseFileReader = new LowercaseFileReader(path); lowercaseFileReader.readFile().forEach(line -> System.out.println(line)); + + BaseFileReader uppercaseFileReader = new UppercaseFileReader(path); + uppercaseFileReader.readFile().forEach(line -> System.out.println(line)); - BaseFileReader upperCaseFileReader = new UppercaseFileReader(filePath); - upperCaseFileReader.readFile().forEach(line -> System.out.println(line)); - - BaseFileReader standardFileReader = new StandardFileReader(filePath); - standardFileReader.readFile().forEach(line -> System.out.println(line)); - } - private String getFilePathFromResourcesFolder(String fileName) { - return getClass().getClassLoader().getResource(fileName).getPath().substring(1); + private Path getPathFromResourcesFile(String filePath) throws URISyntaxException { + return Paths.get(getClass().getClassLoader().getResource(filePath).toURI()); + } } diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java index 659913f046..97452a9eca 100644 --- a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java +++ b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java @@ -1,19 +1,27 @@ package com.baeldung.abstractclasses.filereaders; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; +import java.util.stream.Collectors; public abstract class BaseFileReader { - protected String filePath; + protected Path filePath; - protected BaseFileReader(String filePath) { + protected BaseFileReader(Path filePath) { this.filePath = filePath; } - public String getFilePath() { + public Path getFilePath() { return filePath; } - public abstract List readFile() throws IOException; + public List readFile() throws IOException { + return Files.lines(filePath) + .map(this::mapFileLine).collect(Collectors.toList()); + } + + protected abstract String mapFileLine(String line); } diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java index 0bbef45eb8..53820d393c 100644 --- a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java +++ b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java @@ -1,21 +1,15 @@ package com.baeldung.abstractclasses.filereaders; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.stream.Collectors; +import java.nio.file.Path; public class LowercaseFileReader extends BaseFileReader { - public LowercaseFileReader(String filePath) { + public LowercaseFileReader(Path filePath) { super(filePath); } - + @Override - public List readFile() throws IOException { - return Files.lines(Paths.get(filePath)) - .map(String::toLowerCase) - .collect(Collectors.toList()); - } + public String mapFileLine(String line) { + return line.toLowerCase(); + } } diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java deleted file mode 100644 index 0a90d53c38..0000000000 --- a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/StandardFileReader.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.abstractclasses.filereaders; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.stream.Collectors; - -public class StandardFileReader extends BaseFileReader { - - public StandardFileReader(String filePath) { - super(filePath); - } - - @Override - public List readFile() throws IOException { - return Files.lines(Paths.get(filePath)).collect(Collectors.toList()); - } -} diff --git a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java index 4e8f150964..3144a4f27f 100644 --- a/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java +++ b/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java @@ -1,21 +1,15 @@ package com.baeldung.abstractclasses.filereaders; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.stream.Collectors; +import java.nio.file.Path; public class UppercaseFileReader extends BaseFileReader { - - public UppercaseFileReader(String filePath) { + + public UppercaseFileReader(Path filePath) { super(filePath); } - + @Override - public List readFile() throws IOException { - return Files.lines(Paths.get(filePath)) - .map(String::toUpperCase) - .collect(Collectors.toList()); + public String mapFileLine(String line) { + return line.toUpperCase(); } } diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java deleted file mode 100644 index 348b0f0366..0000000000 --- a/core-java/src/test/java/com/baeldung/abstractclasses/StandardFileReaderUnitTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.abstractclasses; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.net.URL; -import java.nio.file.Paths; -import java.util.List; - -import org.junit.Test; - -import com.baeldung.abstractclasses.filereaders.BaseFileReader; -import com.baeldung.abstractclasses.filereaders.StandardFileReader; - -public class StandardFileReaderUnitTest { - - @Test - public void givenStandardFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { - // We'll transform the resource URL path to URI to load the file correctly in Windows - URL url = getClass().getClassLoader().getResource("files/test.txt"); - String filePath = Paths.get(url.toURI()).toString(); - BaseFileReader standardFileReader = new StandardFileReader(filePath); - - assertThat(standardFileReader.readFile()).isInstanceOf(List.class); - } -} diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/test/LowercaseFileReaderUnitTest.java similarity index 63% rename from core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java rename to core-java/src/test/java/com/baeldung/abstractclasses/test/LowercaseFileReaderUnitTest.java index a97a68e0bd..4f0d3a7cd5 100644 --- a/core-java/src/test/java/com/baeldung/abstractclasses/LowercaseFileReaderUnitTest.java +++ b/core-java/src/test/java/com/baeldung/abstractclasses/test/LowercaseFileReaderUnitTest.java @@ -1,23 +1,20 @@ -package com.baeldung.abstractclasses; +package com.baeldung.abstractclasses.test; import com.baeldung.abstractclasses.filereaders.BaseFileReader; import com.baeldung.abstractclasses.filereaders.LowercaseFileReader; - -import java.net.URL; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; public class LowercaseFileReaderUnitTest { - + @Test public void givenLowercaseFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { - // We'll transform the resource URL path to URI to load the file correctly in Windows - URL url = getClass().getClassLoader().getResource("files/test.txt"); - String filePath = Paths.get(url.toURI()).toString(); - BaseFileReader lowercaseFileReader = new LowercaseFileReader(filePath); - + Path path = Paths.get(getClass().getClassLoader().getResource("files/test.txt").toURI()); + BaseFileReader lowercaseFileReader = new LowercaseFileReader(path); + assertThat(lowercaseFileReader.readFile()).isInstanceOf(List.class); } } diff --git a/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java b/core-java/src/test/java/com/baeldung/abstractclasses/test/UppercaseFileReaderUnitTest.java similarity index 62% rename from core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java rename to core-java/src/test/java/com/baeldung/abstractclasses/test/UppercaseFileReaderUnitTest.java index d698cfe038..e11db57000 100644 --- a/core-java/src/test/java/com/baeldung/abstractclasses/UppercaseFileReaderUnitTest.java +++ b/core-java/src/test/java/com/baeldung/abstractclasses/test/UppercaseFileReaderUnitTest.java @@ -1,9 +1,8 @@ -package com.baeldung.abstractclasses; +package com.baeldung.abstractclasses.test; import com.baeldung.abstractclasses.filereaders.BaseFileReader; import com.baeldung.abstractclasses.filereaders.UppercaseFileReader; - -import java.net.URL; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @@ -13,11 +12,9 @@ public class UppercaseFileReaderUnitTest { @Test public void givenUppercaseFileReaderInstance_whenCalledreadFile_thenCorrect() throws Exception { - // We'll transform the resource URL path to URI to load the file correctly in Windows - URL url = getClass().getClassLoader().getResource("files/test.txt"); - String filePath = Paths.get(url.toURI()).toString(); - BaseFileReader uppercaseFileReader = new UppercaseFileReader(filePath); + Path path = Paths.get(getClass().getClassLoader().getResource("files/test.txt").toURI()); + BaseFileReader uppercaseFileReader = new UppercaseFileReader(path); assertThat(uppercaseFileReader.readFile()).isInstanceOf(List.class); - } + } } From 3fa720b91e1ec5a0a3d21408204989a14309098c Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 18 Nov 2018 19:35:28 +0200 Subject: [PATCH 414/546] fix regex matcher unit test --- .../optmization/OptimizedMatcherUnitTest.java | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java b/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java index f21a755b01..2be6b6ad4b 100644 --- a/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java +++ b/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java @@ -1,6 +1,5 @@ package com.baeldung.regexp.optmization; -import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -14,13 +13,15 @@ import static org.junit.Assert.assertTrue; public class OptimizedMatcherUnitTest { - private long time; - private long mstimePreCompiled; - private long mstimeNotPreCompiled; - private String action; private List items; + + private class TimeWrapper { + private long time; + private long mstimePreCompiled; + private long mstimeNotPreCompiled; + } @Before public void setup() { @@ -48,27 +49,27 @@ public class OptimizedMatcherUnitTest { @Test public void givenANotPreCompiledAndAPreCompiledPatternA_whenMatcheItems_thenPreCompiledFasterThanNotPreCompiled() { - - testPatterns("A*"); - assertTrue(mstimePreCompiled < mstimeNotPreCompiled); + TimeWrapper timeObj = new TimeWrapper(); + testPatterns("A*", timeObj); + assertTrue(timeObj.mstimePreCompiled < timeObj.mstimeNotPreCompiled); } @Test public void givenANotPreCompiledAndAPreCompiledPatternABC_whenMatcheItems_thenPreCompiledFasterThanNotPreCompiled() { - - testPatterns("A*B*C*"); - assertTrue(mstimePreCompiled < mstimeNotPreCompiled); + TimeWrapper timeObj = new TimeWrapper(); + testPatterns("A*B*C*", timeObj); + assertTrue(timeObj.mstimePreCompiled < timeObj.mstimeNotPreCompiled); } @Test public void givenANotPreCompiledAndAPreCompiledPatternECWF_whenMatcheItems_thenPreCompiledFasterThanNotPreCompiled() { - - testPatterns("E*C*W*F*"); - assertTrue(mstimePreCompiled < mstimeNotPreCompiled); + TimeWrapper timeObj = new TimeWrapper(); + testPatterns("E*C*W*F*", timeObj); + assertTrue(timeObj.mstimePreCompiled < timeObj.mstimeNotPreCompiled); } - private void testPatterns(String regex) { - time = System.nanoTime(); + private void testPatterns(String regex, TimeWrapper timeObj) { + timeObj.time = System.nanoTime(); int matched = 0; int unmatched = 0; @@ -83,10 +84,10 @@ public class OptimizedMatcherUnitTest { this.action = "uncompiled: regex=" + regex + " matched=" + matched + " unmatched=" + unmatched; - this.mstimeNotPreCompiled = (System.nanoTime() - time) / 1000000; - System.out.println(this.action + ": " + mstimeNotPreCompiled + "ms"); + timeObj.mstimeNotPreCompiled = (System.nanoTime() - timeObj.time) / 1000000; + System.out.println(this.action + ": " + timeObj.mstimeNotPreCompiled + "ms"); - time = System.nanoTime(); + timeObj.time = System.nanoTime(); Matcher matcher = Pattern.compile(regex).matcher(""); matched = 0; @@ -103,7 +104,7 @@ public class OptimizedMatcherUnitTest { this.action = "compiled: regex=" + regex + " matched=" + matched + " unmatched=" + unmatched; - this.mstimePreCompiled = (System.nanoTime() - time) / 1000000; - System.out.println(this.action + ": " + mstimePreCompiled + "ms"); + timeObj.mstimePreCompiled = (System.nanoTime() - timeObj.time) / 1000000; + System.out.println(this.action + ": " + timeObj.mstimePreCompiled + "ms"); } } From ea1b7c45d4db33cb41774239bca534b565176376 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 18 Nov 2018 19:54:11 +0200 Subject: [PATCH 415/546] Update pom.xml --- grpc/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/grpc/pom.xml b/grpc/pom.xml index bbdfe9bfb2..725bec3e70 100644 --- a/grpc/pom.xml +++ b/grpc/pom.xml @@ -75,5 +75,4 @@ 1.6.1 0.6.1 - From cc48f3bdcf11d44c3e5c1bce100085dbd3592523 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 18 Nov 2018 20:07:29 +0200 Subject: [PATCH 416/546] update guava rangemap --- .../java/org/baeldung/guava/GuavaRangeMapUnitTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java index 81ba72373c..67a7d6a1f7 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java +++ b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java @@ -2,6 +2,9 @@ package org.baeldung.guava; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; import java.util.Map; import org.junit.Test; import com.google.common.collect.ImmutableRangeMap; @@ -98,8 +101,8 @@ public class GuavaRangeMapUnitTest { final RangeMap experiencedSubRangeDesignationMap = experienceRangeDesignationMap.subRangeMap(Range.closed(4, 14)); assertNull(experiencedSubRangeDesignationMap.get(3)); - assertEquals("Executive Director", experiencedSubRangeDesignationMap.get(14)); - assertEquals("Vice President", experiencedSubRangeDesignationMap.get(7)); + assertTrue(experiencedSubRangeDesignationMap.asMapOfRanges().values().containsAll(Arrays.asList("Executive Director", "Vice President", "Executive Director"))); + } @Test From dad9467f97b8fac1a9d77ba0d53270320e40cbf2 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 18 Nov 2018 20:09:39 +0200 Subject: [PATCH 417/546] fix formatting --- .../test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java index 67a7d6a1f7..c0c5efea23 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java +++ b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java @@ -101,7 +101,8 @@ public class GuavaRangeMapUnitTest { final RangeMap experiencedSubRangeDesignationMap = experienceRangeDesignationMap.subRangeMap(Range.closed(4, 14)); assertNull(experiencedSubRangeDesignationMap.get(3)); - assertTrue(experiencedSubRangeDesignationMap.asMapOfRanges().values().containsAll(Arrays.asList("Executive Director", "Vice President", "Executive Director"))); + assertTrue(experiencedSubRangeDesignationMap.asMapOfRanges().values() + .containsAll(Arrays.asList("Executive Director", "Vice President", "Executive Director"))); } From 96d121bcae0f7925c6077c2299473a03ae6b8514 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Mon, 19 Nov 2018 00:04:52 +0530 Subject: [PATCH 418/546] [BAEL-9712] - Created spring-5-security-oauth module --- pom.xml | 4 ++ spring-5-security-oauth/README.md | 3 + spring-5-security-oauth/pom.xml | 68 +++++++++++++++++++ .../com/baeldung/oauth2/LoginController.java | 0 .../java/com/baeldung/oauth2/MvcConfig.java | 0 .../com/baeldung/oauth2/SecurityConfig.java | 4 +- .../oauth2/SpringOAuthApplication.java | 0 .../ExtractorsApplication.java | 0 .../configuration/SecurityConfig.java | 0 .../custom/BaeldungAuthoritiesExtractor.java | 0 .../custom/BaeldungPrincipalExtractor.java | 0 .../github/GithubAuthoritiesExtractor.java | 0 .../github/GithubPrincipalExtractor.java | 0 ...tion-oauth2-extractors-baeldung.properties | 0 ...cation-oauth2-extractors-github.properties | 0 .../resources/application-oauth2.properties | 0 .../src/main/resources/application.properties | 5 ++ .../src/main/resources/logback.xml | 13 ++++ .../src/main/resources/static/css/main.css | 8 +++ .../src/main/resources/templates/index.html | 11 +++ .../resources/templates/loginFailure.html | 0 .../resources/templates/loginSuccess.html | 0 .../templates/oauth2_extractors.html | 0 .../main/resources/templates/oauth_login.html | 0 .../main/resources/templates/securedPage.html | 0 .../oauth2extractors/ExtractorsUnitTest.java | 0 spring-5-security/README.md | 1 - spring-5-security/pom.xml | 15 ---- 28 files changed, 114 insertions(+), 18 deletions(-) create mode 100644 spring-5-security-oauth/README.md create mode 100644 spring-5-security-oauth/pom.xml rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2/LoginController.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2/MvcConfig.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2/SecurityConfig.java (95%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2/SpringOAuthApplication.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2extractors/ExtractorsApplication.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2extractors/configuration/SecurityConfig.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungAuthoritiesExtractor.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungPrincipalExtractor.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubAuthoritiesExtractor.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubPrincipalExtractor.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/resources/application-oauth2-extractors-baeldung.properties (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/resources/application-oauth2-extractors-github.properties (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/resources/application-oauth2.properties (100%) create mode 100644 spring-5-security-oauth/src/main/resources/application.properties create mode 100644 spring-5-security-oauth/src/main/resources/logback.xml create mode 100644 spring-5-security-oauth/src/main/resources/static/css/main.css create mode 100644 spring-5-security-oauth/src/main/resources/templates/index.html rename {spring-5-security => spring-5-security-oauth}/src/main/resources/templates/loginFailure.html (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/resources/templates/loginSuccess.html (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/resources/templates/oauth2_extractors.html (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/resources/templates/oauth_login.html (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/resources/templates/securedPage.html (100%) rename {spring-5-security => spring-5-security-oauth}/src/test/java/com/baeldung/oauth2extractors/ExtractorsUnitTest.java (100%) diff --git a/pom.xml b/pom.xml index 5ebf7ba4f3..0997d7ce88 100644 --- a/pom.xml +++ b/pom.xml @@ -466,6 +466,7 @@ spring-5-reactive-client spring-5-mvc spring-5-security + spring-5-security-oauth spring-5-reactive-oauth spring-activiti spring-akka @@ -768,6 +769,7 @@ spring-5-reactive-client spring-5-reactive-security spring-5-security + spring-5-security-oauth spring-activiti spring-akka spring-all @@ -994,6 +996,7 @@ spring-5-reactive-client spring-5-mvc spring-5-security + spring-5-security-oauth spring-activiti spring-akka spring-amqp @@ -1385,6 +1388,7 @@ spring-5-reactive-client spring-5-mvc spring-5-security + spring-5-security-oauth spring-activiti spring-akka spring-amqp diff --git a/spring-5-security-oauth/README.md b/spring-5-security-oauth/README.md new file mode 100644 index 0000000000..81d95c07d7 --- /dev/null +++ b/spring-5-security-oauth/README.md @@ -0,0 +1,3 @@ +## Relevant articles: + +- [Spring Security 5 -OAuth2 Login](http://www.baeldung.com/spring-security-5-oauth2-login) \ No newline at end of file diff --git a/spring-5-security-oauth/pom.xml b/spring-5-security-oauth/pom.xml new file mode 100644 index 0000000000..a741daaa18 --- /dev/null +++ b/spring-5-security-oauth/pom.xml @@ -0,0 +1,68 @@ + + 4.0.0 + com.baeldung + spring-5-security-oauth + 0.0.1-SNAPSHOT + jar + spring-5-security-oauth + spring 5 security oauth sample project + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity5 + + + + + org.springframework.security.oauth.boot + spring-security-oauth2-autoconfigure + ${oauth-auto.version} + + + org.springframework.security + spring-security-oauth2-client + + + org.springframework.security + spring-security-oauth2-jose + + + + org.springframework + spring-test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + + diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/LoginController.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LoginController.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2/LoginController.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LoginController.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/MvcConfig.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/MvcConfig.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2/MvcConfig.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2/MvcConfig.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/SecurityConfig.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SecurityConfig.java similarity index 95% rename from spring-5-security/src/main/java/com/baeldung/oauth2/SecurityConfig.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SecurityConfig.java index b45f325767..e08057d92f 100644 --- a/spring-5-security/src/main/java/com/baeldung/oauth2/SecurityConfig.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SecurityConfig.java @@ -12,7 +12,7 @@ import org.springframework.core.env.Environment; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.oauth2.client.CommonOAuth2Provider; -import org.springframework.security.oauth2.client.endpoint.NimbusAuthorizationCodeTokenResponseClient; +import org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient; import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient; import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest; import org.springframework.security.oauth2.client.registration.ClientRegistration; @@ -54,7 +54,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Bean public OAuth2AccessTokenResponseClient accessTokenResponseClient() { - return new NimbusAuthorizationCodeTokenResponseClient(); + return new DefaultAuthorizationCodeTokenResponseClient(); } diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/SpringOAuthApplication.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SpringOAuthApplication.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2/SpringOAuthApplication.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SpringOAuthApplication.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2extractors/ExtractorsApplication.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/ExtractorsApplication.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2extractors/ExtractorsApplication.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/ExtractorsApplication.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2extractors/configuration/SecurityConfig.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/configuration/SecurityConfig.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2extractors/configuration/SecurityConfig.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/configuration/SecurityConfig.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungAuthoritiesExtractor.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungAuthoritiesExtractor.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungAuthoritiesExtractor.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungAuthoritiesExtractor.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungPrincipalExtractor.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungPrincipalExtractor.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungPrincipalExtractor.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/custom/BaeldungPrincipalExtractor.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubAuthoritiesExtractor.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubAuthoritiesExtractor.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubAuthoritiesExtractor.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubAuthoritiesExtractor.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubPrincipalExtractor.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubPrincipalExtractor.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubPrincipalExtractor.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2extractors/extractor/github/GithubPrincipalExtractor.java diff --git a/spring-5-security/src/main/resources/application-oauth2-extractors-baeldung.properties b/spring-5-security-oauth/src/main/resources/application-oauth2-extractors-baeldung.properties similarity index 100% rename from spring-5-security/src/main/resources/application-oauth2-extractors-baeldung.properties rename to spring-5-security-oauth/src/main/resources/application-oauth2-extractors-baeldung.properties diff --git a/spring-5-security/src/main/resources/application-oauth2-extractors-github.properties b/spring-5-security-oauth/src/main/resources/application-oauth2-extractors-github.properties similarity index 100% rename from spring-5-security/src/main/resources/application-oauth2-extractors-github.properties rename to spring-5-security-oauth/src/main/resources/application-oauth2-extractors-github.properties diff --git a/spring-5-security/src/main/resources/application-oauth2.properties b/spring-5-security-oauth/src/main/resources/application-oauth2.properties similarity index 100% rename from spring-5-security/src/main/resources/application-oauth2.properties rename to spring-5-security-oauth/src/main/resources/application-oauth2.properties diff --git a/spring-5-security-oauth/src/main/resources/application.properties b/spring-5-security-oauth/src/main/resources/application.properties new file mode 100644 index 0000000000..5912b0f755 --- /dev/null +++ b/spring-5-security-oauth/src/main/resources/application.properties @@ -0,0 +1,5 @@ +server.port=8081 + +logging.level.root=INFO + +logging.level.com.baeldung.dsl.ClientErrorLoggingFilter=DEBUG \ No newline at end of file diff --git a/spring-5-security-oauth/src/main/resources/logback.xml b/spring-5-security-oauth/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/spring-5-security-oauth/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/spring-5-security-oauth/src/main/resources/static/css/main.css b/spring-5-security-oauth/src/main/resources/static/css/main.css new file mode 100644 index 0000000000..febc353af7 --- /dev/null +++ b/spring-5-security-oauth/src/main/resources/static/css/main.css @@ -0,0 +1,8 @@ +p.error { + font-weight: bold; + color: red; +} + +div.logout { + margin-right: 2em;; +} diff --git a/spring-5-security-oauth/src/main/resources/templates/index.html b/spring-5-security-oauth/src/main/resources/templates/index.html new file mode 100644 index 0000000000..4216d74037 --- /dev/null +++ b/spring-5-security-oauth/src/main/resources/templates/index.html @@ -0,0 +1,11 @@ + + + + Home + + + + Home + Welcome! + + \ No newline at end of file diff --git a/spring-5-security/src/main/resources/templates/loginFailure.html b/spring-5-security-oauth/src/main/resources/templates/loginFailure.html similarity index 100% rename from spring-5-security/src/main/resources/templates/loginFailure.html rename to spring-5-security-oauth/src/main/resources/templates/loginFailure.html diff --git a/spring-5-security/src/main/resources/templates/loginSuccess.html b/spring-5-security-oauth/src/main/resources/templates/loginSuccess.html similarity index 100% rename from spring-5-security/src/main/resources/templates/loginSuccess.html rename to spring-5-security-oauth/src/main/resources/templates/loginSuccess.html diff --git a/spring-5-security/src/main/resources/templates/oauth2_extractors.html b/spring-5-security-oauth/src/main/resources/templates/oauth2_extractors.html similarity index 100% rename from spring-5-security/src/main/resources/templates/oauth2_extractors.html rename to spring-5-security-oauth/src/main/resources/templates/oauth2_extractors.html diff --git a/spring-5-security/src/main/resources/templates/oauth_login.html b/spring-5-security-oauth/src/main/resources/templates/oauth_login.html similarity index 100% rename from spring-5-security/src/main/resources/templates/oauth_login.html rename to spring-5-security-oauth/src/main/resources/templates/oauth_login.html diff --git a/spring-5-security/src/main/resources/templates/securedPage.html b/spring-5-security-oauth/src/main/resources/templates/securedPage.html similarity index 100% rename from spring-5-security/src/main/resources/templates/securedPage.html rename to spring-5-security-oauth/src/main/resources/templates/securedPage.html diff --git a/spring-5-security/src/test/java/com/baeldung/oauth2extractors/ExtractorsUnitTest.java b/spring-5-security-oauth/src/test/java/com/baeldung/oauth2extractors/ExtractorsUnitTest.java similarity index 100% rename from spring-5-security/src/test/java/com/baeldung/oauth2extractors/ExtractorsUnitTest.java rename to spring-5-security-oauth/src/test/java/com/baeldung/oauth2extractors/ExtractorsUnitTest.java diff --git a/spring-5-security/README.md b/spring-5-security/README.md index 55fa7ab042..6e094e928f 100644 --- a/spring-5-security/README.md +++ b/spring-5-security/README.md @@ -1,6 +1,5 @@ ## Relevant articles: -- [Spring Security 5 -OAuth2 Login](http://www.baeldung.com/spring-security-5-oauth2-login) - [Extra Login Fields with Spring Security](http://www.baeldung.com/spring-security-extra-login-fields) - [A Custom Spring SecurityConfigurer](http://www.baeldung.com/spring-security-custom-configurer) - [New Password Storage In Spring Security 5](http://www.baeldung.com/spring-security-5-password-storage) diff --git a/spring-5-security/pom.xml b/spring-5-security/pom.xml index da62f39fa9..51ce822dc4 100644 --- a/spring-5-security/pom.xml +++ b/spring-5-security/pom.xml @@ -34,21 +34,6 @@ thymeleaf-extras-springsecurity5 - - - org.springframework.security.oauth.boot - spring-security-oauth2-autoconfigure - ${oauth-auto.version} - - - org.springframework.security - spring-security-oauth2-client - - - org.springframework.security - spring-security-oauth2-jose - - org.springframework spring-test From 31825c7b3bdcb5d35da481ecf65ca817d1d35232 Mon Sep 17 00:00:00 2001 From: geroza Date: Sun, 18 Nov 2018 19:29:38 -0200 Subject: [PATCH 419/546] Fixed one other scenario not working properly --- .../main/resources/META-INF/spring.factories | 1 + .../FailureAnalyzerAppIntegrationTest.java | 47 +++++++++++++++++++ .../failureanalyzer/utils/ListAppender.java | 25 ++++++++++ .../src/test/resources/logback-test.xml | 15 ++++++ 4 files changed, 88 insertions(+) create mode 100644 spring-boot/src/main/resources/META-INF/spring.factories create mode 100644 spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java create mode 100644 spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java create mode 100644 spring-boot/src/test/resources/logback-test.xml diff --git a/spring-boot/src/main/resources/META-INF/spring.factories b/spring-boot/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000..e3d3aa4c8e --- /dev/null +++ b/spring-boot/src/main/resources/META-INF/spring.factories @@ -0,0 +1 @@ +org.springframework.boot.diagnostics.FailureAnalyzer=com.baeldung.failureanalyzer.MyBeanNotOfRequiredTypeFailureAnalyzer \ No newline at end of file diff --git a/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java new file mode 100644 index 0000000000..b3555f55da --- /dev/null +++ b/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java @@ -0,0 +1,47 @@ +package com.baeldung.failureanalyzer; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collection; +import java.util.stream.Collectors; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.BeanCreationException; +import org.springframework.boot.SpringApplication; + +import com.baeldung.failureanalyzer.utils.ListAppender; + +import ch.qos.logback.classic.spi.ILoggingEvent; + +public class FailureAnalyzerAppIntegrationTest { + + private static final String EXPECTED_ANALYSIS_DESCRIPTION_TITLE = "Description:"; + private static final String EXPECTED_ANALYSIS_DESCRIPTION_CONTENT = "The bean myDAO could not be injected as com.baeldung.failureanalyzer.MyDAO because it is of type com.baeldung.failureanalyzer.MySecondDAO"; + private static final String EXPECTED_ANALYSIS_ACTION_TITLE = "Action:"; + private static final String EXPECTED_ANALYSIS_ACTION_CONTENT = "Consider creating a bean with name myDAO of type com.baeldung.failureanalyzer.MyDAO"; + + @BeforeEach + public void clearLogList() { + ListAppender.clearEventList(); + } + + @Test + public void givenBeanCreationErrorInContext_whenContextLoaded_thenFailureAnalyzerLogsReport() { + try { + SpringApplication.run(FailureAnalyzerApplication.class); + } catch (BeanCreationException e) { + Collection allLoggedEntries = ListAppender.getEvents() + .stream() + .map(ILoggingEvent::getFormattedMessage) + .collect(Collectors.toList()); + assertThat(allLoggedEntries).anyMatch(entry -> entry.contains(EXPECTED_ANALYSIS_DESCRIPTION_TITLE)) + .anyMatch(entry -> entry.contains(EXPECTED_ANALYSIS_DESCRIPTION_CONTENT)) + .anyMatch(entry -> entry.contains(EXPECTED_ANALYSIS_ACTION_TITLE)) + .anyMatch(entry -> entry.contains(EXPECTED_ANALYSIS_ACTION_CONTENT)); + return; + } + throw new IllegalStateException("Context load should be failing due to a BeanCreationException!"); + } + +} diff --git a/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java b/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java new file mode 100644 index 0000000000..a298f49ff5 --- /dev/null +++ b/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java @@ -0,0 +1,25 @@ +package com.baeldung.failureanalyzer.utils; + +import java.util.ArrayList; +import java.util.List; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; + +public class ListAppender extends AppenderBase { + + static private List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + events.add(eventObject); + } + + public static List getEvents() { + return events; + } + + public static void clearEventList() { + events.clear(); + } +} \ No newline at end of file diff --git a/spring-boot/src/test/resources/logback-test.xml b/spring-boot/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..9e0f4e221f --- /dev/null +++ b/spring-boot/src/test/resources/logback-test.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file From eba76ca5a2e8e6b9cb8081c3e2519513663cfbfb Mon Sep 17 00:00:00 2001 From: kyleandari <44148335+kyleandari@users.noreply.github.com> Date: Sun, 18 Nov 2018 22:56:37 -0500 Subject: [PATCH 420/546] BAEL-2330 (#5694) * Implementing Hexagonal Architecture in java * Removing duplicates from a string * Fix for the code review feedback - removing the hexagonal architecture code - removing the methods removeDuplicatesUsingCharArray - adding some meaningful sentences to test * Fix for the code review feedback - fix for removeDuplicatesUsingCharArray - adding unit testing - adding brackets around for loops * Fix for the code review feedback --- .../RemoveDuplicateFromString.java | 95 +++++++++++++++++++ .../RemoveDuplicateFromStringUnitTest.java | 58 +++++++++++ 2 files changed, 153 insertions(+) create mode 100644 java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java create mode 100644 java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java diff --git a/java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java b/java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java new file mode 100644 index 0000000000..eeba81f334 --- /dev/null +++ b/java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java @@ -0,0 +1,95 @@ +package com.baeldung.stringduplicates; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; + +public class RemoveDuplicateFromString { + + + String removeDuplicatesUsingCharArray(String str) { + + char[] chars = str.toCharArray(); + StringBuilder sb = new StringBuilder(); + int repeatedCtr; + for (int i = 0; i < chars.length; i++) { + repeatedCtr = 0; + for (int j = i + 1; j < chars.length; j++) { + if (chars[i] == chars[j]) { + repeatedCtr++; + } + } + if (repeatedCtr == 0) { + sb.append(chars[i]); + } + } + return sb.toString(); + } + + String removeDuplicatesUsinglinkedHashSet(String str) { + + StringBuilder sb = new StringBuilder(); + Set linkedHashSet = new LinkedHashSet<>(); + + for (int i = 0; i < str.length(); i++) { + linkedHashSet.add(str.charAt(i)); + } + + for (Character c : linkedHashSet) { + sb.append(c); + } + + return sb.toString(); + } + + String removeDuplicatesUsingSorting(String str) { + + char[] chars = str.toCharArray(); + + Arrays.sort(chars); + + StringBuilder sb = new StringBuilder(); + sb.append(chars[0]); + for (int i = 1; i < chars.length; i++) { + if (chars[i] != chars[i - 1]) { + sb.append(chars[i]); + } + } + + return sb.toString(); + } + + String removeDuplicatesUsingHashSet(String str) { + + StringBuilder sb = new StringBuilder(); + Set hashSet = new HashSet<>(); + + for (int i = 0; i < str.length(); i++) { + hashSet.add(str.charAt(i)); + } + + for (Character c : hashSet) { + sb.append(c); + } + + return sb.toString(); + } + + String removeDuplicatesUsingIndexOf(String str) { + + StringBuilder sb = new StringBuilder(); + int idx; + for (int i = 0; i < str.length(); i++) { + char c = str.charAt(i); + idx = str.indexOf(c, i + 1); + if (idx == -1) { + sb.append(c); + } + } + return sb.toString(); + } + +} + + diff --git a/java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java b/java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java new file mode 100644 index 0000000000..cf7819ced3 --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java @@ -0,0 +1,58 @@ +package com.baeldung.stringduplicates; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class RemoveDuplicateFromStringUnitTest { + + private final static String STR1 = "racecar"; + private final static String STR2 = "J2ee programming"; + private RemoveDuplicateFromString removeDuplicateFromString; + + @Before + public void executedBeforeEach() { + removeDuplicateFromString = new RemoveDuplicateFromString(); + } + + + @Test + public void whenUsingCharArray_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { + String str1 = removeDuplicateFromString.removeDuplicatesUsingCharArray(STR1); + String str2 = removeDuplicateFromString.removeDuplicatesUsingCharArray(STR2); + Assert.assertEquals("ecar", str1); + Assert.assertEquals("J2e poraming", str2); + } + + @Test + public void whenUsingLinkedHashSet_DuplicatesShouldBeRemovedAndItKeepStringOrder() { + String str1 = removeDuplicateFromString.removeDuplicatesUsinglinkedHashSet(STR1); + String str2 = removeDuplicateFromString.removeDuplicatesUsinglinkedHashSet(STR2); + Assert.assertEquals("race", str1); + Assert.assertEquals("J2e progamin", str2); + } + + @Test + public void whenUsingSorting_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { + String str1 = removeDuplicateFromString.removeDuplicatesUsingSorting(STR1); + String str2 = removeDuplicateFromString.removeDuplicatesUsingSorting(STR2); + Assert.assertEquals("acer", str1); + Assert.assertEquals(" 2Jaegimnopr", str2); + } + + @Test + public void whenUsingHashSet_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { + String str1 = removeDuplicateFromString.removeDuplicatesUsingHashSet(STR1); + String str2 = removeDuplicateFromString.removeDuplicatesUsingHashSet(STR2); + Assert.assertEquals("arce", str1); + Assert.assertEquals(" pa2regiJmno", str2); + } + + @Test + public void whenUsingIndexOf_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { + String str1 = removeDuplicateFromString.removeDuplicatesUsingIndexOf(STR1); + String str2 = removeDuplicateFromString.removeDuplicatesUsingIndexOf(STR2); + Assert.assertEquals("ecar", str1); + Assert.assertEquals("J2e poraming", str2); + } +} From ef541ac96a93f4d9b6236ee0393ecfa9f8faf165 Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Sun, 18 Nov 2018 22:46:55 -0600 Subject: [PATCH 421/546] BAEL-2166 BAEL-2302 add links back to articles --- java-strings/README.md | 1 + spring-data-rest/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/java-strings/README.md b/java-strings/README.md index 1b24a2b821..2847a0d0a8 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -36,3 +36,4 @@ - [String Performance Hints](https://www.baeldung.com/java-string-performance) - [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) - [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) +- [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) diff --git a/spring-data-rest/README.md b/spring-data-rest/README.md index 09f8391406..db94a86a6f 100644 --- a/spring-data-rest/README.md +++ b/spring-data-rest/README.md @@ -20,3 +20,4 @@ To view the running application, visit [http://localhost:8080](http://localhost: - [List of In-Memory Databases](http://www.baeldung.com/java-in-memory-databases) - [Projections and Excerpts in Spring Data REST](http://www.baeldung.com/spring-data-rest-projections-excerpts) - [Spring Data REST Events with @RepositoryEventHandler](http://www.baeldung.com/spring-data-rest-events) +- [Customizing HTTP Endpoints in Spring Data REST](https://www.baeldung.com/spring-data-rest-customize-http-endpoints) From d751dc2eae3ef58b02215b77c019cd210a7890cc Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sun, 18 Nov 2018 22:55:50 -0600 Subject: [PATCH 422/546] BAEL-2166 BAEL-2302 update README (#5728) * BAEL-2015: add link back to article * BAEL-2166 BAEL-2302 add links back to articles --- java-strings/README.md | 1 + spring-data-rest/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/java-strings/README.md b/java-strings/README.md index 1b24a2b821..2847a0d0a8 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -36,3 +36,4 @@ - [String Performance Hints](https://www.baeldung.com/java-string-performance) - [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) - [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) +- [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) diff --git a/spring-data-rest/README.md b/spring-data-rest/README.md index 09f8391406..db94a86a6f 100644 --- a/spring-data-rest/README.md +++ b/spring-data-rest/README.md @@ -20,3 +20,4 @@ To view the running application, visit [http://localhost:8080](http://localhost: - [List of In-Memory Databases](http://www.baeldung.com/java-in-memory-databases) - [Projections and Excerpts in Spring Data REST](http://www.baeldung.com/spring-data-rest-projections-excerpts) - [Spring Data REST Events with @RepositoryEventHandler](http://www.baeldung.com/spring-data-rest-events) +- [Customizing HTTP Endpoints in Spring Data REST](https://www.baeldung.com/spring-data-rest-customize-http-endpoints) From ba98695605ce454c0e0ddeb98ee899e9c7054af4 Mon Sep 17 00:00:00 2001 From: Laurentiu Delcea Date: Mon, 19 Nov 2018 17:05:05 +0200 Subject: [PATCH 423/546] Convert between String and Timestamp Issue: BAEL-2325 --- .../StringToTimestampConverterUnitTest.java | 22 +++++++++++++++++++ .../TimestampToStringConverterTest.java | 19 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 java-dates/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java create mode 100644 java-dates/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java diff --git a/java-dates/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java b/java-dates/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java new file mode 100644 index 0000000000..2be646eb51 --- /dev/null +++ b/java-dates/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java @@ -0,0 +1,22 @@ +package com.baeldung.timestamp; + +import org.junit.Assert; +import org.junit.Test; + +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +public class StringToTimestampConverterUnitTest { + + @Test + public void givenDatePattern_whenParsing_thenTimestampIsCorrect() { + String pattern = "MMM dd, yyyy HH:mm:ss.SSSSSSSS"; + String timestampAsString = "Nov 12, 2018 13:02:56.12345678"; + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); + LocalDateTime localDateTime = LocalDateTime.from(formatter.parse(timestampAsString)); + + Timestamp timestamp = Timestamp.valueOf(localDateTime); + Assert.assertEquals("2018-11-12 13:02:56.12345678", timestamp.toString()); + } +} \ No newline at end of file diff --git a/java-dates/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java b/java-dates/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java new file mode 100644 index 0000000000..b25ff2edb3 --- /dev/null +++ b/java-dates/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java @@ -0,0 +1,19 @@ +package com.baeldung.timestamp; + +import org.junit.Assert; +import org.junit.jupiter.api.Test; + +import java.sql.Timestamp; +import java.time.format.DateTimeFormatter; + +public class TimestampToStringConverterTest { + + @Test + public void givenDatePattern_whenFormatting_thenResultingStringIsCorrect() { + Timestamp timestamp = Timestamp.valueOf("2018-12-12 01:02:03.123456789"); + DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME; + + String timestampAsString = formatter.format(timestamp.toLocalDateTime()); + Assert.assertEquals("2018-12-12T01:02:03.123456789", timestampAsString); + } +} \ No newline at end of file From 5145b900990719bc316fec5231bb797ba4542242 Mon Sep 17 00:00:00 2001 From: Seun Matt Date: Mon, 19 Nov 2018 18:37:13 +0100 Subject: [PATCH 424/546] added example code for BAEL-2366 (#5730) --- .../StringReplaceAndRemoveUnitTest.java | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 core-java/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java b/core-java/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java new file mode 100644 index 0000000000..d952d2383b --- /dev/null +++ b/core-java/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java @@ -0,0 +1,83 @@ +package com.baeldung.string; + + +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class StringReplaceAndRemoveUnitTest { + + + @Test + public void givenTestStrings_whenReplace_thenProcessedString() { + + String master = "Hello World Baeldung!"; + String target = "Baeldung"; + String replacement = "Java"; + String processed = master.replace(target, replacement); + assertTrue(processed.contains(replacement)); + assertFalse(processed.contains(target)); + + } + + @Test + public void givenTestStrings_whenReplaceAll_thenProcessedString() { + + String master2 = "Welcome to Baeldung, Hello World Baeldung"; + String regexTarget= "(Baeldung)$"; + String replacement = "Java"; + String processed2 = master2.replaceAll(regexTarget, replacement); + assertTrue(processed2.endsWith("Java")); + + } + + @Test + public void givenTestStrings_whenStringBuilderMethods_thenProcessedString() { + + String master = "Hello World Baeldung!"; + String target = "Baeldung"; + String replacement = "Java"; + + int startIndex = master.indexOf(target); + int stopIndex = startIndex + target.length(); + + StringBuilder builder = new StringBuilder(master); + + + builder.delete(startIndex, stopIndex); + assertFalse(builder.toString().contains(target)); + + + builder.replace(startIndex, stopIndex, replacement); + assertTrue(builder.toString().contains(replacement)); + + + } + + + @Test + public void givenTestStrings_whenStringUtilsMethods_thenProcessedStrings() { + + String master = "Hello World Baeldung!"; + String target = "Baeldung"; + String replacement = "Java"; + + String processed = StringUtils.replace(master, target, replacement); + assertTrue(processed.contains(replacement)); + + String master2 = "Hello World Baeldung!"; + String target2 = "baeldung"; + String processed2 = StringUtils.replaceIgnoreCase(master2, target2, replacement); + assertFalse(processed2.contains(target)); + + } + + + + + + + +} From fcca31572b20af0e346beaef4d51ddcf598cda62 Mon Sep 17 00:00:00 2001 From: myluckagain Date: Mon, 19 Nov 2018 23:34:38 +0500 Subject: [PATCH 425/546] Spring Integration Subflows Issue: BAEL-2276 --- .../subflows/discardflow/FilterExample.java | 57 ++++++++++ .../PublishSubscibeChannelExample.java | 59 +++++------ .../RouteToRecipientsExample.java | 59 +++++------ .../separateflows/SeparateFlowsExample.java | 100 ++++++++---------- .../subflowchannel/FilterExample.java | 60 ----------- .../subflowmapping/RouterExample.java | 63 +++++------ .../subflows/discardflow/FilterUnitTest.java | 62 +++++++++++ .../PublishSubscribeChannelUnitTest.java | 62 +++++++++++ .../RouteToRecipientsUnitTest.java | 63 +++++++++++ .../separateflows/SeparateFlowsUnitTest.java | 75 +++++++++++++ .../subflowmapping/RouterUnitTest.java | 62 +++++++++++ 11 files changed, 517 insertions(+), 205 deletions(-) create mode 100644 spring-integration/src/main/java/com/baeldung/subflows/discardflow/FilterExample.java delete mode 100644 spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java create mode 100644 spring-integration/src/test/java/com/baeldung/subflows/discardflow/FilterUnitTest.java create mode 100644 spring-integration/src/test/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscribeChannelUnitTest.java create mode 100644 spring-integration/src/test/java/com/baeldung/subflows/routetorecipients/RouteToRecipientsUnitTest.java create mode 100644 spring-integration/src/test/java/com/baeldung/subflows/separateflows/SeparateFlowsUnitTest.java create mode 100644 spring-integration/src/test/java/com/baeldung/subflows/subflowmapping/RouterUnitTest.java diff --git a/spring-integration/src/main/java/com/baeldung/subflows/discardflow/FilterExample.java b/spring-integration/src/main/java/com/baeldung/subflows/discardflow/FilterExample.java new file mode 100644 index 0000000000..f0e12f9333 --- /dev/null +++ b/spring-integration/src/main/java/com/baeldung/subflows/discardflow/FilterExample.java @@ -0,0 +1,57 @@ +package com.baeldung.subflows.discardflow; + +import java.util.Collection; +import org.springframework.context.annotation.Bean; +import org.springframework.integration.annotation.Gateway; +import org.springframework.integration.annotation.IntegrationComponentScan; +import org.springframework.integration.annotation.MessagingGateway; +import org.springframework.integration.channel.QueueChannel; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.dsl.IntegrationFlow; + +@EnableIntegration +@IntegrationComponentScan +public class FilterExample { + @MessagingGateway + public interface NumbersClassifier { + @Gateway(requestChannel = "classify.input") + void classify(Collection numbers); + } + + @Bean + QueueChannel multipleofThreeChannel() { + return new QueueChannel(); + } + + @Bean + QueueChannel remainderIsOneChannel() { + return new QueueChannel(); + } + + @Bean + QueueChannel remainderIsTwoChannel() { + return new QueueChannel(); + } + boolean isMultipleOfThree(Integer number) { + return number % 3 == 0; + } + + boolean isRemainderOne(Integer number) { + return number % 3 == 1; + } + + boolean isRemainderTwo(Integer number) { + return number % 3 == 2; + } + @Bean + public IntegrationFlow classify() { + return flow -> flow.split() + . filter(this::isMultipleOfThree, notMultiple -> notMultiple + .discardFlow(oneflow -> oneflow + . filter(this::isRemainderOne, + twoflow -> twoflow .discardChannel("remainderIsTwoChannel")) + .channel("remainderIsOneChannel"))) + .channel("multipleofThreeChannel"); + } + +} \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java b/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java index e26f938632..a1a448fc03 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscibeChannelExample.java @@ -1,15 +1,13 @@ package com.baeldung.subflows.publishsubscribechannel; -import java.util.Arrays; import java.util.Collection; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.integration.annotation.Gateway; import org.springframework.integration.annotation.IntegrationComponentScan; import org.springframework.integration.annotation.MessagingGateway; -import org.springframework.integration.channel.DirectChannel; + +import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.dsl.IntegrationFlow; @@ -18,46 +16,45 @@ import org.springframework.integration.dsl.IntegrationFlow; public class PublishSubscibeChannelExample { @MessagingGateway public interface NumbersClassifier { - @Gateway(requestChannel = "flow.input") - void flow(Collection numbers); + @Gateway(requestChannel = "classify.input") + void classify(Collection numbers); } @Bean - DirectChannel multipleof3Channel() { - return new DirectChannel(); + QueueChannel multipleofThreeChannel() { + return new QueueChannel(); } @Bean - DirectChannel remainderIs1Channel() { - return new DirectChannel(); + QueueChannel remainderIsOneChannel() { + return new QueueChannel(); } @Bean - DirectChannel remainderIs2Channel() { - return new DirectChannel(); + QueueChannel remainderIsTwoChannel() { + return new QueueChannel(); + } + boolean isMultipleOfThree(Integer number) { + return number % 3 == 0; } + boolean isRemainderOne(Integer number) { + return number % 3 == 1; + } + + boolean isRemainderTwo(Integer number) { + return number % 3 == 2; + } @Bean - public IntegrationFlow flow() { + public IntegrationFlow classify() { return flow -> flow.split() - .publishSubscribeChannel(s -> s.subscribe(f -> f. filter(p -> p % 3 == 0) - .channel("multipleof3Channel")) - .subscribe(f -> f. filter(p -> p % 3 == 1) - .channel("remainderIs1Channel")) - .subscribe(f -> f. filter(p -> p % 3 == 2) - .channel("remainderIs2Channel"))); + .publishSubscribeChannel(subscription -> subscription.subscribe(subflow -> subflow. filter(this::isMultipleOfThree) + .channel("multipleofThreeChannel")) + .subscribe(subflow -> subflow. filter(this::isRemainderOne) + .channel("remainderIsOneChannel")) + .subscribe(subflow -> subflow. filter(this::isRemainderTwo) + .channel("remainderIsTwoChannel"))); } + - public static void main(String[] args) { - final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(PublishSubscibeChannelExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); - multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); - remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); - remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - ctx.getBean(NumbersClassifier.class) - .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } } diff --git a/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java b/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java index 04fdb87dfa..e0b4841736 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/routeToRecipients/RouteToRecipientsExample.java @@ -1,15 +1,12 @@ -package com.baeldung.subflows.routeToRecipients; +package com.baeldung.subflows.routetorecipients; -import java.util.Arrays; import java.util.Collection; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.integration.annotation.Gateway; import org.springframework.integration.annotation.IntegrationComponentScan; import org.springframework.integration.annotation.MessagingGateway; -import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.dsl.IntegrationFlow; @@ -18,44 +15,46 @@ import org.springframework.integration.dsl.IntegrationFlow; public class RouteToRecipientsExample { @MessagingGateway public interface NumbersClassifier { - @Gateway(requestChannel = "flow.input") - void flow(Collection numbers); + @Gateway(requestChannel = "classify.input") + void classify(Collection numbers); } @Bean - DirectChannel multipleof3Channel() { - return new DirectChannel(); + QueueChannel multipleofThreeChannel() { + return new QueueChannel(); } @Bean - DirectChannel remainderIs1Channel() { - return new DirectChannel(); + QueueChannel remainderIsOneChannel() { + return new QueueChannel(); } @Bean - DirectChannel remainderIs2Channel() { - return new DirectChannel(); + QueueChannel remainderIsTwoChannel() { + return new QueueChannel(); + } + boolean isMultipleOfThree(Integer number) { + return number % 3 == 0; + } + + boolean isRemainderOne(Integer number) { + return number % 3 == 1; + } + + boolean isRemainderTwo(Integer number) { + return number % 3 == 2; } @Bean - public IntegrationFlow flow() { + public IntegrationFlow classify() { return flow -> flow.split() - .routeToRecipients(r -> r. recipient("multipleof3Channel", p -> p % 3 == 0)// filter - . recipient("remainderIs1Channel", p -> p % 3 == 1) - .recipientFlow(sf -> sf. filter(p -> p % 3 == 2) - .channel("remainderIs2Channel"))); + .routeToRecipients(route -> route + .recipientFlow(subflow -> subflow + . filter(this::isMultipleOfThree) + .channel("multipleofThreeChannel")) + . recipient("remainderIsOneChannel",this::isRemainderOne) + . recipient("remainderIsTwoChannel",this::isRemainderTwo)); } + - public static void main(String[] args) { - final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(RouteToRecipientsExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); - multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); - remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); - remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - ctx.getBean(NumbersClassifier.class) - .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } } \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java b/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java index 8ed46ead87..457b8045c5 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/separateflows/SeparateFlowsExample.java @@ -1,15 +1,13 @@ package com.baeldung.subflows.separateflows; -import java.util.Arrays; import java.util.Collection; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.integration.annotation.Gateway; import org.springframework.integration.annotation.IntegrationComponentScan; import org.springframework.integration.annotation.MessagingGateway; -import org.springframework.integration.channel.DirectChannel; + +import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.dsl.IntegrationFlow; @@ -18,66 +16,62 @@ import org.springframework.integration.dsl.IntegrationFlow; public class SeparateFlowsExample { @MessagingGateway public interface NumbersClassifier { - @Gateway(requestChannel = "multipleof3Flow.input") - void multipleof3(Collection is); + @Gateway(requestChannel = "multipleOfThreeFlow.input") + void multipleofThree(Collection numbers); - @Gateway(requestChannel = "remainderIs1Flow.input") - void remainderIs1(Collection is); + @Gateway(requestChannel = "remainderIsOneFlow.input") + void remainderIsOne(Collection numbers); - @Gateway(requestChannel = "remainderIs2Flow.input") - void remainderIs2(Collection numbers); + @Gateway(requestChannel = "remainderIsTwoFlow.input") + void remainderIsTwo(Collection numbers); + } + + @Bean + QueueChannel multipleOfThreeChannel() { + return new QueueChannel(); + } + + @Bean + QueueChannel remainderIsOneChannel() { + return new QueueChannel(); + } + + @Bean + QueueChannel remainderIsTwoChannel() { + return new QueueChannel(); + } + + boolean isMultipleOfThree(Integer number) { + return number % 3 == 0; + } + + boolean isRemainderOne(Integer number) { + return number % 3 == 1; + } + + boolean isRemainderTwo(Integer number) { + return number % 3 == 2; } @Bean - DirectChannel multipleof3Channel() { - return new DirectChannel(); + public IntegrationFlow multipleOfThreeFlow() { + return flow -> flow.split() + . filter(this::isMultipleOfThree) + .channel("multipleOfThreeChannel"); } @Bean - DirectChannel remainderIs1Channel() { - return new DirectChannel(); + public IntegrationFlow remainderIsOneFlow() { + return flow -> flow.split() + . filter(this::isRemainderOne) + .channel("remainderIsOneChannel"); } @Bean - DirectChannel remainderIs2Channel() { - return new DirectChannel(); + public IntegrationFlow remainderIsTwoFlow() { + return flow -> flow.split() + . filter(this::isRemainderTwo) + .channel("remainderIsTwoChannel"); } - @Bean - public IntegrationFlow multipleof3Flow() { - return f -> f.split() - . filter(p -> p % 3 == 0) - .channel("multipleof3Channel"); - } - - @Bean - public IntegrationFlow remainderIs1Flow() { - return f -> f.split() - . filter(p -> p % 3 == 1) - .channel("remainderIs1Channel"); - } - - @Bean - public IntegrationFlow remainderIs2Flow() { - return f -> f.split() - . filter(p -> p % 3 == 2) - .channel("remainderIs2Channel"); - } - - public static void main(String[] args) { - final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(SeparateFlowsExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); - multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); - remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); - remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - ctx.getBean(NumbersClassifier.class) - .multipleof3(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.getBean(NumbersClassifier.class) - .remainderIs1(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.getBean(NumbersClassifier.class) - .remainderIs2(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } } \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java b/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java deleted file mode 100644 index 6db3741523..0000000000 --- a/spring-integration/src/main/java/com/baeldung/subflows/subflowchannel/FilterExample.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.baeldung.subflows.subflowchannel; - -import java.util.Arrays; -import java.util.Collection; - -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.integration.annotation.Gateway; -import org.springframework.integration.annotation.IntegrationComponentScan; -import org.springframework.integration.annotation.MessagingGateway; -import org.springframework.integration.channel.DirectChannel; -import org.springframework.integration.config.EnableIntegration; -import org.springframework.integration.dsl.IntegrationFlow; - -@EnableIntegration -@IntegrationComponentScan -public class FilterExample { - @MessagingGateway - public interface NumbersClassifier { - @Gateway(requestChannel = "flow.input") - void flow(Collection numbers); - } - - @Bean - DirectChannel multipleof3Channel() { - return new DirectChannel(); - } - - @Bean - DirectChannel remainderIs1Channel() { - return new DirectChannel(); - } - - @Bean - DirectChannel remainderIs2Channel() { - return new DirectChannel(); - } - - @Bean - public IntegrationFlow flow() { - return flow -> flow.split() - . filter(x -> x % 3 == 0, sf -> sf.discardFlow(subf -> subf. filter(x -> x % 3 == 1, ssf -> ssf.discardChannel("remainderIs2Channel")) - .channel("remainderIs1Channel"))) - .channel("multipleof3Channel"); - } - - public static void main(String[] args) { - final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(FilterExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); - multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); - remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); - remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - ctx.getBean(NumbersClassifier.class) - .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } -} \ No newline at end of file diff --git a/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java b/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java index de1f11cf70..c0e902e739 100644 --- a/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java +++ b/spring-integration/src/main/java/com/baeldung/subflows/subflowmapping/RouterExample.java @@ -1,15 +1,11 @@ package com.baeldung.subflows.subflowmapping; -import java.util.Arrays; import java.util.Collection; - -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.integration.annotation.Gateway; import org.springframework.integration.annotation.IntegrationComponentScan; import org.springframework.integration.annotation.MessagingGateway; -import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.dsl.IntegrationFlow; @@ -18,44 +14,49 @@ import org.springframework.integration.dsl.IntegrationFlow; public class RouterExample { @MessagingGateway public interface NumbersClassifier { - @Gateway(requestChannel = "flow.input") - void flow(Collection numbers); + @Gateway(requestChannel = "classify.input") + void classify(Collection numbers); } @Bean - DirectChannel multipleof3Channel() { - return new DirectChannel(); + QueueChannel multipleofThreeChannel() { + return new QueueChannel(); } @Bean - DirectChannel remainderIs1Channel() { - return new DirectChannel(); + QueueChannel remainderIsOneChannel() { + return new QueueChannel(); } @Bean - DirectChannel remainderIs2Channel() { - return new DirectChannel(); + QueueChannel remainderIsTwoChannel() { + return new QueueChannel(); + } + + boolean isMultipleOfThree(Integer number) { + return number % 3 == 0; + } + + boolean isRemainderOne(Integer number) { + return number % 3 == 1; + } + + boolean isRemainderTwo(Integer number) { + return number % 3 == 2; } @Bean - public IntegrationFlow flow() { - return f -> f.split() - . route(p -> p % 3, m -> m.channelMapping(0, "multipleof3Channel") - .subFlowMapping(1, sf -> sf.channel("remainderIs1Channel")) - .subFlowMapping(2, sf -> sf. handle((p, h) -> p))) - .channel("remainderIs2Channel"); + public IntegrationFlow classify() { + return flow -> flow.split() + . route(number -> number % 3, + mapping -> mapping + .channelMapping(0, "multipleofThreeChannel") + .subFlowMapping(1, subflow -> subflow.channel("remainderIsOneChannel")) + .subFlowMapping(2, subflow -> subflow + . handle((payload, headers) -> { + // do extra work on the payload + return payload; + }))).channel("remainderIsTwoChannel"); } - public static void main(String[] args) { - final ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(RouterExample.class); - DirectChannel multipleof3Channel = ctx.getBean("multipleof3Channel", DirectChannel.class); - multipleof3Channel.subscribe(x -> System.out.println("multipleof3Channel: " + x)); - DirectChannel remainderIs1Channel = ctx.getBean("remainderIs1Channel", DirectChannel.class); - remainderIs1Channel.subscribe(x -> System.out.println("remainderIs1Channel: " + x)); - DirectChannel remainderIs2Channel = ctx.getBean("remainderIs2Channel", DirectChannel.class); - remainderIs2Channel.subscribe(x -> System.out.println("remainderIs2Channel: " + x)); - ctx.getBean(NumbersClassifier.class) - .flow(Arrays.asList(1, 2, 3, 4, 5, 6)); - ctx.close(); - } } \ No newline at end of file diff --git a/spring-integration/src/test/java/com/baeldung/subflows/discardflow/FilterUnitTest.java b/spring-integration/src/test/java/com/baeldung/subflows/discardflow/FilterUnitTest.java new file mode 100644 index 0000000000..3b3106212b --- /dev/null +++ b/spring-integration/src/test/java/com/baeldung/subflows/discardflow/FilterUnitTest.java @@ -0,0 +1,62 @@ +package com.baeldung.subflows.discardflow; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.integration.channel.QueueChannel; +import org.springframework.messaging.Message; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.baeldung.subflows.discardflow.FilterExample.NumbersClassifier; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { FilterExample.class }) +public class FilterUnitTest { + @Autowired + private QueueChannel multipleofThreeChannel; + + @Autowired + private QueueChannel remainderIsOneChannel; + + @Autowired + private QueueChannel remainderIsTwoChannel; + + @Autowired + private NumbersClassifier numbersClassifier; + + @Test + public void whenSendMessagesToFlow_thenNumbersAreClassified() { + + numbersClassifier.classify(Arrays.asList(1, 2, 3, 4, 5, 6)); + + Message outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 3); + + outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 6); + + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 1); + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 4); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 2); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 5); + + } + +} diff --git a/spring-integration/src/test/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscribeChannelUnitTest.java b/spring-integration/src/test/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscribeChannelUnitTest.java new file mode 100644 index 0000000000..91bf38c626 --- /dev/null +++ b/spring-integration/src/test/java/com/baeldung/subflows/publishsubscribechannel/PublishSubscribeChannelUnitTest.java @@ -0,0 +1,62 @@ +package com.baeldung.subflows.publishsubscribechannel; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.integration.channel.QueueChannel; +import org.springframework.messaging.Message; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.baeldung.subflows.publishsubscribechannel.PublishSubscibeChannelExample.NumbersClassifier; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { PublishSubscibeChannelExample.class }) +public class PublishSubscribeChannelUnitTest { + @Autowired + private QueueChannel multipleofThreeChannel; + + @Autowired + private QueueChannel remainderIsOneChannel; + + @Autowired + private QueueChannel remainderIsTwoChannel; + + @Autowired + private NumbersClassifier numbersClassifier; + + @Test + public void whenSendMessagesToFlow_thenNumbersAreClassified() { + + numbersClassifier.classify(Arrays.asList(1, 2, 3, 4, 5, 6)); + + Message outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 3); + + outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 6); + + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 1); + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 4); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 2); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 5); + + } + +} diff --git a/spring-integration/src/test/java/com/baeldung/subflows/routetorecipients/RouteToRecipientsUnitTest.java b/spring-integration/src/test/java/com/baeldung/subflows/routetorecipients/RouteToRecipientsUnitTest.java new file mode 100644 index 0000000000..d7a768dcd9 --- /dev/null +++ b/spring-integration/src/test/java/com/baeldung/subflows/routetorecipients/RouteToRecipientsUnitTest.java @@ -0,0 +1,63 @@ +package com.baeldung.subflows.routetorecipients; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.integration.channel.QueueChannel; +import org.springframework.messaging.Message; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.baeldung.subflows.routetorecipients.RouteToRecipientsExample; +import com.baeldung.subflows.routetorecipients.RouteToRecipientsExample.NumbersClassifier; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { RouteToRecipientsExample.class }) +public class RouteToRecipientsUnitTest { + @Autowired + private QueueChannel multipleofThreeChannel; + + @Autowired + private QueueChannel remainderIsOneChannel; + + @Autowired + private QueueChannel remainderIsTwoChannel; + + @Autowired + private NumbersClassifier numbersClassifier; + + @Test + public void whenSendMessagesToFlow_thenNumbersAreClassified() { + + numbersClassifier.classify(Arrays.asList(1, 2, 3, 4, 5, 6)); + + Message outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 3); + + outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 6); + + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 1); + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 4); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 2); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 5); + + } + +} diff --git a/spring-integration/src/test/java/com/baeldung/subflows/separateflows/SeparateFlowsUnitTest.java b/spring-integration/src/test/java/com/baeldung/subflows/separateflows/SeparateFlowsUnitTest.java new file mode 100644 index 0000000000..c02badcb1a --- /dev/null +++ b/spring-integration/src/test/java/com/baeldung/subflows/separateflows/SeparateFlowsUnitTest.java @@ -0,0 +1,75 @@ +package com.baeldung.subflows.separateflows; + +import java.util.Arrays; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.integration.channel.QueueChannel; +import org.springframework.messaging.Message; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.baeldung.subflows.separateflows.SeparateFlowsExample.NumbersClassifier; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { SeparateFlowsExample.class }) +public class SeparateFlowsUnitTest { + @Autowired + private QueueChannel multipleOfThreeChannel; + @Autowired + private QueueChannel remainderIsOneChannel; + @Autowired + private QueueChannel remainderIsTwoChannel; + + @Autowired + private NumbersClassifier numbersClassifier; + + @Test + public void whenSendMessagesToMultipleOf3Flow_thenOutputMultiplesOf3() { + + numbersClassifier.multipleofThree(Arrays.asList(1, 2, 3, 4, 5, 6)); + + Message outMessage = multipleOfThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 3); + + outMessage = multipleOfThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 6); + outMessage = multipleOfThreeChannel.receive(0); + assertNull(outMessage); + } + + @Test + public void whenSendMessagesToRemainderIs1Flow_thenOutputRemainderIs1() { + + numbersClassifier.remainderIsOne(Arrays.asList(1, 2, 3, 4, 5, 6)); + + Message outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 1); + + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 4); + + } + + @Test + public void whenSendMessagesToRemainderIs2Flow_thenOutputRemainderIs2() { + + numbersClassifier.remainderIsTwo(Arrays.asList(1, 2, 3, 4, 5, 6)); + + Message outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 2); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 5); + + } + +} diff --git a/spring-integration/src/test/java/com/baeldung/subflows/subflowmapping/RouterUnitTest.java b/spring-integration/src/test/java/com/baeldung/subflows/subflowmapping/RouterUnitTest.java new file mode 100644 index 0000000000..9ecbb22a9b --- /dev/null +++ b/spring-integration/src/test/java/com/baeldung/subflows/subflowmapping/RouterUnitTest.java @@ -0,0 +1,62 @@ +package com.baeldung.subflows.subflowmapping; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.integration.channel.QueueChannel; +import org.springframework.messaging.Message; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.baeldung.subflows.subflowmapping.RouterExample.NumbersClassifier; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { RouterExample.class }) +public class RouterUnitTest { + @Autowired + private QueueChannel multipleofThreeChannel; + + @Autowired + private QueueChannel remainderIsOneChannel; + + @Autowired + private QueueChannel remainderIsTwoChannel; + + @Autowired + private NumbersClassifier numbersClassifier; + + @Test + public void whenSendMessagesToFlow_thenNumbersAreClassified() { + + numbersClassifier.classify(Arrays.asList(1, 2, 3, 4, 5, 6)); + + Message outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 3); + + outMessage = multipleofThreeChannel.receive(0); + + assertEquals(outMessage.getPayload(), 6); + + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 1); + outMessage = remainderIsOneChannel.receive(0); + + assertEquals(outMessage.getPayload(), 4); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 2); + + outMessage = remainderIsTwoChannel.receive(0); + + assertEquals(outMessage.getPayload(), 5); + + } + +} From 456f4b0f5a5a6a6ab0f6685c7cb84107728f320b Mon Sep 17 00:00:00 2001 From: cror Date: Mon, 19 Nov 2018 16:41:11 +0100 Subject: [PATCH 426/546] BAEL-2388: examples for equals and hashCode --- java-collections-maps/pom.xml | 6 +++ .../java/com/baeldung/map/hashCode/Money.java | 32 +++++++++++++ .../java/com/baeldung/map/hashCode/Team.java | 39 ++++++++++++++++ .../com/baeldung/map/hashCode/Voucher.java | 31 +++++++++++++ .../com/baeldung/map/hashCode/WrongTeam.java | 24 ++++++++++ .../baeldung/map/hashCode/WrongVoucher.java | 33 +++++++++++++ .../map/hashCode/equalsverifier_notes.txt | 1 + .../baeldung/map/hashCode/MoneyUnitTest.java | 27 +++++++++++ .../baeldung/map/hashCode/TeamUnitTest.java | 46 +++++++++++++++++++ 9 files changed, 239 insertions(+) create mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/Money.java create mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/Team.java create mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java create mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongTeam.java create mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java create mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt create mode 100644 java-collections-maps/src/test/java/com/baeldung/map/hashCode/MoneyUnitTest.java create mode 100644 java-collections-maps/src/test/java/com/baeldung/map/hashCode/TeamUnitTest.java diff --git a/java-collections-maps/pom.xml b/java-collections-maps/pom.xml index 0803866c51..6af8f7a5c6 100644 --- a/java-collections-maps/pom.xml +++ b/java-collections-maps/pom.xml @@ -41,6 +41,12 @@ streamex 0.6.5 + + nl.jqno.equalsverifier + equalsverifier + 3.0.3 + test + diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Money.java b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Money.java new file mode 100644 index 0000000000..0ba494d944 --- /dev/null +++ b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Money.java @@ -0,0 +1,32 @@ +package com.baeldung.map.hashcode; + +class Money { + + int amount; + String currencyCode; + + Money(int amount, String currencyCode) { + this.amount = amount; + this.currencyCode = currencyCode; + } + + @Override + public boolean equals(Object o) { + if (o == this) + return true; + if (!(o instanceof Money)) + return false; + Money other = (Money)o; + return this.amount == other.amount + && this.currencyCode == other.currencyCode; + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + amount; + result = 31 * result + currencyCode.hashCode(); + return result; + } + +} diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Team.java b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Team.java new file mode 100644 index 0000000000..6c1473b8e9 --- /dev/null +++ b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Team.java @@ -0,0 +1,39 @@ +package com.baeldung.map.hashcode; + +class Team { + + final String city; + final String department; + + Team(String city, String department) { + this.city = city; + this.department = department; + } + + @Override + public final boolean equals(Object o) { + if (o == this) + return true; + if (!(o instanceof Team)) + return false; + Team otherTeam = (Team)o; + boolean cityEquals = (this.city == null && otherTeam.city == null) + || this.city != null && this.city.equals(otherTeam.city); + boolean departmentEquals = (this.department == null && otherTeam.department == null) + || this.department != null && this.department.equals(otherTeam.department); + return cityEquals && departmentEquals; + } + + @Override + public final int hashCode() { + int result = 17; + if (city != null) { + result = 31 * result + city.hashCode(); + } + if (department != null) { + result = 31 * result + department.hashCode(); + } + return result; + } + +} diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java new file mode 100644 index 0000000000..b4536b38ea --- /dev/null +++ b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java @@ -0,0 +1,31 @@ +package com.baeldung.map.hashcode; + +class Voucher { + + private Money value; + private String store; + + Voucher(int amount, String currencyCode, String store) { + this.value = new Money(amount, currencyCode); + this.store = store; + } + + @Override + public boolean equals(Object o) { + if (o == this) + return true; + if (!(o instanceof Voucher)) + return false; + Voucher other = (Voucher)o; + return this.value == other.value + && this.store == other.store; + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + value.hashCode(); + result = 31 * result + store.hashCode(); + return result; + } +} \ No newline at end of file diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongTeam.java b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongTeam.java new file mode 100644 index 0000000000..57fb218ce0 --- /dev/null +++ b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongTeam.java @@ -0,0 +1,24 @@ +package com.baeldung.map.hashcode; + +class WrongTeam { + + String city; + String department; + + WrongTeam(String city, String department) { + this.city = city; + this.department = department; + } + + @Override + public boolean equals(Object o) { + if (o == this) + return true; + if (!(o instanceof WrongTeam)) + return false; + WrongTeam otherTeam = (WrongTeam)o; + return this.city == otherTeam.city + && this.department == otherTeam.department; + } + +} diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java new file mode 100644 index 0000000000..03122c7cc8 --- /dev/null +++ b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java @@ -0,0 +1,33 @@ +package com.baeldung.map.hashcode; + +class WrongVoucher extends Money { + + private String store; + + WrongVoucher(int amount, String currencyCode, String store) { + super(amount, currencyCode); + + this.store = store; + } + + @Override + public boolean equals(Object o) { + if (o == this) + return true; + if (!(o instanceof WrongVoucher)) + return false; + WrongVoucher other = (WrongVoucher)o; + return this.amount == other.amount + && this.currencyCode == other.currencyCode + && this.store == other.store; + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + amount; + result = 31 * result + currencyCode.hashCode(); + result = 31 * result + store.hashCode(); + return result; + } +} \ No newline at end of file diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt new file mode 100644 index 0000000000..adc14f393a --- /dev/null +++ b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt @@ -0,0 +1 @@ + Non-nullity: hashCode throws NullPointerException on field city. diff --git a/java-collections-maps/src/test/java/com/baeldung/map/hashCode/MoneyUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/hashCode/MoneyUnitTest.java new file mode 100644 index 0000000000..f4cba4d114 --- /dev/null +++ b/java-collections-maps/src/test/java/com/baeldung/map/hashCode/MoneyUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.map.hashcode; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertFalse; + +import org.junit.Test; + +public class MoneyUnitTest { + + @Test + public void givenMoneyInstancesWithSameAmountAndCurrency_whenEquals_thenReturnsTrue() { + Money income = new Money(55, "USD"); + Money expenses = new Money(55, "USD"); + + assertTrue(income.equals(expenses)); + } + + @Test + public void givenMoneyAndVoucherInstances_whenEquals_thenReturnValuesArentSymmetric() { + Money cash = new Money(42, "USD"); + WrongVoucher voucher = new WrongVoucher(42, "USD", "Amazon"); + + assertFalse(voucher.equals(cash)); + assertTrue(cash.equals(voucher)); + } + +} diff --git a/java-collections-maps/src/test/java/com/baeldung/map/hashCode/TeamUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/hashCode/TeamUnitTest.java new file mode 100644 index 0000000000..89a7462438 --- /dev/null +++ b/java-collections-maps/src/test/java/com/baeldung/map/hashCode/TeamUnitTest.java @@ -0,0 +1,46 @@ +package com.baeldung.map.hashcode; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; + +import nl.jqno.equalsverifier.EqualsVerifier; + +public class TeamUnitTest { + + @Test + public void givenMapKeyWithHashCode_whenSearched_thenReturnsCorrectValue() { + Map leaders = new HashMap<>(); + leaders.put(new Team("New York", "development"), "Anne"); + leaders.put(new Team("Boston", "development"), "Brian"); + leaders.put(new Team("Boston", "marketing"), "Charlie"); + + Team myTeam = new Team("New York", "development"); + String myTeamleader = leaders.get(myTeam); + + assertEquals("Anne", myTeamleader); + } + + @Test + public void givenMapKeyWithoutHashCode_whenSearched_thenReturnsWrongValue() { + Map leaders = new HashMap<>(); + leaders.put(new WrongTeam("New York", "development"), "Anne"); + leaders.put(new WrongTeam("Boston", "development"), "Brian"); + leaders.put(new WrongTeam("Boston", "marketing"), "Charlie"); + + WrongTeam myTeam = new WrongTeam("New York", "development"); + String myTeamleader = leaders.get(myTeam); + + assertFalse("Anne".equals(myTeamleader)); + } + + @Test + public void equalsContract() { + EqualsVerifier.forClass(Team.class).verify(); + } + +} From cd8a9fd89a059beb8d709e5eebb04479ccb0d897 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Mon, 19 Nov 2018 22:57:27 +0200 Subject: [PATCH 427/546] Update spring.factories --- .../src/main/resources/META-INF/spring.factories | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories b/spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories index 5f55544eff..11c775fc6c 100644 --- a/spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories +++ b/spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories @@ -1,3 +1 @@ -org.springframework.boot.diagnostics.FailureAnalyzer=com.baeldung.failureanalyzer.MyBeanNotOfRequiredTypeFailureAnalyzer - -org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.baeldung.autoconfiguration.MySQLAutoconfiguration \ No newline at end of file +org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.baeldung.autoconfiguration.MySQLAutoconfiguration From 4d30ff3b438cd19d240a6b38225c74727c5a964a Mon Sep 17 00:00:00 2001 From: getwordsdone <44430887+getwordsdone@users.noreply.github.com> Date: Tue, 20 Nov 2018 10:31:31 +0530 Subject: [PATCH 428/546] A Guide to Constructors Issue: BAEL-2345 --- .../baeldung/constructors/BankAccount.java | 56 +++++++++++++++++++ .../baeldung/constructors/Transaction.java | 25 +++++++++ .../constructors/ConstructorUnitTest.java | 53 ++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/constructors/BankAccount.java create mode 100644 core-java/src/main/java/com/baeldung/constructors/Transaction.java create mode 100644 core-java/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/constructors/BankAccount.java b/core-java/src/main/java/com/baeldung/constructors/BankAccount.java new file mode 100644 index 0000000000..3d50e85245 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/constructors/BankAccount.java @@ -0,0 +1,56 @@ +package com.baeldung.constructors; + +import java.time.LocalDateTime; + +class BankAccount { + String name; + LocalDateTime opened; + double balance; + + @Override + public String toString() { + return String.format("%s, %s, %f", this.name, this.opened.toString(), this.balance); + } + + public String getName() { + return name; + } + + public LocalDateTime getOpened() { + return opened; + } + + public double getBalance() { + return this.balance; + } +} + +class BankAccountEmptyConstructor extends BankAccount { + public BankAccountEmptyConstructor() { + this.name = ""; + this.opened = LocalDateTime.now(); + this.balance = 0.0d; + } +} + +class BankAccountParameterizedConstructor extends BankAccount { + public BankAccountParameterizedConstructor(String name, LocalDateTime opened, double balance) { + this.name = name; + this.opened = opened; + this.balance = balance; + } +} + +class BankAccountCopyConstructor extends BankAccount { + public BankAccountCopyConstructor(String name, LocalDateTime opened, double balance) { + this.name = name; + this.opened = opened; + this.balance = balance; + } + + public BankAccountCopyConstructor(BankAccount other) { + this.name = other.name; + this.opened = LocalDateTime.now(); + this.balance = 0.0f; + } +} diff --git a/core-java/src/main/java/com/baeldung/constructors/Transaction.java b/core-java/src/main/java/com/baeldung/constructors/Transaction.java new file mode 100644 index 0000000000..14704f507a --- /dev/null +++ b/core-java/src/main/java/com/baeldung/constructors/Transaction.java @@ -0,0 +1,25 @@ +package com.baeldung.constructors; + +import java.time.LocalDateTime; + +class Transaction { + final BankAccountEmptyConstructor bankAccount; + final LocalDateTime date; + final double amount; + + public Transaction(BankAccountEmptyConstructor account, LocalDateTime date, double amount) { + this.bankAccount = account; + this.date = date; + this.amount = amount; + } + + /* + * Compilation Error :'(, all final variables must be explicitly initialised. + * public Transaction() { + * } + */ + + public void invalidMethod() { + // this.amount = 102.03; // Results in a compiler error. You cannot change the value of a final variable. + } +} diff --git a/core-java/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java b/core-java/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java new file mode 100644 index 0000000000..2cd8832fbf --- /dev/null +++ b/core-java/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java @@ -0,0 +1,53 @@ +package com.baeldung.constructors; + +import com.baeldung.constructors.*; + +import java.util.logging.Logger; +import java.time.LocalDateTime; +import java.time.Month; + +import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +public class ConstructorUnitTest { + final static Logger LOGGER = Logger.getLogger(ConstructorUnitTest.class.getName()); + + @Test + public void givenNoExplicitContructor_whenUsed_thenFails() { + BankAccount account = new BankAccount(); + assertThatThrownBy(() -> { account.toString(); }).isInstanceOf(Exception.class); + } + + @Test + public void givenNoArgumentConstructor_whenUsed_thenSucceeds() { + BankAccountEmptyConstructor account = new BankAccountEmptyConstructor(); + assertThatCode(() -> { + account.toString(); + }).doesNotThrowAnyException(); + } + + @Test + public void givenParameterisedConstructor_whenUsed_thenSucceeds() { + LocalDateTime opened = LocalDateTime.of(2018, Month.JUNE, 29, 06, 30, 00); + BankAccountParameterizedConstructor account = + new BankAccountParameterizedConstructor("Tom", opened, 1000.0f); + + assertThatCode(() -> { + account.toString(); + }).doesNotThrowAnyException(); + } + + @Test + public void givenCopyContructor_whenUser_thenMaintainsLogic() { + LocalDateTime opened = LocalDateTime.of(2018, Month.JUNE, 29, 06, 30, 00); + BankAccountCopyConstructor account = new BankAccountCopyConstructor("Tim", opened, 1000.0f); + BankAccountCopyConstructor newAccount = new BankAccountCopyConstructor(account); + + assertThat(account.getName()).isEqualTo(newAccount.getName()); + assertThat(account.getOpened()).isNotEqualTo(newAccount.getOpened()); + + assertThat(newAccount.getBalance()).isEqualTo(0.0f); + } +} From a67c10eec7ff0d733c1ed86f6f590147c4bb7140 Mon Sep 17 00:00:00 2001 From: cror Date: Tue, 20 Nov 2018 13:01:06 +0100 Subject: [PATCH 429/546] BAEL-2388: moved examples java-collections-maps -> core-java-long. Fixing String comparisons --- core-java-lang/pom.xml | 7 +++ .../com/baeldung/equalshashcode}/Money.java | 10 ++-- .../com/baeldung/equalshashcode}/Team.java | 2 +- .../com/baeldung/equalshashcode/Voucher.java | 38 +++++++++++++++ .../baeldung/equalshashcode}/WrongTeam.java | 8 +++- .../baeldung/equalshashcode/WrongVoucher.java | 47 +++++++++++++++++++ .../equalshashcode}/MoneyUnitTest.java | 2 +- .../equalshashcode}/TeamUnitTest.java | 2 +- java-collections-maps/pom.xml | 6 --- .../com/baeldung/map/hashCode/Voucher.java | 31 ------------ .../baeldung/map/hashCode/WrongVoucher.java | 33 ------------- .../map/hashCode/equalsverifier_notes.txt | 1 - 12 files changed, 109 insertions(+), 78 deletions(-) rename {java-collections-maps/src/main/java/com/baeldung/map/hashCode => core-java-lang/src/main/java/com/baeldung/equalshashcode}/Money.java (60%) rename {java-collections-maps/src/main/java/com/baeldung/map/hashCode => core-java-lang/src/main/java/com/baeldung/equalshashcode}/Team.java (96%) create mode 100644 core-java-lang/src/main/java/com/baeldung/equalshashcode/Voucher.java rename {java-collections-maps/src/main/java/com/baeldung/map/hashCode => core-java-lang/src/main/java/com/baeldung/equalshashcode}/WrongTeam.java (67%) create mode 100644 core-java-lang/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java rename {java-collections-maps/src/test/java/com/baeldung/map/hashCode => core-java-lang/src/test/java/com/baeldung/equalshashcode}/MoneyUnitTest.java (94%) rename {java-collections-maps/src/test/java/com/baeldung/map/hashCode => core-java-lang/src/test/java/com/baeldung/equalshashcode}/TeamUnitTest.java (97%) delete mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java delete mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java delete mode 100644 java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt diff --git a/core-java-lang/pom.xml b/core-java-lang/pom.xml index ace39de274..2f307859f1 100644 --- a/core-java-lang/pom.xml +++ b/core-java-lang/pom.xml @@ -66,6 +66,12 @@ mail ${javax.mail.version} + + nl.jqno.equalsverifier + equalsverifier + ${equalsverifier.version} + test + @@ -424,6 +430,7 @@ 3.1.1 2.0.3.RELEASE 1.6.0 + 3.0.3 diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Money.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/Money.java similarity index 60% rename from java-collections-maps/src/main/java/com/baeldung/map/hashCode/Money.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/Money.java index 0ba494d944..60c043545d 100644 --- a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Money.java +++ b/core-java-lang/src/main/java/com/baeldung/equalshashcode/Money.java @@ -1,4 +1,4 @@ -package com.baeldung.map.hashcode; +package com.baeldung.equalshashcode; class Money { @@ -17,15 +17,19 @@ class Money { if (!(o instanceof Money)) return false; Money other = (Money)o; + boolean currencyCodeEquals = (this.currencyCode == null && other.currencyCode == null) + || (this.currencyCode != null && this.currencyCode.equals(other.currencyCode)); return this.amount == other.amount - && this.currencyCode == other.currencyCode; + && currencyCodeEquals; } @Override public int hashCode() { int result = 17; result = 31 * result + amount; - result = 31 * result + currencyCode.hashCode(); + if (currencyCode != null) { + result = 31 * result + currencyCode.hashCode(); + } return result; } diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Team.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/Team.java similarity index 96% rename from java-collections-maps/src/main/java/com/baeldung/map/hashCode/Team.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/Team.java index 6c1473b8e9..c2dee1de6b 100644 --- a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Team.java +++ b/core-java-lang/src/main/java/com/baeldung/equalshashcode/Team.java @@ -1,4 +1,4 @@ -package com.baeldung.map.hashcode; +package com.baeldung.equalshashcode; class Team { diff --git a/core-java-lang/src/main/java/com/baeldung/equalshashcode/Voucher.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/Voucher.java new file mode 100644 index 0000000000..19f46e0358 --- /dev/null +++ b/core-java-lang/src/main/java/com/baeldung/equalshashcode/Voucher.java @@ -0,0 +1,38 @@ +package com.baeldung.equalshashcode; + +class Voucher { + + private Money value; + private String store; + + Voucher(int amount, String currencyCode, String store) { + this.value = new Money(amount, currencyCode); + this.store = store; + } + + @Override + public boolean equals(Object o) { + if (o == this) + return true; + if (!(o instanceof Voucher)) + return false; + Voucher other = (Voucher)o; + boolean valueEquals = (this.value == null && other.value == null) + || (this.value != null && this.value.equals(other.value)); + boolean storeEquals = (this.store == null && other.store == null) + || (this.store != null && this.store.equals(other.store)); + return valueEquals && storeEquals; + } + + @Override + public int hashCode() { + int result = 17; + if (this.value != null) { + result = 31 * result + value.hashCode(); + } + if (this.store != null) { + result = 31 * result + store.hashCode(); + } + return result; + } +} \ No newline at end of file diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongTeam.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/WrongTeam.java similarity index 67% rename from java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongTeam.java rename to core-java-lang/src/main/java/com/baeldung/equalshashcode/WrongTeam.java index 57fb218ce0..c4477aa790 100644 --- a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongTeam.java +++ b/core-java-lang/src/main/java/com/baeldung/equalshashcode/WrongTeam.java @@ -1,5 +1,11 @@ -package com.baeldung.map.hashcode; +package com.baeldung.equalshashcode; +/* (non-Javadoc) +* This class overrides equals, but it doesn't override hashCode. +* +* To see which problems this leads to: +* TeamUnitTest.givenMapKeyWithoutHashCode_whenSearched_thenReturnsWrongValue +*/ class WrongTeam { String city; diff --git a/core-java-lang/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java b/core-java-lang/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java new file mode 100644 index 0000000000..97935bf8de --- /dev/null +++ b/core-java-lang/src/main/java/com/baeldung/equalshashcode/WrongVoucher.java @@ -0,0 +1,47 @@ +package com.baeldung.equalshashcode; + +/* (non-Javadoc) +* This class extends the Money class that has overridden the equals method and once again overrides the equals method. +* +* To see which problems this leads to: +* MoneyUnitTest.givenMoneyAndVoucherInstances_whenEquals_thenReturnValuesArentSymmetric +*/ +class WrongVoucher extends Money { + + private String store; + + WrongVoucher(int amount, String currencyCode, String store) { + super(amount, currencyCode); + + this.store = store; + } + + @Override + public boolean equals(Object o) { + if (o == this) + return true; + if (!(o instanceof WrongVoucher)) + return false; + WrongVoucher other = (WrongVoucher)o; + boolean currencyCodeEquals = (this.currencyCode == null && other.currencyCode == null) + || (this.currencyCode != null && this.currencyCode.equals(other.currencyCode)); + boolean storeEquals = (this.store == null && other.store == null) + || (this.store != null && this.store.equals(other.store)); + return this.amount == other.amount + && currencyCodeEquals + && storeEquals; + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + amount; + if (this.currencyCode != null) { + result = 31 * result + currencyCode.hashCode(); + } + if (this.store != null) { + result = 31 * result + store.hashCode(); + } + return result; + } +} \ No newline at end of file diff --git a/java-collections-maps/src/test/java/com/baeldung/map/hashCode/MoneyUnitTest.java b/core-java-lang/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java similarity index 94% rename from java-collections-maps/src/test/java/com/baeldung/map/hashCode/MoneyUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java index f4cba4d114..60584fdb53 100644 --- a/java-collections-maps/src/test/java/com/baeldung/map/hashCode/MoneyUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/equalshashcode/MoneyUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.map.hashcode; +package com.baeldung.equalshashcode; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; diff --git a/java-collections-maps/src/test/java/com/baeldung/map/hashCode/TeamUnitTest.java b/core-java-lang/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java similarity index 97% rename from java-collections-maps/src/test/java/com/baeldung/map/hashCode/TeamUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java index 89a7462438..a2de408796 100644 --- a/java-collections-maps/src/test/java/com/baeldung/map/hashCode/TeamUnitTest.java +++ b/core-java-lang/src/test/java/com/baeldung/equalshashcode/TeamUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.map.hashcode; +package com.baeldung.equalshashcode; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/java-collections-maps/pom.xml b/java-collections-maps/pom.xml index 6af8f7a5c6..0803866c51 100644 --- a/java-collections-maps/pom.xml +++ b/java-collections-maps/pom.xml @@ -41,12 +41,6 @@ streamex 0.6.5 - - nl.jqno.equalsverifier - equalsverifier - 3.0.3 - test - diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java deleted file mode 100644 index b4536b38ea..0000000000 --- a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/Voucher.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.baeldung.map.hashcode; - -class Voucher { - - private Money value; - private String store; - - Voucher(int amount, String currencyCode, String store) { - this.value = new Money(amount, currencyCode); - this.store = store; - } - - @Override - public boolean equals(Object o) { - if (o == this) - return true; - if (!(o instanceof Voucher)) - return false; - Voucher other = (Voucher)o; - return this.value == other.value - && this.store == other.store; - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + value.hashCode(); - result = 31 * result + store.hashCode(); - return result; - } -} \ No newline at end of file diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java deleted file mode 100644 index 03122c7cc8..0000000000 --- a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/WrongVoucher.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.baeldung.map.hashcode; - -class WrongVoucher extends Money { - - private String store; - - WrongVoucher(int amount, String currencyCode, String store) { - super(amount, currencyCode); - - this.store = store; - } - - @Override - public boolean equals(Object o) { - if (o == this) - return true; - if (!(o instanceof WrongVoucher)) - return false; - WrongVoucher other = (WrongVoucher)o; - return this.amount == other.amount - && this.currencyCode == other.currencyCode - && this.store == other.store; - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + amount; - result = 31 * result + currencyCode.hashCode(); - result = 31 * result + store.hashCode(); - return result; - } -} \ No newline at end of file diff --git a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt b/java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt deleted file mode 100644 index adc14f393a..0000000000 --- a/java-collections-maps/src/main/java/com/baeldung/map/hashCode/equalsverifier_notes.txt +++ /dev/null @@ -1 +0,0 @@ - Non-nullity: hashCode throws NullPointerException on field city. From 6045b4291a618d4b00046aa9ae495f1ff325996b Mon Sep 17 00:00:00 2001 From: Jan Hauer Date: Thu, 8 Nov 2018 10:43:42 +0100 Subject: [PATCH 430/546] BAEL-2305 Adds array intersection operations --- .../array/operations/ArrayOperations.java | 14 ++++ .../operations/IntersectionUnitTest.java | 66 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java diff --git a/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java b/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java index 98155ed952..d8cc0afd61 100644 --- a/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java +++ b/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java @@ -4,11 +4,13 @@ import java.lang.reflect.Array; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedHashSet; +import java.util.LinkedList; import java.util.Random; import java.util.Set; import java.util.function.Function; import java.util.function.IntPredicate; import java.util.function.Predicate; +import java.util.stream.Stream; import org.apache.commons.lang3.ArrayUtils; @@ -194,4 +196,16 @@ public class ArrayOperations { public static T getRandomFromObjectArray(T[] array) { return array[new Random().nextInt(array.length)]; } + + public static Integer[] intersectionSimple(final Integer[] a, final Integer[] b){ + return Stream.of(a).filter(Arrays.asList(b)::contains).toArray(Integer[]::new); + } + + public static Integer[] intersectionSet(final Integer[] a, final Integer[] b){ + return Stream.of(a).filter(Arrays.asList(b)::contains).distinct().toArray(Integer[]::new); + } + + public static Integer[] intersectionMultiSet(final Integer[] a, final Integer[] b){ + return Stream.of(a).filter(new LinkedList<>(Arrays.asList(b))::remove).toArray(Integer[]::new); + } } diff --git a/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java b/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java new file mode 100644 index 0000000000..3c61060ea8 --- /dev/null +++ b/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java @@ -0,0 +1,66 @@ +package com.baeldung.array.operations; + +import org.junit.jupiter.api.Test; + +import static com.baeldung.array.operations.ArrayOperations.intersectionMultiSet; +import static com.baeldung.array.operations.ArrayOperations.intersectionSet; +import static com.baeldung.array.operations.ArrayOperations.intersectionSimple; +import static org.assertj.core.api.Assertions.assertThat; + +class IntersectionUnitTest { + private static final Integer[] a = { 1, 3, 2 }; + private static final Integer[] b = { 4, 3, 2, 4, 2, 3, 4, 4, 3 }; + private static final Integer[] c = { 1, 3, 2, 3, 3, 2 }; + + @Test + void whenIntersectionSimpleIsUsed_thenCommonEntriesAreInTheResult() { + assertThat(intersectionSimple(a, b)).isEqualTo(new Integer[] { 3, 2 }); + assertThat(intersectionSimple(b, a)).isEqualTo(new Integer[] { 3, 2, 2, 3, 3 }); + } + + @Test + void whenIntersectionSimpleIsUsedWithAnArrayAndItself_thenTheResultIsTheIdentity() { + assertThat(intersectionSimple(b, b)).isEqualTo(b); + assertThat(intersectionSimple(a, a)).isEqualTo(a); + } + + @Test + void whenIntersectionSetIsUsed_thenCommonEntriesAreInTheResult() { + assertThat(intersectionSet(b, a)).isEqualTo(new Integer[] { 3, 2 }); + } + + @Test + void whenIntersectionSetIsUsed_thenTheNumberOfEntriesDoesNotChangeWithTheParameterOrder() { + assertThat(intersectionSet(a, b)).isEqualTo(new Integer[] { 3, 2 }); + assertThat(intersectionSet(b, a)).isEqualTo(new Integer[] { 3, 2 }); + } + + @Test + void whenIntersectionSetIsUsedWithAnArrayAndWithItself_andTheInputHasNoDuplicateEntries_ThenTheResultIsTheIdentity() { + assertThat(intersectionSet(a, a)).isEqualTo(a); + } + + @Test + void whenIntersectionSetIsUsedWithAnArrayAndWithItself_andTheInputHasDuplicateEntries_ThenTheResultIsNotTheIdentity() { + assertThat(intersectionSet(b, b)).isNotEqualTo(b); + } + + @Test + void whenMultiSetIsUsed_thenCommonEntriesAreInTheResult() { + assertThat(intersectionMultiSet(b, a)).isEqualTo(new Integer[] { 3, 2 }); + } + + @Test + void whenIntersectionMultiSetIsUsed_thenTheNumberOfEntriesDoesNotChangeWithTheParameterOrder() { + assertThat(intersectionMultiSet(a, b)).isEqualTo(new Integer[] { 3, 2 }); + assertThat(intersectionMultiSet(b, a)).isEqualTo(new Integer[] { 3, 2 }); + assertThat(intersectionMultiSet(b, c)).isEqualTo(new Integer[] { 3, 2, 2, 3, 3 }); + assertThat(intersectionMultiSet(c, b)).isEqualTo(new Integer[] { 3, 2, 3, 3, 2 }); + } + + @Test + void whenIntersectionMultiSetIsUsedWithAnArrayAndWithItself_ThenTheResultIsTheIdentity() { + assertThat(intersectionMultiSet(b, b)).isEqualTo(b); + assertThat(intersectionMultiSet(a, a)).isEqualTo(a); + } +} \ No newline at end of file From 2c4cefe51693fb961d15b4ea5942868909603c9a Mon Sep 17 00:00:00 2001 From: Vizsoro Date: Tue, 20 Nov 2018 19:33:54 +0100 Subject: [PATCH 431/546] Arrow in Kotlin Issue: BAEL-1495 --- kotlin-libraries/pom.xml | 7 + .../FunctionalErrorHandlingWithEither.kt | 54 +++++++ .../FunctionalErrorHandlingWithOption.kt | 46 ++++++ .../kotlin/arrow/FunctionalDataTypes.kt | 143 ++++++++++++++++++ .../FunctionalErrorHandlingWithEitherTest.kt | 68 +++++++++ .../FunctionalErrorHandlingWithOptionTest.kt | 34 +++++ 6 files changed, 352 insertions(+) create mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEither.kt create mode 100644 kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOption.kt create mode 100644 kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalDataTypes.kt create mode 100644 kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEitherTest.kt create mode 100644 kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOptionTest.kt diff --git a/kotlin-libraries/pom.xml b/kotlin-libraries/pom.xml index c5b7fed951..92a643e458 100644 --- a/kotlin-libraries/pom.xml +++ b/kotlin-libraries/pom.xml @@ -87,6 +87,13 @@ h2 ${h2database.version} + + + io.arrow-kt + arrow-core + 0.7.3 + + diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEither.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEither.kt new file mode 100644 index 0000000000..75dfb9a2a4 --- /dev/null +++ b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEither.kt @@ -0,0 +1,54 @@ +package com.baeldung.kotlin.arrow + +import arrow.core.Either +import arrow.core.filterOrElse +import kotlin.math.sqrt + +class FunctionalErrorHandlingWithEither { + + sealed class ComputeProblem { + object OddNumber : ComputeProblem() + object NotANumber : ComputeProblem() + } + + fun parseInput(s : String) : Either = Either.cond(s.toIntOrNull() != null, {-> s.toInt()}, {->ComputeProblem.NotANumber} ) + + fun isEven(x : Int) : Boolean = x % 2 == 0 + + fun biggestDivisor(x: Int) : Int = biggestDivisor(x, 2) + + fun biggestDivisor(x : Int, y : Int) : Int { + if(x == y){ + return 1; + } + if(x % y == 0){ + return x / y; + } + return biggestDivisor(x, y+1) + } + + fun isSquareNumber(x : Int) : Boolean { + val sqrt: Double = sqrt(x.toDouble()) + return sqrt % 1.0 == 0.0 + } + + fun computeWithEither(input : String) : Either { + return parseInput(input) + .filterOrElse(::isEven) {->ComputeProblem.OddNumber} + .map (::biggestDivisor) + .map (::isSquareNumber) + } + + fun computeWithEitherClient(input : String) { + val computeWithEither = computeWithEither(input) + + when(computeWithEither){ + is Either.Right -> "The greatest divisor is square number: ${computeWithEither.b}" + is Either.Left -> when(computeWithEither.a){ + is ComputeProblem.NotANumber -> "Wrong input! Not a number!" + is ComputeProblem.OddNumber -> "It is an odd number!" + } + } + } + +} \ No newline at end of file diff --git a/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOption.kt b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOption.kt new file mode 100644 index 0000000000..5fddd1d88e --- /dev/null +++ b/kotlin-libraries/src/main/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOption.kt @@ -0,0 +1,46 @@ +package com.baeldung.kotlin.arrow + +import arrow.core.None +import arrow.core.Option +import arrow.core.Some +import kotlin.math.sqrt + +class FunctionalErrorHandlingWithOption { + + fun parseInput(s : String) : Option = Option.fromNullable(s.toIntOrNull()) + + fun isEven(x : Int) : Boolean = x % 2 == 0 + + fun biggestDivisor(x: Int) : Int = biggestDivisor(x, 2) + + fun biggestDivisor(x : Int, y : Int) : Int { + if(x == y){ + return 1; + } + if(x % y == 0){ + return x / y; + } + return biggestDivisor(x, y+1) + } + + fun isSquareNumber(x : Int) : Boolean { + val sqrt: Double = sqrt(x.toDouble()) + return sqrt % 1.0 == 0.0 + } + + fun computeWithOption(input : String) : Option { + return parseInput(input) + .filter(::isEven) + .map(::biggestDivisor) + .map(::isSquareNumber) + } + + fun computeWithOptionClient(input : String) : String{ + val computeOption = computeWithOption(input) + + return when(computeOption){ + is None -> "Not an even number!" + is Some -> "The greatest divisor is square number: ${computeOption.t}" + } + } +} \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalDataTypes.kt b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalDataTypes.kt new file mode 100644 index 0000000000..692425ee07 --- /dev/null +++ b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalDataTypes.kt @@ -0,0 +1,143 @@ +package com.baeldung.kotlin.arrow + +import arrow.core.* +import org.junit.Assert +import org.junit.Test + +class FunctionalDataTypes { + + @Test + fun whenIdCreated_thanValueIsPresent(){ + val id = Id("foo") + val justId = Id.just("foo"); + + Assert.assertEquals("foo", id.extract()) + Assert.assertEquals(justId, id) + } + + fun length(s : String) : Int = s.length + + fun isBigEnough(i : Int) : Boolean = i > 10 + + @Test + fun whenIdCreated_thanMapIsAssociative(){ + val foo = Id("foo") + + val map1 = foo.map(::length) + .map(::isBigEnough) + val map2 = foo.map { s -> isBigEnough(length(s)) } + + Assert.assertEquals(map1, map2) + } + + fun lengthId(s : String) : Id = Id.just(length(s)) + + fun isBigEnoughId(i : Int) : Id = Id.just(isBigEnough(i)) + + @Test + fun whenIdCreated_thanFlatMapIsAssociative(){ + val bar = Id("bar") + + val flatMap = bar.flatMap(::lengthId) + .flatMap(::isBigEnoughId) + val flatMap1 = bar.flatMap { s -> lengthId(s).flatMap(::isBigEnoughId) } + + Assert.assertEquals(flatMap, flatMap1) + } + + @Test + fun whenOptionCreated_thanValueIsPresent(){ + val factory = Option.just(42) + val constructor = Option(42) + val emptyOptional = Option.empty() + val fromNullable = Option.fromNullable(null) + + Assert.assertEquals(42, factory.getOrElse { -1 }) + Assert.assertEquals(factory, constructor) + Assert.assertEquals(emptyOptional, fromNullable) + } + + @Test + fun whenOptionCreated_thanConstructorDifferFromFactory(){ + val constructor : Option = Option(null) + val fromNullable : Option = Option.fromNullable(null) + + try{ + constructor.map { s -> s!!.length } + Assert.fail() + } catch (e : KotlinNullPointerException){ + fromNullable.map { s->s!!.length } + } + Assert.assertNotEquals(constructor, fromNullable) + } + + fun wrapper(x : Integer?) : Option = if (x == null) Option.just(-1) else Option.just(x.toInt()) + + @Test + fun whenOptionFromNullableCreated_thanItBreaksLeftIdentity(){ + val optionFromNull = Option.fromNullable(null) + + Assert.assertNotEquals(optionFromNull.flatMap(::wrapper), wrapper(null)) + } + + @Test + fun whenEitherCreated_thanOneValueIsPresent(){ + val rightOnly : Either = Either.right(42) + val leftOnly : Either = Either.left("foo") + + Assert.assertTrue(rightOnly.isRight()) + Assert.assertTrue(leftOnly.isLeft()) + Assert.assertEquals(42, rightOnly.getOrElse { -1 }) + Assert.assertEquals(-1, leftOnly.getOrElse { -1 }) + + Assert.assertEquals(0, rightOnly.map { it % 2 }.getOrElse { -1 }) + Assert.assertEquals(-1, leftOnly.map { it % 2 }.getOrElse { -1 }) + Assert.assertTrue(rightOnly.flatMap { Either.Right(it % 2) }.isRight()) + Assert.assertTrue(leftOnly.flatMap { Either.Right(it % 2) }.isLeft()) + } + + @Test + fun whenEvalNowUsed_thenMapEvaluatedLazily(){ + val now = Eval.now(1) + Assert.assertEquals(1, now.value()) + + var counter : Int = 0 + val map = now.map { x -> counter++; x+1 } + Assert.assertEquals(0, counter) + + val value = map.value() + Assert.assertEquals(2, value) + Assert.assertEquals(1, counter) + } + + @Test + fun whenEvalLaterUsed_theResultIsMemoized(){ + var counter : Int = 0 + val later = Eval.later { counter++; counter } + Assert.assertEquals(0, counter) + + val firstValue = later.value() + Assert.assertEquals(1, firstValue) + Assert.assertEquals(1, counter) + + val secondValue = later.value() + Assert.assertEquals(1, secondValue) + Assert.assertEquals(1, counter) + } + + @Test + fun whenEvalAlwaysUsed_theResultIsNotMemoized(){ + var counter : Int = 0 + val later = Eval.always { counter++; counter } + Assert.assertEquals(0, counter) + + val firstValue = later.value() + Assert.assertEquals(1, firstValue) + Assert.assertEquals(1, counter) + + val secondValue = later.value() + Assert.assertEquals(2, secondValue) + Assert.assertEquals(2, counter) + } + +} \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEitherTest.kt b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEitherTest.kt new file mode 100644 index 0000000000..47fbf825a0 --- /dev/null +++ b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithEitherTest.kt @@ -0,0 +1,68 @@ +package com.baeldung.kotlin.arrow + +import arrow.core.Either +import com.baeldung.kotlin.arrow.FunctionalErrorHandlingWithEither.ComputeProblem.NotANumber +import com.baeldung.kotlin.arrow.FunctionalErrorHandlingWithEither.ComputeProblem.OddNumber +import org.junit.Assert +import org.junit.Test + +class FunctionalErrorHandlingWithEitherTest { + + val operator = FunctionalErrorHandlingWithEither() + + @Test + fun givenInvalidInput_whenComputeInvoked_NotANumberIsPresent(){ + val computeWithEither = operator.computeWithEither("bar") + + Assert.assertTrue(computeWithEither.isLeft()) + when(computeWithEither){ + is Either.Left -> when(computeWithEither.a){ + NotANumber -> "Ok." + else -> Assert.fail() + } + else -> Assert.fail() + } + } + + @Test + fun givenOddNumberInput_whenComputeInvoked_OddNumberIsPresent(){ + val computeWithEither = operator.computeWithEither("121") + + Assert.assertTrue(computeWithEither.isLeft()) + when(computeWithEither){ + is Either.Left -> when(computeWithEither.a){ + OddNumber -> "Ok." + else -> Assert.fail() + } + else -> Assert.fail() + } + } + + @Test + fun givenEvenNumberWithoutSquare_whenComputeInvoked_OddNumberIsPresent(){ + val computeWithEither = operator.computeWithEither("100") + + Assert.assertTrue(computeWithEither.isRight()) + when(computeWithEither){ + is Either.Right -> when(computeWithEither.b){ + false -> "Ok." + else -> Assert.fail() + } + else -> Assert.fail() + } + } + + @Test + fun givenEvenNumberWithSquare_whenComputeInvoked_OddNumberIsPresent(){ + val computeWithEither = operator.computeWithEither("98") + + Assert.assertTrue(computeWithEither.isRight()) + when(computeWithEither){ + is Either.Right -> when(computeWithEither.b){ + true -> "Ok." + else -> Assert.fail() + } + else -> Assert.fail() + } + } +} \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOptionTest.kt b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOptionTest.kt new file mode 100644 index 0000000000..3ca4cd033f --- /dev/null +++ b/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/arrow/FunctionalErrorHandlingWithOptionTest.kt @@ -0,0 +1,34 @@ +package com.baeldung.kotlin.arrow + +import org.junit.Assert +import org.junit.Test + +class FunctionalErrorHandlingWithOptionTest { + + val operator = FunctionalErrorHandlingWithOption() + + @Test + fun givenInvalidInput_thenErrorMessageIsPresent(){ + val useComputeOption = operator.computeWithOptionClient("foo") + Assert.assertEquals("Not an even number!", useComputeOption) + } + + @Test + fun givenOddNumberInput_thenErrorMessageIsPresent(){ + val useComputeOption = operator.computeWithOptionClient("539") + Assert.assertEquals("Not an even number!",useComputeOption) + } + + @Test + fun givenEvenNumberInputWithNonSquareNum_thenFalseMessageIsPresent(){ + val useComputeOption = operator.computeWithOptionClient("100") + Assert.assertEquals("The greatest divisor is square number: false",useComputeOption) + } + + @Test + fun givenEvenNumberInputWithSquareNum_thenTrueMessageIsPresent(){ + val useComputeOption = operator.computeWithOptionClient("242") + Assert.assertEquals("The greatest divisor is square number: true",useComputeOption) + } + +} \ No newline at end of file From b0ea0e56483771e87333c6ddaec6ab7b48997bb6 Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Tue, 20 Nov 2018 21:28:01 -0600 Subject: [PATCH 432/546] BAEL-2312: add link back to article --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index 11d9fd2ee0..7617897e95 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -85,3 +85,4 @@ - [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) - [Implementing a Binary Tree in Java](https://www.baeldung.com/java-binary-tree) +- [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) From 7e9f96117e5cc9becca1660adc855e07744f3b36 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Tue, 20 Nov 2018 21:33:41 -0600 Subject: [PATCH 433/546] BAEL-2312 update README (#5744) * BAEL-2015: add link back to article * BAEL-2166 BAEL-2302 add links back to articles * BAEL-2312: add link back to article --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index 11d9fd2ee0..7617897e95 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -85,3 +85,4 @@ - [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) - [Implementing a Binary Tree in Java](https://www.baeldung.com/java-binary-tree) +- [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) From cf602faff9a5d2971f28c853374cb90066108831 Mon Sep 17 00:00:00 2001 From: Loredana Date: Thu, 22 Nov 2018 00:37:23 +0200 Subject: [PATCH 434/546] revert boot 2.1 upgrade --- parent-boot-2/pom.xml | 5 +++-- .../security/SpringSecurity5Application.java | 11 ++++++----- .../Spring5ReactiveServerClientIntegrationTest.java | 13 +++++++------ spring-5-security/pom.xml | 4 ++-- spring-data-rest/pom.xml | 4 ++++ spring-security-mvc-boot/pom.xml | 2 +- spring-security-sso/pom.xml | 4 +++- .../spring-security-sso-auth-server/pom.xml | 8 ++++---- .../spring-security-sso-ui-2/pom.xml | 4 ++-- spring-security-sso/spring-security-sso-ui/pom.xml | 4 ++-- spring-security-thymeleaf/pom.xml | 2 +- 11 files changed, 35 insertions(+), 26 deletions(-) diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index bb89cb2729..67837e1a4e 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -77,7 +77,8 @@ 3.1.0 1.0.11.RELEASE - 2.1.0.RELEASE - 2.1.0.RELEASE + 2.0.5.RELEASE + + diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java index ba913bc2d7..f2963c4fa5 100644 --- a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/security/SpringSecurity5Application.java @@ -8,8 +8,8 @@ import org.springframework.http.server.reactive.HttpHandler; import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter; import org.springframework.web.reactive.config.EnableWebFlux; import org.springframework.web.server.adapter.WebHttpHandlerBuilder; -import reactor.netty.DisposableServer; -import reactor.netty.http.server.HttpServer; +import reactor.ipc.netty.NettyContext; +import reactor.ipc.netty.http.server.HttpServer; @ComponentScan(basePackages = {"com.baeldung.reactive.security"}) @EnableWebFlux @@ -18,16 +18,17 @@ public class SpringSecurity5Application { public static void main(String[] args) { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringSecurity5Application.class)) { - context.getBean(DisposableServer.class).onDispose().block(); + context.getBean(NettyContext.class).onClose().block(); } } @Bean - public DisposableServer nettyContext(ApplicationContext context) { + public NettyContext nettyContext(ApplicationContext context) { HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context) .build(); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler); - return HttpServer.create().host("localhost").port(8080).handle(adapter).bind().block(); + HttpServer httpServer = HttpServer.create("localhost", 8080); + return httpServer.newHandler(adapter).block(); } } diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java index 384600994e..5ebfa39358 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java +++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/Spring5ReactiveServerClientIntegrationTest.java @@ -10,8 +10,8 @@ import org.springframework.web.reactive.function.server.RouterFunctions; import org.springframework.web.reactive.function.server.ServerResponse; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import reactor.netty.DisposableServer; -import reactor.netty.http.server.HttpServer; +import reactor.ipc.netty.NettyContext; +import reactor.ipc.netty.http.server.HttpServer; import java.time.Duration; @@ -19,11 +19,11 @@ import static org.springframework.web.reactive.function.server.RequestPredicates import static org.springframework.web.reactive.function.server.RequestPredicates.POST; public class Spring5ReactiveServerClientIntegrationTest { - private static DisposableServer nettyServer; + private static NettyContext nettyContext; @BeforeAll public static void setUp() throws Exception { - HttpServer server = HttpServer.create().host("localhost").port(8080); + HttpServer server = HttpServer.create("localhost", 8080); RouterFunction route = RouterFunctions.route(POST("/task/process"), request -> ServerResponse.ok() .body(request.bodyToFlux(Task.class) .map(ll -> new Task("TaskName", 1)), Task.class)) @@ -31,12 +31,13 @@ public class Spring5ReactiveServerClientIntegrationTest { .body(Mono.just("server is alive"), String.class))); HttpHandler httpHandler = RouterFunctions.toHttpHandler(route); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler); - nettyServer = server.handle(adapter).bind().block(); + nettyContext = server.newHandler(adapter) + .block(); } @AfterAll public static void shutDown() { - nettyServer.dispose(); + nettyContext.dispose(); } // @Test diff --git a/spring-5-security/pom.xml b/spring-5-security/pom.xml index da62f39fa9..f5fb359896 100644 --- a/spring-5-security/pom.xml +++ b/spring-5-security/pom.xml @@ -31,14 +31,14 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity5 + thymeleaf-extras-springsecurity4 org.springframework.security.oauth.boot spring-security-oauth2-autoconfigure - ${oauth-auto.version} + 2.0.1.RELEASE org.springframework.security diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index a756ef0497..a6f12e1904 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -42,4 +42,8 @@ ${project.artifactId} + + 2.1.0.RELEASE + + diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-mvc-boot/pom.xml index 0a40b0b324..2427d0de1a 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-mvc-boot/pom.xml @@ -36,7 +36,7 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity5 + thymeleaf-extras-springsecurity4 org.springframework.boot diff --git a/spring-security-sso/pom.xml b/spring-security-sso/pom.xml index 7761919ca7..6e61da1519 100644 --- a/spring-security-sso/pom.xml +++ b/spring-security-sso/pom.xml @@ -23,6 +23,8 @@ 3.1.0 + 2.3.3.RELEASE + 2.0.1.RELEASE - \ No newline at end of file + diff --git a/spring-security-sso/spring-security-sso-auth-server/pom.xml b/spring-security-sso/spring-security-sso-auth-server/pom.xml index c0ad6dee2e..ff76f377c6 100644 --- a/spring-security-sso/spring-security-sso-auth-server/pom.xml +++ b/spring-security-sso/spring-security-sso-auth-server/pom.xml @@ -20,10 +20,10 @@ - org.springframework.security.oauth.boot - spring-security-oauth2-autoconfigure - ${oauth-auto.version} + org.springframework.security.oauth + spring-security-oauth2 + ${oauth.version} - \ No newline at end of file + diff --git a/spring-security-sso/spring-security-sso-ui-2/pom.xml b/spring-security-sso/spring-security-sso-ui-2/pom.xml index 5881409c3a..1f9a5754ae 100644 --- a/spring-security-sso/spring-security-sso-ui-2/pom.xml +++ b/spring-security-sso/spring-security-sso-ui-2/pom.xml @@ -37,9 +37,9 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity5 + thymeleaf-extras-springsecurity4 - \ No newline at end of file + diff --git a/spring-security-sso/spring-security-sso-ui/pom.xml b/spring-security-sso/spring-security-sso-ui/pom.xml index 3e85eb4737..56131749ba 100644 --- a/spring-security-sso/spring-security-sso-ui/pom.xml +++ b/spring-security-sso/spring-security-sso-ui/pom.xml @@ -38,9 +38,9 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity5 + thymeleaf-extras-springsecurity4 - \ No newline at end of file + diff --git a/spring-security-thymeleaf/pom.xml b/spring-security-thymeleaf/pom.xml index d8b476683a..5b7715bdeb 100644 --- a/spring-security-thymeleaf/pom.xml +++ b/spring-security-thymeleaf/pom.xml @@ -43,7 +43,7 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity5 + thymeleaf-extras-springsecurity4 From 9726c99c31a163f0d34f88c409d621286e57ae64 Mon Sep 17 00:00:00 2001 From: Kuba Date: Thu, 22 Nov 2018 03:28:17 +0100 Subject: [PATCH 435/546] BAEL-2279 - Logging reactive sequence (#5667) * BAEL-2279 - Logging reactive sequence * BAEL-2279 - Logging reactive sequence * Format fix. * Add all examples. Fix formatting. * BAEL 2279 - rename file, formatting fixes, update deps. --- logging-modules/log4j/pom.xml | 10 ++++++++- .../webFluxLogging/WebFluxLoggingExample.java | 21 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index 432295fc62..1b27e03445 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 com.baeldung @@ -43,6 +44,12 @@ disruptor ${disruptor.version} + + + org.springframework.boot + spring-boot-starter-webflux + ${spring-boot.version} + @@ -50,6 +57,7 @@ 2.7 2.7 3.3.6 + 2.1.0.RELEASE \ No newline at end of file diff --git a/logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java b/logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java new file mode 100644 index 0000000000..f429fd57f3 --- /dev/null +++ b/logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java @@ -0,0 +1,21 @@ +package com.baeldung.webFluxLogging; + +import reactor.core.publisher.Flux; + +public class WebFluxLoggingExample { + + public static void main(String[] args) { + Flux reactiveStream = Flux.range(1, 5).log(); + + reactiveStream.subscribe(); + + reactiveStream = Flux.range(1, 5).log().take(3); + + reactiveStream.subscribe(); + + reactiveStream = Flux.range(1, 5).take(3).log(); + + reactiveStream.subscribe(); + } + +} From 31858afca7598cf4c5b8e305f7fa4cb113d340d5 Mon Sep 17 00:00:00 2001 From: charlesgonzales <39999268+charlesgonzales@users.noreply.github.com> Date: Thu, 22 Nov 2018 12:49:54 +0800 Subject: [PATCH 436/546] Bi-monthly test failure - fix (BAEL-10330) (#5736) * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.MD * Update README.md * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md --- algorithms-miscellaneous-2/README.md | 1 + core-java-10/README.md | 1 + core-java-8/README.md | 1 + core-java-collections/README.md | 1 + core-java-io/README.md | 1 + core-java/README.md | 2 ++ java-dates/README.md | 1 + persistence-modules/spring-boot-persistence/README.MD | 1 + persistence-modules/spring-data-jpa/README.md | 1 + persistence-modules/spring-data-mongodb/README.md | 1 + spring-5-reactive-oauth/README.md | 3 +++ spring-all/README.md | 1 + spring-cloud/README.md | 1 + spring-rest-template/README.md | 1 + spring-rest/README.md | 1 + 15 files changed, 18 insertions(+) create mode 100644 spring-5-reactive-oauth/README.md diff --git a/algorithms-miscellaneous-2/README.md b/algorithms-miscellaneous-2/README.md index 6772a94a8d..d693a44f66 100644 --- a/algorithms-miscellaneous-2/README.md +++ b/algorithms-miscellaneous-2/README.md @@ -17,3 +17,4 @@ - [Round Up to the Nearest Hundred](https://www.baeldung.com/java-round-up-nearest-hundred) - [Calculate Percentage in Java](https://www.baeldung.com/java-calculate-percentage) - [Converting Between Byte Arrays and Hexadecimal Strings in Java](https://www.baeldung.com/java-byte-arrays-hex-strings) +- [Convert Latitude and Longitude to a 2D Point in Java](https://www.baeldung.com/java-convert-latitude-longitude) diff --git a/core-java-10/README.md b/core-java-10/README.md index 84fa381a26..f0a25712a7 100644 --- a/core-java-10/README.md +++ b/core-java-10/README.md @@ -4,3 +4,4 @@ - [Java 10 LocalVariable Type-Inference](http://www.baeldung.com/java-10-local-variable-type-inference) - [Guide to Java 10](http://www.baeldung.com/java-10-overview) - [Copy a List to Another List in Java](http://www.baeldung.com/java-copy-list-to-another) +- [Deep Dive Into the New Java JIT Compiler – Graal](https://www.baeldung.com/graal-java-jit-compiler) diff --git a/core-java-8/README.md b/core-java-8/README.md index ffd629a170..6786b29120 100644 --- a/core-java-8/README.md +++ b/core-java-8/README.md @@ -33,3 +33,4 @@ - [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) - [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects) - [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic) +- [How to Replace Many if Statements in Java](https://www.baeldung.com/java-replace-if-statements) diff --git a/core-java-collections/README.md b/core-java-collections/README.md index 0fcf7367c7..858dbef0b3 100644 --- a/core-java-collections/README.md +++ b/core-java-collections/README.md @@ -50,3 +50,4 @@ - [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) - [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line) - [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist) +- [A Guide to EnumMap](https://www.baeldung.com/java-enum-map) diff --git a/core-java-io/README.md b/core-java-io/README.md index c81e466b57..3d028783ed 100644 --- a/core-java-io/README.md +++ b/core-java-io/README.md @@ -34,3 +34,4 @@ - [Read a File into an ArrayList](https://www.baeldung.com/java-file-to-arraylist) - [Guide to Java OutputStream](https://www.baeldung.com/java-outputstream) - [Reading a CSV File into an Array](https://www.baeldung.com/java-csv-file-array) +- [Guide to BufferedReader](https://www.baeldung.com/java-buffered-reader) diff --git a/core-java/README.md b/core-java/README.md index 7617897e95..e8923e9a2f 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -85,4 +85,6 @@ - [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) - [Implementing a Binary Tree in Java](https://www.baeldung.com/java-binary-tree) +- [Changing the Order in a Sum Operation Can Produce Different Results?](https://www.baeldung.com/java-floating-point-sum-order) +- [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources) - [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) diff --git a/java-dates/README.md b/java-dates/README.md index 66046b16a6..3f6d7998b8 100644 --- a/java-dates/README.md +++ b/java-dates/README.md @@ -24,3 +24,4 @@ - [Add Hours To a Date In Java](http://www.baeldung.com/java-add-hours-date) - [Guide to DateTimeFormatter](https://www.baeldung.com/java-datetimeformatter) - [Format ZonedDateTime to String](https://www.baeldung.com/java-format-zoned-datetime-string) +- [Convert Between java.time.Instant and java.sql.Timestamp](Convert Between java.time.Instant and java.sql.Timestamp) diff --git a/persistence-modules/spring-boot-persistence/README.MD b/persistence-modules/spring-boot-persistence/README.MD index 6cf172426a..8988fb4ebd 100644 --- a/persistence-modules/spring-boot-persistence/README.MD +++ b/persistence-modules/spring-boot-persistence/README.MD @@ -4,3 +4,4 @@ - [Configuring Separate Spring DataSource for Tests](http://www.baeldung.com/spring-testing-separate-data-source) - [Quick Guide on data.sql and schema.sql Files in Spring Boot](http://www.baeldung.com/spring-boot-data-sql-and-schema-sql) - [Configuring a Tomcat Connection Pool in Spring Boot](https://www.baeldung.com/spring-boot-tomcat-connection-pool) +- [Hibernate Field Naming with Spring Boot](https://www.baeldung.com/hibernate-field-naming-spring-boot) diff --git a/persistence-modules/spring-data-jpa/README.md b/persistence-modules/spring-data-jpa/README.md index 44ce240da3..a65b744944 100644 --- a/persistence-modules/spring-data-jpa/README.md +++ b/persistence-modules/spring-data-jpa/README.md @@ -15,6 +15,7 @@ - [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date) - [DDD Aggregates and @DomainEvents](https://www.baeldung.com/spring-data-ddd) - [Spring Data – CrudRepository save() Method](https://www.baeldung.com/spring-data-crud-repository-save) +- [Limiting Query Results with JPA and Spring Data JPA](https://www.baeldung.com/jpa-limit-query-results) ### Eclipse Config After importing the project into Eclipse, you may see the following error: diff --git a/persistence-modules/spring-data-mongodb/README.md b/persistence-modules/spring-data-mongodb/README.md index c7bc7584be..c4f21dffc0 100644 --- a/persistence-modules/spring-data-mongodb/README.md +++ b/persistence-modules/spring-data-mongodb/README.md @@ -12,3 +12,4 @@ - [Spring Data MongoDB: Projections and Aggregations](http://www.baeldung.com/spring-data-mongodb-projections-aggregations) - [Spring Data Annotations](http://www.baeldung.com/spring-data-annotations) - [Spring Data MongoDB Transactions](https://www.baeldung.com/spring-data-mongodb-transactions ) +- [ZonedDateTime with Spring Data MongoDB](https://www.baeldung.com/spring-data-mongodb-zoneddatetime) diff --git a/spring-5-reactive-oauth/README.md b/spring-5-reactive-oauth/README.md new file mode 100644 index 0000000000..0f27cf5d20 --- /dev/null +++ b/spring-5-reactive-oauth/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Spring Security OAuth Login with WebFlux](https://www.baeldung.com/spring-oauth-login-webflux) diff --git a/spring-all/README.md b/spring-all/README.md index 34e5c3435e..0d78efdcf2 100644 --- a/spring-all/README.md +++ b/spring-all/README.md @@ -33,3 +33,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring Cache – Creating a Custom KeyGenerator](http://www.baeldung.com/spring-cache-custom-keygenerator) - [Spring @Primary Annotation](http://www.baeldung.com/spring-primary) - [Spring Events](https://www.baeldung.com/spring-events) +- [Spring Null-Safety Annotations](https://www.baeldung.com/spring-null-safety-annotations) diff --git a/spring-cloud/README.md b/spring-cloud/README.md index 16bc2d110a..dc43bd1a66 100644 --- a/spring-cloud/README.md +++ b/spring-cloud/README.md @@ -30,3 +30,4 @@ - [Introduction to Netflix Archaius with Spring Cloud](https://www.baeldung.com/netflix-archaius-spring-cloud-integration) - [An Intro to Spring Cloud Vault](https://www.baeldung.com/spring-cloud-vault) - [Netflix Archaius with Various Database Configurations](https://www.baeldung.com/netflix-archaius-database-configurations) +- [Rate Limiting in Spring Cloud Netflix Zuul](https://www.baeldung.com/spring-cloud-zuul-rate-limit) diff --git a/spring-rest-template/README.md b/spring-rest-template/README.md index d69d5c01c7..2c31796080 100644 --- a/spring-rest-template/README.md +++ b/spring-rest-template/README.md @@ -5,3 +5,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: - [Uploading MultipartFile with Spring RestTemplate](http://www.baeldung.com/spring-rest-template-multipart-upload) +- [Mocking a RestTemplate in Spring](https://www.baeldung.com/spring-mock-rest-template) diff --git a/spring-rest/README.md b/spring-rest/README.md index d449a4d92a..5b8a35a4a5 100644 --- a/spring-rest/README.md +++ b/spring-rest/README.md @@ -23,3 +23,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Using the Spring RestTemplate Interceptor](http://www.baeldung.com/spring-rest-template-interceptor) - [Get and Post Lists of Objects with RestTemplate](http://www.baeldung.com/spring-rest-template-list) - [How to Set a Header on a Response with Spring 5](http://www.baeldung.com/spring-response-header) +- [Spring’s RequestBody and ResponseBody Annotations](https://www.baeldung.com/spring-request-response-body) From 4d3b4ca3f0f11cd6cfb06c57abe4f006c7db6ba4 Mon Sep 17 00:00:00 2001 From: Seun Matt Date: Thu, 22 Nov 2018 08:02:44 +0100 Subject: [PATCH 437/546] Moved example code for BAEL-2366 (#5752) * added example code for BAEL-2366 * moved example code for BAEL-2366 --- .../StringReplaceAndRemoveUnitTest.java | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 java-strings/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java diff --git a/java-strings/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java b/java-strings/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java new file mode 100644 index 0000000000..d952d2383b --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java @@ -0,0 +1,83 @@ +package com.baeldung.string; + + +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class StringReplaceAndRemoveUnitTest { + + + @Test + public void givenTestStrings_whenReplace_thenProcessedString() { + + String master = "Hello World Baeldung!"; + String target = "Baeldung"; + String replacement = "Java"; + String processed = master.replace(target, replacement); + assertTrue(processed.contains(replacement)); + assertFalse(processed.contains(target)); + + } + + @Test + public void givenTestStrings_whenReplaceAll_thenProcessedString() { + + String master2 = "Welcome to Baeldung, Hello World Baeldung"; + String regexTarget= "(Baeldung)$"; + String replacement = "Java"; + String processed2 = master2.replaceAll(regexTarget, replacement); + assertTrue(processed2.endsWith("Java")); + + } + + @Test + public void givenTestStrings_whenStringBuilderMethods_thenProcessedString() { + + String master = "Hello World Baeldung!"; + String target = "Baeldung"; + String replacement = "Java"; + + int startIndex = master.indexOf(target); + int stopIndex = startIndex + target.length(); + + StringBuilder builder = new StringBuilder(master); + + + builder.delete(startIndex, stopIndex); + assertFalse(builder.toString().contains(target)); + + + builder.replace(startIndex, stopIndex, replacement); + assertTrue(builder.toString().contains(replacement)); + + + } + + + @Test + public void givenTestStrings_whenStringUtilsMethods_thenProcessedStrings() { + + String master = "Hello World Baeldung!"; + String target = "Baeldung"; + String replacement = "Java"; + + String processed = StringUtils.replace(master, target, replacement); + assertTrue(processed.contains(replacement)); + + String master2 = "Hello World Baeldung!"; + String target2 = "baeldung"; + String processed2 = StringUtils.replaceIgnoreCase(master2, target2, replacement); + assertFalse(processed2.contains(target)); + + } + + + + + + + +} From 56ab8e2049028b784ac2a769a86171cd5a59a852 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Thu, 22 Nov 2018 15:29:58 +0530 Subject: [PATCH 438/546] BAEL-2334: Adding file for the tutorial on Graph in Java --- .../main/java/com/baeldung/graph/Graph.java | 112 ++++++++++++++++++ .../com/baeldung/graph/GraphTraversal.java | 44 +++++++ .../graph/GraphTraversalUnitTest.java | 36 ++++++ 3 files changed, 192 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/graph/Graph.java create mode 100644 core-java/src/main/java/com/baeldung/graph/GraphTraversal.java create mode 100644 core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/graph/Graph.java b/core-java/src/main/java/com/baeldung/graph/Graph.java new file mode 100644 index 0000000000..7095f64709 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/graph/Graph.java @@ -0,0 +1,112 @@ +package com.baeldung.graph; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class Graph { + private Set vertices; + private Set edges; + private Map> adjVertices; + + Graph() { + this.vertices = new HashSet(); + this.edges = new HashSet(); + this.adjVertices = new HashMap>(); + } + + boolean addVertex(String label) { + return vertices.add(new Vertex(label)); + } + + boolean removeVertex(String label) { + return vertices.remove(new Vertex(label)); + } + + boolean addEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + Edge e = new Edge(v1, v2); + if (this.edges.add(e)) { + adjVertices.putIfAbsent(v1, new HashSet<>()); + adjVertices.putIfAbsent(v2, new HashSet<>()); + adjVertices.get(v1) + .add(e); + adjVertices.get(v2) + .add(e); + } + return true; + } + + boolean removeEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + Edge e = new Edge(v1, v2); + if (this.edges.remove(e)) { + Set eV1 = adjVertices.get(v1); + Set eV2 = adjVertices.get(v2); + + if (eV1 != null) + eV1.remove(e); + if (eV2 != null) + eV2.remove(e); + } + return true; + } + + Set getAdjVertices(String label) { + Vertex v = new Vertex(label); + return adjVertices.get(v) + .stream() + .map(e -> e.v1.equals(v) ? e.v2 : e.v1) + .collect(Collectors.toSet()); + } + + class Vertex { + String label; + Vertex(String label) { + this.label = label; + } + @Override + public boolean equals(Object obj) { + Vertex vertex = (Vertex) obj; + return vertex.label == label; + } + @Override + public int hashCode() { + return label.hashCode(); + } + @Override + public String toString() { + return label; + } + } + + class Edge { + Vertex v1; + Vertex v2; + Edge(String label1, String label2) { + this.v1 = new Vertex(label1); + this.v2 = new Vertex(label2); + } + Edge(Vertex vertex1, Vertex vertex2) { + this.v1 = vertex1; + this.v2 = vertex2; + } + @Override + public boolean equals(Object obj) { + Edge edge = (Edge) obj; + return edge.v1.equals(v1) && edge.v2.equals(v2); + } + @Override + public int hashCode() { + return v1.hashCode() + v2.hashCode(); + } + @Override + public String toString() { + return v1.label + "-" + v2.label; + } + } +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/graph/GraphTraversal.java b/core-java/src/main/java/com/baeldung/graph/GraphTraversal.java new file mode 100644 index 0000000000..479e653a5c --- /dev/null +++ b/core-java/src/main/java/com/baeldung/graph/GraphTraversal.java @@ -0,0 +1,44 @@ +package com.baeldung.graph; + +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.Queue; +import java.util.Set; +import java.util.Stack; + +import com.baeldung.graph.Graph.Vertex; + +public class GraphTraversal { + static Set depthFirstTraversal(Graph graph, String root) { + Set visited = new LinkedHashSet(); + Stack stack = new Stack(); + stack.push(root); + while (!stack.isEmpty()) { + String vertex = stack.pop(); + if (!visited.contains(vertex)) { + visited.add(vertex); + for (Vertex v : graph.getAdjVertices(vertex)) { + stack.push(v.label); + } + } + } + return visited; + } + + static Set breadthFirstTraversal(Graph graph, String root) { + Set visited = new LinkedHashSet(); + Queue queue = new LinkedList(); + queue.add(root); + visited.add(root); + while (!queue.isEmpty()) { + String vertex = queue.poll(); + for (Vertex v : graph.getAdjVertices(vertex)) { + if (!visited.contains(v.label)) { + visited.add(v.label); + queue.add(v.label); + } + } + } + return visited; + } +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java new file mode 100644 index 0000000000..84611a580a --- /dev/null +++ b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java @@ -0,0 +1,36 @@ +package com.baeldung.graph; + +import org.junit.Assert; +import org.junit.Test; + +public class GraphTraversalUnitTest { + @Test + public void givenAGraph_whenTraversingDepthFirst_thenExpectedResult() { + Graph graph = createGraph(); + Assert.assertEquals("[A, D, E, B, C]", + GraphTraversal.depthFirstTraversal(graph, "A").toString()); + } + + @Test + public void givenAGraph_whenTraversingBreadthFirst_thenExpectedResult() { + Graph graph = createGraph(); + Assert.assertEquals("[A, B, D, C, E]", + GraphTraversal.breadthFirstTraversal(graph, "A").toString()); + } + + Graph createGraph() { + Graph graph = new Graph(); + graph.addVertex("A"); + graph.addVertex("B"); + graph.addVertex("C"); + graph.addVertex("D"); + graph.addVertex("E"); + graph.addEdge("A", "B"); + graph.addEdge("A", "D"); + graph.addEdge("B", "C"); + graph.addEdge("D", "C"); + graph.addEdge("B", "E"); + graph.addEdge("D", "E"); + return graph; + } +} \ No newline at end of file From 3928c8955934209ae00de8656c6065de1f5a565c Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Thu, 22 Nov 2018 16:19:26 +0200 Subject: [PATCH 439/546] the third profile --- pom.xml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pom.xml b/pom.xml index 5ebf7ba4f3..2fed100fc6 100644 --- a/pom.xml +++ b/pom.xml @@ -738,6 +738,46 @@ helidon + + + + default-third + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + 3 + true + + **/*IntegrationTest.java + **/*IntTest.java + **/*LongRunningUnitTest.java + **/*ManualTest.java + **/*JdbcTest.java + **/*LiveTest.java + + + + + + + + + parent-boot-1 + parent-boot-2 + parent-spring-4 + parent-spring-5 + parent-java + parent-kotlin + + testing-modules/gatling + geotools + + From af3e0e9b063b71b6109be70b2b5c8b1a1e3db728 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Thu, 22 Nov 2018 17:38:17 +0200 Subject: [PATCH 440/546] splitting the integration-lite profile --- pom.xml | 72 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/pom.xml b/pom.xml index 2fed100fc6..d72fcc9f26 100644 --- a/pom.xml +++ b/pom.xml @@ -1238,43 +1238,8 @@ - - integration-lite-test - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin - - spring-4 - - - - - integration-lite + integration-lite-first @@ -1302,6 +1267,7 @@ parent-spring-5 parent-java parent-kotlin + asm atomix persistence-modules/apache-cayenne @@ -1449,7 +1415,41 @@ spring-cucumber spring-ejb spring-aop + + + + + + integration-lite-second + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + + parent-boot-1 + parent-boot-2 + parent-spring-4 + parent-spring-5 + parent-java + parent-kotlin + persistence-modules/spring-data-dynamodb persistence-modules/spring-data-keyvalue persistence-modules/spring-data-mongodb From 608fe77823aa77578393678afed1f7709c67562a Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Thu, 22 Nov 2018 17:53:33 +0200 Subject: [PATCH 441/546] disable gib default (#5726) * disable gib default * Update .travis.yml --- .travis.yml | 2 +- pom.xml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 683422dc97..5e86714a89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ before_install: - echo "MAVEN_OPTS='-Xmx2048M -Xss128M -XX:+CMSClassUnloadingEnabled -XX:+UseG1GC -XX:-UseGCOverheadLimit'" > ~/.mavenrc install: skip -script: travis_wait 60 mvn -q install -Pdefault-first,default-second +script: travis_wait 60 mvn -q install -Pdefault-first,default-second -Dgib.enabled=true sudo: required diff --git a/pom.xml b/pom.xml index d72fcc9f26..00d5af8214 100644 --- a/pom.xml +++ b/pom.xml @@ -1575,7 +1575,6 @@ + false 4.12 1.3 From 076de3f006be1687b600bbb9ca86a9e1ebebdd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Dupire?= Date: Thu, 22 Nov 2018 17:22:47 +0100 Subject: [PATCH 442/546] BAEL-2309 Retrieving a Class Name in Java (#5716) * [BAEL-2309] SomeClass and its test * [BAEL-2309] Fixing test naming * [BAEL-2309] Changed name for RetrievingClassName * [BAEL-2309] Updating package name * [BAEL-2309] Fix comment mistake * [BAEL-2309] Fixing test class name --- .../className/RetrievingClassName.java | 9 + .../RetrievingClassNameUnitTest.java | 156 ++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/className/RetrievingClassName.java create mode 100644 core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/className/RetrievingClassName.java b/core-java/src/main/java/com/baeldung/className/RetrievingClassName.java new file mode 100644 index 0000000000..ab6c8a51ff --- /dev/null +++ b/core-java/src/main/java/com/baeldung/className/RetrievingClassName.java @@ -0,0 +1,9 @@ +package com.baeldung.className; + +public class RetrievingClassName { + + public class InnerClass { + + } + +} diff --git a/core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java b/core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java new file mode 100644 index 0000000000..f9dbf91d2c --- /dev/null +++ b/core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java @@ -0,0 +1,156 @@ +package com.baeldung.className; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +public class RetrievingClassNameUnitTest { + + // Retrieving Simple Name + @Test + public void givenRetrievingClassName_whenGetSimpleName_thenRetrievingClassName() { + assertEquals("RetrievingClassName", RetrievingClassName.class.getSimpleName()); + } + + @Test + public void givenPrimitiveInt_whenGetSimpleName_thenInt() { + assertEquals("int", int.class.getSimpleName()); + } + + @Test + public void givenRetrievingClassNameArray_whenGetSimpleName_thenRetrievingClassNameWithBrackets() { + assertEquals("RetrievingClassName[]", RetrievingClassName[].class.getSimpleName()); + assertEquals("RetrievingClassName[][]", RetrievingClassName[][].class.getSimpleName()); + } + + @Test + public void givenAnonymousClass_whenGetSimpleName_thenEmptyString() { + assertEquals("", new RetrievingClassName() {}.getClass().getSimpleName()); + } + + // Retrieving Other Names + // - Primitive Types + @Test + public void givenPrimitiveInt_whenGetName_thenInt() { + assertEquals("int", int.class.getName()); + } + + @Test + public void givenPrimitiveInt_whenGetTypeName_thenInt() { + assertEquals("int", int.class.getTypeName()); + } + + @Test + public void givenPrimitiveInt_whenGetCanonicalName_thenInt() { + assertEquals("int", int.class.getCanonicalName()); + } + + // - Object Types + @Test + public void givenRetrievingClassName_whenGetName_thenCanonicalName() { + assertEquals("com.baeldung.className.RetrievingClassName", RetrievingClassName.class.getName()); + } + + @Test + public void givenRetrievingClassName_whenGetTypeName_thenCanonicalName() { + assertEquals("com.baeldung.className.RetrievingClassName", RetrievingClassName.class.getTypeName()); + } + + @Test + public void givenRetrievingClassName_whenGetCanonicalName_thenCanonicalName() { + assertEquals("com.baeldung.className.RetrievingClassName", RetrievingClassName.class.getCanonicalName()); + } + + // - Inner Classes + @Test + public void givenRetrievingClassNameInnerClass_whenGetName_thenCanonicalNameWithDollarSeparator() { + assertEquals("com.baeldung.className.RetrievingClassName$InnerClass", RetrievingClassName.InnerClass.class.getName()); + } + + @Test + public void givenRetrievingClassNameInnerClass_whenGetTypeName_thenCanonicalNameWithDollarSeparator() { + assertEquals("com.baeldung.className.RetrievingClassName$InnerClass", RetrievingClassName.InnerClass.class.getTypeName()); + } + + @Test + public void givenRetrievingClassNameInnerClass_whenGetCanonicalName_thenCanonicalName() { + assertEquals("com.baeldung.className.RetrievingClassName.InnerClass", RetrievingClassName.InnerClass.class.getCanonicalName()); + } + + // - Anonymous Classes + @Test + public void givenAnonymousClass_whenGetName_thenCallingClassCanonicalNameWithDollarSeparatorAndCountNumber() { + // These are the second and third appearences of an anonymous class in RetrievingClassNameUnitTest, hence $2 and $3 expectations + assertEquals("com.baeldung.className.RetrievingClassNameUnitTest$2", new RetrievingClassName() {}.getClass().getName()); + assertEquals("com.baeldung.className.RetrievingClassNameUnitTest$3", new RetrievingClassName() {}.getClass().getName()); + } + + @Test + public void givenAnonymousClass_whenGetTypeName_thenCallingClassCanonicalNameWithDollarSeparatorAndCountNumber() { + // These are the fourth and fifth appearences of an anonymous class in RetrievingClassNameUnitTest, hence $4 and $5 expectations + assertEquals("com.baeldung.className.RetrievingClassNameUnitTest$4", new RetrievingClassName() {}.getClass().getTypeName()); + assertEquals("com.baeldung.className.RetrievingClassNameUnitTest$5", new RetrievingClassName() {}.getClass().getTypeName()); + } + + @Test + public void givenAnonymousClass_whenGetCanonicalName_thenNull() { + assertNull(new RetrievingClassName() {}.getClass().getCanonicalName()); + } + + // - Arrays + @Test + public void givenPrimitiveIntArray_whenGetName_thenOpeningBracketsAndPrimitiveIntLetter() { + assertEquals("[I", int[].class.getName()); + assertEquals("[[I", int[][].class.getName()); + } + + @Test + public void givenRetrievingClassNameArray_whenGetName_thenOpeningBracketsLetterLAndRetrievingClassNameGetName() { + assertEquals("[Lcom.baeldung.className.RetrievingClassName;", RetrievingClassName[].class.getName()); + assertEquals("[[Lcom.baeldung.className.RetrievingClassName;", RetrievingClassName[][].class.getName()); + } + + @Test + public void givenRetrievingClassNameInnerClassArray_whenGetName_thenOpeningBracketsLetterLAndRetrievingClassNameInnerClassGetName() { + assertEquals("[Lcom.baeldung.className.RetrievingClassName$InnerClass;", RetrievingClassName.InnerClass[].class.getName()); + assertEquals("[[Lcom.baeldung.className.RetrievingClassName$InnerClass;", RetrievingClassName.InnerClass[][].class.getName()); + } + + @Test + public void givenPrimitiveIntArray_whenGetTypeName_thenPrimitiveIntGetTypeNameWithBrackets() { + assertEquals("int[]", int[].class.getTypeName()); + assertEquals("int[][]", int[][].class.getTypeName()); + } + + @Test + public void givenRetrievingClassNameArray_whenGetTypeName_thenRetrievingClassNameGetTypeNameWithBrackets() { + assertEquals("com.baeldung.className.RetrievingClassName[]", RetrievingClassName[].class.getTypeName()); + assertEquals("com.baeldung.className.RetrievingClassName[][]", RetrievingClassName[][].class.getTypeName()); + } + + @Test + public void givenRetrievingClassNameInnerClassArray_whenGetTypeName_thenRetrievingClassNameInnerClassGetTypeNameWithBrackets() { + assertEquals("com.baeldung.className.RetrievingClassName$InnerClass[]", RetrievingClassName.InnerClass[].class.getTypeName()); + assertEquals("com.baeldung.className.RetrievingClassName$InnerClass[][]", RetrievingClassName.InnerClass[][].class.getTypeName()); + } + + @Test + public void givenPrimitiveIntArray_whenGetCanonicalName_thenPrimitiveIntGetCanonicalNameWithBrackets() { + assertEquals("int[]", int[].class.getCanonicalName()); + assertEquals("int[][]", int[][].class.getCanonicalName()); + } + + @Test + public void givenRetrievingClassNameArray_whenGetCanonicalName_thenRetrievingClassNameGetCanonicalNameWithBrackets() { + assertEquals("com.baeldung.className.RetrievingClassName[]", RetrievingClassName[].class.getCanonicalName()); + assertEquals("com.baeldung.className.RetrievingClassName[][]", RetrievingClassName[][].class.getCanonicalName()); + } + + @Test + public void givenRetrievingClassNameInnerClassArray_whenGetCanonicalName_thenRetrievingClassNameInnerClassGetCanonicalNameWithBrackets() { + assertEquals("com.baeldung.className.RetrievingClassName.InnerClass[]", RetrievingClassName.InnerClass[].class.getCanonicalName()); + assertEquals("com.baeldung.className.RetrievingClassName.InnerClass[][]", RetrievingClassName.InnerClass[][].class.getCanonicalName()); + } + +} \ No newline at end of file From e24d89199b668199a35b445fd4fc417ac9a1dc4e Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Thu, 22 Nov 2018 19:52:02 +0200 Subject: [PATCH 443/546] profile work --- pom.xml | 96 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index 00d5af8214..f94574a801 100644 --- a/pom.xml +++ b/pom.xml @@ -1384,37 +1384,6 @@ testing-modules/selenium-junit-testng persistence-modules/solr spark-java - spring-4 - spring-5-data-reactive - spring-5-reactive - spring-5-reactive-security - spring-5-reactive-client - spring-5-mvc - spring-5-security - spring-activiti - spring-akka - spring-amqp - spring-all - spring-amqp-simple - spring-apache-camel - spring-batch - spring-bom - spring-boot-keycloak - spring-boot-bootstrap - spring-boot-admin - spring-boot-camel - persistence-modules/spring-boot-persistence - spring-boot-security - spring-boot-mvc - spring-boot-logging-log4j2 - spring-boot-disable-console-logging - spring-cloud-data-flow - spring-cloud - spring-cloud-bus - spring-core - spring-cucumber - spring-ejb - spring-aop @@ -1450,6 +1419,38 @@ parent-java parent-kotlin + spring-4 + spring-5-data-reactive + spring-5-reactive + spring-5-reactive-security + spring-5-reactive-client + spring-5-mvc + spring-5-security + spring-activiti + spring-akka + spring-amqp + spring-all + spring-amqp-simple + spring-apache-camel + spring-batch + spring-bom + spring-boot-keycloak + spring-boot-bootstrap + spring-boot-admin + spring-boot-camel + persistence-modules/spring-boot-persistence + spring-boot-security + spring-boot-mvc + spring-boot-logging-log4j2 + spring-boot-disable-console-logging + spring-cloud-data-flow + spring-cloud + spring-cloud-bus + spring-core + spring-cucumber + spring-ejb + spring-aop + persistence-modules/spring-data-dynamodb persistence-modules/spring-data-keyvalue persistence-modules/spring-data-mongodb @@ -1531,6 +1532,39 @@ testing-modules/testing testing-modules/testng video-tutorials + + + + + + integration-lite-third + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + + parent-boot-1 + parent-boot-2 + parent-spring-4 + parent-spring-5 + parent-java + parent-kotlin xmlunit-2 struts-2 From 5ad9f285e14451760cb24c189276ad76cce5fcc7 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Thu, 22 Nov 2018 20:37:50 +0200 Subject: [PATCH 444/546] profile work --- pom.xml | 783 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 400 insertions(+), 383 deletions(-) diff --git a/pom.xml b/pom.xml index f94574a801..e36a972611 100644 --- a/pom.xml +++ b/pom.xml @@ -934,310 +934,6 @@ - - integration - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin - - - - - - - - - - testing-modules/mockito - testing-modules/mockito-2 - testing-modules/mocks - mustache - mvn-wrapper - noexception - persistence-modules/orientdb - osgi - orika - patterns - pdf - protobuffer - persistence-modules/querydsl - reactor-core - persistence-modules/redis - testing-modules/rest-assured - testing-modules/rest-testing - resteasy - rxjava - rxjava-2 - spring-swagger-codegen - testing-modules/selenium-junit-testng - persistence-modules/solr - spark-java - spring-4 - spring-5 - spring-5-data-reactive - spring-5-reactive - spring-5-reactive-security - spring-5-reactive-client - spring-5-mvc - spring-5-security - spring-activiti - spring-akka - spring-amqp - spring-all - spring-amqp-simple - spring-apache-camel - spring-batch - jmh - - - - - - spring-bom - spring-boot - spring-boot-client - spring-boot-keycloak - spring-boot-bootstrap - spring-boot-admin - spring-boot-camel - spring-boot-ops - persistence-modules/spring-boot-persistence - spring-boot-security - spring-boot-mvc - spring-boot-logging-log4j2 - spring-boot-disable-console-logging - spring-cloud-data-flow - spring-cloud - spring-cloud-bus - spring-core - spring-cucumber - spring-ejb - spring-aop - persistence-modules/spring-data-cassandra - persistence-modules/spring-data-couchbase-2 - persistence-modules/spring-data-dynamodb - persistence-modules/spring-data-elasticsearch - persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb - persistence-modules/spring-data-jpa - persistence-modules/spring-data-neo4j - persistence-modules/spring-data-redis - spring-data-rest - - - - - - - persistence-modules/spring-data-solr - spring-dispatcher-servlet - spring-exceptions - spring-freemarker - persistence-modules/spring-hibernate-3 - persistence-modules/spring-hibernate4 - persistence-modules/spring-hibernate-5 - persistence-modules/spring-data-eclipselink - spring-integration - spring-jenkins-pipeline - spring-jersey - spring-jms - spring-jooq - persistence-modules/spring-jpa - spring-kafka - spring-katharsis - spring-ldap - spring-mockito - spring-mvc-forms-jsp - spring-mvc-forms-thymeleaf - spring-mvc-java - spring-mvc-velocity - spring-mvc-webflow - spring-mvc-xml - spring-mvc-kotlin - spring-protobuf - spring-quartz - spring-rest-angular - spring-rest-full - spring-rest-query-language - spring-rest - spring-resttemplate - spring-rest-simple - spring-reactive-kotlin - - - - - - - - - - - - - - - - java-websocket - persistence-modules/activejdbc - animal-sniffer-mvn-plugin - apache-avro - apache-bval - apache-shiro - apache-spark - asciidoctor - checker-plugin - - - core-java-sun - custom-pmd - dagger - data-structures - dubbo - persistence-modules/flyway - - - jni - jooby - - - - ratpack - rest-with-spark-java - spring-boot-autoconfiguration - spring-boot-custom-starter - spring-boot-jasypt - spring-data-rest-querydsl - spring-groovy - spring-mobile - spring-mustache - spring-mvc-simple - spring-mybatis - spring-rest-hal-browser - spring-rest-shell - spring-rest-template - spring-roo - spring-security-stormpath - sse-jaxrs - static-analysis - stripe - - - wicket - xstream - cas/cas-secured-app - - - - - - - - - - - - - - jenkins/hello-world - - - - spring-boot-custom-starter/greeter - persistence-modules/spring-boot-h2/spring-boot-h2-database - - - - - - - - integration-lite-first @@ -1270,7 +966,6 @@ asm atomix - persistence-modules/apache-cayenne aws aws-lambda akka-streams @@ -1290,25 +985,30 @@ autovalue axon azure + apache-velocity + apache-solrj + apache-meecrowave + antlr + bootique + cdi - java-strings - core-java-collections - java-collections-conversions - java-collections-maps core-java-io core-java-8 - java-streams core-groovy - couchbase - persistence-modules/deltaspike + dozer + disruptor + drools + deeplearning4j + ethereum + feign flips - testing-modules/groovy-spock + google-cloud gson guava @@ -1317,17 +1017,20 @@ guava-modules/guava-19 guava-modules/guava-21 guice - disruptor - spring-static-resources + hazelcast - persistence-modules/hbase - hystrix + httpclient + image-processing immutables - persistence-modules/influxdb + jackson - vavr + java-strings + + java-collections-conversions + java-collections-maps + java-streams java-lite java-numbers java-rmi @@ -1345,45 +1048,68 @@ json jsoup jta - testing-modules/junit-5 - testing-modules/junit5-migration jws + jersey + java-spi + java-ee-8-security-api + libraries-data linkrest logging-modules/log-mdc logging-modules/log4j - logging-modules/logback lombok + lucene + mapstruct - maven mesos-marathon msf4j - testing-modules/mockito - testing-modules/mockito-2 - testing-modules/mocks mustache mvn-wrapper + mybatis + metrics + maven-archetype + noexception - persistence-modules/orientdb + osgi orika + patterns pdf protobuffer - persistence-modules/querydsl - reactor-core + performance-tests + + persistence-modules/java-jdbi persistence-modules/redis - testing-modules/rest-assured - testing-modules/rest-testing + persistence-modules/orientdb + persistence-modules/querydsl + persistence-modules/apache-cayenne + persistence-modules/solr + persistence-modules/spring-data-dynamodb + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-mongodb + persistence-modules/spring-data-neo4j + persistence-modules/spring-data-solr + persistence-modules/spring-hibernate-5 + persistence-modules/spring-data-eclipselink + persistence-modules/spring-jpa + persistence-modules/spring-hibernate-3 + persistence-modules/spring-data-gemfire + persistence-modules/spring-boot-persistence + persistence-modules/liquibase + persistence-modules/java-cockroachdb + persistence-modules/deltaspike + persistence-modules/hbase + persistence-modules/influxdb + persistence-modules/spring-hibernate4 + + reactor-core resteasy rxjava rxjava-2 - spring-swagger-codegen - testing-modules/selenium-junit-testng - persistence-modules/solr - spark-java + rabbitmq @@ -1434,15 +1160,16 @@ spring-apache-camel spring-batch spring-bom + spring-boot-keycloak spring-boot-bootstrap spring-boot-admin spring-boot-camel - persistence-modules/spring-boot-persistence spring-boot-security spring-boot-mvc spring-boot-logging-log4j2 spring-boot-disable-console-logging + spring-cloud-data-flow spring-cloud spring-cloud-bus @@ -1451,27 +1178,17 @@ spring-ejb spring-aop - persistence-modules/spring-data-dynamodb - persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb - persistence-modules/spring-data-neo4j - spring-data-rest - persistence-modules/spring-data-solr spring-dispatcher-servlet spring-exceptions spring-freemarker - persistence-modules/spring-hibernate-3 - persistence-modules/spring-hibernate-5 - persistence-modules/spring-data-eclipselink spring-integration spring-jenkins-pipeline spring-jersey spring-jms spring-jooq - persistence-modules/spring-jpa spring-kafka spring-katharsis spring-ldap @@ -1529,9 +1246,15 @@ spring-vault spring-jinq spring-rest-embedded-tomcat - testing-modules/testing - testing-modules/testng - video-tutorials + + spring-static-resources + spring-swagger-codegen + spring-drools + spring-boot-property-exp + spring-security-thymeleaf + spring-boot-ctx-fluent + spring-webflux-amqp + @@ -1565,48 +1288,38 @@ parent-spring-5 parent-java parent-kotlin - - xmlunit-2 + + spark-java + saas struts-2 - apache-velocity - apache-solrj - rabbitmq - - persistence-modules/spring-data-gemfire - mybatis - spring-drools - drools - persistence-modules/liquibase - spring-boot-property-exp + + testing-modules/selenium-junit-testng + testing-modules/groovy-spock + testing-modules/mockito + testing-modules/mockito-2 + testing-modules/mocks + testing-modules/rest-assured + testing-modules/rest-testing + testing-modules/junit-5 + testing-modules/junit5-migration + testing-modules/testing + testing-modules/testng testing-modules/mockserver testing-modules/test-containers + twilio + undertow + + video-tutorials vaadin vertx-and-rxjava - saas - deeplearning4j - lucene vraptor - persistence-modules/java-cockroachdb - spring-security-thymeleaf - persistence-modules/java-jdbi - jersey - java-spi - performance-tests - twilio - spring-boot-ctx-fluent - java-ee-8-security-api - spring-webflux-amqp - antlr - maven-archetype - apache-meecrowave - - persistence-modules/spring-hibernate4 - xml vertx - metrics - httpclient - + vavr + + xmlunit-2 + xml + + + + + + + + + + testing-modules/mockito + testing-modules/mockito-2 + testing-modules/mocks + mustache + mvn-wrapper + noexception + persistence-modules/orientdb + osgi + orika + patterns + pdf + protobuffer + persistence-modules/querydsl + reactor-core + persistence-modules/redis + testing-modules/rest-assured + testing-modules/rest-testing + resteasy + rxjava + rxjava-2 + spring-swagger-codegen + testing-modules/selenium-junit-testng + persistence-modules/solr + spark-java + spring-4 + spring-5 + spring-5-data-reactive + spring-5-reactive + spring-5-reactive-security + spring-5-reactive-client + spring-5-mvc + spring-5-security + spring-activiti + spring-akka + spring-amqp + spring-all + spring-amqp-simple + spring-apache-camel + spring-batch + jmh + + + + + + spring-bom + spring-boot + spring-boot-client + spring-boot-keycloak + spring-boot-bootstrap + spring-boot-admin + spring-boot-camel + spring-boot-ops + persistence-modules/spring-boot-persistence + spring-boot-security + spring-boot-mvc + spring-boot-logging-log4j2 + spring-boot-disable-console-logging + spring-cloud-data-flow + spring-cloud + spring-cloud-bus + spring-core + spring-cucumber + spring-ejb + spring-aop + persistence-modules/spring-data-cassandra + persistence-modules/spring-data-couchbase-2 + persistence-modules/spring-data-dynamodb + persistence-modules/spring-data-elasticsearch + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-mongodb + persistence-modules/spring-data-jpa + persistence-modules/spring-data-neo4j + persistence-modules/spring-data-redis + spring-data-rest + + + + + + + persistence-modules/spring-data-solr + spring-dispatcher-servlet + spring-exceptions + spring-freemarker + persistence-modules/spring-hibernate-3 + persistence-modules/spring-hibernate4 + persistence-modules/spring-hibernate-5 + persistence-modules/spring-data-eclipselink + spring-integration + spring-jenkins-pipeline + spring-jersey + spring-jms + spring-jooq + persistence-modules/spring-jpa + spring-kafka + spring-katharsis + spring-ldap + spring-mockito + spring-mvc-forms-jsp + spring-mvc-forms-thymeleaf + spring-mvc-java + spring-mvc-velocity + spring-mvc-webflow + spring-mvc-xml + spring-mvc-kotlin + spring-protobuf + spring-quartz + spring-rest-angular + spring-rest-full + spring-rest-query-language + spring-rest + spring-resttemplate + spring-rest-simple + spring-reactive-kotlin + + + + + + + + + + + + + + + + java-websocket + persistence-modules/activejdbc + animal-sniffer-mvn-plugin + apache-avro + apache-bval + apache-shiro + apache-spark + asciidoctor + checker-plugin + + + core-java-sun + custom-pmd + dagger + data-structures + dubbo + persistence-modules/flyway + + + jni + jooby + + + + ratpack + rest-with-spark-java + spring-boot-autoconfiguration + spring-boot-custom-starter + spring-boot-jasypt + spring-data-rest-querydsl + spring-groovy + spring-mobile + spring-mustache + spring-mvc-simple + spring-mybatis + spring-rest-hal-browser + spring-rest-shell + spring-rest-template + spring-roo + spring-security-stormpath + sse-jaxrs + static-analysis + stripe + + + wicket + xstream + cas/cas-secured-app + + + + + + + + + + + + + + jenkins/hello-world + + + + spring-boot-custom-starter/greeter + persistence-modules/spring-boot-h2/spring-boot-h2-database + + + + + + + + integration-heavy From bb00c371513bb44812bda03d120ee9a389a0f74d Mon Sep 17 00:00:00 2001 From: smokeyrobot Date: Thu, 22 Nov 2018 15:13:14 -0500 Subject: [PATCH 445/546] Gatling vs JMeter vs The Grinder Issue: BAEL-46 --- .../load-testing-comparison/pom.xml | 148 +++++++++ .../com/baeldung/loadtesting/Application.java | 12 + .../loadtesting/RewardsController.java | 51 +++ .../loadtesting/TransactionController.java | 26 ++ .../model/CustomerRewardsAccount.java | 22 ++ .../loadtesting/model/Transaction.java | 30 ++ .../repository/CustomerRewardsRepository.java | 11 + .../repository/TransactionRepository.java | 11 + .../scripts/Gatling/GatlingScenario.scala | 52 ++++ .../resources/scripts/JMeter/Test Plan.jmx | 293 ++++++++++++++++++ .../scripts/The Grinder/grinder.properties | 5 + .../resources/scripts/The Grinder/grinder.py | 40 +++ 12 files changed, 701 insertions(+) create mode 100644 testing-modules/load-testing-comparison/pom.xml create mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/Application.java create mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/RewardsController.java create mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java create mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java create mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java create mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/CustomerRewardsRepository.java create mode 100644 testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/TransactionRepository.java create mode 100644 testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala create mode 100644 testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx create mode 100644 testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties create mode 100644 testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml new file mode 100644 index 0000000000..869eda1bb5 --- /dev/null +++ b/testing-modules/load-testing-comparison/pom.xml @@ -0,0 +1,148 @@ + + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + ../../pom.xml + + 4.0.0 + + load-testing-bakeoff + + + 1.8 + 1.8 + UTF-8 + 2.11.12 + 2.2.5 + 3.2.2 + 2.2.1 + 5.0 + 3.11 + 2.0.5.RELEASE + + + + + io.gatling + gatling-app + ${gatling.version} + + + io.gatling + gatling-recorder + ${gatling.version} + + + io.gatling.highcharts + gatling-charts-highcharts + ${gatling.version} + + + org.scala-lang + scala-library + ${scala.version} + + + + + + + + com.fasterxml.jackson.core + jackson-databind + 2.9.4 + + + org.springframework.boot + spring-boot-starter + ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-web + ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-test + ${spring.boot.version} + test + + + com.h2database + h2 + 1.4.197 + + + org.projectlombok + lombok + 1.18.2 + compile + + + + + + + + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.0.5.RELEASE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/Application.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/Application.java new file mode 100644 index 0000000000..6647bcb640 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/Application.java @@ -0,0 +1,12 @@ +package com.baeldung.loadtesting; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/RewardsController.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/RewardsController.java new file mode 100644 index 0000000000..50cc6fb7ab --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/RewardsController.java @@ -0,0 +1,51 @@ +package com.baeldung.loadtesting; + +import com.baeldung.loadtesting.model.CustomerRewardsAccount; +import com.baeldung.loadtesting.model.Transaction; +import com.baeldung.loadtesting.repository.CustomerRewardsRepository; +import com.baeldung.loadtesting.repository.TransactionRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Calendar; +import java.util.List; +import java.util.Optional; + +@RestController +public class RewardsController { + + @Autowired + private CustomerRewardsRepository customerRewardsRepository; + + @Autowired + private TransactionRepository transactionRepository; + + @PostMapping(path="/transactions/add") + public @ResponseBody Transaction saveTransactions(@RequestBody Transaction trnsctn){ + trnsctn.setTransactionDate(Calendar.getInstance().getTime()); + Transaction result = transactionRepository.save(trnsctn); + return result; + } + + @GetMapping(path="/transactions/findAll/{rewardId}") + public @ResponseBody Iterable getTransactions(@PathVariable Integer rewardId){ + return transactionRepository.findByCustomerRewardsId(rewardId); + } + + @PostMapping(path="/rewards/add") + public @ResponseBody CustomerRewardsAccount addRewardsAcount(@RequestBody CustomerRewardsAccount body) { + Optional acct = customerRewardsRepository.findByCustomerId(body.getCustomerId()); + return !acct.isPresent() ? customerRewardsRepository.save(body) : acct.get(); + } + + @GetMapping(path="/rewards/find/{customerId}") + public @ResponseBody + Optional find(@PathVariable Integer customerId) { + return customerRewardsRepository.findByCustomerId(customerId); + } + + @GetMapping(path="/rewards/all") + public @ResponseBody List findAll() { + return customerRewardsRepository.findAll(); + } +} diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java new file mode 100644 index 0000000000..2ea2c06a41 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/TransactionController.java @@ -0,0 +1,26 @@ +package com.baeldung.loadtesting; + +import com.baeldung.loadtesting.model.Transaction; +import com.baeldung.loadtesting.repository.TransactionRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@Deprecated +public class TransactionController { + + @Autowired + private TransactionRepository transactionRepository; + + @PostMapping(path="/addTransaction") + public @ResponseBody + String saveTransactions(@RequestBody Transaction trnsctn){ + transactionRepository.save(trnsctn); + return "Saved Transaction."; + } + + @GetMapping(path="/findAll/{rewardId}") + public @ResponseBody Iterable getTransactions(@RequestParam Integer id){ + return transactionRepository.findByCustomerRewardsId(id); + } +} diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java new file mode 100644 index 0000000000..2c6742fbaf --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/CustomerRewardsAccount.java @@ -0,0 +1,22 @@ +package com.baeldung.loadtesting.model; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +import lombok.Data; + +@Entity +@Data +public class CustomerRewardsAccount { + + @Id + @GeneratedValue(strategy= GenerationType.AUTO) + private Integer id; + private Integer customerId; + + public Integer getCustomerId(){ + return this.customerId; + } +} diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java new file mode 100644 index 0000000000..312f52f4ab --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/model/Transaction.java @@ -0,0 +1,30 @@ +package com.baeldung.loadtesting.model; + +import lombok.Data; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.util.Date; +import java.util.Calendar; + +@Entity +@Data +public class Transaction { + + @Id + @GeneratedValue(strategy= GenerationType.AUTO) + private Integer id; + private Integer customerRewardsId; + private Integer customerId; + private Date transactionDate; + + public Transaction(){ + transactionDate = Calendar.getInstance().getTime(); + } + + public void setTransactionDate(Date transactionDate){ + this.transactionDate = transactionDate; + } +} diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/CustomerRewardsRepository.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/CustomerRewardsRepository.java new file mode 100644 index 0000000000..f945359eb8 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/CustomerRewardsRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.loadtesting.repository; + +import com.baeldung.loadtesting.model.CustomerRewardsAccount; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.Optional; + +public interface CustomerRewardsRepository extends JpaRepository { + + Optional findByCustomerId(Integer customerId); +} diff --git a/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/TransactionRepository.java b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/TransactionRepository.java new file mode 100644 index 0000000000..af0b343c10 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/java/com/baeldung/loadtesting/repository/TransactionRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.loadtesting.repository; + +import com.baeldung.loadtesting.model.Transaction; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface TransactionRepository extends JpaRepository { + + List findByCustomerRewardsId(Integer rewardsId); +} diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala new file mode 100644 index 0000000000..f9b3837759 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/Gatling/GatlingScenario.scala @@ -0,0 +1,52 @@ +package com.baeldung + +import scala.util._ +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import scala.concurrent.duration._ + +class RewardsScenario extends Simulation { + + def randCustId() = Random.nextInt(99) + + val httpProtocol = http.baseUrl("http://localhost:8080") + .acceptHeader("text/html,application/json;q=0.9,*/*;q=0.8") + .doNotTrackHeader("1") + .acceptLanguageHeader("en-US,en;q=0.5") + .acceptEncodingHeader("gzip, deflate") + .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0") + + val scn = scenario("RewardsScenario") + .repeat(10){ + exec(http("transactions_add") + .post("/transactions/add/") + .body(StringBody("""{ "customerRewardsId":null,"customerId":""""+ randCustId() + """","transactionDate":null }""")).asJson + .check(jsonPath("$.id").saveAs("txnId")) + .check(jsonPath("$.transactionDate").saveAs("txtDate")) + .check(jsonPath("$.customerId").saveAs("custId"))) + .pause(1) + + .exec(http("get_reward") + .get("/rewards/find/${custId}") + .check(jsonPath("$.id").saveAs("rwdId"))) + .pause(1) + + .doIf("${rwdId.isUndefined()}"){ + exec(http("rewards_add") + .post("/rewards/add") + .body(StringBody("""{ "customerId": "${custId}" }""")).asJson + .check(jsonPath("$.id").saveAs("rwdId"))) + } + + .exec(http("transactions_add") + .post("/transactions/add/") + .body(StringBody("""{ "customerRewardsId":"${rwdId}","customerId":"${custId}","transactionDate":"${txtDate}" }""")).asJson) + .pause(1) + + .exec(http("get_reward") + .get("/transactions/findAll/${rwdId}")) + } + setUp( + scn.inject(atOnceUsers(100)) + ).protocols(httpProtocol) +} \ No newline at end of file diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx b/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx new file mode 100644 index 0000000000..da32a13a22 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/JMeter/Test Plan.jmx @@ -0,0 +1,293 @@ + + + + + + false + true + false + + + + + + + + continue + + false + 10 + + 100 + 0 + false + + + + + + true + 1 + + + + + + Content-Type + application/json + + + + + + true + + + + false + {"customerRewardsId":null,"customerId":${random},"transactionDate":null} + = + + + + localhost + 8080 + http + + /transactions/add + POST + true + false + true + false + + + + + + + txnId + $.id + 1 + all + foo + + + + txnDate + $.transactionDate + 1 + Never + + + + custId + $.customerId + 1 + all + bob + + + + + + + + localhost + 8080 + + + /rewards/find/${custId} + GET + true + false + true + false + + + + + + + rwdId + $.id + 1 + 0 + all + + + + + ${rwdId} == 0 + true + + + + true + + + + false + {"customerId":${custId}} + = + + + + localhost + 8080 + + + /rewards/add + POST + true + false + true + false + + + + + + + rwdId + $.id + 1 + bar + all + + + + + + true + + + + false + {"id":${txnId},"customerRewardsId":${rwdId},"customerId":${custId},"transactionDate":"${txnDate}"} + = + + + + localhost + 8080 + + + /transactions/add + POST + true + false + true + false + + + + + + + + + + localhost + 8080 + + + /transactions/findAll/${rwdId} + GET + true + false + true + false + + + + + + + + 10000 + 1 + + false + 67 + random + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + + diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties new file mode 100644 index 0000000000..68adf90856 --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.properties @@ -0,0 +1,5 @@ +grinder.script = grinder.py +grinder.threads = 100 +grinder.processes = 1 +grinder.runs = 10 +grinder.logDirectory = /logs diff --git a/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py new file mode 100644 index 0000000000..025f90d38b --- /dev/null +++ b/testing-modules/load-testing-comparison/src/main/resources/scripts/The Grinder/grinder.py @@ -0,0 +1,40 @@ +import java.util.Random +from net.grinder.script import Test +from net.grinder.script.Grinder import grinder +from net.grinder.plugin.http import HTTPRequest, HTTPPluginControl, HTTPUtilities +from HTTPClient import NVPair + +def parseJsonString(json, element): + for x in json.split(","): + pc = x.replace('"','').split(":") + if pc[0].replace("{","") == element: + ele = pc[1].replace("}","") + return ele + else: + return "" + +test1 = Test(1, "Request resource") +request1 = HTTPRequest() +headers = \ +( NVPair('Content-Type', 'application/json'), ) +request1.setHeaders(headers) +utilities = HTTPPluginControl.getHTTPUtilities() +test1.record(request1) +random=java.util.Random() + +class TestRunner: + def __call__(self): + customerId = str(random.nextInt()); + + result = request1.POST("http://localhost:8080/transactions/add", "{"'"customerRewardsId"'":null,"'"customerId"'":"+ customerId + ","'"transactionDate"'":null}") + txnId = parseJsonString(result.getText(), "id") + + result = request1.GET("http://localhost:8080/rewards/find/"+ customerId) + rwdId = parseJsonString(result.getText(), "id") + + if rwdId == "": + result = request1.POST("http://localhost:8080/rewards/add", "{"'"customerId"'":"+ customerId + "}") + rwdId = parseJsonString(result.getText(), "id") + + result = request1.POST("http://localhost:8080/transactions/add", "{"'"id"'":" + txnId + ","'"customerRewardsId"'":" + rwdId + ","'"customerId"'":"+ customerId + ","'"transactionDate"'":null}") + result = request1.GET("http://localhost:8080/transactions/findAll/" + rwdId) \ No newline at end of file From 668aa4a583105f6598bb861a63cd5ade1a72f854 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Thu, 22 Nov 2018 22:42:18 +0200 Subject: [PATCH 446/546] profiles work --- pom.xml | 14 +++++++++++--- spring-amqp-simple/pom.xml | 1 - 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e36a972611..bc0c63213f 100644 --- a/pom.xml +++ b/pom.xml @@ -1089,7 +1089,6 @@ persistence-modules/solr persistence-modules/spring-data-dynamodb persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb persistence-modules/spring-data-neo4j persistence-modules/spring-data-solr persistence-modules/spring-hibernate-5 @@ -1111,6 +1110,11 @@ rxjava-2 rabbitmq + + + @@ -1146,7 +1150,6 @@ parent-kotlin spring-4 - spring-5-data-reactive spring-5-reactive spring-5-reactive-security spring-5-reactive-client @@ -1156,7 +1159,6 @@ spring-akka spring-amqp spring-all - spring-amqp-simple spring-apache-camel spring-batch spring-bom @@ -1255,6 +1257,12 @@ spring-boot-ctx-fluent spring-webflux-amqp + + + diff --git a/spring-amqp-simple/pom.xml b/spring-amqp-simple/pom.xml index 3d9ea55cfa..ea9c227d8c 100644 --- a/spring-amqp-simple/pom.xml +++ b/spring-amqp-simple/pom.xml @@ -5,7 +5,6 @@ com.baeldung spring-amqp-simple 1.0.0-SNAPSHOT - Spring AMQP Simple App parent-boot-1 From 4c1f773d07d65bf3716e0d4089aebfbaf39bb04a Mon Sep 17 00:00:00 2001 From: Loredana Date: Thu, 22 Nov 2018 22:59:37 +0200 Subject: [PATCH 447/546] move constructors to java lang module --- core-java-lang/README.md | 1 + .../src/main/java/com/baeldung/constructors/BankAccount.java | 0 .../src/main/java/com/baeldung/constructors/Transaction.java | 0 .../test/java/com/baeldung/constructors/ConstructorUnitTest.java | 0 4 files changed, 1 insertion(+) rename {core-java => core-java-lang}/src/main/java/com/baeldung/constructors/BankAccount.java (100%) rename {core-java => core-java-lang}/src/main/java/com/baeldung/constructors/Transaction.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java (100%) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 85312cba68..62af72818f 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -56,4 +56,5 @@ - [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) - [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) +- [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) diff --git a/core-java/src/main/java/com/baeldung/constructors/BankAccount.java b/core-java-lang/src/main/java/com/baeldung/constructors/BankAccount.java similarity index 100% rename from core-java/src/main/java/com/baeldung/constructors/BankAccount.java rename to core-java-lang/src/main/java/com/baeldung/constructors/BankAccount.java diff --git a/core-java/src/main/java/com/baeldung/constructors/Transaction.java b/core-java-lang/src/main/java/com/baeldung/constructors/Transaction.java similarity index 100% rename from core-java/src/main/java/com/baeldung/constructors/Transaction.java rename to core-java-lang/src/main/java/com/baeldung/constructors/Transaction.java diff --git a/core-java/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java b/core-java-lang/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/constructors/ConstructorUnitTest.java From bf184639e7f96754af246b9b78eef4a54b85b573 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Thu, 22 Nov 2018 23:36:10 +0200 Subject: [PATCH 448/546] Update README.md --- patterns/design-patterns/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/patterns/design-patterns/README.md b/patterns/design-patterns/README.md index 75f7cec73a..ae372bd460 100644 --- a/patterns/design-patterns/README.md +++ b/patterns/design-patterns/README.md @@ -12,3 +12,4 @@ - [The DAO Pattern in Java](http://www.baeldung.com/java-dao-pattern) - [Interpreter Design Pattern in Java](http://www.baeldung.com/java-interpreter-pattern) - [State Design Pattern in Java](https://www.baeldung.com/java-state-design-pattern) +- [The Decorator Pattern in Java](https://www.baeldung.com/java-decorator-pattern) From d988b1280a2c7d2d31029f3f4f1734dbd78ff511 Mon Sep 17 00:00:00 2001 From: Loredana Date: Thu, 22 Nov 2018 23:59:22 +0200 Subject: [PATCH 449/546] fix test --- .../org/baeldung/client/TestRestTemplateBasicLiveTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java b/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java index 03a76aca74..e303c75a28 100644 --- a/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java +++ b/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java @@ -58,9 +58,9 @@ public class TestRestTemplateBasicLiveTest { @Test public void givenRestTemplateWrapperWithCredentials_whenSendGetForEntity_thenStatusOk() { - RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder().basicAuthentication("user", "passwd"); + RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); restTemplateBuilder.configure(restTemplate); - TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder); + TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder, "user", "passwd"); ResponseEntity response = testRestTemplate.getForEntity(URL_SECURED_BY_AUTHENTICATION, String.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); From 58a536c3953e8a3e71dd256d11a67d8bdf49b7c9 Mon Sep 17 00:00:00 2001 From: kyleandari <44148335+kyleandari@users.noreply.github.com> Date: Fri, 23 Nov 2018 10:46:20 -0500 Subject: [PATCH 450/546] BAEL 2330 * Implementing Hexagonal Architecture in java * Removing duplicates from a string * Fix for the code review feedback - removing the hexagonal architecture code - removing the methods removeDuplicatesUsingCharArray - adding some meaningful sentences to test * Fix for the code review feedback - fix for removeDuplicatesUsingCharArray - adding unit testing - adding brackets around for loops * Fix for the code review feedback * Adding remove duplicates using java 8 distinct adding assets to the unittests to test for empty strings * Checking for empty strings in unit tests Adding an if statement to check whether an empty string is passed to removeDuplicatesUsingSorting method --- .../RemoveDuplicateFromString.java | 25 ++++++++++++------- .../RemoveDuplicateFromStringUnitTest.java | 24 ++++++++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java b/java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java index eeba81f334..d8fd9c4b14 100644 --- a/java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java +++ b/java-strings/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java @@ -44,16 +44,16 @@ public class RemoveDuplicateFromString { } String removeDuplicatesUsingSorting(String str) { - - char[] chars = str.toCharArray(); - - Arrays.sort(chars); - StringBuilder sb = new StringBuilder(); - sb.append(chars[0]); - for (int i = 1; i < chars.length; i++) { - if (chars[i] != chars[i - 1]) { - sb.append(chars[i]); + if(!str.isEmpty()) { + char[] chars = str.toCharArray(); + Arrays.sort(chars); + + sb.append(chars[0]); + for (int i = 1; i < chars.length; i++) { + if (chars[i] != chars[i - 1]) { + sb.append(chars[i]); + } } } @@ -90,6 +90,13 @@ public class RemoveDuplicateFromString { return sb.toString(); } + + String removeDuplicatesUsingDistinct(String str) { + StringBuilder sb = new StringBuilder(); + str.chars().distinct().forEach(c -> sb.append((char) c)); + return sb.toString(); + } + } diff --git a/java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java b/java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java index cf7819ced3..895ecc4a3b 100644 --- a/java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java +++ b/java-strings/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java @@ -8,6 +8,8 @@ public class RemoveDuplicateFromStringUnitTest { private final static String STR1 = "racecar"; private final static String STR2 = "J2ee programming"; + private final static String STR_EMPTY = ""; + private RemoveDuplicateFromString removeDuplicateFromString; @Before @@ -20,6 +22,8 @@ public class RemoveDuplicateFromStringUnitTest { public void whenUsingCharArray_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { String str1 = removeDuplicateFromString.removeDuplicatesUsingCharArray(STR1); String str2 = removeDuplicateFromString.removeDuplicatesUsingCharArray(STR2); + String strEmpty = removeDuplicateFromString.removeDuplicatesUsingCharArray(STR_EMPTY); + Assert.assertEquals("", strEmpty); Assert.assertEquals("ecar", str1); Assert.assertEquals("J2e poraming", str2); } @@ -28,6 +32,9 @@ public class RemoveDuplicateFromStringUnitTest { public void whenUsingLinkedHashSet_DuplicatesShouldBeRemovedAndItKeepStringOrder() { String str1 = removeDuplicateFromString.removeDuplicatesUsinglinkedHashSet(STR1); String str2 = removeDuplicateFromString.removeDuplicatesUsinglinkedHashSet(STR2); + + String strEmpty = removeDuplicateFromString.removeDuplicatesUsinglinkedHashSet(STR_EMPTY); + Assert.assertEquals("", strEmpty); Assert.assertEquals("race", str1); Assert.assertEquals("J2e progamin", str2); } @@ -36,6 +43,9 @@ public class RemoveDuplicateFromStringUnitTest { public void whenUsingSorting_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { String str1 = removeDuplicateFromString.removeDuplicatesUsingSorting(STR1); String str2 = removeDuplicateFromString.removeDuplicatesUsingSorting(STR2); + + String strEmpty = removeDuplicateFromString.removeDuplicatesUsingSorting(STR_EMPTY); + Assert.assertEquals("", strEmpty); Assert.assertEquals("acer", str1); Assert.assertEquals(" 2Jaegimnopr", str2); } @@ -44,6 +54,8 @@ public class RemoveDuplicateFromStringUnitTest { public void whenUsingHashSet_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { String str1 = removeDuplicateFromString.removeDuplicatesUsingHashSet(STR1); String str2 = removeDuplicateFromString.removeDuplicatesUsingHashSet(STR2); + String strEmpty = removeDuplicateFromString.removeDuplicatesUsingHashSet(STR_EMPTY); + Assert.assertEquals("", strEmpty); Assert.assertEquals("arce", str1); Assert.assertEquals(" pa2regiJmno", str2); } @@ -52,7 +64,19 @@ public class RemoveDuplicateFromStringUnitTest { public void whenUsingIndexOf_DuplicatesShouldBeRemovedWithoutKeepingStringOrder() { String str1 = removeDuplicateFromString.removeDuplicatesUsingIndexOf(STR1); String str2 = removeDuplicateFromString.removeDuplicatesUsingIndexOf(STR2); + String strEmpty = removeDuplicateFromString.removeDuplicatesUsingIndexOf(STR_EMPTY); + Assert.assertEquals("", strEmpty); Assert.assertEquals("ecar", str1); Assert.assertEquals("J2e poraming", str2); } + + @Test + public void whenUsingJava8_DuplicatesShouldBeRemovedAndItKeepStringOrder() { + String str1 = removeDuplicateFromString.removeDuplicatesUsingDistinct(STR1); + String str2 = removeDuplicateFromString.removeDuplicatesUsingDistinct(STR2); + String strEmpty = removeDuplicateFromString.removeDuplicatesUsingDistinct(STR_EMPTY); + Assert.assertEquals("", strEmpty); + Assert.assertEquals("race", str1); + Assert.assertEquals("J2e progamin", str2); + } } From cfd9a97bd48769f4bbf937e0b71be49177ad1e02 Mon Sep 17 00:00:00 2001 From: Eugen Date: Fri, 23 Nov 2018 17:57:50 +0200 Subject: [PATCH 451/546] Delete README.md --- parent-boot-1/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 parent-boot-1/README.md diff --git a/parent-boot-1/README.md b/parent-boot-1/README.md deleted file mode 100644 index ff12555376..0000000000 --- a/parent-boot-1/README.md +++ /dev/null @@ -1 +0,0 @@ -## Relevant articles: From 64bc8a412d2a40d82fde575c6b542c5e18106f34 Mon Sep 17 00:00:00 2001 From: eelhazati Date: Fri, 23 Nov 2018 17:00:08 +0100 Subject: [PATCH 452/546] JPA Entity Graph. --- .../com/baeldung/jpa/entitygraph/MainApp.java | 26 ++++++ .../jpa/entitygraph/model/Comment.java | 63 +++++++++++++ .../baeldung/jpa/entitygraph/model/Post.java | 86 +++++++++++++++++ .../baeldung/jpa/entitygraph/model/User.java | 48 ++++++++++ .../jpa/entitygraph/repo/PostRepository.java | 93 +++++++++++++++++++ .../main/resources/META-INF/persistence.xml | 55 +++++++---- .../java-jpa/src/main/resources/data-init.sql | 8 ++ .../entitygraph/repo/PostRepositoryTest.java | 68 ++++++++++++++ 8 files changed, 428 insertions(+), 19 deletions(-) create mode 100644 persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/MainApp.java create mode 100644 persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Comment.java create mode 100644 persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Post.java create mode 100644 persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/User.java create mode 100644 persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/repo/PostRepository.java create mode 100644 persistence-modules/java-jpa/src/main/resources/data-init.sql create mode 100644 persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryTest.java diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/MainApp.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/MainApp.java new file mode 100644 index 0000000000..88aa4389e9 --- /dev/null +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/MainApp.java @@ -0,0 +1,26 @@ +package com.baeldung.jpa.entitygraph; + +import com.baeldung.jpa.entitygraph.model.Post; +import com.baeldung.jpa.entitygraph.repo.PostRepository; + +public class MainApp { + + public static void main(String... args) { + Long postId = 1L; + Post post = null; + PostRepository postRepository = new PostRepository(); + + //Using EntityManager.find(). + post = postRepository.find(postId); + post = postRepository.findWithEntityGraph(postId); + post = postRepository.findWithEntityGraph2(postId); + + //Using JPQL: Query and TypedQuery + post = postRepository.findUsingJpql(postId); + + //Using Criteria API + post = postRepository.findUsingCriteria(postId); + + postRepository.clean(); + } +} \ No newline at end of file diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Comment.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Comment.java new file mode 100644 index 0000000000..40ecd3262b --- /dev/null +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Comment.java @@ -0,0 +1,63 @@ +package com.baeldung.jpa.entitygraph.model; + +import javax.persistence.*; + +@Entity +public class Comment { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String reply; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn + private Post post; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn + private User user; + //... + + public Comment() { + } + + public Comment(String reply, Post post, User user) { + this.reply = reply; + this.post = post; + this.user = user; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getReply() { + return reply; + } + + public void setReply(String reply) { + this.reply = reply; + } + + public Post getPost() { + return post; + } + + public void setPost(Post post) { + this.post = post; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} \ No newline at end of file diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Post.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Post.java new file mode 100644 index 0000000000..59f17ae0c5 --- /dev/null +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/Post.java @@ -0,0 +1,86 @@ +package com.baeldung.jpa.entitygraph.model; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@NamedEntityGraph( + name = "post-entity-graph", + attributeNodes = { + @NamedAttributeNode("subject"), + @NamedAttributeNode("user"), + @NamedAttributeNode("comments"), + } +) +@NamedEntityGraph( + name = "post-entity-graph-with-comment-users", + attributeNodes = { + @NamedAttributeNode("subject"), + @NamedAttributeNode("user"), + @NamedAttributeNode(value = "comments", subgraph = "comments-subgraph"), + }, + subgraphs = { + @NamedSubgraph( + name = "comments-subgraph", + attributeNodes = { + @NamedAttributeNode("user") + } + ) + } +) +@Entity +public class Post { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private String subject; + @OneToMany(mappedBy = "post") + private List comments = new ArrayList<>(); + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn + private User user; + //... + + public Post() { + } + + public Post(String subject, User user) { + this.subject = subject; + this.user = user; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public List getComments() { + return comments; + } + + public void setComments(List comments) { + this.comments = comments; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/User.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/User.java new file mode 100644 index 0000000000..b712100d4e --- /dev/null +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/model/User.java @@ -0,0 +1,48 @@ +package com.baeldung.jpa.entitygraph.model; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private String name; + private String email; + + //... + + public User() { + } + + public User(String email) { + this.email = email; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/repo/PostRepository.java b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/repo/PostRepository.java new file mode 100644 index 0000000000..28f1e1b93c --- /dev/null +++ b/persistence-modules/java-jpa/src/main/java/com/baeldung/jpa/entitygraph/repo/PostRepository.java @@ -0,0 +1,93 @@ +package com.baeldung.jpa.entitygraph.repo; + +import com.baeldung.jpa.entitygraph.model.Post; + +import javax.persistence.*; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Root; +import java.util.HashMap; +import java.util.Map; + +public class PostRepository { + private EntityManagerFactory emf = null; + + + public PostRepository() { + Map properties = new HashMap(); + properties.put("hibernate.show_sql", "true"); + properties.put("hibernate.format_sql", "true"); + emf = Persistence.createEntityManagerFactory("entity-graph-pu", properties); + } + + public Post find(Long id) { + EntityManager entityManager = emf.createEntityManager(); + + Post post = entityManager.find(Post.class, id); + + entityManager.close(); + return post; + } + + public Post findWithEntityGraph(Long id) { + EntityManager entityManager = emf.createEntityManager(); + + EntityGraph entityGraph = entityManager.getEntityGraph("post-entity-graph"); + Map properties = new HashMap<>(); + properties.put("javax.persistence.fetchgraph", entityGraph); + Post post = entityManager.find(Post.class, id, properties); + + entityManager.close(); + return post; + } + + public Post findWithEntityGraph2(Long id) { + EntityManager entityManager = emf.createEntityManager(); + + EntityGraph entityGraph = entityManager.createEntityGraph(Post.class); + entityGraph.addAttributeNodes("subject"); + entityGraph.addAttributeNodes("user"); + entityGraph.addSubgraph("comments") + .addAttributeNodes("user"); + + Map properties = new HashMap<>(); + properties.put("javax.persistence.fetchgraph", entityGraph); + Post post = entityManager.find(Post.class, id, properties); + + entityManager.close(); + return post; + } + + public Post findUsingJpql(Long id) { + EntityManager entityManager = emf.createEntityManager(); + + EntityGraph entityGraph = entityManager.getEntityGraph("post-entity-graph-with-comment-users"); + Post post = entityManager.createQuery("Select p from Post p where p.id=:id", Post.class) + .setParameter("id", id) + .setHint("javax.persistence.fetchgraph", entityGraph) + .getSingleResult(); + + entityManager.close(); + return post; + } + + public Post findUsingCriteria(Long id) { + EntityManager entityManager = emf.createEntityManager(); + + EntityGraph entityGraph = entityManager.getEntityGraph("post-entity-graph-with-comment-users"); + CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); + CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Post.class); + Root root = criteriaQuery.from(Post.class); + criteriaQuery.where(criteriaBuilder.equal(root.get("id"), id)); + TypedQuery typedQuery = entityManager.createQuery(criteriaQuery); + typedQuery.setHint("javax.persistence.loadgraph", entityGraph); + Post post = typedQuery.getSingleResult(); + + entityManager.close(); + return post; + } + + public void clean() { + emf.close(); + } +} diff --git a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml index 3fdc8ce27c..433d456cc9 100644 --- a/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/java-jpa/src/main/resources/META-INF/persistence.xml @@ -9,12 +9,12 @@ org.hibernate.jpa.HibernatePersistenceProvider com.baeldung.sqlresultsetmapping.ScheduledDay - + - - - + value="jdbc:h2:mem:test;INIT=RUNSCRIPT FROM 'classpath:database.sql'"/> + + + @@ -25,28 +25,45 @@ org.hibernate.jpa.HibernatePersistenceProvider com.baeldung.jpa.stringcast.Message - - - - - - + + + + + + - + org.hibernate.jpa.HibernatePersistenceProvider com.baeldung.jpa.model.Car - - - - - - + + + + + + - + + + com.baeldung.jpa.entitygraph.model.Post + com.baeldung.jpa.entitygraph.model.User + com.baeldung.jpa.entitygraph.model.Comment + true + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/java-jpa/src/main/resources/data-init.sql b/persistence-modules/java-jpa/src/main/resources/data-init.sql new file mode 100644 index 0000000000..86c3f2a651 --- /dev/null +++ b/persistence-modules/java-jpa/src/main/resources/data-init.sql @@ -0,0 +1,8 @@ +INSERT INTO `USER` (`ID`,`NAME`,`EMAIL`) VALUES (1,'user1','user1@test.com'); +INSERT INTO `USER` (`ID`,`NAME`,`EMAIL`) VALUES (2,'user2','user2@test.com'); +INSERT INTO `USER` (`ID`,`NAME`,`EMAIL`) VALUES (3,'user3','user3@test.com'); + +INSERT INTO `POST` (`ID`,`SUBJECT`,`USER_ID`) VALUES (1,'JPA Entity Graph In Action',1); + +INSERT INTO `COMMENT` (`ID`,`REPLY`,`POST_ID`,`USER_ID`) VALUES (1,'Nice !!',1,2); +INSERT INTO `COMMENT` (`ID`,`REPLY`,`POST_ID`,`USER_ID`) VALUES (2,'Cool !!',1,3); diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryTest.java new file mode 100644 index 0000000000..382742f223 --- /dev/null +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryTest.java @@ -0,0 +1,68 @@ +package com.baeldung.jpa.entitygraph.repo; + +import com.baeldung.jpa.entitygraph.model.Comment; +import com.baeldung.jpa.entitygraph.model.Post; +import com.baeldung.jpa.entitygraph.model.User; +import org.hibernate.LazyInitializationException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import static org.junit.Assert.*; + +public class PostRepositoryTest { + + private static PostRepository postRepository = null; + + @BeforeClass + public static void once() { + postRepository = new PostRepository(); + } + + @Test(expected = LazyInitializationException.class) + public void find() { + Post post = postRepository.find(1L); + assertNotNull(post.getUser()); + String email = post.getUser().getEmail(); + assertNull(email); + } + + @Test + public void findWithEntityGraph() { + Post post = postRepository.findWithEntityGraph(1L); + assertNotNull(post.getUser()); + String email = post.getUser().getEmail(); + assertNotNull(email); + } + + @Test(expected = LazyInitializationException.class) + public void findWithEntityGraph_Comment_Without_User() { + Post post = postRepository.findWithEntityGraph(1L); + assertNotNull(post.getUser()); + String email = post.getUser().getEmail(); + assertNotNull(email); + assertNotNull(post.getComments()); + assertEquals(post.getComments().size(), 2); + Comment comment = post.getComments().get(0); + assertNotNull(comment); + User user = comment.getUser(); + user.getEmail(); + } + + @Test + public void findWithEntityGraph2_Comment_With_User() { + Post post = postRepository.findWithEntityGraph2(1L); + assertNotNull(post.getComments()); + assertEquals(post.getComments().size(), 2); + Comment comment = post.getComments().get(0); + assertNotNull(comment); + User user = comment.getUser(); + assertNotNull(user); + assertEquals(user.getEmail(), "user2@test.com"); + } + + @AfterClass + public static void destroy() { + postRepository.clean(); + } +} \ No newline at end of file From 3d945c079a8b4daabc3a1cd0c15155f7aec2579f Mon Sep 17 00:00:00 2001 From: eric-martin Date: Fri, 23 Nov 2018 23:41:00 -0600 Subject: [PATCH 453/546] Added @DirtiesContext to SpringContextIntegrationTest --- .../test/java/org/baeldung/SpringContextIntegrationTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-jenkins-pipeline/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-jenkins-pipeline/src/test/java/org/baeldung/SpringContextIntegrationTest.java index 8eb1589de7..0354f7211c 100644 --- a/spring-jenkins-pipeline/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ b/spring-jenkins-pipeline/src/test/java/org/baeldung/SpringContextIntegrationTest.java @@ -3,12 +3,14 @@ package org.baeldung; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; import com.baeldung.SpringJenkinsPipelineApplication; @RunWith(SpringRunner.class) @SpringBootTest(classes = SpringJenkinsPipelineApplication.class) +@DirtiesContext public class SpringContextIntegrationTest { @Test From 6e3245a0f142d7dc2c836c1f6d67e013a27424a9 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 24 Nov 2018 12:17:39 +0200 Subject: [PATCH 454/546] profile work --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bc0c63213f..ae5897b6f3 100644 --- a/pom.xml +++ b/pom.xml @@ -775,7 +775,7 @@ parent-kotlin testing-modules/gatling - geotools + From 0d6007309574c5e29c255fc910aedf9dfc8934a4 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sat, 24 Nov 2018 13:36:14 +0200 Subject: [PATCH 455/546] customise oauth2 requests --- .../CustomAuthorizationRequestResolver.java | 50 ++++++++++++++ .../oauth2/CustomRequestEntityConverter.java | 26 +++++++ .../oauth2/CustomTokenResponseConverter.java | 67 +++++++++++++++++++ .../com/baeldung/oauth2/SecurityConfig.java | 18 ++++- 4 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 spring-5-security/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java create mode 100644 spring-5-security/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java create mode 100644 spring-5-security/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java b/spring-5-security/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java new file mode 100644 index 0000000000..025064423d --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java @@ -0,0 +1,50 @@ +package com.baeldung.oauth2; + +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; +import org.springframework.security.oauth2.client.web.DefaultOAuth2AuthorizationRequestResolver; +import org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver; +import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest; + +public class CustomAuthorizationRequestResolver implements OAuth2AuthorizationRequestResolver { + + private OAuth2AuthorizationRequestResolver defaultResolver; + + public CustomAuthorizationRequestResolver(ClientRegistrationRepository repo, String authorizationRequestBaseUri){ + defaultResolver = new DefaultOAuth2AuthorizationRequestResolver(repo, authorizationRequestBaseUri); + } + + @Override + public OAuth2AuthorizationRequest resolve(HttpServletRequest request) { + OAuth2AuthorizationRequest req = defaultResolver.resolve(request); + if(req != null){ + req = customizeAuthorizationRequest(req); + } + return req; + } + + @Override + public OAuth2AuthorizationRequest resolve(HttpServletRequest request, String clientRegistrationId) { + OAuth2AuthorizationRequest req = defaultResolver.resolve(request, clientRegistrationId); + if(req != null){ + req = customizeAuthorizationRequest(req); + } + return req; + } + + private OAuth2AuthorizationRequest customizeAuthorizationRequest(OAuth2AuthorizationRequest req) { + Map extraParams = new HashMap(); + extraParams.putAll(req.getAdditionalParameters()); //VIP note + extraParams.put("test", "extra"); + System.out.println("here ====================="); + return OAuth2AuthorizationRequest.from(req).additionalParameters(extraParams).build(); + } + + private OAuth2AuthorizationRequest customizeAuthorizationRequest1(OAuth2AuthorizationRequest req) { + return OAuth2AuthorizationRequest.from(req).state("xyz").build(); + } +} diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java b/spring-5-security/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java new file mode 100644 index 0000000000..8884065769 --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java @@ -0,0 +1,26 @@ +package com.baeldung.oauth2; + +import org.springframework.core.convert.converter.Converter; +import org.springframework.http.RequestEntity; +import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest; +import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequestEntityConverter; +import org.springframework.util.MultiValueMap; + +public class CustomRequestEntityConverter implements Converter> { + + private OAuth2AuthorizationCodeGrantRequestEntityConverter defaultConverter; + + public CustomRequestEntityConverter() { + defaultConverter = new OAuth2AuthorizationCodeGrantRequestEntityConverter(); + } + + @Override + public RequestEntity convert(OAuth2AuthorizationCodeGrantRequest req) { + RequestEntity entity = defaultConverter.convert(req); + MultiValueMap params = (MultiValueMap) entity.getBody(); + params.add("test2", "extra2"); + System.out.println(params.entrySet()); + return new RequestEntity<>(params, entity.getHeaders(), entity.getMethod(), entity.getUrl()); + } + +} diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java b/spring-5-security/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java new file mode 100644 index 0000000000..741f44871a --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java @@ -0,0 +1,67 @@ +package com.baeldung.oauth2; + +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.springframework.core.convert.converter.Converter; +import org.springframework.security.oauth2.core.OAuth2AccessToken; +import org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse; +import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames; +import org.springframework.util.StringUtils; + +public class CustomTokenResponseConverter implements Converter, OAuth2AccessTokenResponse> { + private static final Set TOKEN_RESPONSE_PARAMETER_NAMES = Stream.of( + OAuth2ParameterNames.ACCESS_TOKEN, + OAuth2ParameterNames.TOKEN_TYPE, + OAuth2ParameterNames.EXPIRES_IN, + OAuth2ParameterNames.REFRESH_TOKEN, + OAuth2ParameterNames.SCOPE) .collect(Collectors.toSet()); + + @Override + public OAuth2AccessTokenResponse convert(Map tokenResponseParameters) { + String accessToken = tokenResponseParameters.get(OAuth2ParameterNames.ACCESS_TOKEN); + + OAuth2AccessToken.TokenType accessTokenType = null; + if (OAuth2AccessToken.TokenType.BEARER.getValue() + .equalsIgnoreCase(tokenResponseParameters.get(OAuth2ParameterNames.TOKEN_TYPE))) { + accessTokenType = OAuth2AccessToken.TokenType.BEARER; + } + + long expiresIn = 0; + if (tokenResponseParameters.containsKey(OAuth2ParameterNames.EXPIRES_IN)) { + try { + expiresIn = Long.valueOf(tokenResponseParameters.get(OAuth2ParameterNames.EXPIRES_IN)); + } catch (NumberFormatException ex) { + } + } + + Set scopes = Collections.emptySet(); + if (tokenResponseParameters.containsKey(OAuth2ParameterNames.SCOPE)) { + String scope = tokenResponseParameters.get(OAuth2ParameterNames.SCOPE); + scopes = Arrays.stream(StringUtils.delimitedListToStringArray(scope, " ")) + .collect(Collectors.toSet()); + } + + String refreshToken = tokenResponseParameters.get(OAuth2ParameterNames.REFRESH_TOKEN); + + Map additionalParameters = new LinkedHashMap<>(); + tokenResponseParameters.entrySet() + .stream() + .filter(e -> !TOKEN_RESPONSE_PARAMETER_NAMES.contains(e.getKey())) + .forEach(e -> additionalParameters.put(e.getKey(), e.getValue())); + + return OAuth2AccessTokenResponse.withToken(accessToken) + .tokenType(accessTokenType) + .expiresIn(expiresIn) + .scopes(scopes) + .refreshToken(refreshToken) + .additionalParameters(additionalParameters) + .build(); + } + +} diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/SecurityConfig.java b/spring-5-security/src/main/java/com/baeldung/oauth2/SecurityConfig.java index b45f325767..cf27b01a75 100644 --- a/spring-5-security/src/main/java/com/baeldung/oauth2/SecurityConfig.java +++ b/spring-5-security/src/main/java/com/baeldung/oauth2/SecurityConfig.java @@ -9,18 +9,22 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; +import org.springframework.http.converter.FormHttpMessageConverter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.oauth2.client.CommonOAuth2Provider; -import org.springframework.security.oauth2.client.endpoint.NimbusAuthorizationCodeTokenResponseClient; +import org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient; import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient; import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest; +import org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler; import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository; import org.springframework.security.oauth2.client.web.AuthorizationRequestRepository; import org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizationRequestRepository; import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest; +import org.springframework.security.oauth2.core.http.converter.OAuth2AccessTokenResponseHttpMessageConverter; +import org.springframework.web.client.RestTemplate; @Configuration @PropertySource("application-oauth2.properties") @@ -37,6 +41,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { .oauth2Login() .loginPage("/oauth_login") .authorizationEndpoint() + .authorizationRequestResolver( new CustomAuthorizationRequestResolver(clientRegistrationRepository(),"/oauth2/authorize-client")) + .baseUri("/oauth2/authorize-client") .authorizationRequestRepository(authorizationRequestRepository()) .and() @@ -54,7 +60,15 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Bean public OAuth2AccessTokenResponseClient accessTokenResponseClient() { - return new NimbusAuthorizationCodeTokenResponseClient(); + DefaultAuthorizationCodeTokenResponseClient accessTokenResponseClient = new DefaultAuthorizationCodeTokenResponseClient(); + accessTokenResponseClient.setRequestEntityConverter(new CustomRequestEntityConverter()); + + OAuth2AccessTokenResponseHttpMessageConverter tokenResponseHttpMessageConverter = new OAuth2AccessTokenResponseHttpMessageConverter(); + tokenResponseHttpMessageConverter.setTokenResponseConverter(new CustomTokenResponseConverter()); + RestTemplate restTemplate = new RestTemplate(Arrays.asList(new FormHttpMessageConverter(), tokenResponseHttpMessageConverter)); + restTemplate.setErrorHandler(new OAuth2ErrorResponseErrorHandler()); + accessTokenResponseClient.setRestOperations(restTemplate); + return accessTokenResponseClient; } From a6c9c5840f9942c89a7318c6ea7cced0de058345 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 24 Nov 2018 13:36:27 +0200 Subject: [PATCH 456/546] disabling unnecessary repo --- libraries/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/pom.xml b/libraries/pom.xml index 8ffd33272d..936e86873d 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -720,11 +720,11 @@ - + false From 991436fa16b659cbe79a053f8ed4781f0662d284 Mon Sep 17 00:00:00 2001 From: saikat Date: Sat, 24 Nov 2018 18:58:48 +0530 Subject: [PATCH 457/546] Rename project module --- pom.xml | 2 +- {restx-demo => restx}/data/credentials.json | 0 {restx-demo => restx}/data/users.json | 0 {restx-demo => restx}/md.restx.json | 0 {restx-demo => restx}/pom.xml | 3 +-- {restx-demo => restx}/src/main/java/restx/demo/AppModule.java | 0 {restx-demo => restx}/src/main/java/restx/demo/AppServer.java | 0 {restx-demo => restx}/src/main/java/restx/demo/Roles.java | 0 .../src/main/java/restx/demo/domain/Message.java | 0 .../src/main/java/restx/demo/rest/HelloResource.java | 0 {restx-demo => restx}/src/main/resources/logback.xml | 0 .../src/main/resources/restx/demo/settings.properties | 0 {restx-demo => restx}/src/main/webapp/WEB-INF/web.xml | 0 .../test/java/restx/demo/rest/HelloResourceSpecUnitTest.java | 0 .../resources/specs/hello/should_admin_say_hello.spec.yaml | 0 .../resources/specs/hello/should_anyone_say_hello.spec.yaml | 0 .../should_missing_value_triggers_validation_error.spec.yaml | 0 .../resources/specs/hello/should_user1_say_hello.spec.yaml | 0 .../resources/specs/hello/should_user2_not_say_hello.spec.yaml | 0 19 files changed, 2 insertions(+), 3 deletions(-) rename {restx-demo => restx}/data/credentials.json (100%) rename {restx-demo => restx}/data/users.json (100%) rename {restx-demo => restx}/md.restx.json (100%) rename {restx-demo => restx}/pom.xml (98%) rename {restx-demo => restx}/src/main/java/restx/demo/AppModule.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/AppServer.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/Roles.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/domain/Message.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/rest/HelloResource.java (100%) rename {restx-demo => restx}/src/main/resources/logback.xml (100%) rename {restx-demo => restx}/src/main/resources/restx/demo/settings.properties (100%) rename {restx-demo => restx}/src/main/webapp/WEB-INF/web.xml (100%) rename restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java => restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml (100%) diff --git a/pom.xml b/pom.xml index 10e23da0ad..77c666b3ab 100644 --- a/pom.xml +++ b/pom.xml @@ -1608,7 +1608,7 @@ persistence-modules/spring-data-elasticsearch core-java-concurrency core-java-concurrency-collections - restx-demo + restx diff --git a/restx-demo/data/credentials.json b/restx/data/credentials.json similarity index 100% rename from restx-demo/data/credentials.json rename to restx/data/credentials.json diff --git a/restx-demo/data/users.json b/restx/data/users.json similarity index 100% rename from restx-demo/data/users.json rename to restx/data/users.json diff --git a/restx-demo/md.restx.json b/restx/md.restx.json similarity index 100% rename from restx-demo/md.restx.json rename to restx/md.restx.json diff --git a/restx-demo/pom.xml b/restx/pom.xml similarity index 98% rename from restx-demo/pom.xml rename to restx/pom.xml index da106b8191..c6233b968c 100644 --- a/restx-demo/pom.xml +++ b/restx/pom.xml @@ -4,8 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - restx-demo - restx-demo + restx 0.1-SNAPSHOT war restx-demo diff --git a/restx-demo/src/main/java/restx/demo/AppModule.java b/restx/src/main/java/restx/demo/AppModule.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/AppModule.java rename to restx/src/main/java/restx/demo/AppModule.java diff --git a/restx-demo/src/main/java/restx/demo/AppServer.java b/restx/src/main/java/restx/demo/AppServer.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/AppServer.java rename to restx/src/main/java/restx/demo/AppServer.java diff --git a/restx-demo/src/main/java/restx/demo/Roles.java b/restx/src/main/java/restx/demo/Roles.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/Roles.java rename to restx/src/main/java/restx/demo/Roles.java diff --git a/restx-demo/src/main/java/restx/demo/domain/Message.java b/restx/src/main/java/restx/demo/domain/Message.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/domain/Message.java rename to restx/src/main/java/restx/demo/domain/Message.java diff --git a/restx-demo/src/main/java/restx/demo/rest/HelloResource.java b/restx/src/main/java/restx/demo/rest/HelloResource.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/rest/HelloResource.java rename to restx/src/main/java/restx/demo/rest/HelloResource.java diff --git a/restx-demo/src/main/resources/logback.xml b/restx/src/main/resources/logback.xml similarity index 100% rename from restx-demo/src/main/resources/logback.xml rename to restx/src/main/resources/logback.xml diff --git a/restx-demo/src/main/resources/restx/demo/settings.properties b/restx/src/main/resources/restx/demo/settings.properties similarity index 100% rename from restx-demo/src/main/resources/restx/demo/settings.properties rename to restx/src/main/resources/restx/demo/settings.properties diff --git a/restx-demo/src/main/webapp/WEB-INF/web.xml b/restx/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from restx-demo/src/main/webapp/WEB-INF/web.xml rename to restx/src/main/webapp/WEB-INF/web.xml diff --git a/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java b/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java similarity index 100% rename from restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java rename to restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java diff --git a/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml b/restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml rename to restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml From 9ba79376452c320ebb8b9b6cca7a61920a0f9767 Mon Sep 17 00:00:00 2001 From: saikat Date: Sat, 24 Nov 2018 19:00:09 +0530 Subject: [PATCH 458/546] Rename unit test to fix PMD failure --- .../java/restx/demo/rest/HelloResourceSpecUnitTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java b/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java index 138a22d074..f67e4565b3 100644 --- a/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java +++ b/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java @@ -1,13 +1,13 @@ package restx.demo.rest; -import restx.demo.AppServer; import org.junit.runner.RunWith; -import restx.tests.RestxSpecTestsRunner; + import restx.tests.FindSpecsIn; +import restx.tests.RestxSpecTestsRunner; @RunWith(RestxSpecTestsRunner.class) @FindSpecsIn("specs/hello") -public class HelloResourceSpecTest { +public class HelloResourceSpecUnitTest { /** * Useless, thanks to both @RunWith(RestxSpecTestsRunner.class) & @FindSpecsIn() From 8d393165c4ce7a372b0ff5a595d9351b8a4afa48 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 24 Nov 2018 18:35:05 +0200 Subject: [PATCH 459/546] Update and rename PostRepositoryTest.java to PostRepositoryIntegrationTest.java --- ...RepositoryTest.java => PostRepositoryIntegrationTest.java} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/{PostRepositoryTest.java => PostRepositoryIntegrationTest.java} (94%) diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryIntegrationTest.java similarity index 94% rename from persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryTest.java rename to persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryIntegrationTest.java index 382742f223..4724bb41ad 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/entitygraph/repo/PostRepositoryIntegrationTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import static org.junit.Assert.*; -public class PostRepositoryTest { +public class PostRepositoryIntegrationTest { private static PostRepository postRepository = null; @@ -65,4 +65,4 @@ public class PostRepositoryTest { public static void destroy() { postRepository.clean(); } -} \ No newline at end of file +} From 27ec13ea96cf876ba159babd9ec4e4a67c0877ca Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 25 Nov 2018 00:23:51 +0530 Subject: [PATCH 460/546] [BAEL-9712] - Modifed oauth version --- spring-5-security-oauth/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-5-security-oauth/pom.xml b/spring-5-security-oauth/pom.xml index 13359ae84a..33a0677724 100644 --- a/spring-5-security-oauth/pom.xml +++ b/spring-5-security-oauth/pom.xml @@ -66,7 +66,7 @@ - 2.0.5.RELEASE + 2.0.1.RELEASE From 4e4da4eb7739315bd797491938998723f850174e Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 24 Nov 2018 21:50:20 +0200 Subject: [PATCH 461/546] fix start, edit readme --- spring-5-security-oauth/README.md | 3 ++- spring-5-security-oauth/pom.xml | 1 + spring-5-security/README.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-5-security-oauth/README.md b/spring-5-security-oauth/README.md index 81d95c07d7..f13925992b 100644 --- a/spring-5-security-oauth/README.md +++ b/spring-5-security-oauth/README.md @@ -1,3 +1,4 @@ ## Relevant articles: -- [Spring Security 5 -OAuth2 Login](http://www.baeldung.com/spring-security-5-oauth2-login) \ No newline at end of file +- [Spring Security 5 -OAuth2 Login](http://www.baeldung.com/spring-security-5-oauth2-login) +- [Extracting Principal and Authorities using Spring Security OAuth](https://www.baeldung.com/spring-security-oauth-principal-authorities-extractor) diff --git a/spring-5-security-oauth/pom.xml b/spring-5-security-oauth/pom.xml index 33a0677724..f200052adf 100644 --- a/spring-5-security-oauth/pom.xml +++ b/spring-5-security-oauth/pom.xml @@ -67,6 +67,7 @@ 2.0.1.RELEASE + com.baeldung.oauth2.SpringOAuthApplication diff --git a/spring-5-security/README.md b/spring-5-security/README.md index 6e094e928f..37dc8b0f28 100644 --- a/spring-5-security/README.md +++ b/spring-5-security/README.md @@ -4,4 +4,4 @@ - [A Custom Spring SecurityConfigurer](http://www.baeldung.com/spring-security-custom-configurer) - [New Password Storage In Spring Security 5](http://www.baeldung.com/spring-security-5-password-storage) - [Default Password Encoder in Spring Security 5](https://www.baeldung.com/spring-security-5-default-password-encoder) -- [Extracting Principal and Authorities using Spring Security OAuth](https://www.baeldung.com/spring-security-oauth-principal-authorities-extractor) + From bff2c6f5b06ded73a09fce5ef6bc78cfc5645621 Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 25 Nov 2018 01:25:41 +0530 Subject: [PATCH 462/546] [BAEL-10780] - Added code for the checking string input article --- .../string/checkinputs/CheckIntegerInput.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 java-strings/src/main/java/com/baeldung/string/checkinputs/CheckIntegerInput.java diff --git a/java-strings/src/main/java/com/baeldung/string/checkinputs/CheckIntegerInput.java b/java-strings/src/main/java/com/baeldung/string/checkinputs/CheckIntegerInput.java new file mode 100644 index 0000000000..9462244bbb --- /dev/null +++ b/java-strings/src/main/java/com/baeldung/string/checkinputs/CheckIntegerInput.java @@ -0,0 +1,19 @@ +package com.baeldung.string.checkinputs; + +import java.util.Scanner; + +public class CheckIntegerInput { + + public static void main(String[] args) { + + try (Scanner scanner = new Scanner(System.in)) { + System.out.println("Enter an integer : "); + + if (scanner.hasNextInt()) { + System.out.println("You entered : " + scanner.nextInt()); + } else { + System.out.println("The input is not an integer"); + } + } + } +} \ No newline at end of file From 3c3d484eeb6a5676e3055cfa2d4b43c369b8a30b Mon Sep 17 00:00:00 2001 From: Alejandro Gervasio Date: Sat, 24 Nov 2018 18:02:25 -0300 Subject: [PATCH 463/546] BAEL-2354 - An Introduction to the Event Notification Model in CDI 2.0 (#5685) * Initial Commit * Update pom.xml * Update pom.xml * Update LowercaseTextServiceUnitTest.java * Update UppercaseTextServiceUnitTest.java * Delete TextApplication.java * Update source files * Update BootstrappingApplication.java * Add AnotherSimpleEventObserver class * Rename event classes * Update ExampleEventSource.java * Update UppercaseTextService.java * Delete TextService.java * Delete LowercaseTextService.java * Delete LowercaseTextServiceUnitTest.java * Delete UppercaseTextServiceUnitTest.java * Fixed text service unit test * Update TextService.java --- cdi/pom.xml | 25 +++++++++++-------- .../application/BootstrappingApplication.java | 15 +++++++++++ .../cdi2observers/events/ExampleEvent.java | 14 +++++++++++ .../events/ExampleEventSource.java | 14 +++++++++++ .../AnotherExampleEventObserver.java | 12 +++++++++ .../observers/ExampleEventObserver.java | 13 ++++++++++ .../cdi2observers/services/TextService.java | 8 ++++++ .../tests/TextServiceUnitTest.java | 14 +++++++++++ 8 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java create mode 100644 cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java create mode 100644 cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java create mode 100644 cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java create mode 100644 cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java create mode 100644 cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java create mode 100644 cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java diff --git a/cdi/pom.xml b/cdi/pom.xml index 2c719c1d7f..0b735e0ca5 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -5,7 +5,7 @@ com.baeldung cdi 1.0-SNAPSHOT - + com.baeldung parent-spring-4 @@ -14,6 +14,16 @@ + + javax.enterprise + cdi-api + ${cdi-api.version} + + + org.jboss.weld.se + weld-se-core + ${weld-se-core.version} + org.hamcrest hamcrest-core @@ -42,11 +52,6 @@ aspectjweaver ${aspectjweaver.version} - - org.jboss.weld.se - weld-se-core - ${weld-se-core.version} - org.springframework spring-test @@ -54,13 +59,13 @@ test - - 1.8.9 - 2.4.1.Final + 2.0.SP1 + 3.0.5.Final + 1.9.2 1.3 3.10.0 4.12 + 5.1.2.RELEASE - diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java new file mode 100644 index 0000000000..4896408502 --- /dev/null +++ b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.cdi.cdi2observers.application; + +import com.baeldung.cdi.cdi2observers.events.ExampleEvent; +import javax.enterprise.inject.se.SeContainer; +import javax.enterprise.inject.se.SeContainerInitializer; + +public class BootstrappingApplication { + + public static void main(String... args) { + SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance(); + try (SeContainer container = containerInitializer.initialize()) { + container.getBeanManager().fireEvent(new ExampleEvent("Welcome to Baeldung!")); + } + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java new file mode 100644 index 0000000000..a2329d2ef1 --- /dev/null +++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java @@ -0,0 +1,14 @@ +package com.baeldung.cdi.cdi2observers.events; + +public class ExampleEvent { + + private final String eventMessage; + + public ExampleEvent(String eventMessage) { + this.eventMessage = eventMessage; + } + + public String getEventMessage() { + return eventMessage; + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java new file mode 100644 index 0000000000..f37030778a --- /dev/null +++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java @@ -0,0 +1,14 @@ +package com.baeldung.cdi.cdi2observers.events; + +import javax.enterprise.event.Event; +import javax.inject.Inject; + +public class ExampleEventSource { + + @Inject + Event exampleEvent; + + public void fireEvent() { + exampleEvent.fireAsync(new ExampleEvent("Welcome to Baeldung!")); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java new file mode 100644 index 0000000000..34520c2b3d --- /dev/null +++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java @@ -0,0 +1,12 @@ +package com.baeldung.cdi.cdi2observers.observers; + +import com.baeldung.cdi.cdi2observers.events.ExampleEvent; +import javax.annotation.Priority; +import javax.enterprise.event.Observes; + +public class AnotherExampleEventObserver { + + public String onEvent(@Observes @Priority(2) ExampleEvent event) { + return event.getEventMessage(); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java new file mode 100644 index 0000000000..b3522b2ad0 --- /dev/null +++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java @@ -0,0 +1,13 @@ +package com.baeldung.cdi.cdi2observers.observers; + +import com.baeldung.cdi.cdi2observers.events.ExampleEvent; +import com.baeldung.cdi.cdi2observers.services.TextService; +import javax.annotation.Priority; +import javax.enterprise.event.Observes; + +public class ExampleEventObserver { + + public String onEvent(@Observes @Priority(1) ExampleEvent event, TextService textService) { + return textService.parseText(event.getEventMessage()); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java new file mode 100644 index 0000000000..47788a0657 --- /dev/null +++ b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java @@ -0,0 +1,8 @@ +package com.baeldung.cdi.cdi2observers.services; + +public class TextService { + + public String parseText(String text) { + return text.toUpperCase(); + } +} diff --git a/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java new file mode 100644 index 0000000000..deecf13f9a --- /dev/null +++ b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java @@ -0,0 +1,14 @@ +package com.baeldung.cdi.cdi2observers.tests; + +import com.baeldung.cdi.cdi2observers.services.TextService; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + +public class TextServiceUnitTest { + + @Test + public void givenTextServiceInstance_whenCalledparseText_thenCorrect() { + TextService textService = new TextService(); + assertThat(textService.parseText("Baeldung")).isEqualTo("BAELDUNG"); + } +} From f784c3bb793b6de50323700e771a5e001f3e4850 Mon Sep 17 00:00:00 2001 From: Amitabh Mandal Date: Sun, 25 Nov 2018 15:31:22 +0530 Subject: [PATCH 464/546] BAEL-2168 Java EE 7 Batch Processing (#5645) * jberet batch * Batch Understanding * partition * exception * some more changes --- jee-7/pom.xml | 935 ++++++++++-------- .../ChunkExceptionSkipReadListener.java | 11 + .../batch/understanding/CustomCheckPoint.java | 12 + .../understanding/DeciderJobSequence.java | 14 + .../understanding/InjectSimpleBatchLet.java | 20 + .../batch/understanding/SimpleBatchLet.java | 13 + .../SimpleChunkItemProcessor.java | 12 + .../understanding/SimpleChunkItemReader.java | 27 + .../SimpleChunkItemReaderError.java | 31 + .../understanding/SimpleChunkWriter.java | 13 + .../exception/MyInputRecord.java | 41 + .../exception/MyItemProcessor.java | 15 + .../understanding/exception/MyItemReader.java | 42 + .../understanding/exception/MyItemWriter.java | 19 + .../exception/MyOutputRecord.java | 39 + .../exception/MyRetryProcessorListener.java | 11 + .../exception/MyRetryReadListener.java | 11 + .../exception/MyRetryWriteListener.java | 12 + .../exception/MySkipProcessorListener.java | 11 + .../exception/MySkipReadListener.java | 11 + .../exception/MySkipWriteListener.java | 13 + .../META-INF/batch-jobs/customCheckPoint.xml | 12 + .../META-INF/batch-jobs/decideJobSequence.xml | 18 + .../META-INF/batch-jobs/flowJobSequence.xml | 21 + .../batch-jobs/injectionSimpleBatchLet.xml | 13 + .../batch-jobs/partitionSimpleBatchLet.xml | 24 + .../META-INF/batch-jobs/simpleBatchLet.xml | 9 + .../META-INF/batch-jobs/simpleChunk.xml | 11 + .../META-INF/batch-jobs/simpleErrorChunk.xml | 24 + .../batch-jobs/simpleErrorSkipChunk.xml | 26 + .../META-INF/batch-jobs/simpleJobSequence.xml | 17 + .../META-INF/batch-jobs/splitJobSequence.xml | 22 + jee-7/src/main/resources/META-INF/beans.xml | 8 + .../batch/understanding/BatchTestHelper.java | 79 ++ .../CustomCheckPointUnitTest.java | 33 + .../understanding/JobSequenceUnitTest.java | 74 ++ .../understanding/SimpleBatchLetUnitTest.java | 68 ++ .../understanding/SimpleChunkUnitTest.java | 67 ++ .../SimpleErrorChunkUnitTest.java | 48 + 39 files changed, 1473 insertions(+), 414 deletions(-) create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java create mode 100644 jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml create mode 100644 jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml create mode 100644 jee-7/src/main/resources/META-INF/beans.xml create mode 100644 jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java create mode 100644 jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java create mode 100644 jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java create mode 100644 jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java create mode 100644 jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java create mode 100644 jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java diff --git a/jee-7/pom.xml b/jee-7/pom.xml index 4f6e6a20fb..9011648d17 100644 --- a/jee-7/pom.xml +++ b/jee-7/pom.xml @@ -1,430 +1,537 @@ - - 4.0.0 - jee-7 - 1.0-SNAPSHOT - war - JavaEE 7 Arquillian Archetype Sample + + 4.0.0 + jee-7 + 1.0-SNAPSHOT + war + JavaEE 7 Arquillian Archetype Sample - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - javax - javaee-api - ${javaee_api.version} - provided - + + + javax + javaee-api + ${javaee_api.version} + provided + - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.graphene - graphene-webdriver - ${graphene-webdriver.version} - pom - test - - - com.jayway.awaitility - awaitility - ${awaitility.version} - test - + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + org.jboss.arquillian.graphene + graphene-webdriver + ${graphene-webdriver.version} + pom + test + + + com.jayway.awaitility + awaitility + ${awaitility.version} + test + - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven - test - jar - + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + test + jar + - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven-archive - test - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - commons-io - commons-io - ${commons-io.version} - - - com.sun.faces - jsf-api - ${com.sun.faces.jsf.version} - - - com.sun.faces - jsf-impl - ${com.sun.faces.jsf.version} - - - javax.servlet - jstl - ${jstl.version} - - - javax.servlet - javax.servlet-api - ${javax.servlet-api.version} - - - javax.servlet.jsp - jsp-api - ${jsp-api.version} - provided - - - taglibs - standard - ${taglibs.standard.version} - + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven-archive + test + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + commons-io + commons-io + ${commons-io.version} + + + com.sun.faces + jsf-api + ${com.sun.faces.jsf.version} + + + com.sun.faces + jsf-impl + ${com.sun.faces.jsf.version} + + + javax.servlet + jstl + ${jstl.version} + + + javax.servlet + javax.servlet-api + ${javax.servlet-api.version} + + + javax.servlet.jsp + jsp-api + ${jsp-api.version} + provided + + + taglibs + standard + ${taglibs.standard.version} + - - javax.mvc - javax.mvc-api - 20160715 - - - org.glassfish.ozark - ozark - ${ozark.version} - + + javax.mvc + javax.mvc-api + 20160715 + + + org.glassfish.ozark + ozark + ${ozark.version} + - - org.springframework.security - spring-security-web - ${org.springframework.security.version} - + + org.springframework.security + spring-security-web + ${org.springframework.security.version} + - - org.springframework.security - spring-security-config - ${org.springframework.security.version} - - - org.springframework.security - spring-security-taglibs - ${org.springframework.security.version} - - + + org.springframework.security + spring-security-config + ${org.springframework.security.version} + + + org.springframework.security + spring-security-taglibs + ${org.springframework.security.version} + + - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - src/main/webapp - false - - - - + + org.jboss.spec.javax.batch + jboss-batch-api_1.0_spec + 1.0.0.Final + + + org.jberet + jberet-core + 1.0.2.Final + + + org.jberet + jberet-support + 1.0.2.Final + + + org.jboss.spec.javax.transaction + jboss-transaction-api_1.2_spec + 1.0.0.Final + + + org.jboss.marshalling + jboss-marshalling + 1.4.2.Final + + + org.jboss.weld + weld-core + 2.1.1.Final + + + org.jboss.weld.se + weld-se + 2.1.1.Final + + + org.jberet + jberet-se + 1.0.2.Final + + + com.h2database + h2 + 1.4.178 + + + org.glassfish.jersey.containers + jersey-container-jetty-servlet + 2.22.1 + + - - - - org.jboss.arquillian - arquillian-bom - ${arquillian_core.version} - import - pom - - - org.jboss.arquillian.extension - arquillian-drone-bom - ${arquillian-drone-bom.version} - pom - import - - - + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + src/main/webapp + false + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-pmd-plugin + + + [3.8,) + + + check + + + + + + + + + + + + + - - - wildfly-managed-arquillian - - true - - - standalone-full.xml - ${project.build.directory}/wildfly-${version.wildfly} - - - - io.undertow - undertow-websockets-jsr - ${undertow-websockets-jsr.version} - test - - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-jaxb-provider - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-json-p-provider - ${resteasy.version} - test - - - org.wildfly - wildfly-arquillian-container-managed - ${wildfly.version} - test - - + + + + org.jboss.arquillian + arquillian-bom + ${arquillian_core.version} + import + pom + + + org.jboss.arquillian.extension + arquillian-drone-bom + ${arquillian-drone-bom.version} + pom + import + + + - - - - - maven-dependency-plugin - ${maven-dependency-plugin.version} - - ${maven.test.skip} - - - - unpack - process-test-classes - - unpack - - - - - org.wildfly - wildfly-dist - ${wildfly.version} - zip - false - ${project.build.directory} - - - - - - - - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - ${project.build.directory}/wildfly-${wildfly.version} - - - - - - - - - wildfly-remote-arquillian - - - io.undertow - undertow-websockets-jsr - ${undertow-websockets-jsr.version} - test - - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-jaxb-provider - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-json-p-provider - ${resteasy.version} - test - - - org.wildfly - wildfly-arquillian-container-remote - ${wildfly.version} - test - - - - - glassfish-embedded-arquillian - - - org.glassfish.main.extras - glassfish-embedded-all - ${glassfish-embedded-all.version} - test - - - org.glassfish - javax.json - ${javax.json.version} - test - - - org.glassfish.tyrus - tyrus-client - ${tyrus.version} - test - - - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus.version} - test - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - test - - - org.jboss.arquillian.container - arquillian-glassfish-embedded-3.1 - ${arquillian-glassfish.version} - test - - - - - glassfish-remote-arquillian - - - org.glassfish - javax.json - ${javax.json.version} - test - - - org.glassfish.tyrus - tyrus-client - ${tyrus.version} - test - - - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus.version} - test - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - test - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey.version} - test - - - org.glassfish.jersey.media - jersey-media-json-processing - ${jersey.version} - test - - - org.jboss.arquillian.container - arquillian-glassfish-remote-3.1 - ${arquillian-glassfish.version} - test - - - - - webdriver-chrome - - true - - - chrome - - - - webdriver-firefox - - firefox - - - + + + wildfly-managed-arquillian + + true + + + standalone-full.xml + ${project.build.directory}/wildfly-${version.wildfly} + + + + io.undertow + undertow-websockets-jsr + ${undertow-websockets-jsr.version} + test + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-jaxb-provider + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-json-p-provider + ${resteasy.version} + test + + + org.wildfly + wildfly-arquillian-container-managed + ${wildfly.version} + test + + + sun.jdk + jconsole + + + + - - - bintray-mvc-spec-maven - bintray - http://dl.bintray.com/mvc-spec/maven - - true - - - false - - - + + + + + maven-dependency-plugin + ${maven-dependency-plugin.version} + + ${maven.test.skip} + + + + unpack + process-test-classes + + unpack + + + + + org.wildfly + wildfly-dist + ${wildfly.version} + zip + false + ${project.build.directory} + + + sun.jdk + jconsole + + + + + + + + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + ${project.build.directory}/wildfly-${wildfly.version} + + + + + + + + + wildfly-remote-arquillian + + + io.undertow + undertow-websockets-jsr + ${undertow-websockets-jsr.version} + test + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-jaxb-provider + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-json-p-provider + ${resteasy.version} + test + + + org.wildfly + wildfly-arquillian-container-remote + ${wildfly.version} + test + + + sun.jdk + jconsole + + + + + + + glassfish-embedded-arquillian + + + org.glassfish.main.extras + glassfish-embedded-all + ${glassfish-embedded-all.version} + test + + + org.glassfish + javax.json + ${javax.json.version} + test + + + org.glassfish.tyrus + tyrus-client + ${tyrus.version} + test + + + org.glassfish.tyrus + tyrus-container-grizzly-client + ${tyrus.version} + test + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + test + + + org.jboss.arquillian.container + arquillian-glassfish-embedded-3.1 + ${arquillian-glassfish.version} + test + + + + + glassfish-remote-arquillian + + + org.glassfish + javax.json + ${javax.json.version} + test + + + org.glassfish.tyrus + tyrus-client + ${tyrus.version} + test + + + org.glassfish.tyrus + tyrus-container-grizzly-client + ${tyrus.version} + test + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + test + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey.version} + test + + + org.glassfish.jersey.media + jersey-media-json-processing + ${jersey.version} + test + + + org.jboss.arquillian.container + arquillian-glassfish-remote-3.1 + ${arquillian-glassfish.version} + test + + + + + webdriver-chrome + + true + + + chrome + + + + webdriver-firefox + + firefox + + + - - 1.8 - 3.0.0 - 7.0 - 1.1.11.Final - 8.2.1.Final - 1.7.0 - 1.4.6.Final - 3.0.19.Final - 4.1.1 - 1.0.4 - 1.13 - 2.25 - 1.0.0.Final - 2.6 - 4.2.3.RELEASE - 2.21.0 - 1.1.2 - 2.4 - 2.2.14 - 4.5 - 2.0.1.Final - 3.1.0 - 2.1.0.Final - 2.8 - 1.2 - 2.2 - 20160715 - + + + bintray-mvc-spec-maven + bintray + http://dl.bintray.com/mvc-spec/maven + + true + + + false + + + - + + 1.8 + 3.0.0 + 7.0 + 1.1.11.Final + 8.2.1.Final + 1.7.0 + 1.4.6.Final + 3.0.19.Final + 4.1.1 + 1.0.4 + 1.13 + 2.25 + 1.0.0.Final + 2.6 + 4.2.3.RELEASE + 2.21.0 + 1.1.2 + 2.4 + 2.2.14 + 4.5 + 2.0.1.Final + 3.1.0 + 2.1.0.Final + 2.8 + 1.2 + 2.2 + 20160715 + + + \ No newline at end of file diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java new file mode 100644 index 0000000000..ce47de66af --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java @@ -0,0 +1,11 @@ +package com.baeldung.batch.understanding; + +import javax.batch.api.chunk.listener.SkipReadListener; +import javax.inject.Named; + +@Named +public class ChunkExceptionSkipReadListener implements SkipReadListener { + @Override + public void onSkipReadItem(Exception e) throws Exception { + } +} \ No newline at end of file diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java b/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java new file mode 100644 index 0000000000..fe6759b365 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java @@ -0,0 +1,12 @@ +package com.baeldung.batch.understanding; + +import javax.batch.api.chunk.AbstractCheckpointAlgorithm; +import javax.inject.Named; + +@Named +public class CustomCheckPoint extends AbstractCheckpointAlgorithm { + @Override + public boolean isReadyToCheckpoint() throws Exception { + return SimpleChunkItemReader.COUNT % 5 == 0; + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java b/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java new file mode 100644 index 0000000000..6cc2012f23 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java @@ -0,0 +1,14 @@ +package com.baeldung.batch.understanding; + +import javax.batch.api.Decider; +import javax.batch.runtime.StepExecution; +import javax.inject.Named; + +@Named +public class DeciderJobSequence implements Decider { + @Override + public String decide(StepExecution[] ses) throws Exception { + return "nothing"; + } + +} \ No newline at end of file diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java b/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java new file mode 100644 index 0000000000..93eb20708d --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java @@ -0,0 +1,20 @@ +package com.baeldung.batch.understanding; + +import javax.batch.api.AbstractBatchlet; +import javax.batch.api.BatchProperty; +import javax.batch.runtime.BatchStatus; +import javax.inject.Inject; +import javax.inject.Named; + +@Named +public class InjectSimpleBatchLet extends AbstractBatchlet { + @Inject + @BatchProperty(name = "name") + private String nameString; + + @Override + public String process() throws Exception { + System.out.println("Value passed in = " + nameString); + return BatchStatus.COMPLETED.toString(); + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java new file mode 100644 index 0000000000..6a367b064b --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java @@ -0,0 +1,13 @@ +package com.baeldung.batch.understanding; + +import javax.batch.api.AbstractBatchlet; +import javax.batch.runtime.BatchStatus; +import javax.inject.Named; + +@Named +public class SimpleBatchLet extends AbstractBatchlet { + @Override + public String process() throws Exception { + return BatchStatus.FAILED.toString(); + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java new file mode 100644 index 0000000000..3f8166b6d8 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java @@ -0,0 +1,12 @@ +package com.baeldung.batch.understanding; + +import javax.batch.api.chunk.ItemProcessor; +import javax.inject.Named; + +@Named +public class SimpleChunkItemProcessor implements ItemProcessor { + @Override + public Integer processItem(Object t) { + return ((Integer) t).intValue() % 2 == 0 ? null : ((Integer) t).intValue(); + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java new file mode 100644 index 0000000000..10f81d95d0 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java @@ -0,0 +1,27 @@ +package com.baeldung.batch.understanding; + +import java.io.Serializable; +import java.util.StringTokenizer; +import javax.batch.api.chunk.AbstractItemReader; +import javax.inject.Named; + +@Named +public class SimpleChunkItemReader extends AbstractItemReader { + private StringTokenizer tokens; + public static int COUNT = 0; + + @Override + public Integer readItem() throws Exception { + if (tokens.hasMoreTokens()) { + COUNT++; + String tempTokenize = tokens.nextToken(); + return Integer.valueOf(tempTokenize); + } + return null; + } + + @Override + public void open(Serializable checkpoint) throws Exception { + tokens = new StringTokenizer("1,2,3,4,5,6,7,8,9,10", ","); + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java new file mode 100644 index 0000000000..92096d0571 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java @@ -0,0 +1,31 @@ +package com.baeldung.batch.understanding; + +import java.io.Serializable; +import java.util.StringTokenizer; + +import javax.batch.api.chunk.AbstractItemReader; +import javax.inject.Named; + +@Named +public class SimpleChunkItemReaderError extends AbstractItemReader { + private StringTokenizer tokens; + public static int COUNT = 0; + + @Override + public Integer readItem() throws Exception { + if (tokens.hasMoreTokens()) { + COUNT++; + int token = Integer.valueOf(tokens.nextToken()); + if (token == 3) { + throw new RuntimeException("Something happened"); + } + return Integer.valueOf(token); + } + return null; + } + + @Override + public void open(Serializable checkpoint) throws Exception { + tokens = new StringTokenizer("1,2,3,4,5,6,7,8,9,10", ","); + } +} \ No newline at end of file diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java new file mode 100644 index 0000000000..909596766d --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java @@ -0,0 +1,13 @@ +package com.baeldung.batch.understanding; + +import java.util.List; + +import javax.batch.api.chunk.AbstractItemWriter; +import javax.inject.Named; + +@Named +public class SimpleChunkWriter extends AbstractItemWriter { + @Override + public void writeItems(List items) throws Exception { + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java new file mode 100644 index 0000000000..e813a699c2 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java @@ -0,0 +1,41 @@ +package com.baeldung.batch.understanding.exception; + +import java.io.Serializable; + +public class MyInputRecord implements Serializable { + private int id; + + public MyInputRecord(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + MyInputRecord that = (MyInputRecord) o; + + return id == that.id; + } + + @Override + public int hashCode() { + return id; + } + + @Override + public String toString() { + return "MyInputRecord: " + id; + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java new file mode 100644 index 0000000000..4427a1f548 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java @@ -0,0 +1,15 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.ItemProcessor; +import javax.inject.Named; + +@Named +public class MyItemProcessor implements ItemProcessor { + @Override + public Object processItem(Object t) { + if (((MyInputRecord) t).getId() == 6) { + throw new NullPointerException(); + } + return new MyOutputRecord(((MyInputRecord) t).getId()); + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java new file mode 100644 index 0000000000..dd1876ab7d --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java @@ -0,0 +1,42 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.AbstractItemReader; +import javax.inject.Named; +import java.io.Serializable; +import java.util.StringTokenizer; + +@Named +public class MyItemReader extends AbstractItemReader { + private StringTokenizer tokens; + private MyInputRecord lastElement; + private boolean alreadyFailed; + + @Override + public void open(Serializable checkpoint) { + tokens = new StringTokenizer("1,2,3,4,5,6,7,8,9,10", ","); + if (checkpoint != null) { + while (!Integer.valueOf(tokens.nextToken()) + .equals(((MyInputRecord) checkpoint).getId())) { + } + } + } + + @Override + public Object readItem() { + if (tokens.hasMoreTokens()) { + int token = Integer.valueOf(tokens.nextToken()); + if (token == 5 && !alreadyFailed) { + alreadyFailed = true; + throw new IllegalArgumentException("Could not read record"); + } + lastElement = new MyInputRecord(token); + return lastElement; + } + return null; + } + + @Override + public Serializable checkpointInfo() throws Exception { + return lastElement; + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java new file mode 100644 index 0000000000..4e80d86d44 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java @@ -0,0 +1,19 @@ + +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.AbstractItemWriter; +import javax.inject.Named; +import java.util.List; + +@Named +public class MyItemWriter extends AbstractItemWriter { + private static int retries = 0; + + @Override + public void writeItems(List list) { + if (retries <= 3 && list.contains(new MyOutputRecord(8))) { + retries++; + throw new UnsupportedOperationException(); + } + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java new file mode 100644 index 0000000000..8f18fca7ba --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java @@ -0,0 +1,39 @@ +package com.baeldung.batch.understanding.exception; + +import java.io.Serializable; + +public class MyOutputRecord implements Serializable { + private int id; + + public MyOutputRecord(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MyOutputRecord that = (MyOutputRecord) o; + + return id == that.id; + } + + @Override + public int hashCode() { + return id; + } + + @Override + public String toString() { + return "MyOutputRecord: " + id; + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java new file mode 100644 index 0000000000..3bd35820c3 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java @@ -0,0 +1,11 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.listener.RetryProcessListener; +import javax.inject.Named; + +@Named +public class MyRetryProcessorListener implements RetryProcessListener { + @Override + public void onRetryProcessException(Object item, Exception ex) throws Exception { + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java new file mode 100644 index 0000000000..5c4f56b75d --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java @@ -0,0 +1,11 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.listener.RetryReadListener; +import javax.inject.Named; + +@Named +public class MyRetryReadListener implements RetryReadListener { + @Override + public void onRetryReadException(Exception ex) throws Exception { + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java new file mode 100644 index 0000000000..a8683d86a9 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java @@ -0,0 +1,12 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.listener.RetryWriteListener; +import javax.inject.Named; +import java.util.List; + +@Named +public class MyRetryWriteListener implements RetryWriteListener { + @Override + public void onRetryWriteException(List items, Exception ex) throws Exception { + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java new file mode 100644 index 0000000000..74f7565cf7 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java @@ -0,0 +1,11 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.listener.SkipProcessListener; +import javax.inject.Named; + +@Named +public class MySkipProcessorListener implements SkipProcessListener { + @Override + public void onSkipProcessItem(Object t, Exception e) throws Exception { + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java new file mode 100644 index 0000000000..aecaf93e75 --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java @@ -0,0 +1,11 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.listener.SkipReadListener; +import javax.inject.Named; + +@Named +public class MySkipReadListener implements SkipReadListener { + @Override + public void onSkipReadItem(Exception e) throws Exception { + } +} diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java new file mode 100644 index 0000000000..928773b61d --- /dev/null +++ b/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java @@ -0,0 +1,13 @@ +package com.baeldung.batch.understanding.exception; + +import javax.batch.api.chunk.listener.SkipWriteListener; +import javax.inject.Named; +import java.util.List; + +@Named +public class MySkipWriteListener implements SkipWriteListener { + @Override + public void onSkipWriteItem(List list, Exception e) throws Exception { + list.remove(new MyOutputRecord(2)); + } +} diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml b/jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml new file mode 100644 index 0000000000..b0f327dd39 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml b/jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml new file mode 100644 index 0000000000..4905586fb9 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml b/jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml new file mode 100644 index 0000000000..207a9242b1 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml b/jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml new file mode 100644 index 0000000000..d152f063f6 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml b/jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml new file mode 100644 index 0000000000..76c64ee899 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml b/jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml new file mode 100644 index 0000000000..9c707de8a4 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml b/jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml new file mode 100644 index 0000000000..b2b15b7bd9 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml b/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml new file mode 100644 index 0000000000..743fcafd65 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml b/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml new file mode 100644 index 0000000000..2fafb83cc7 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml b/jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml new file mode 100644 index 0000000000..7110db7f23 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml b/jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml new file mode 100644 index 0000000000..0a9ea97dc7 --- /dev/null +++ b/jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jee-7/src/main/resources/META-INF/beans.xml b/jee-7/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000000..ae0f4bf2ee --- /dev/null +++ b/jee-7/src/main/resources/META-INF/beans.xml @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java b/jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java new file mode 100644 index 0000000000..5060bd9b91 --- /dev/null +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java @@ -0,0 +1,79 @@ +package com.baeldung.batch.understanding; + +import java.util.HashMap; +import java.util.Map; + +import javax.batch.runtime.BatchRuntime; +import javax.batch.runtime.BatchStatus; +import javax.batch.runtime.JobExecution; +import javax.batch.runtime.Metric; + +public class BatchTestHelper { + private static final int MAX_TRIES = 40; + private static final int THREAD_SLEEP = 1000; + + private BatchTestHelper() { + throw new UnsupportedOperationException(); + } + + public static JobExecution keepTestAlive(JobExecution jobExecution) throws InterruptedException { + int maxTries = 0; + while (!jobExecution.getBatchStatus() + .equals(BatchStatus.COMPLETED)) { + if (maxTries < MAX_TRIES) { + maxTries++; + Thread.sleep(THREAD_SLEEP); + jobExecution = BatchRuntime.getJobOperator() + .getJobExecution(jobExecution.getExecutionId()); + } else { + break; + } + } + Thread.sleep(THREAD_SLEEP); + return jobExecution; + } + + public static JobExecution keepTestFailed(JobExecution jobExecution) throws InterruptedException { + int maxTries = 0; + while (!jobExecution.getBatchStatus() + .equals(BatchStatus.FAILED)) { + if (maxTries < MAX_TRIES) { + maxTries++; + Thread.sleep(THREAD_SLEEP); + jobExecution = BatchRuntime.getJobOperator() + .getJobExecution(jobExecution.getExecutionId()); + } else { + break; + } + } + Thread.sleep(THREAD_SLEEP); + + return jobExecution; + } + + public static JobExecution keepTestStopped(JobExecution jobExecution) throws InterruptedException { + int maxTries = 0; + while (!jobExecution.getBatchStatus() + .equals(BatchStatus.STOPPED)) { + if (maxTries < MAX_TRIES) { + maxTries++; + Thread.sleep(THREAD_SLEEP); + jobExecution = BatchRuntime.getJobOperator() + .getJobExecution(jobExecution.getExecutionId()); + } else { + break; + } + } + Thread.sleep(THREAD_SLEEP); + return jobExecution; + } + + public static Map getMetricsMap(Metric[] metrics) { + Map metricsMap = new HashMap<>(); + for (Metric metric : metrics) { + metricsMap.put(metric.getType(), metric.getValue()); + } + return metricsMap; + } + +} diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java new file mode 100644 index 0000000000..a9488c5c03 --- /dev/null +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.batch.understanding; + +import static org.junit.jupiter.api.Assertions.*; +import java.util.Map; +import java.util.Properties; +import javax.batch.operations.JobOperator; +import javax.batch.runtime.BatchRuntime; +import javax.batch.runtime.BatchStatus; +import javax.batch.runtime.JobExecution; +import javax.batch.runtime.Metric; +import javax.batch.runtime.StepExecution; +import com.baeldung.batch.understanding.BatchTestHelper; + +import org.junit.jupiter.api.Test; + +class CustomCheckPointUnitTest { + @Test + public void givenChunk_whenCustomCheckPoint_thenCommitCount_3() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("customCheckPoint", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + for (StepExecution stepExecution : jobOperator.getStepExecutions(executionId)) { + if (stepExecution.getStepName() + .equals("firstChunkStep")) { + Map metricsMap = BatchTestHelper.getMetricsMap(stepExecution.getMetrics()); + assertEquals(3L, metricsMap.get(Metric.MetricType.COMMIT_COUNT) + .longValue()); + } + } + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } +} diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java new file mode 100644 index 0000000000..7c5e8d0b78 --- /dev/null +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java @@ -0,0 +1,74 @@ +package com.baeldung.batch.understanding; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import javax.batch.operations.JobOperator; +import javax.batch.runtime.BatchRuntime; +import javax.batch.runtime.BatchStatus; +import javax.batch.runtime.JobExecution; +import javax.batch.runtime.StepExecution; + +import org.junit.jupiter.api.Test; + +class JobSequenceUnitTest { + @Test + public void givenTwoSteps_thenBatch_CompleteWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleJobSequence", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + assertEquals(2 , jobOperator.getStepExecutions(executionId).size()); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } + + @Test + public void givenFlow_thenBatch_CompleteWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("flowJobSequence", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + assertEquals(3 , jobOperator.getStepExecutions(executionId).size()); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } + + @Test + public void givenDecider_thenBatch_CompleteWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("decideJobSequence", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + List stepExecutions = jobOperator.getStepExecutions(executionId); + List executedSteps = new ArrayList<>(); + for (StepExecution stepExecution : stepExecutions) { + executedSteps.add(stepExecution.getStepName()); + } + assertEquals(2, jobOperator.getStepExecutions(executionId).size()); + assertArrayEquals(new String[] { "firstBatchStepStep1", "firstBatchStepStep3" }, executedSteps.toArray()); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } + + @Test + public void givenSplit_thenBatch_CompletesWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("splitJobSequence", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + List stepExecutions = jobOperator.getStepExecutions(executionId); + List executedSteps = new ArrayList<>(); + for (StepExecution stepExecution : stepExecutions) { + executedSteps.add(stepExecution.getStepName()); + } + assertEquals(3, stepExecutions.size()); + assertTrue(executedSteps.contains("splitJobSequenceStep1")); + assertTrue(executedSteps.contains("splitJobSequenceStep2")); + assertTrue(executedSteps.contains("splitJobSequenceStep3")); + assertTrue(executedSteps.get(0).equals("splitJobSequenceStep1") || executedSteps.get(0).equals("splitJobSequenceStep2")); + assertTrue(executedSteps.get(1).equals("splitJobSequenceStep1") || executedSteps.get(1).equals("splitJobSequenceStep2")); + assertTrue(executedSteps.get(2).equals("splitJobSequenceStep3")); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } +} diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java new file mode 100644 index 0000000000..485c997cc6 --- /dev/null +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java @@ -0,0 +1,68 @@ +package com.baeldung.batch.understanding; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.batch.operations.JobOperator; +import javax.batch.runtime.BatchRuntime; +import javax.batch.runtime.BatchStatus; +import javax.batch.runtime.JobExecution; +import javax.batch.runtime.Metric; +import javax.batch.runtime.StepExecution; + +import org.junit.jupiter.api.Test; + +class SimpleBatchLetUnitTest { + @Test + public void givenBatchLet_thenBatch_CompleteWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleBatchLet", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } + + @Test + public void givenBatchLetProperty_thenBatch_CompleteWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("injectionSimpleBatchLet", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } + + @Test + public void givenBatchLetPartition_thenBatch_CompleteWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("partitionSimpleBatchLet", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } + + @Test + public void givenBatchLetStarted_whenStopped_thenBatchStopped() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleBatchLet", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobOperator.stop(executionId); + jobExecution = BatchTestHelper.keepTestStopped(jobExecution); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.STOPPED); + } + + @Test + public void givenBatchLetStopped_whenRestarted_thenBatchCompletesSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleBatchLet", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobOperator.stop(executionId); + jobExecution = BatchTestHelper.keepTestStopped(jobExecution); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.STOPPED); + executionId = jobOperator.restart(jobExecution.getExecutionId(), new Properties()); + jobExecution = BatchTestHelper.keepTestAlive(jobOperator.getJobExecution(executionId)); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } +} diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java new file mode 100644 index 0000000000..57c794ba00 --- /dev/null +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java @@ -0,0 +1,67 @@ +package com.baeldung.batch.understanding; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.batch.operations.JobOperator; +import javax.batch.runtime.BatchRuntime; +import javax.batch.runtime.BatchStatus; +import javax.batch.runtime.JobExecution; +import javax.batch.runtime.Metric; +import javax.batch.runtime.StepExecution; + +import org.junit.jupiter.api.Test; + +class SimpleChunkUnitTest { + @Test + public void givenChunk_thenBatch_CompletesWithSucess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleChunk", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + List stepExecutions = jobOperator.getStepExecutions(executionId); + for (StepExecution stepExecution : stepExecutions) { + if (stepExecution.getStepName() + .equals("firstChunkStep")) { + Map metricsMap = BatchTestHelper.getMetricsMap(stepExecution.getMetrics()); + assertEquals(10L, metricsMap.get(Metric.MetricType.READ_COUNT) + .longValue()); + assertEquals(10L / 2L, metricsMap.get(Metric.MetricType.WRITE_COUNT) + .longValue()); + assertEquals(10L / 3 + (10L % 3 > 0 ? 1 : 0), metricsMap.get(Metric.MetricType.COMMIT_COUNT) + .longValue()); + } + } + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } + + @Test + public void givenChunk__thenBatch_fetchInformation() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleChunk", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + // job name contains simpleBatchLet which is the name of the file + assertTrue(jobOperator.getJobNames().contains("simpleChunk")); + // job parameters are empty + assertTrue(jobOperator.getParameters(executionId).isEmpty()); + // step execution information + List stepExecutions = jobOperator.getStepExecutions(executionId); + assertEquals("firstChunkStep", stepExecutions.get(0).getStepName()); + // finding out batch status + assertEquals(BatchStatus.COMPLETED, stepExecutions.get(0).getBatchStatus()); + Map metricTest = BatchTestHelper.getMetricsMap(stepExecutions.get(0).getMetrics()); + assertEquals(10L, metricTest.get(Metric.MetricType.READ_COUNT).longValue()); + assertEquals(5L, metricTest.get(Metric.MetricType.FILTER_COUNT).longValue()); + assertEquals(4L, metricTest.get(Metric.MetricType.COMMIT_COUNT).longValue()); + assertEquals(5L, metricTest.get(Metric.MetricType.WRITE_COUNT).longValue()); + assertEquals(0L, metricTest.get(Metric.MetricType.READ_SKIP_COUNT).longValue()); + assertEquals(0L, metricTest.get(Metric.MetricType.WRITE_SKIP_COUNT).longValue()); + assertEquals(0L, metricTest.get(Metric.MetricType.PROCESS_SKIP_COUNT).longValue()); + assertEquals(0L, metricTest.get(Metric.MetricType.ROLLBACK_COUNT).longValue()); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } +} diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java new file mode 100644 index 0000000000..0f6d068888 --- /dev/null +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java @@ -0,0 +1,48 @@ +package com.baeldung.batch.understanding; + +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.*; + +import java.util.List; +import java.util.Map; +import java.util.Properties; +import javax.batch.operations.JobOperator; +import javax.batch.runtime.BatchRuntime; +import javax.batch.runtime.BatchStatus; +import javax.batch.runtime.JobExecution; +import javax.batch.runtime.Metric.MetricType; +import javax.batch.runtime.StepExecution; + +import org.junit.jupiter.api.Test; + +class SimpleErrorChunkUnitTest { + + @Test + public void givenChunkError_thenBatch_CompletesWithFailed() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleErrorChunk", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestFailed(jobExecution); + System.out.println(jobExecution.getBatchStatus()); + assertEquals(jobExecution.getBatchStatus(), BatchStatus.FAILED); + } + + @Test + public void givenChunkError_thenErrorSkipped_CompletesWithSuccess() throws Exception { + JobOperator jobOperator = BatchRuntime.getJobOperator(); + Long executionId = jobOperator.start("simpleErrorSkipChunk", new Properties()); + JobExecution jobExecution = jobOperator.getJobExecution(executionId); + jobExecution = BatchTestHelper.keepTestAlive(jobExecution); + List stepExecutions = jobOperator.getStepExecutions(executionId); + for (StepExecution stepExecution : stepExecutions) { + if (stepExecution.getStepName() + .equals("errorStep")) { + Map metricsMap = BatchTestHelper.getMetricsMap(stepExecution.getMetrics()); + long skipCount = metricsMap.get(MetricType.PROCESS_SKIP_COUNT) + .longValue(); + assertTrue("Skip count=" + skipCount, skipCount == 1l || skipCount == 2l); + } + } + assertEquals(jobExecution.getBatchStatus(), BatchStatus.COMPLETED); + } +} From cb840c6224ddc74280447e1e55213ca0e07186e9 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sun, 25 Nov 2018 14:55:27 +0200 Subject: [PATCH 465/546] move customise oauth2 requests --- spring-5-security-oauth/pom.xml | 3 ++- .../baeldung/oauth2/CustomAuthorizationRequestResolver.java | 0 .../java/com/baeldung/oauth2/CustomRequestEntityConverter.java | 0 .../java/com/baeldung/oauth2/CustomTokenResponseConverter.java | 0 4 files changed, 2 insertions(+), 1 deletion(-) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java (100%) rename {spring-5-security => spring-5-security-oauth}/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java (100%) diff --git a/spring-5-security-oauth/pom.xml b/spring-5-security-oauth/pom.xml index f200052adf..5814f1dd43 100644 --- a/spring-5-security-oauth/pom.xml +++ b/spring-5-security-oauth/pom.xml @@ -31,7 +31,7 @@ org.thymeleaf.extras - thymeleaf-extras-springsecurity4 + thymeleaf-extras-springsecurity5 @@ -66,6 +66,7 @@ + 2.1.0.RELEASE 2.0.1.RELEASE com.baeldung.oauth2.SpringOAuthApplication diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java diff --git a/spring-5-security/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java similarity index 100% rename from spring-5-security/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java From 0b7f01463c2ce5cadee5fb43f3625f78876a0ca5 Mon Sep 17 00:00:00 2001 From: Trevor Gowing Date: Sun, 25 Nov 2018 17:09:32 +0200 Subject: [PATCH 466/546] Fix typo Passenger#fistName BAEL-2208 --- .../main/java/com/baeldung/limit/Passenger.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java index e7eb3af10b..fb5c35de91 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java @@ -17,7 +17,7 @@ class Passenger { @Basic(optional = false) @Column(nullable = false) - private String fistName; + private String firstName; @Basic(optional = false) @Column(nullable = false) @@ -27,8 +27,8 @@ class Passenger { @Column(nullable = false) private int seatNumber; - private Passenger(String fistName, String lastName, int seatNumber) { - this.fistName = fistName; + private Passenger(String firstName, String lastName, int seatNumber) { + this.firstName = firstName; this.lastName = lastName; this.seatNumber = seatNumber; } @@ -44,20 +44,20 @@ class Passenger { if (object == null || getClass() != object.getClass()) return false; Passenger passenger = (Passenger) object; - return getSeatNumber() == passenger.getSeatNumber() && Objects.equals(getFistName(), passenger.getFistName()) + return getSeatNumber() == passenger.getSeatNumber() && Objects.equals(getFirstName(), passenger.getFirstName()) && Objects.equals(getLastName(), passenger.getLastName()); } @Override public int hashCode() { - return Objects.hash(getFistName(), getLastName(), getSeatNumber()); + return Objects.hash(getFirstName(), getLastName(), getSeatNumber()); } @Override public String toString() { final StringBuilder toStringBuilder = new StringBuilder(getClass().getSimpleName()); toStringBuilder.append("{ id=").append(id); - toStringBuilder.append(", fistName='").append(fistName).append('\''); + toStringBuilder.append(", firstName='").append(firstName).append('\''); toStringBuilder.append(", lastName='").append(lastName).append('\''); toStringBuilder.append(", seatNumber=").append(seatNumber); toStringBuilder.append('}'); @@ -68,8 +68,8 @@ class Passenger { return id; } - String getFistName() { - return fistName; + String getFirstName() { + return firstName; } String getLastName() { From 0c384f13b07351b745ae15b08aeb93ea999ee55b Mon Sep 17 00:00:00 2001 From: Trevor Gowing Date: Sun, 25 Nov 2018 16:13:57 +0200 Subject: [PATCH 467/546] Rename limit package to passenger Rename LimitIntegrationTest to PassengerRepositoryIntegrationTest Going to include code on sorting so it will no longer be limit specific. BAEL-2331 --- .../{limit => passenger}/CustomPassengerRepository.java | 2 +- .../java/com/baeldung/{limit => passenger}/Passenger.java | 2 +- .../baeldung/{limit => passenger}/PassengerRepository.java | 2 +- .../{limit => passenger}/PassengerRepositoryImpl.java | 2 +- .../PassengerRepositoryIntegrationTest.java} | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) rename persistence-modules/spring-data-jpa/src/main/java/com/baeldung/{limit => passenger}/CustomPassengerRepository.java (80%) rename persistence-modules/spring-data-jpa/src/main/java/com/baeldung/{limit => passenger}/Passenger.java (98%) rename persistence-modules/spring-data-jpa/src/main/java/com/baeldung/{limit => passenger}/PassengerRepository.java (86%) rename persistence-modules/spring-data-jpa/src/main/java/com/baeldung/{limit => passenger}/PassengerRepositoryImpl.java (94%) rename persistence-modules/spring-data-jpa/src/test/java/com/baeldung/{limit/LimitIntegrationTest.java => passenger/PassengerRepositoryIntegrationTest.java} (96%) diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/CustomPassengerRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/CustomPassengerRepository.java similarity index 80% rename from persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/CustomPassengerRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/CustomPassengerRepository.java index e9b5ba272f..7ae44bfbda 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/CustomPassengerRepository.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/CustomPassengerRepository.java @@ -1,4 +1,4 @@ -package com.baeldung.limit; +package com.baeldung.passenger; import java.util.List; diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/Passenger.java similarity index 98% rename from persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/Passenger.java index fb5c35de91..24ae47e597 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/Passenger.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/Passenger.java @@ -1,4 +1,4 @@ -package com.baeldung.limit; +package com.baeldung.passenger; import javax.persistence.Basic; import javax.persistence.Column; diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java similarity index 86% rename from persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepository.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java index 6301f6e307..58c782f27a 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepository.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java @@ -1,4 +1,4 @@ -package com.baeldung.limit; +package com.baeldung.passenger; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepositoryImpl.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepositoryImpl.java similarity index 94% rename from persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepositoryImpl.java rename to persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepositoryImpl.java index 2d13eb7cad..bd6e535e3e 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/limit/PassengerRepositoryImpl.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepositoryImpl.java @@ -1,4 +1,4 @@ -package com.baeldung.limit; +package com.baeldung.passenger; import org.springframework.stereotype.Repository; diff --git a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/limit/LimitIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java similarity index 96% rename from persistence-modules/spring-data-jpa/src/test/java/com/baeldung/limit/LimitIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java index 27e0ebdd9f..19366730c5 100644 --- a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/limit/LimitIntegrationTest.java +++ b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.limit; +package com.baeldung.passenger; import org.junit.Before; import org.junit.Test; @@ -18,7 +18,7 @@ import static org.junit.Assert.assertEquals; @DataJpaTest @RunWith(SpringRunner.class) -public class LimitIntegrationTest { +public class PassengerRepositoryIntegrationTest { @PersistenceContext private EntityManager entityManager; From 322af68ae2093966427c4265440f8994d2416a6d Mon Sep 17 00:00:00 2001 From: Trevor Gowing Date: Sun, 25 Nov 2018 17:11:31 +0200 Subject: [PATCH 468/546] How to sort query results with Spring Data BAEL-2331 --- .../passenger/PassengerRepository.java | 4 +++ .../PassengerRepositoryIntegrationTest.java | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java index 58c782f27a..2e4561d91b 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java @@ -2,7 +2,11 @@ package com.baeldung.passenger; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + interface PassengerRepository extends JpaRepository, CustomPassengerRepository { Passenger findFirstByOrderBySeatNumberAsc(); + + List findByOrderBySeatNumberAsc(); } diff --git a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java index 19366730c5..5ca2d21421 100644 --- a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java +++ b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java @@ -14,6 +14,8 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import java.util.List; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.contains; import static org.junit.Assert.assertEquals; @DataJpaTest @@ -66,4 +68,30 @@ public class PassengerRepositoryIntegrationTest { Passenger actual = page.getContent().get(0); assertEquals(expected, actual); } + + @Test + public void givenSeveralPassengersWhenOrderedBySeatNumberAscThenThePassengersReturnedInCorrectOrder() { + Passenger fred = Passenger.from("Fred", "Bloggs", 22); + Passenger ricki = Passenger.from("Ricki", "Bobbie", 36); + Passenger jill = Passenger.from("Jill", "Smith", 50); + Passenger siya = Passenger.from("Siya", "Kolisi", 85); + Passenger eve = Passenger.from("Eve", "Jackson", 95); + + List passengers = repository.findByOrderBySeatNumberAsc(); + + assertThat(passengers, contains(fred, ricki, jill, siya, eve)); + } + + @Test + public void givenSeveralPassengersWhenFindAllWithSortBySeatNumberAscThenReturnPassengersInCorrectOrder() { + Passenger fred = Passenger.from("Fred", "Bloggs", 22); + Passenger ricki = Passenger.from("Ricki", "Bobbie", 36); + Passenger jill = Passenger.from("Jill", "Smith", 50); + Passenger siya = Passenger.from("Siya", "Kolisi", 85); + Passenger eve = Passenger.from("Eve", "Jackson", 95); + + List passengers = repository.findAll(Sort.by(Sort.Direction.ASC, "seatNumber")); + + assertThat(passengers, contains(fred, ricki, jill, siya, eve)); + } } From a2722368af3aaec55d19b603e3d75b52639fb9fd Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 25 Nov 2018 20:10:37 +0200 Subject: [PATCH 469/546] add data order methods --- .../java/com/baeldung/passenger/PassengerRepository.java | 5 +++++ .../passenger/PassengerRepositoryIntegrationTest.java | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java index 2e4561d91b..6ae6afb403 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/passenger/PassengerRepository.java @@ -1,5 +1,6 @@ package com.baeldung.passenger; +import org.springframework.data.domain.Sort; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; @@ -9,4 +10,8 @@ interface PassengerRepository extends JpaRepository, CustomPass Passenger findFirstByOrderBySeatNumberAsc(); List findByOrderBySeatNumberAsc(); + + List findByLastNameOrderBySeatNumberAsc(String lastName); + + List findByLastName(String lastName, Sort sort); } diff --git a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java index 5ca2d21421..c57e771345 100644 --- a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java +++ b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/passenger/PassengerRepositoryIntegrationTest.java @@ -70,7 +70,7 @@ public class PassengerRepositoryIntegrationTest { } @Test - public void givenSeveralPassengersWhenOrderedBySeatNumberAscThenThePassengersReturnedInCorrectOrder() { + public void givenPassengers_whenOrderedBySeatNumberAsc_thenCorrectOrder() { Passenger fred = Passenger.from("Fred", "Bloggs", 22); Passenger ricki = Passenger.from("Ricki", "Bobbie", 36); Passenger jill = Passenger.from("Jill", "Smith", 50); @@ -83,7 +83,7 @@ public class PassengerRepositoryIntegrationTest { } @Test - public void givenSeveralPassengersWhenFindAllWithSortBySeatNumberAscThenReturnPassengersInCorrectOrder() { + public void givenPassengers_whenFindAllWithSortBySeatNumberAsc_thenCorrectOrder() { Passenger fred = Passenger.from("Fred", "Bloggs", 22); Passenger ricki = Passenger.from("Ricki", "Bobbie", 36); Passenger jill = Passenger.from("Jill", "Smith", 50); @@ -94,4 +94,5 @@ public class PassengerRepositoryIntegrationTest { assertThat(passengers, contains(fred, ricki, jill, siya, eve)); } + } From 777b9ecc9bbefaf9c8d3bbcbeef50a1a0e6bfbf2 Mon Sep 17 00:00:00 2001 From: DOHA Date: Sun, 25 Nov 2018 22:04:02 +0200 Subject: [PATCH 470/546] minor fix --- spring-5-security-oauth/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-5-security-oauth/pom.xml b/spring-5-security-oauth/pom.xml index 5814f1dd43..59150a153f 100644 --- a/spring-5-security-oauth/pom.xml +++ b/spring-5-security-oauth/pom.xml @@ -67,7 +67,7 @@ 2.1.0.RELEASE - 2.0.1.RELEASE + 2.1.0.RELEASE com.baeldung.oauth2.SpringOAuthApplication From 29c9eb444567c40ed0dd20d1661753dfd258fbd7 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Sun, 25 Nov 2018 16:05:39 -0800 Subject: [PATCH 471/546] BAEL-2330 (#5776) update readme --- java-strings/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java-strings/README.md b/java-strings/README.md index 2847a0d0a8..222b28e8ad 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -37,3 +37,4 @@ - [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) - [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) - [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) +- [Removing Repeated Characters from a String](https://www.baeldung.com/java-remove-repeated-char) From a1de031c67871e55b54cfbbdb3988a5732709816 Mon Sep 17 00:00:00 2001 From: FrancoCorleone Date: Mon, 26 Nov 2018 04:14:20 +0100 Subject: [PATCH 472/546] Add joining primitives tests (#5740) * Add joining primitives tests * Small refactor * Fix naming for PMD * Add char examples to testing cases * Fix literal separator * CR changes --- .../StringFromPrimitiveArrayUnitTest.java | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 java-strings/src/test/java/com/baeldung/string/StringFromPrimitiveArrayUnitTest.java diff --git a/java-strings/src/test/java/com/baeldung/string/StringFromPrimitiveArrayUnitTest.java b/java-strings/src/test/java/com/baeldung/string/StringFromPrimitiveArrayUnitTest.java new file mode 100644 index 0000000000..c93089e543 --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/string/StringFromPrimitiveArrayUnitTest.java @@ -0,0 +1,129 @@ +package com.baeldung.string; + +import com.google.common.base.Joiner; +import com.google.common.primitives.Chars; +import com.google.common.primitives.Ints; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import java.nio.CharBuffer; +import java.util.Arrays; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +import static org.assertj.core.api.Assertions.assertThat; + + +public class StringFromPrimitiveArrayUnitTest { + + private int[] intArray = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + + private char[] charArray = {'a', 'b', 'c', 'd', 'e', 'f'}; + + private char separatorChar = '-'; + + private String separator = String.valueOf(separatorChar); + + private String expectedIntString = "1-2-3-4-5-6-7-8-9"; + + private String expectedCharString = "a-b-c-d-e-f"; + + @Test + public void givenIntArray_whenJoinBySeparator_thenReturnsString_through_Java8CollectorsJoining() { + assertThat(Arrays.stream(intArray) + .mapToObj(String::valueOf) + .collect(Collectors.joining(separator))) + .isEqualTo(expectedIntString); + } + + @Test + public void givenCharArray_whenJoinBySeparator_thenReturnsString_through_Java8CollectorsJoining() { + assertThat(CharBuffer.wrap(charArray).chars() + .mapToObj(intChar -> String.valueOf((char) intChar)) + .collect(Collectors.joining(separator))) + .isEqualTo(expectedCharString); + } + + + @Test + public void giveIntArray_whenJoinBySeparator_thenReturnsString_through_Java8StringJoiner() { + StringJoiner intStringJoiner = new StringJoiner(separator); + + Arrays.stream(intArray) + .mapToObj(String::valueOf) + .forEach(intStringJoiner::add); + + assertThat(intStringJoiner.toString()).isEqualTo(expectedIntString); + } + + @Test + public void givenCharArray_whenJoinBySeparator_thenReturnsString_through_Java8StringJoiner() { + StringJoiner charStringJoiner = new StringJoiner(separator); + + CharBuffer.wrap(charArray).chars() + .mapToObj(intChar -> String.valueOf((char) intChar)) + .forEach(charStringJoiner::add); + + assertThat(charStringJoiner.toString()).isEqualTo(expectedCharString); + } + + @Test + public void givenIntArray_whenJoinBySeparator_thenReturnsString_through_CommonsLang() { + assertThat(StringUtils.join(intArray, separatorChar)).isEqualTo(expectedIntString); + assertThat(StringUtils.join(ArrayUtils.toObject(intArray), separator)).isEqualTo(expectedIntString); + } + + @Test + public void givenCharArray_whenJoinBySeparator_thenReturnsString_through_CommonsLang() { + assertThat(StringUtils.join(charArray, separatorChar)).isEqualTo(expectedCharString); + assertThat(StringUtils.join(ArrayUtils.toObject(charArray), separator)).isEqualTo(expectedCharString); + } + + @Test + public void givenIntArray_whenJoinBySeparator_thenReturnsString_through_GuavaJoiner() { + assertThat(Joiner.on(separator).join(Ints.asList(intArray))).isEqualTo(expectedIntString); + } + + @Test + public void givenCharArray_whenJoinBySeparator_thenReturnsString_through_GuavaJoiner() { + assertThat(Joiner.on(separator).join(Chars.asList(charArray))).isEqualTo(expectedCharString); + } + + @Test + public void givenIntArray_whenJoinBySeparator_thenReturnsString_through_Java7StringBuilder() { + assertThat(joinIntArrayWithStringBuilder(intArray, separator)).isEqualTo(expectedIntString); + } + + @Test + public void givenCharArray_whenJoinBySeparator_thenReturnsString_through_Java7StringBuilder() { + assertThat(joinCharArrayWithStringBuilder(charArray, separator)).isEqualTo(expectedCharString); + } + + private String joinIntArrayWithStringBuilder(int[] array, String separator) { + if (array.length == 0) { + return ""; + } + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < array.length - 1; i++) { + stringBuilder.append(array[i]); + stringBuilder.append(separator); + } + stringBuilder.append(array[array.length - 1]); + return stringBuilder.toString(); + } + + private String joinCharArrayWithStringBuilder(char[] array, String separator) { + if (array.length == 0) { + return ""; + } + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < array.length - 1; i++) { + stringBuilder.append(array[i]); + stringBuilder.append(separator); + } + stringBuilder.append(array[array.length - 1]); + return stringBuilder.toString(); + } + +} From 7719b2e30a1ed724dc291919fda7dc48b3b53c08 Mon Sep 17 00:00:00 2001 From: Seun Matt Date: Mon, 26 Nov 2018 17:20:11 +0100 Subject: [PATCH 473/546] example code for BAEL-1961 (#5781) * added example code for BAEL-2366 * moved example code for BAEL-2366 * example code for BAEL-1961 * moved example code into integration test * updated the test assertions --- .../com/baeldung/mongodb/Application.java | 8 ++ .../baeldung/mongodb/daos/UserRepository.java | 10 +++ .../mongodb/events/UserModelListener.java | 28 +++++++ .../mongodb/models/DatabaseSequence.java | 32 ++++++++ .../com/baeldung/mongodb/models/User.java | 73 +++++++++++++++++++ .../services/SequenceGeneratorService.java | 35 +++++++++ ...goDbAutoGeneratedFieldIntegrationTest.java | 36 +++++++++ 7 files changed, 222 insertions(+) create mode 100755 spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java create mode 100644 spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java create mode 100755 spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java create mode 100755 spring-boot/src/main/java/com/baeldung/mongodb/models/User.java create mode 100755 spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java create mode 100644 spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/Application.java b/spring-boot/src/main/java/com/baeldung/mongodb/Application.java index 092ce3352b..c0a9ad59a7 100644 --- a/spring-boot/src/main/java/com/baeldung/mongodb/Application.java +++ b/spring-boot/src/main/java/com/baeldung/mongodb/Application.java @@ -1,11 +1,19 @@ package com.baeldung.mongodb; +import com.baeldung.mongodb.daos.UserRepository; +import com.baeldung.mongodb.models.User; +import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +import java.util.List; @SpringBootApplication public class Application { + public static void main(String[] args) { SpringApplication.run(Application.class, args); } + } diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java b/spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java new file mode 100755 index 0000000000..7f58fdd1c8 --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java @@ -0,0 +1,10 @@ +package com.baeldung.mongodb.daos; + + +import com.baeldung.mongodb.models.User; +import org.springframework.data.mongodb.repository.MongoRepository; + + +public interface UserRepository extends MongoRepository { + +} diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java b/spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java new file mode 100644 index 0000000000..24b53f3d2d --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java @@ -0,0 +1,28 @@ +package com.baeldung.mongodb.events; + + +import com.baeldung.mongodb.models.User; +import com.baeldung.mongodb.services.SequenceGeneratorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener; +import org.springframework.data.mongodb.core.mapping.event.BeforeConvertEvent; +import org.springframework.stereotype.Component; + + +@Component +public class UserModelListener extends AbstractMongoEventListener { + + private SequenceGeneratorService sequenceGenerator; + + @Autowired + public UserModelListener(SequenceGeneratorService sequenceGenerator) { + this.sequenceGenerator = sequenceGenerator; + } + + @Override + public void onBeforeConvert(BeforeConvertEvent event) { + event.getSource().setId(sequenceGenerator.generateSequence(User.SEQUENCE_NAME)); + } + + +} diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java b/spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java new file mode 100755 index 0000000000..c2c04f7ee6 --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java @@ -0,0 +1,32 @@ +package com.baeldung.mongodb.models; + +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; + + +@Document(collection = "database_sequences") +public class DatabaseSequence { + + @Id + private String id; + + private long seq; + + public DatabaseSequence() {} + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public long getSeq() { + return seq; + } + + public void setSeq(long seq) { + this.seq = seq; + } +} diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/models/User.java b/spring-boot/src/main/java/com/baeldung/mongodb/models/User.java new file mode 100755 index 0000000000..1f08074313 --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/mongodb/models/User.java @@ -0,0 +1,73 @@ +package com.baeldung.mongodb.models; + +import org.springframework.data.annotation.Id; +import org.springframework.data.annotation.Transient; +import org.springframework.data.mongodb.core.mapping.Document; + + +@Document(collection = "users") +public class User { + + @Transient + public static final String SEQUENCE_NAME = "users_sequence"; + + @Id + private long id; + + private String firstName; + + private String lastName; + + private String email; + + public User() { } + + public User(String firstName, String lastName, String email) { + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", firstName='" + firstName + '\'' + + ", lastName='" + lastName + '\'' + + ", email='" + email + '\'' + + '}'; + } +} diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java b/spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java new file mode 100755 index 0000000000..52ece27d63 --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java @@ -0,0 +1,35 @@ +package com.baeldung.mongodb.services; + +import com.baeldung.mongodb.models.DatabaseSequence; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.mongodb.core.MongoOperations; +import org.springframework.data.mongodb.core.query.Update; +import org.springframework.stereotype.Service; + +import java.util.Objects; + +import static org.springframework.data.mongodb.core.FindAndModifyOptions.options; +import static org.springframework.data.mongodb.core.query.Criteria.where; +import static org.springframework.data.mongodb.core.query.Query.query; + + +@Service +public class SequenceGeneratorService { + + + private MongoOperations mongoOperations; + + @Autowired + public SequenceGeneratorService(MongoOperations mongoOperations) { + this.mongoOperations = mongoOperations; + } + + public long generateSequence(String seqName) { + + DatabaseSequence counter = mongoOperations.findAndModify(query(where("_id").is(seqName)), + new Update().inc("seq",1), options().returnNew(true).upsert(true), + DatabaseSequence.class); + return !Objects.isNull(counter) ? counter.getSeq() : 1; + + } +} diff --git a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java new file mode 100644 index 0000000000..3430bca69a --- /dev/null +++ b/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java @@ -0,0 +1,36 @@ +package com.baeldung.mongodb; + +import com.baeldung.mongodb.daos.UserRepository; +import com.baeldung.mongodb.models.User; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.junit4.SpringRunner; +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; + + +@RunWith(SpringRunner.class) +public class MongoDbAutoGeneratedFieldIntegrationTest { + + @Autowired + private UserRepository userRepository; + + @Test + public void contextLoads() {} + + @Test + public void givenUserObject_whenSave_thenCreateNewUser() { + + User user = new User(); + user.setFirstName("John"); + user.setLastName("Doe"); + user.setEmail("john.doe@example.com"); + userRepository.save(user); + + assertThat(userRepository.findAll().size()).isGreaterThan(0); + } + + +} From 5ba5b605360e1de095fe29d3bd3b7f32fd382761 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 27 Nov 2018 02:08:42 +0100 Subject: [PATCH 474/546] BAEL-2368 convert array to string and back (#5689) * BAEL-2368 convert string array to string * BAEL-2368 Convert array to string code * BAEL-2368 Change package * Fix for test --- .../ArrayToStringUnitTest.java | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 java-collections-conversions/src/test/java/org/baeldung/convertarraytostring/ArrayToStringUnitTest.java diff --git a/java-collections-conversions/src/test/java/org/baeldung/convertarraytostring/ArrayToStringUnitTest.java b/java-collections-conversions/src/test/java/org/baeldung/convertarraytostring/ArrayToStringUnitTest.java new file mode 100644 index 0000000000..b563475997 --- /dev/null +++ b/java-collections-conversions/src/test/java/org/baeldung/convertarraytostring/ArrayToStringUnitTest.java @@ -0,0 +1,136 @@ +package org.baeldung.convertarraytostring; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; + +public class ArrayToStringUnitTest { + + // convert with Java + + @Test + public void givenAStringArray_whenConvertBeforeJava8_thenReturnString() { + + String[] strArray = { "Convert", "Array", "With", "Java" }; + StringBuilder stringBuilder = new StringBuilder(); + + for (int i = 0; i < strArray.length; i++) { + stringBuilder.append(strArray[i]); + } + String joinedString = stringBuilder.toString(); + + assertThat(joinedString, instanceOf(String.class)); + assertEquals("ConvertArrayWithJava", joinedString); + } + + @Test + public void givenAString_whenConvertBeforeJava8_thenReturnStringArray() { + + String input = "lorem ipsum dolor sit amet"; + String[] strArray = input.split(" "); + + assertThat(strArray, instanceOf(String[].class)); + assertEquals(5, strArray.length); + + input = "loremipsum"; + strArray = input.split(""); + assertThat(strArray, instanceOf(String[].class)); + assertEquals(10, strArray.length); + } + + @Test + public void givenAnIntArray_whenConvertBeforeJava8_thenReturnString() { + + int[] strArray = { 1, 2, 3, 4, 5 }; + StringBuilder stringBuilder = new StringBuilder(); + + for (int i = 0; i < strArray.length; i++) { + stringBuilder.append(Integer.valueOf(strArray[i])); + } + String joinedString = stringBuilder.toString(); + + assertThat(joinedString, instanceOf(String.class)); + assertEquals("12345", joinedString); + } + + // convert with Java Stream API + + @Test + public void givenAStringArray_whenConvertWithJavaStream_thenReturnString() { + + String[] strArray = { "Convert", "With", "Java", "Streams" }; + String joinedString = Arrays.stream(strArray) + .collect(Collectors.joining()); + assertThat(joinedString, instanceOf(String.class)); + assertEquals("ConvertWithJavaStreams", joinedString); + + joinedString = Arrays.stream(strArray) + .collect(Collectors.joining(",")); + assertThat(joinedString, instanceOf(String.class)); + assertEquals("Convert,With,Java,Streams", joinedString); + } + + + // convert with Apache Commons + + @Test + public void givenAStringArray_whenConvertWithApacheCommons_thenReturnString() { + + String[] strArray = { "Convert", "With", "Apache", "Commons" }; + String joinedString = StringUtils.join(strArray); + + assertThat(joinedString, instanceOf(String.class)); + assertEquals("ConvertWithApacheCommons", joinedString); + } + + @Test + public void givenAString_whenConvertWithApacheCommons_thenReturnStringArray() { + + String input = "lorem ipsum dolor sit amet"; + String[] strArray = StringUtils.split(input, " "); + + assertThat(strArray, instanceOf(String[].class)); + assertEquals(5, strArray.length); + } + + + // convert with Guava + + @Test + public void givenAStringArray_whenConvertWithGuava_thenReturnString() { + + String[] strArray = { "Convert", "With", "Guava", null }; + String joinedString = Joiner.on("") + .skipNulls() + .join(strArray); + + assertThat(joinedString, instanceOf(String.class)); + assertEquals("ConvertWithGuava", joinedString); + } + + + @Test + public void givenAString_whenConvertWithGuava_thenReturnStringArray() { + + String input = "lorem ipsum dolor sit amet"; + + List resultList = Splitter.on(' ') + .trimResults() + .omitEmptyStrings() + .splitToList(input); + String[] strArray = resultList.toArray(new String[0]); + + assertThat(strArray, instanceOf(String[].class)); + assertEquals(5, strArray.length); + } +} From 71bca76bf827294905ea98cb6dab1bde1abc029a Mon Sep 17 00:00:00 2001 From: enpy Date: Tue, 27 Nov 2018 16:21:45 +0100 Subject: [PATCH 475/546] BAEL-2809 Get all Data in a table with Hibernate (#5670) * BAEL-2809 Get all Data in a table with Hibernate * Delete transaction.log * Update FindAll.java * Update FindAllTest.java * Update FindAll.java * Update FindAllTest.java * Rename FindAllTest.java to FindAllUnitTest.java --- .../baeldung/hibernate/findall/FindAll.java | 35 +++++++++++ .../hibernate/findall/FindAllUnitTest.java | 63 +++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/findall/FindAll.java create mode 100644 persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/findall/FindAllUnitTest.java diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/findall/FindAll.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/findall/FindAll.java new file mode 100644 index 0000000000..cc0c234df0 --- /dev/null +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/findall/FindAll.java @@ -0,0 +1,35 @@ +package com.baeldung.hibernate.findall; + +import java.util.List; + +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Root; + +import org.hibernate.Session; + +import com.baeldung.hibernate.pojo.Student; + +public class FindAll { + + private Session session; + + public FindAll(Session session) { + super(); + this.session = session; + } + + public List findAllWithJpql() { + return session.createQuery("SELECT a FROM Student a", Student.class).getResultList(); + } + + public List findAllWithCriteriaQuery() { + CriteriaBuilder cb = session.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Student.class); + Root rootEntry = cq.from(Student.class); + CriteriaQuery all = cq.select(rootEntry); + TypedQuery allQuery = session.createQuery(all); + return allQuery.getResultList(); + } +} diff --git a/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/findall/FindAllUnitTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/findall/FindAllUnitTest.java new file mode 100644 index 0000000000..8a1b9e9791 --- /dev/null +++ b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/findall/FindAllUnitTest.java @@ -0,0 +1,63 @@ +package com.baeldung.hibernate.findall; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.List; + +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.hibernate.HibernateUtil; +import com.baeldung.hibernate.pojo.Student; + +public class FindAllUnitTest { + + private Session session; + private Transaction transaction; + + private FindAll findAll; + + @Before + public void setUp() throws IOException { + + session = HibernateUtil.getSessionFactory().openSession(); + transaction = session.beginTransaction(); + findAll = new FindAll(session); + + session.createNativeQuery("delete from Student").executeUpdate(); + + Student student1 = new Student(); + session.persist(student1); + + Student student2 = new Student(); + session.persist(student2); + + Student student3 = new Student(); + session.persist(student3); + + transaction.commit(); + transaction = session.beginTransaction(); + } + + @After + public void tearDown() { + transaction.rollback(); + session.close(); + } + + @Test + public void givenCriteriaQuery_WhenFindAll_ThenGetAllPersons() { + List list = findAll.findAllWithCriteriaQuery(); + assertEquals(3, list.size()); + } + + @Test + public void givenJpql_WhenFindAll_ThenGetAllPersons() { + List list = findAll.findAllWithJpql(); + assertEquals(3, list.size()); + } +} From 7410f52561a0949751cc27e60a5902fc8d0f65d5 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Wed, 28 Nov 2018 01:00:16 +0530 Subject: [PATCH 476/546] Changed the source files for incorporating review comments on the tutorial. --- .../main/java/com/baeldung/graph/Graph.java | 116 ++++++------------ .../graph/GraphTraversalUnitTest.java | 30 ++--- 2 files changed, 55 insertions(+), 91 deletions(-) diff --git a/core-java/src/main/java/com/baeldung/graph/Graph.java b/core-java/src/main/java/com/baeldung/graph/Graph.java index 7095f64709..43b5c0aa08 100644 --- a/core-java/src/main/java/com/baeldung/graph/Graph.java +++ b/core-java/src/main/java/com/baeldung/graph/Graph.java @@ -1,67 +1,57 @@ package com.baeldung.graph; +import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Set; import java.util.stream.Collectors; public class Graph { - private Set vertices; - private Set edges; - private Map> adjVertices; + private Map> adjVertices; Graph() { - this.vertices = new HashSet(); - this.edges = new HashSet(); - this.adjVertices = new HashMap>(); + this.adjVertices = new HashMap>(); } - boolean addVertex(String label) { - return vertices.add(new Vertex(label)); + void addVertex(String label) { + adjVertices.putIfAbsent(new Vertex(label), new ArrayList<>()); } - boolean removeVertex(String label) { - return vertices.remove(new Vertex(label)); - } - - boolean addEdge(String label1, String label2) { - Vertex v1 = new Vertex(label1); - Vertex v2 = new Vertex(label2); - Edge e = new Edge(v1, v2); - if (this.edges.add(e)) { - adjVertices.putIfAbsent(v1, new HashSet<>()); - adjVertices.putIfAbsent(v2, new HashSet<>()); - adjVertices.get(v1) - .add(e); - adjVertices.get(v2) - .add(e); - } - return true; - } - - boolean removeEdge(String label1, String label2) { - Vertex v1 = new Vertex(label1); - Vertex v2 = new Vertex(label2); - Edge e = new Edge(v1, v2); - if (this.edges.remove(e)) { - Set eV1 = adjVertices.get(v1); - Set eV2 = adjVertices.get(v2); - - if (eV1 != null) - eV1.remove(e); - if (eV2 != null) - eV2.remove(e); - } - return true; - } - - Set getAdjVertices(String label) { + void removeVertex(String label) { Vertex v = new Vertex(label); - return adjVertices.get(v) - .stream() - .map(e -> e.v1.equals(v) ? e.v2 : e.v1) - .collect(Collectors.toSet()); + adjVertices.values().stream().map(e -> e.remove(v)).collect(Collectors.toList()); + adjVertices.remove(new Vertex(label)); + } + + void addEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + adjVertices.get(v1).add(v2); + adjVertices.get(v2).add(v1); + } + + void removeEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + List eV1 = adjVertices.get(v1); + List eV2 = adjVertices.get(v2); + if (eV1 != null) + eV1.remove(v2); + if (eV2 != null) + eV2.remove(v1); + } + + List getAdjVertices(String label) { + return adjVertices.get(new Vertex(label)); + } + + String printGraph() { + StringBuffer sb = new StringBuffer(); + for(Vertex v : adjVertices.keySet()) { + sb.append(v); + sb.append(adjVertices.get(v)); + } + return sb.toString(); } class Vertex { @@ -83,30 +73,4 @@ public class Graph { return label; } } - - class Edge { - Vertex v1; - Vertex v2; - Edge(String label1, String label2) { - this.v1 = new Vertex(label1); - this.v2 = new Vertex(label2); - } - Edge(Vertex vertex1, Vertex vertex2) { - this.v1 = vertex1; - this.v2 = vertex2; - } - @Override - public boolean equals(Object obj) { - Edge edge = (Edge) obj; - return edge.v1.equals(v1) && edge.v2.equals(v2); - } - @Override - public int hashCode() { - return v1.hashCode() + v2.hashCode(); - } - @Override - public String toString() { - return v1.label + "-" + v2.label; - } - } } \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java index 84611a580a..d955d56d95 100644 --- a/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java +++ b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java @@ -7,30 +7,30 @@ public class GraphTraversalUnitTest { @Test public void givenAGraph_whenTraversingDepthFirst_thenExpectedResult() { Graph graph = createGraph(); - Assert.assertEquals("[A, D, E, B, C]", - GraphTraversal.depthFirstTraversal(graph, "A").toString()); + Assert.assertEquals("[Bob, Rob, Maria, Alice, Mark]", + GraphTraversal.depthFirstTraversal(graph, "Bob").toString()); } @Test public void givenAGraph_whenTraversingBreadthFirst_thenExpectedResult() { Graph graph = createGraph(); - Assert.assertEquals("[A, B, D, C, E]", - GraphTraversal.breadthFirstTraversal(graph, "A").toString()); + Assert.assertEquals("[Bob, Alice, Rob, Mark, Maria]", + GraphTraversal.breadthFirstTraversal(graph, "Bob").toString()); } Graph createGraph() { Graph graph = new Graph(); - graph.addVertex("A"); - graph.addVertex("B"); - graph.addVertex("C"); - graph.addVertex("D"); - graph.addVertex("E"); - graph.addEdge("A", "B"); - graph.addEdge("A", "D"); - graph.addEdge("B", "C"); - graph.addEdge("D", "C"); - graph.addEdge("B", "E"); - graph.addEdge("D", "E"); + graph.addVertex("Bob"); + graph.addVertex("Alice"); + graph.addVertex("Mark"); + graph.addVertex("Rob"); + graph.addVertex("Maria"); + graph.addEdge("Bob", "Alice"); + graph.addEdge("Bob", "Rob"); + graph.addEdge("Alice", "Mark"); + graph.addEdge("Rob", "Mark"); + graph.addEdge("Alice", "Maria"); + graph.addEdge("Rob", "Maria"); return graph; } } \ No newline at end of file From 3d2f6eff678ba244de9a9b1150e7c82307614fa4 Mon Sep 17 00:00:00 2001 From: Ger Roza Date: Tue, 27 Nov 2018 17:32:34 -0200 Subject: [PATCH 477/546] [BAEL-2278] spring-5-reactive | debugging reactive streams (#5789) * First approach for the scenario, not stable yet. * Added 2 services for teh article Consumer is the main example project, with all the debugging functionality * * cleaned unused spring-5-data functionality * cleaning unused spring-5-data pom * *fixed indentation error * addressed Jira comments: * Created live test, and renamed unit test as integrtion test * Tried to fix issue in CI, couldnt reproduce locally --- .../consumer/ConsumerSSEApplication.java | 33 +++++ .../consumer/chronjobs/ChronJobs.java | 122 ++++++++++++++++++ .../ReactiveConfigsToggleRestController.java | 23 ++++ .../debugging/consumer/model/Foo.java | 26 ++++ .../debugging/consumer/model/FooDto.java | 12 ++ .../consumer/service/FooNameHelper.java | 45 +++++++ .../consumer/service/FooQuantityHelper.java | 31 +++++ .../consumer/service/FooReporter.java | 26 ++++ .../consumer/service/FooService.java | 91 +++++++++++++ .../server/ServerSSEApplication.java | 29 +++++ .../server/handlers/ServerHandler.java | 47 +++++++ .../baeldung/debugging/server/model/Foo.java | 16 +++ .../server/routers/ServerRouter.java | 22 ++++ .../src/main/resources/application.properties | 3 +- .../ConsumerFooServiceIntegrationTest.java | 65 ++++++++++ .../consumer/ConsumerFooServiceLiveTest.java | 49 +++++++ .../consumer/utils/ListAppender.java | 25 ++++ .../src/test/resources/logback-test.xml | 16 +++ 18 files changed, 679 insertions(+), 2 deletions(-) create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/ConsumerSSEApplication.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/controllers/ReactiveConfigsToggleRestController.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooNameHelper.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooQuantityHelper.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooReporter.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/server/ServerSSEApplication.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/server/handlers/ServerHandler.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/server/model/Foo.java create mode 100644 spring-5-reactive/src/main/java/com/baeldung/debugging/server/routers/ServerRouter.java create mode 100644 spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceIntegrationTest.java create mode 100644 spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceLiveTest.java create mode 100644 spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/utils/ListAppender.java create mode 100644 spring-5-reactive/src/test/resources/logback-test.xml diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/ConsumerSSEApplication.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/ConsumerSSEApplication.java new file mode 100644 index 0000000000..55db3d7392 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/ConsumerSSEApplication.java @@ -0,0 +1,33 @@ +package com.baeldung.debugging.consumer; + +import java.util.Collections; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.web.server.SecurityWebFilterChain; + +import reactor.core.publisher.Hooks; + +@SpringBootApplication(exclude = MongoReactiveAutoConfiguration.class) +@EnableScheduling +public class ConsumerSSEApplication { + + public static void main(String[] args) { + Hooks.onOperatorDebug(); + SpringApplication app = new SpringApplication(ConsumerSSEApplication.class); + app.setDefaultProperties(Collections.singletonMap("server.port", "8082")); + app.run(args); + } + + @Bean + public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { + http.authorizeExchange() + .anyExchange() + .permitAll(); + return http.build(); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java new file mode 100644 index 0000000000..09cbc34a6f --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java @@ -0,0 +1,122 @@ +package com.baeldung.debugging.consumer.chronjobs; + +import java.time.Duration; +import java.util.concurrent.ThreadLocalRandom; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.client.WebClient; + +import com.baeldung.debugging.consumer.model.Foo; +import com.baeldung.debugging.consumer.model.FooDto; +import com.baeldung.debugging.consumer.service.FooService; + +import reactor.core.publisher.Flux; + +@Component +public class ChronJobs { + + private static Logger logger = LoggerFactory.getLogger(ChronJobs.class); + private WebClient client = WebClient.create("http://localhost:8081"); + + @Autowired + private FooService service; + + @Scheduled(fixedRate = 10000) + public void consumeInfiniteFlux() { + Flux fluxFoo = client.get() + .uri("/functional-reactive/periodic-foo") + .accept(MediaType.TEXT_EVENT_STREAM) + .retrieve() + .bodyToFlux(FooDto.class) + .delayElements(Duration.ofMillis(100)) + .map(dto -> { + logger.debug("process 1 with dto id {} name{}", dto.getId(), dto.getName()); + return new Foo(dto); + }); + Integer random = ThreadLocalRandom.current() + .nextInt(0, 3); + switch (random) { + case 0: + logger.info("process 1 with approach 1"); + service.processFoo(fluxFoo); + break; + case 1: + logger.info("process 1 with approach 1 EH"); + service.processUsingApproachOneWithErrorHandling(fluxFoo); + break; + default: + logger.info("process 1 with approach 2"); + service.processFooInAnotherScenario(fluxFoo); + break; + + } + } + + @Scheduled(fixedRate = 20000) + public void consumeFiniteFlux2() { + Flux fluxFoo = client.get() + .uri("/functional-reactive/periodic-foo-2") + .accept(MediaType.TEXT_EVENT_STREAM) + .retrieve() + .bodyToFlux(FooDto.class) + .delayElements(Duration.ofMillis(100)) + .map(dto -> { + logger.debug("process 2 with dto id {} name{}", dto.getId(), dto.getName()); + return new Foo(dto); + }); + Integer random = ThreadLocalRandom.current() + .nextInt(0, 3); + switch (random) { + case 0: + logger.info("process 2 with approach 1"); + service.processFoo(fluxFoo); + break; + case 1: + logger.info("process 2 with approach 1 EH"); + service.processUsingApproachOneWithErrorHandling(fluxFoo); + break; + default: + logger.info("process 2 with approach 2"); + service.processFooInAnotherScenario(fluxFoo); + break; + + } + } + + @Scheduled(fixedRate = 20000) + public void consumeFiniteFlux3() { + Flux fluxFoo = client.get() + .uri("/functional-reactive/periodic-foo-2") + .accept(MediaType.TEXT_EVENT_STREAM) + .retrieve() + .bodyToFlux(FooDto.class) + .delayElements(Duration.ofMillis(100)) + .map(dto -> { + logger.debug("process 3 with dto id {} name{}", dto.getId(), dto.getName()); + return new Foo(dto); + }); + logger.info("process 3 with approach 3"); + service.processUsingApproachThree(fluxFoo); + } + + @Scheduled(fixedRate = 20000) + public void consumeFiniteFluxWithCheckpoint4() { + Flux fluxFoo = client.get() + .uri("/functional-reactive/periodic-foo-2") + .accept(MediaType.TEXT_EVENT_STREAM) + .retrieve() + .bodyToFlux(FooDto.class) + .delayElements(Duration.ofMillis(100)) + .map(dto -> { + logger.debug("process 4 with dto id {} name{}", dto.getId(), dto.getName()); + return new Foo(dto); + }); + logger.info("process 4 with approach 4"); + service.processUsingApproachFourWithCheckpoint(fluxFoo); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/controllers/ReactiveConfigsToggleRestController.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/controllers/ReactiveConfigsToggleRestController.java new file mode 100644 index 0000000000..3dcdc6c7c0 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/controllers/ReactiveConfigsToggleRestController.java @@ -0,0 +1,23 @@ +package com.baeldung.debugging.consumer.controllers; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import reactor.core.publisher.Hooks; + +@RestController +public class ReactiveConfigsToggleRestController { + + @GetMapping("/debug-hook-on") + public String setReactiveDebugOn() { + Hooks.onOperatorDebug(); + return "DEBUG HOOK ON"; + } + + @GetMapping("/debug-hook-off") + public String setReactiveDebugOff() { + Hooks.resetOnOperatorDebug(); + return "DEBUG HOOK OFF"; + } + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java new file mode 100644 index 0000000000..e101457b84 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java @@ -0,0 +1,26 @@ +package com.baeldung.debugging.consumer.model; + +import java.util.concurrent.ThreadLocalRandom; + +import org.springframework.data.annotation.Id; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Foo { + + @Id + private Integer id; + private String formattedName; + private Integer quantity; + + public Foo(FooDto dto) { + this.id = (ThreadLocalRandom.current() + .nextInt(0, 100) == 0) ? null : dto.getId(); + this.formattedName = dto.getName(); + this.quantity = ThreadLocalRandom.current() + .nextInt(0, 10); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java new file mode 100644 index 0000000000..50508fd216 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java @@ -0,0 +1,12 @@ +package com.baeldung.debugging.consumer.model; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class FooDto { + + private Integer id; + private String name; +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooNameHelper.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooNameHelper.java new file mode 100644 index 0000000000..772b360437 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooNameHelper.java @@ -0,0 +1,45 @@ +package com.baeldung.debugging.consumer.service; + +import java.util.concurrent.ThreadLocalRandom; + +import com.baeldung.debugging.consumer.model.Foo; + +import reactor.core.publisher.Flux; + +public class FooNameHelper { + + public static Flux concatAndSubstringFooName(Flux flux) { + flux = concatFooName(flux); + flux = substringFooName(flux); + return flux; + } + + public static Flux concatFooName(Flux flux) { + flux = flux.map(foo -> { + String processedName = null; + Integer random = ThreadLocalRandom.current() + .nextInt(0, 80); + processedName = (random != 0) ? foo.getFormattedName() : foo.getFormattedName() + "-bael"; + foo.setFormattedName(processedName); + return foo; + }); + return flux; + } + + public static Flux substringFooName(Flux flux) { + return flux.map(foo -> { + String processedName; + Integer random = ThreadLocalRandom.current() + .nextInt(0, 100); + + processedName = (random == 0) ? foo.getFormattedName() + .substring(10, 15) + : foo.getFormattedName() + .substring(0, 5); + + foo.setFormattedName(processedName); + return foo; + }); + } + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooQuantityHelper.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooQuantityHelper.java new file mode 100644 index 0000000000..615239313d --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooQuantityHelper.java @@ -0,0 +1,31 @@ +package com.baeldung.debugging.consumer.service; + +import java.util.concurrent.ThreadLocalRandom; + +import com.baeldung.debugging.consumer.model.Foo; + +import reactor.core.publisher.Flux; + +public class FooQuantityHelper { + + public static Flux processFooReducingQuantity(Flux flux) { + flux = flux.map(foo -> { + Integer result; + Integer random = ThreadLocalRandom.current() + .nextInt(0, 90); + result = (random == 0) ? result = 0 : foo.getQuantity() + 2; + foo.setQuantity(result); + return foo; + }); + return divideFooQuantity(flux); + } + + public static Flux divideFooQuantity(Flux flux) { + return flux.map(foo -> { + Integer result = Math.round(5 / foo.getQuantity()); + foo.setQuantity(result); + return foo; + }); + } + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooReporter.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooReporter.java new file mode 100644 index 0000000000..f53cd238e0 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooReporter.java @@ -0,0 +1,26 @@ +package com.baeldung.debugging.consumer.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.baeldung.debugging.consumer.model.Foo; + +import reactor.core.publisher.Flux; + +public class FooReporter { + + private static Logger logger = LoggerFactory.getLogger(FooReporter.class); + + public static Flux reportResult(Flux input, String approach) { + return input.map(foo -> { + if (foo.getId() == null) + throw new IllegalArgumentException("Null id is not valid!"); + logger.info("Reporting for approach {}: Foo with id '{}' name '{}' and quantity '{}'", approach, foo.getId(), foo.getFormattedName(), foo.getQuantity()); + return foo; + }); + } + + public static Flux reportResult(Flux input) { + return reportResult(input, "default"); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java new file mode 100644 index 0000000000..937e445ef5 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java @@ -0,0 +1,91 @@ +package com.baeldung.debugging.consumer.service; + +import static com.baeldung.debugging.consumer.service.FooNameHelper.concatAndSubstringFooName; +import static com.baeldung.debugging.consumer.service.FooNameHelper.substringFooName; +import static com.baeldung.debugging.consumer.service.FooQuantityHelper.divideFooQuantity; +import static com.baeldung.debugging.consumer.service.FooQuantityHelper.processFooReducingQuantity; +import static com.baeldung.debugging.consumer.service.FooReporter.reportResult; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import com.baeldung.debugging.consumer.model.Foo; + +import reactor.core.publisher.Flux; + +@Component +public class FooService { + + private static Logger logger = LoggerFactory.getLogger(FooService.class); + + public void processFoo(Flux flux) { + flux = FooNameHelper.concatFooName(flux); + flux = FooNameHelper.substringFooName(flux); + flux = flux.log(); + flux = FooReporter.reportResult(flux); + flux = flux.doOnError(error -> { + logger.error("The following error happened on processFoo method!", error); + }); + flux.subscribe(); + } + + public void processFooInAnotherScenario(Flux flux) { + flux = FooNameHelper.substringFooName(flux); + flux = FooQuantityHelper.divideFooQuantity(flux); + flux.subscribe(); + } + + public void processUsingApproachOneWithErrorHandling(Flux flux) { + logger.info("starting approach one w error handling!"); + flux = concatAndSubstringFooName(flux); + flux = concatAndSubstringFooName(flux); + flux = substringFooName(flux); + flux = processFooReducingQuantity(flux); + flux = processFooReducingQuantity(flux); + flux = processFooReducingQuantity(flux); + flux = reportResult(flux, "ONE w/ EH"); + flux = flux.doOnError(error -> { + logger.error("Approach 1 with Error Handling failed!", error); + }); + flux.subscribe(); + } + + public void processUsingApproachThree(Flux flux) { + logger.info("starting approach three!"); + flux = concatAndSubstringFooName(flux); + flux = reportResult(flux, "THREE"); + flux = flux.doOnError(error -> { + logger.error("Approach 3 failed!", error); + }); + flux.subscribe(); + } + + public void processUsingApproachFourWithCheckpoint(Flux flux) { + logger.info("starting approach four!"); + flux = concatAndSubstringFooName(flux); + flux = flux.checkpoint("CHECKPOINT 1"); + flux = concatAndSubstringFooName(flux); + flux = divideFooQuantity(flux); + flux = flux.checkpoint("CHECKPOINT 2", true); + flux = reportResult(flux, "FOUR"); + flux = concatAndSubstringFooName(flux).doOnError(error -> { + logger.error("Approach 4 failed!", error); + }); + flux.subscribe(); + } + + public void processUsingApproachFourWithInitialCheckpoint(Flux flux) { + logger.info("starting approach four!"); + flux = concatAndSubstringFooName(flux); + flux = flux.checkpoint("CHECKPOINT 1", true); + flux = concatAndSubstringFooName(flux); + flux = divideFooQuantity(flux); + flux = reportResult(flux, "FOUR"); + flux = flux.doOnError(error -> { + logger.error("Approach 4-2 failed!", error); + }); + flux.subscribe(); + } + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/server/ServerSSEApplication.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/ServerSSEApplication.java new file mode 100644 index 0000000000..6b24ee39f0 --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/ServerSSEApplication.java @@ -0,0 +1,29 @@ +package com.baeldung.debugging.server; + +import java.util.Collections; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.web.server.SecurityWebFilterChain; +import org.springframework.web.reactive.config.EnableWebFlux; + +@EnableWebFlux +@SpringBootApplication +public class ServerSSEApplication { + + public static void main(String[] args) { + SpringApplication app = new SpringApplication(ServerSSEApplication.class); + app.setDefaultProperties(Collections.singletonMap("server.port", "8081")); + app.run(args); + } + + @Bean + public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { + http.authorizeExchange() + .anyExchange() + .permitAll(); + return http.build(); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/server/handlers/ServerHandler.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/handlers/ServerHandler.java new file mode 100644 index 0000000000..759cd9b01d --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/handlers/ServerHandler.java @@ -0,0 +1,47 @@ +package com.baeldung.debugging.server.handlers; + +import java.time.Duration; +import java.util.concurrent.ThreadLocalRandom; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import com.baeldung.debugging.server.model.Foo; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +@Component +public class ServerHandler { + + private static Logger logger = LoggerFactory.getLogger(ServerHandler.class); + + public Mono useHandler(final ServerRequest request) { + // there are chances that something goes wrong here... + return ServerResponse.ok() + .contentType(MediaType.TEXT_EVENT_STREAM) + .body(Flux.interval(Duration.ofSeconds(1)) + .map(sequence -> { + logger.info("retrieving Foo. Sequence: {}", sequence); + if (ThreadLocalRandom.current() + .nextInt(0, 50) == 1) { + throw new RuntimeException("There was an error retrieving the Foo!"); + } + return new Foo(sequence, "name" + sequence); + + }), Foo.class); + } + + public Mono useHandlerFinite(final ServerRequest request) { + return ServerResponse.ok() + .contentType(MediaType.TEXT_EVENT_STREAM) + .body(Flux.range(0, 50) + .map(sequence -> { + return new Foo(new Long(sequence), "theFooNameNumber" + sequence); + }), Foo.class); + } +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/server/model/Foo.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/model/Foo.java new file mode 100644 index 0000000000..a60e468e7f --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/model/Foo.java @@ -0,0 +1,16 @@ +package com.baeldung.debugging.server.model; + +import org.springframework.data.annotation.Id; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Foo { + + @Id + private Long id; + private String name; + +} diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/server/routers/ServerRouter.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/routers/ServerRouter.java new file mode 100644 index 0000000000..6378b2213d --- /dev/null +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/server/routers/ServerRouter.java @@ -0,0 +1,22 @@ +package com.baeldung.debugging.server.routers; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import com.baeldung.debugging.server.handlers.ServerHandler; + +@Configuration +public class ServerRouter { + + @Bean + public RouterFunction responseRoute(@Autowired ServerHandler handler) { + return RouterFunctions.route(RequestPredicates.GET("/functional-reactive/periodic-foo"), handler::useHandler) + .andRoute(RequestPredicates.GET("/functional-reactive/periodic-foo-2"), handler::useHandlerFinite); + } + +} diff --git a/spring-5-reactive/src/main/resources/application.properties b/spring-5-reactive/src/main/resources/application.properties index 92f3116f84..4b49e8e8a2 100644 --- a/spring-5-reactive/src/main/resources/application.properties +++ b/spring-5-reactive/src/main/resources/application.properties @@ -1,2 +1 @@ -logging.level.root=INFO - +logging.level.root=INFO \ No newline at end of file diff --git a/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceIntegrationTest.java b/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceIntegrationTest.java new file mode 100644 index 0000000000..b7ed031ec7 --- /dev/null +++ b/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceIntegrationTest.java @@ -0,0 +1,65 @@ +package com.baeldung.debugging.consumer; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.baeldung.debugging.consumer.model.Foo; +import com.baeldung.debugging.consumer.service.FooService; +import com.baeldung.debugging.consumer.utils.ListAppender; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.IThrowableProxy; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Hooks; + +public class ConsumerFooServiceIntegrationTest { + + FooService service = new FooService(); + + @BeforeEach + public void clearLogList() { + Hooks.onOperatorDebug(); + ListAppender.clearEventList(); + } + + @Test + public void givenFooWithNullId_whenProcessFoo_thenLogsWithDebugTrace() { + Foo one = new Foo(1, "nameverylong", 8); + Foo two = new Foo(null, "nameverylong", 4); + Flux flux = Flux.just(one, two); + + service.processFoo(flux); + + Collection allLoggedEntries = ListAppender.getEvents() + .stream() + .map(ILoggingEvent::getFormattedMessage) + .collect(Collectors.toList()); + + Collection allSuppressedEntries = ListAppender.getEvents() + .stream() + .map(ILoggingEvent::getThrowableProxy) + .flatMap(t -> { + return Optional.ofNullable(t) + .map(IThrowableProxy::getSuppressed) + .map(Arrays::stream) + .orElse(Stream.empty()); + }) + .map(IThrowableProxy::getMessage) + .collect(Collectors.toList()); + assertThat(allLoggedEntries).anyMatch(entry -> entry.contains("The following error happened on processFoo method!")) + .anyMatch(entry -> entry.contains("| onSubscribe")) + .anyMatch(entry -> entry.contains("| cancel()")); + + assertThat(allSuppressedEntries).anyMatch(entry -> entry.contains("Assembly trace from producer")) + .anyMatch(entry -> entry.contains("Error has been observed by the following operator(s)")); + } + +} diff --git a/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceLiveTest.java b/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceLiveTest.java new file mode 100644 index 0000000000..af9bdfbc9b --- /dev/null +++ b/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/ConsumerFooServiceLiveTest.java @@ -0,0 +1,49 @@ +package com.baeldung.debugging.consumer; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springframework.test.web.reactive.server.WebTestClient; +import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec; + +import com.baeldung.debugging.consumer.service.FooService; + +public class ConsumerFooServiceLiveTest { + + FooService service = new FooService(); + + private static final String BASE_URL = "http://localhost:8082"; + private static final String DEBUG_HOOK_ON = BASE_URL + "/debug-hook-on"; + private static final String DEBUG_HOOK_OFF = BASE_URL + "/debug-hook-off"; + + private static WebTestClient client; + + @BeforeAll + public static void setup() { + client = WebTestClient.bindToServer() + .baseUrl(BASE_URL) + .build(); + } + + @Test + public void whenRequestingDebugHookOn_thenObtainExpectedMessage() { + ResponseSpec response = client.get() + .uri(DEBUG_HOOK_ON) + .exchange(); + response.expectStatus() + .isOk() + .expectBody(String.class) + .isEqualTo("DEBUG HOOK ON"); + } + + @Test + public void whenRequestingDebugHookOff_thenObtainExpectedMessage() { + ResponseSpec response = client.get() + .uri(DEBUG_HOOK_OFF) + .exchange(); + response.expectStatus() + .isOk() + .expectBody(String.class) + .isEqualTo("DEBUG HOOK OFF"); + } + +} diff --git a/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/utils/ListAppender.java b/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/utils/ListAppender.java new file mode 100644 index 0000000000..c8c1c110bb --- /dev/null +++ b/spring-5-reactive/src/test/java/com/baeldung/debugging/consumer/utils/ListAppender.java @@ -0,0 +1,25 @@ +package com.baeldung.debugging.consumer.utils; + +import java.util.ArrayList; +import java.util.List; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; + +public class ListAppender extends AppenderBase { + + static private List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + events.add(eventObject); + } + + public static List getEvents() { + return events; + } + + public static void clearEventList() { + events.clear(); + } +} diff --git a/spring-5-reactive/src/test/resources/logback-test.xml b/spring-5-reactive/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..514029e402 --- /dev/null +++ b/spring-5-reactive/src/test/resources/logback-test.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file From 0f2fea091b053a30c418532439c98ee13794767a Mon Sep 17 00:00:00 2001 From: DOHA Date: Wed, 28 Nov 2018 13:59:16 +0200 Subject: [PATCH 478/546] add more custom oauth examples --- .../CustomAuthorizationRequestResolver.java | 7 ++++++ .../LinkedinTokenResponseConverter.java | 24 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LinkedinTokenResponseConverter.java diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java index 025064423d..b3fcd15a9a 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java @@ -47,4 +47,11 @@ public class CustomAuthorizationRequestResolver implements OAuth2AuthorizationRe private OAuth2AuthorizationRequest customizeAuthorizationRequest1(OAuth2AuthorizationRequest req) { return OAuth2AuthorizationRequest.from(req).state("xyz").build(); } + + private OAuth2AuthorizationRequest customizeOktaReq(OAuth2AuthorizationRequest req) { + Map extraParams = new HashMap(); + extraParams.putAll(req.getAdditionalParameters()); + extraParams.put("idp", "https://idprovider.com"); + return OAuth2AuthorizationRequest.from(req).additionalParameters(extraParams).build(); + } } diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LinkedinTokenResponseConverter.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LinkedinTokenResponseConverter.java new file mode 100644 index 0000000000..f638b6101a --- /dev/null +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LinkedinTokenResponseConverter.java @@ -0,0 +1,24 @@ +package com.baeldung.oauth2; + +import java.util.Map; + +import org.springframework.core.convert.converter.Converter; +import org.springframework.security.oauth2.core.OAuth2AccessToken; +import org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse; +import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames; + +public class LinkedinTokenResponseConverter implements Converter, OAuth2AccessTokenResponse> { + + @Override + public OAuth2AccessTokenResponse convert(Map tokenResponseParameters) { + String accessToken = tokenResponseParameters.get(OAuth2ParameterNames.ACCESS_TOKEN); + long expiresIn = Long.valueOf(tokenResponseParameters.get(OAuth2ParameterNames.EXPIRES_IN)); + + OAuth2AccessToken.TokenType accessTokenType = OAuth2AccessToken.TokenType.BEARER; + + return OAuth2AccessTokenResponse.withToken(accessToken) + .tokenType(accessTokenType) + .expiresIn(expiresIn) + .build(); + } +} From ac37b4fb65bcceb3f977a208508f894f0e66fb3e Mon Sep 17 00:00:00 2001 From: Kuba Date: Wed, 28 Nov 2018 15:42:07 +0100 Subject: [PATCH 479/546] BAEL-2279 - Logging reactive sequence * BAEL-2279 - Logging reactive sequence * BAEL-2279 - Logging reactive sequence * Format fix. * Add all examples. Fix formatting. * BAEL 2279 - rename file, formatting fixes, update deps. * BAEL-2279 - Move code to reactive module. * BAEL 2279 - Remove old code. --- logging-modules/log4j/pom.xml | 7 ------- .../baeldung/webflux/logging}/WebFluxLoggingExample.java | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) rename {logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging => spring-5-reactive/src/main/java/com/baeldung/webflux/logging}/WebFluxLoggingExample.java (91%) diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index 1b27e03445..c5ce1d06ad 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/pom.xml @@ -44,12 +44,6 @@ disruptor ${disruptor.version} - - - org.springframework.boot - spring-boot-starter-webflux - ${spring-boot.version} - @@ -57,7 +51,6 @@ 2.7 2.7 3.3.6 - 2.1.0.RELEASE \ No newline at end of file diff --git a/logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java b/spring-5-reactive/src/main/java/com/baeldung/webflux/logging/WebFluxLoggingExample.java similarity index 91% rename from logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java rename to spring-5-reactive/src/main/java/com/baeldung/webflux/logging/WebFluxLoggingExample.java index f429fd57f3..c4881b2296 100644 --- a/logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java +++ b/spring-5-reactive/src/main/java/com/baeldung/webflux/logging/WebFluxLoggingExample.java @@ -1,4 +1,4 @@ -package com.baeldung.webFluxLogging; +package com.baeldung.webflux.logging; import reactor.core.publisher.Flux; From b6431622ed022ca029a725a902bb0458ccbd5720 Mon Sep 17 00:00:00 2001 From: Aravind Ranganathan Date: Wed, 28 Nov 2018 12:01:32 -0500 Subject: [PATCH 480/546] Spring Data Cassandra Reactive Issue: BAEL-1870 --- .../spring-data-cassandra-reactive/pom.xml | 70 +++++++++++++++++++ ...pringDataCassandraReactiveApplication.java | 12 ++++ .../controller/EmployeeController.java | 49 +++++++++++++ .../cassandra/reactive/model/Employee.java | 20 ++++++ .../repository/EmployeeRepository.java | 11 +++ .../reactive/service/EmployeeService.java | 35 ++++++++++ .../src/main/resources/application.properties | 2 + ...tiveEmployeeRepositoryIntegrationTest.java | 55 +++++++++++++++ 8 files changed, 254 insertions(+) create mode 100644 persistence-modules/spring-data-cassandra-reactive/pom.xml create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java diff --git a/persistence-modules/spring-data-cassandra-reactive/pom.xml b/persistence-modules/spring-data-cassandra-reactive/pom.xml new file mode 100644 index 0000000000..037b1fd3c1 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/pom.xml @@ -0,0 +1,70 @@ + + + 4.0.0 + + com.baeldung + spring-data-cassandra-reactive + 0.0.1-SNAPSHOT + jar + + spring-data-cassandra-reactive + Spring Data Cassandra reactive + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + + 1.8 + + + + + org.springframework.data + spring-data-cassandra + 2.1.2.RELEASE + + + io.projectreactor + reactor-core + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java new file mode 100644 index 0000000000..5f467042a3 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.cassandra.reactive; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringDataCassandraReactiveApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringDataCassandraReactiveApplication.class, args); + } +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java new file mode 100644 index 0000000000..e9de213e61 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java @@ -0,0 +1,49 @@ +package com.baeldung.cassandra.reactive.controller; + +import com.baeldung.cassandra.reactive.model.Employee; +import com.baeldung.cassandra.reactive.service.EmployeeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import javax.annotation.PostConstruct; +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("employee") +public class EmployeeController { + + @Autowired + EmployeeService employeeService; + + @PostConstruct + public void saveEmployees() { + List employees = new ArrayList<>(); + employees.add(new Employee(123, "John Doe", "Delaware", "jdoe@xyz.com", 31)); + employees.add(new Employee(324, "Adam Smith", "North Carolina", "asmith@xyz.com", 43)); + employees.add(new Employee(355, "Kevin Dunner", "Virginia", "kdunner@xyz.com", 24)); + employees.add(new Employee(643, "Mike Lauren", "New York", "mlauren@xyz.com", 41)); + employeeService.initializeEmployees(employees); + } + + @GetMapping("/list") + public Flux getAllEmployees() { + Flux employees = employeeService.getAllEmployees(); + return employees; + } + + @GetMapping("/{id}") + public Mono getEmployeeById(@PathVariable int id) { + return employeeService.getEmployeeById(id); + } + + @GetMapping("/filterByAge/{age}") + public Flux getEmployeesFilterByAge(@PathVariable int age) { + return employeeService.getEmployeesFilterByAge(age); + } +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java new file mode 100644 index 0000000000..a78f884778 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java @@ -0,0 +1,20 @@ +package com.baeldung.cassandra.reactive.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.cassandra.core.mapping.PrimaryKey; +import org.springframework.data.cassandra.core.mapping.Table; + +@Table +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Employee { + @PrimaryKey + private int id; + private String name; + private String address; + private String email; + private int age; +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java new file mode 100644 index 0000000000..22dc2b4565 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.cassandra.reactive.repository; + +import com.baeldung.cassandra.reactive.model.Employee; +import org.springframework.data.cassandra.repository.AllowFiltering; +import org.springframework.data.cassandra.repository.ReactiveCassandraRepository; +import reactor.core.publisher.Flux; + +public interface EmployeeRepository extends ReactiveCassandraRepository { + @AllowFiltering + Flux findByAgeGreaterThan(int age); +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java new file mode 100644 index 0000000000..40c330937a --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java @@ -0,0 +1,35 @@ +package com.baeldung.cassandra.reactive.service; + +import com.baeldung.cassandra.reactive.model.Employee; +import com.baeldung.cassandra.reactive.repository.EmployeeRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.util.List; + +@Service +public class EmployeeService { + + @Autowired + EmployeeRepository employeeRepository; + + public void initializeEmployees(List employees) { + Flux savedEmployees = employeeRepository.saveAll(employees); + savedEmployees.subscribe(); + } + + public Flux getAllEmployees() { + Flux employees = employeeRepository.findAll(); + return employees; + } + + public Flux getEmployeesFilterByAge(int age) { + return employeeRepository.findByAgeGreaterThan(age); + } + + public Mono getEmployeeById(int id) { + return employeeRepository.findById(id); + } +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties b/persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties new file mode 100644 index 0000000000..7ed2f10131 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.data.cassandra.keyspace-name=practice +spring.data.cassandra.port=9042 \ No newline at end of file diff --git a/persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java b/persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java new file mode 100644 index 0000000000..ad726fe969 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java @@ -0,0 +1,55 @@ +package com.baeldung.cassandra.reactive; + +import com.baeldung.cassandra.reactive.model.Employee; +import com.baeldung.cassandra.reactive.repository.EmployeeRepository; +import org.junit.Before; +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.test.context.junit4.SpringRunner; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ReactiveEmployeeRepositoryIntegrationTest { + + @Autowired + EmployeeRepository repository; + + @Before + public void setUp() { + + Flux deleteAndInsert = repository.deleteAll() // + .thenMany(repository.saveAll(Flux.just( + new Employee(111, "John Doe", "Delaware", "jdoe@xyz.com", 31), + new Employee(222, "Adam Smith", "North Carolina", "asmith@xyz.com", 43), + new Employee(333, "Kevin Dunner", "Virginia", "kdunner@xyz.com", 24), + new Employee(444, "Mike Lauren", "New York", "mlauren@xyz.com", 41)))); + + StepVerifier.create(deleteAndInsert).expectNextCount(4).verifyComplete(); + } + + @Test + public void givenRecordsAreInserted_whenDbIsQueried_thenShouldIncludeNewRecords() { + + Mono saveAndCount = repository.count() + .doOnNext(System.out::println) + .thenMany(repository.saveAll(Flux.just(new Employee(325, "Kim Jones", "Florida", "kjones@xyz.com", 42), + new Employee(654, "Tom Moody", "New Hampshire", "tmoody@xyz.com", 44)))) + .last() + .flatMap(v -> repository.count()) + .doOnNext(System.out::println); + + StepVerifier.create(saveAndCount).expectNext(6L).verifyComplete(); + } + + @Test + public void givenAgeForFilter_whenDbIsQueried_thenShouldReturnFilteredRecords() { + StepVerifier.create(repository.findByAgeGreaterThan(35)).expectNextCount(2).verifyComplete(); + } + +} From c81567741e2072face906788d33f366056c95fea Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 28 Nov 2018 10:02:09 -0700 Subject: [PATCH 481/546] Move ClassName to core-java-lang (#5796) Issue: BAEL-2309 --- .../src/main/java/com/baeldung/className/RetrievingClassName.java | 0 .../java/com/baeldung/className/RetrievingClassNameUnitTest.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {core-java => core-java-lang}/src/main/java/com/baeldung/className/RetrievingClassName.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java (100%) diff --git a/core-java/src/main/java/com/baeldung/className/RetrievingClassName.java b/core-java-lang/src/main/java/com/baeldung/className/RetrievingClassName.java similarity index 100% rename from core-java/src/main/java/com/baeldung/className/RetrievingClassName.java rename to core-java-lang/src/main/java/com/baeldung/className/RetrievingClassName.java diff --git a/core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java b/core-java-lang/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java From 866666f3db77a8d72a58a4f269561537d9389533 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 28 Nov 2018 10:02:35 -0700 Subject: [PATCH 482/546] Add load-testing-comparison to Build (#5757) Issue: bael-46 --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 70248b9993..b998967bbf 100644 --- a/pom.xml +++ b/pom.xml @@ -377,6 +377,7 @@ feign flips testing-modules/groovy-spock + testing-modules/load-testing-comparison google-cloud google-web-toolkit gson From 4b6515d8a379b5bfc0aaae572a21ecb7581cb21f Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Wed, 28 Nov 2018 20:46:43 +0100 Subject: [PATCH 483/546] added readme --- restx/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 restx/README.md diff --git a/restx/README.md b/restx/README.md new file mode 100644 index 0000000000..f586f08a21 --- /dev/null +++ b/restx/README.md @@ -0,0 +1,3 @@ +# Relevant Articles + +* [Introduction to RESTX](https://www.baeldung.com/java-restx) From 5871653e65d41da0191afe56ed2b1ce2cac92338 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 28 Nov 2018 23:42:40 +0200 Subject: [PATCH 484/546] Update and rename OptimizedMatcherUnitTest.java to OptimizedMatcherManualTest.java --- ...izedMatcherUnitTest.java => OptimizedMatcherManualTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-java/src/test/java/com/baeldung/regexp/optmization/{OptimizedMatcherUnitTest.java => OptimizedMatcherManualTest.java} (98%) diff --git a/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java b/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherManualTest.java similarity index 98% rename from core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java rename to core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherManualTest.java index 2be6b6ad4b..f44968a5a7 100644 --- a/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java +++ b/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherManualTest.java @@ -11,7 +11,7 @@ import java.util.regex.Pattern; import static org.junit.Assert.assertTrue; -public class OptimizedMatcherUnitTest { +public class OptimizedMatcherManualTest { private String action; From 186c2994a745dccf09a543bd578655556e2ff7c9 Mon Sep 17 00:00:00 2001 From: DOHA Date: Thu, 29 Nov 2018 01:51:07 +0200 Subject: [PATCH 485/546] organise oauth2 request code --- .../oauth2/CustomRequestSecurityConfig.java | 119 ++++++++++++++++++ .../com/baeldung/oauth2/SecurityConfig.java | 13 -- .../CustomAuthorizationRequestResolver.java | 2 +- .../CustomRequestEntityConverter.java | 2 +- .../CustomTokenResponseConverter.java | 2 +- .../LinkedinTokenResponseConverter.java | 2 +- 6 files changed, 123 insertions(+), 17 deletions(-) create mode 100644 spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java rename spring-5-security-oauth/src/main/java/com/baeldung/{oauth2 => oauth2request}/CustomAuthorizationRequestResolver.java (98%) rename spring-5-security-oauth/src/main/java/com/baeldung/{oauth2 => oauth2request}/CustomRequestEntityConverter.java (96%) rename spring-5-security-oauth/src/main/java/com/baeldung/{oauth2 => oauth2request}/CustomTokenResponseConverter.java (98%) rename spring-5-security-oauth/src/main/java/com/baeldung/{oauth2 => oauth2request}/LinkedinTokenResponseConverter.java (96%) diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java new file mode 100644 index 0000000000..51caee8178 --- /dev/null +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java @@ -0,0 +1,119 @@ +package com.baeldung.oauth2; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.env.Environment; +import org.springframework.http.converter.FormHttpMessageConverter; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.oauth2.client.CommonOAuth2Provider; +import org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient; +import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient; +import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest; +import org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler; +import org.springframework.security.oauth2.client.registration.ClientRegistration; +import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; +import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository; +import org.springframework.security.oauth2.client.web.AuthorizationRequestRepository; +import org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizationRequestRepository; +import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest; +import org.springframework.security.oauth2.core.http.converter.OAuth2AccessTokenResponseHttpMessageConverter; +import org.springframework.web.client.RestTemplate; + +import com.baeldung.oauth2request.CustomAuthorizationRequestResolver; +import com.baeldung.oauth2request.CustomRequestEntityConverter; +import com.baeldung.oauth2request.CustomTokenResponseConverter; + +//@Configuration +@PropertySource("application-oauth2.properties") +public class CustomRequestSecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .antMatchers("/oauth_login", "/loginFailure", "/") + .permitAll() + .anyRequest() + .authenticated() + .and() + .oauth2Login() + .loginPage("/oauth_login") + .authorizationEndpoint() + .authorizationRequestResolver( new CustomAuthorizationRequestResolver(clientRegistrationRepository(),"/oauth2/authorize-client")) + + .baseUri("/oauth2/authorize-client") + .authorizationRequestRepository(authorizationRequestRepository()) + .and() + .tokenEndpoint() + .accessTokenResponseClient(accessTokenResponseClient()) + .and() + .defaultSuccessUrl("/loginSuccess") + .failureUrl("/loginFailure"); + } + + @Bean + public AuthorizationRequestRepository authorizationRequestRepository() { + return new HttpSessionOAuth2AuthorizationRequestRepository(); + } + + @Bean + public OAuth2AccessTokenResponseClient accessTokenResponseClient() { + DefaultAuthorizationCodeTokenResponseClient accessTokenResponseClient = new DefaultAuthorizationCodeTokenResponseClient(); + accessTokenResponseClient.setRequestEntityConverter(new CustomRequestEntityConverter()); + + OAuth2AccessTokenResponseHttpMessageConverter tokenResponseHttpMessageConverter = new OAuth2AccessTokenResponseHttpMessageConverter(); + tokenResponseHttpMessageConverter.setTokenResponseConverter(new CustomTokenResponseConverter()); + RestTemplate restTemplate = new RestTemplate(Arrays.asList(new FormHttpMessageConverter(), tokenResponseHttpMessageConverter)); + restTemplate.setErrorHandler(new OAuth2ErrorResponseErrorHandler()); + accessTokenResponseClient.setRestOperations(restTemplate); + return accessTokenResponseClient; + } + + + // additional configuration for non-Spring Boot projects + private static List clients = Arrays.asList("google", "facebook"); + + //@Bean + public ClientRegistrationRepository clientRegistrationRepository() { + List registrations = clients.stream() + .map(c -> getRegistration(c)) + .filter(registration -> registration != null) + .collect(Collectors.toList()); + + return new InMemoryClientRegistrationRepository(registrations); + } + + private static String CLIENT_PROPERTY_KEY = "spring.security.oauth2.client.registration."; + + @Autowired + private Environment env; + + private ClientRegistration getRegistration(String client) { + String clientId = env.getProperty(CLIENT_PROPERTY_KEY + client + ".client-id"); + + if (clientId == null) { + return null; + } + + String clientSecret = env.getProperty(CLIENT_PROPERTY_KEY + client + ".client-secret"); + if (client.equals("google")) { + return CommonOAuth2Provider.GOOGLE.getBuilder(client) + .clientId(clientId) + .clientSecret(clientSecret) + .build(); + } + if (client.equals("facebook")) { + return CommonOAuth2Provider.FACEBOOK.getBuilder(client) + .clientId(clientId) + .clientSecret(clientSecret) + .build(); + } + return null; + } + +} diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SecurityConfig.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SecurityConfig.java index cf27b01a75..e17e339142 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SecurityConfig.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/SecurityConfig.java @@ -9,22 +9,18 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; -import org.springframework.http.converter.FormHttpMessageConverter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.oauth2.client.CommonOAuth2Provider; import org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient; import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient; import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest; -import org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler; import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository; import org.springframework.security.oauth2.client.web.AuthorizationRequestRepository; import org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizationRequestRepository; import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest; -import org.springframework.security.oauth2.core.http.converter.OAuth2AccessTokenResponseHttpMessageConverter; -import org.springframework.web.client.RestTemplate; @Configuration @PropertySource("application-oauth2.properties") @@ -41,8 +37,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { .oauth2Login() .loginPage("/oauth_login") .authorizationEndpoint() - .authorizationRequestResolver( new CustomAuthorizationRequestResolver(clientRegistrationRepository(),"/oauth2/authorize-client")) - .baseUri("/oauth2/authorize-client") .authorizationRequestRepository(authorizationRequestRepository()) .and() @@ -61,13 +55,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Bean public OAuth2AccessTokenResponseClient accessTokenResponseClient() { DefaultAuthorizationCodeTokenResponseClient accessTokenResponseClient = new DefaultAuthorizationCodeTokenResponseClient(); - accessTokenResponseClient.setRequestEntityConverter(new CustomRequestEntityConverter()); - - OAuth2AccessTokenResponseHttpMessageConverter tokenResponseHttpMessageConverter = new OAuth2AccessTokenResponseHttpMessageConverter(); - tokenResponseHttpMessageConverter.setTokenResponseConverter(new CustomTokenResponseConverter()); - RestTemplate restTemplate = new RestTemplate(Arrays.asList(new FormHttpMessageConverter(), tokenResponseHttpMessageConverter)); - restTemplate.setErrorHandler(new OAuth2ErrorResponseErrorHandler()); - accessTokenResponseClient.setRestOperations(restTemplate); return accessTokenResponseClient; } diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomAuthorizationRequestResolver.java similarity index 98% rename from spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomAuthorizationRequestResolver.java index b3fcd15a9a..47aacf9c06 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomAuthorizationRequestResolver.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomAuthorizationRequestResolver.java @@ -1,4 +1,4 @@ -package com.baeldung.oauth2; +package com.baeldung.oauth2request; import java.util.HashMap; import java.util.Map; diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomRequestEntityConverter.java similarity index 96% rename from spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomRequestEntityConverter.java index 8884065769..5486105c34 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestEntityConverter.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomRequestEntityConverter.java @@ -1,4 +1,4 @@ -package com.baeldung.oauth2; +package com.baeldung.oauth2request; import org.springframework.core.convert.converter.Converter; import org.springframework.http.RequestEntity; diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomTokenResponseConverter.java similarity index 98% rename from spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomTokenResponseConverter.java index 741f44871a..b9775d674a 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomTokenResponseConverter.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/CustomTokenResponseConverter.java @@ -1,4 +1,4 @@ -package com.baeldung.oauth2; +package com.baeldung.oauth2request; import java.util.Arrays; import java.util.Collections; diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LinkedinTokenResponseConverter.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/LinkedinTokenResponseConverter.java similarity index 96% rename from spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LinkedinTokenResponseConverter.java rename to spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/LinkedinTokenResponseConverter.java index f638b6101a..89b3d32de5 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/LinkedinTokenResponseConverter.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2request/LinkedinTokenResponseConverter.java @@ -1,4 +1,4 @@ -package com.baeldung.oauth2; +package com.baeldung.oauth2request; import java.util.Map; From 2ee5e03b887585e5a4f1b4657b5d47583f2984fb Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 22 Nov 2018 23:07:29 +0330 Subject: [PATCH 486/546] Added the codes used for operator overloading article --- .../kotlin/com/baeldung/operators/Money.kt | 27 +++++++++++++++++ .../kotlin/com/baeldung/operators/Page.kt | 14 +++++++++ .../kotlin/com/baeldung/operators/Point.kt | 14 +++++++++ .../main/kotlin/com/baeldung/operators/UI.kt | 30 +++++++++++++++++++ .../kotlin/com/baeldung/operators/Utils.kt | 4 +++ 5 files changed, 89 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt new file mode 100644 index 0000000000..ffaea71e1e --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt @@ -0,0 +1,27 @@ +enum class Currency { + DOLLARS, EURO +} + +class Money(val amount: BigDecimal, val currency: Currency) : Comparable { + + override fun compareTo(other: Money): Int = + convert(Currency.DOLLARS).compareTo(other.convert(Currency.DOLLARS)) + + fun convert(currency: Currency): BigDecimal = TODO() + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is Money) return false + + if (amount != other.amount) return false + if (currency != other.currency) return false + + return true + } + + override fun hashCode(): Int { + var result = amount.hashCode() + result = 31 * result + currency.hashCode() + return result + } +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt new file mode 100644 index 0000000000..db03779b35 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt @@ -0,0 +1,14 @@ +interface Page { + fun pageNumber(): Int + fun pageSize(): Int + fun elements(): MutableList +} + +operator fun Page.get(index: Int): T = elements()[index] +operator fun Page.get(start: Int, endExclusive: Int): List = elements().subList(start, endExclusive) +operator fun Page.set(index: Int, value: T) { + elements()[index] = value +} + +operator fun Page.contains(element: T): Boolean = element in elements() +operator fun Page.iterator() = elements().iterator() \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt new file mode 100644 index 0000000000..7af2fc1cad --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt @@ -0,0 +1,14 @@ +data class Point(val x: Int, val y: Int) + +operator fun Point.unaryMinus() = Point(-x, -y) +operator fun Point.not() = Point(y, x) +operator fun Point.inc() = Point(x + 1, y + 1) +operator fun Point.dec() = Point(x - 1, y - 1) + +operator fun Point.plus(other: Point): Point = Point(x + other.x, y + other.y) +operator fun Point.minus(other: Point): Point = Point(x - other.x, y - other.y) +operator fun Point.times(other: Point): Point = Point(x * other.x, y * other.y) +operator fun Point.div(other: Point): Point = Point(x / other.x, y / other.y) +operator fun Point.rem(other: Point): Point = Point(x % other.x, y % other.y) +operator fun Point.times(factor: Int): Point = Point(x * factor, y * factor) +operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt new file mode 100644 index 0000000000..abb4a4a00c --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt @@ -0,0 +1,30 @@ +interface View +class TextView(val value: String) : View +class ImageView(val url: String) : View + +class UI { + private val views = mutableListOf() + + operator fun String.unaryPlus() { + views.add(TextView(this)) + } + + operator fun View.unaryPlus() { + views.add(this) + } +} + +fun ui(init: UI.() -> Unit): UI { + val ui = UI() + ui.init() + + return ui +} + +fun main(args: Array) { + val header = ui { + +ImageView("http://logo.com") + +"Brand name" + +"Brand description" + } +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt new file mode 100644 index 0000000000..a3c671369c --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt @@ -0,0 +1,4 @@ +operator fun MutableCollection.plusAssign(element: T) { + add(element) +} +operator fun BigInteger.plus(other: Int): BigInteger = add(BigInteger("$other")) \ No newline at end of file From a8d9eb084a9f48d14dd9af46e2f870b12df74c33 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 22 Nov 2018 23:47:49 +0330 Subject: [PATCH 487/546] Added two missing import statements --- core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt | 2 ++ core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt index ffaea71e1e..1bb015ac27 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt @@ -1,3 +1,5 @@ +import java.math.BigDecimal + enum class Currency { DOLLARS, EURO } diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt index a3c671369c..ba33d3e7a2 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt @@ -1,3 +1,5 @@ +import java.math.BigInteger + operator fun MutableCollection.plusAssign(element: T) { add(element) } From 1250605e19850ea102e4275fcc8a882220c82d97 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Sun, 25 Nov 2018 00:51:27 +0330 Subject: [PATCH 488/546] Added a new shape class instead of UI. --- .../kotlin/com/baeldung/operators/Point.kt | 17 ++++++++++- .../main/kotlin/com/baeldung/operators/UI.kt | 30 ------------------- 2 files changed, 16 insertions(+), 31 deletions(-) delete mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt index 7af2fc1cad..22617a4ee6 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt @@ -11,4 +11,19 @@ operator fun Point.times(other: Point): Point = Point(x * other.x, y * other.y) operator fun Point.div(other: Point): Point = Point(x / other.x, y / other.y) operator fun Point.rem(other: Point): Point = Point(x % other.x, y % other.y) operator fun Point.times(factor: Int): Point = Point(x * factor, y * factor) -operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) \ No newline at end of file +operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) + +class Shape { + private val points = mutableListOf() + + operator fun Point.unaryPlus() { + points.add(this) + } +} + +fun shape(init: Shape.() -> Unit): Shape { + val shape = Shape() + shape.init() + + return shape +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt deleted file mode 100644 index abb4a4a00c..0000000000 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt +++ /dev/null @@ -1,30 +0,0 @@ -interface View -class TextView(val value: String) : View -class ImageView(val url: String) : View - -class UI { - private val views = mutableListOf() - - operator fun String.unaryPlus() { - views.add(TextView(this)) - } - - operator fun View.unaryPlus() { - views.add(this) - } -} - -fun ui(init: UI.() -> Unit): UI { - val ui = UI() - ui.init() - - return ui -} - -fun main(args: Array) { - val header = ui { - +ImageView("http://logo.com") - +"Brand name" - +"Brand description" - } -} \ No newline at end of file From ad8ae556a8a8e0673d8810490447366e5a544584 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 29 Nov 2018 13:30:52 +0330 Subject: [PATCH 489/546] Added a few unit tests for kotlin operator examples. --- .../kotlin/com/baeldung/operators/Money.kt | 2 + .../kotlin/com/baeldung/operators/Page.kt | 2 + .../kotlin/com/baeldung/operators/Point.kt | 4 +- .../kotlin/com/baeldung/operators/Utils.kt | 2 + .../kotlin/com/baeldung/operators/PageTest.kt | 28 +++++++++++ .../com/baeldung/operators/PointTest.kt | 48 +++++++++++++++++++ 6 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt index 1bb015ac27..93eb78c5b6 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + import java.math.BigDecimal enum class Currency { diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt index db03779b35..1077eb94f9 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + interface Page { fun pageNumber(): Int fun pageSize(): Int diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt index 22617a4ee6..e3282e64cc 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + data class Point(val x: Int, val y: Int) operator fun Point.unaryMinus() = Point(-x, -y) @@ -14,7 +16,7 @@ operator fun Point.times(factor: Int): Point = Point(x * factor, y * factor) operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) class Shape { - private val points = mutableListOf() + val points = mutableListOf() operator fun Point.unaryPlus() { points.add(this) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt index ba33d3e7a2..0f16544f38 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + import java.math.BigInteger operator fun MutableCollection.plusAssign(element: T) { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt new file mode 100644 index 0000000000..4217fc0c08 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt @@ -0,0 +1,28 @@ +package com.baeldung.operators + +import org.junit.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class PageTest { + + private val page = PageImpl(1, 10, "Java", "Kotlin", "Scala") + + @Test + fun `Get convention should work as expected`() { + assertEquals(page[1], "Kotlin") + assertEquals(page[1, 3], listOf("Kotlin", "Scala")) + } + + @Test + fun `In convention should work on a page as expected`() { + assertTrue("Kotlin" in page) + } + +} + +private class PageImpl(val page: Int, val size: Int, vararg val elements: T) : Page { + override fun pageNumber(): Int = page + override fun pageSize(): Int = size + override fun elements(): MutableList = mutableListOf(*elements) +} \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt new file mode 100644 index 0000000000..168ab6431d --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt @@ -0,0 +1,48 @@ +package com.baeldung.operators + +import org.junit.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class PointTest { + + private val p1 = Point(1, 2) + private val p2 = Point(2, 3) + + @Test + fun `We should be able to add two points together using +`() { + assertEquals(p1 + p2, Point(3, 5)) + } + + @Test + fun `We shoud be able to subtract one point from another using -`() { + assertEquals(p1 - p2, Point(-1, -1)) + } + + @Test + fun `We should be able to multiply two points together with *`() { + assertEquals(p1 * p2, Point(2, 6)) + } + + @Test + fun `We should be able to divide one point by another`() { + assertEquals(p1 / p2, Point(0, 0)) + } + + @Test + fun `We should be able to scale a point by an integral factor`() { + assertEquals(p1 * 2, Point(2, 4)) + assertEquals(2 * p1, Point(2, 4)) + } + + @Test + fun `We should be able to add points to an empty shape`() { + val line = shape { + +Point(0, 0) + +Point(1, 3) + } + + assertTrue(Point(0, 0) in line.points) + assertTrue(Point(1, 3) in line.points) + } +} \ No newline at end of file From ef74a2538e126eec8bec6e5b81d6ecd570454c12 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 29 Nov 2018 15:57:06 +0330 Subject: [PATCH 490/546] Added a few unit tests for kotlin operator examples. --- .../test/kotlin/com/baeldung/operators/UtilsTest.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt new file mode 100644 index 0000000000..4abe962cb5 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt @@ -0,0 +1,13 @@ +package com.baeldung.operators + +import java.math.BigInteger +import org.junit.Test +import kotlin.test.assertEquals + +class UtilsTest { + + @Test + fun `We should be able to add an int value to an existing BigInteger using +`() { + assertEquals(BigInteger.ZERO + 1, BigInteger.ONE) + } +} \ No newline at end of file From f5b4a5e7023881474110c19e192246694b1bc99d Mon Sep 17 00:00:00 2001 From: Dionis Prifti Date: Thu, 29 Nov 2018 15:46:33 +0100 Subject: [PATCH 491/546] BAEL-2347: Added test examples for Coupound Assignment Operators. --- .../CompoundOperatorsTest.java | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java diff --git a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java new file mode 100644 index 0000000000..4a7833af95 --- /dev/null +++ b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java @@ -0,0 +1,111 @@ +package com.baeldung.compoundoperators; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class CompoundOperatorsTest { + + @Test + public void whenAssignmentOperatorIsUsed_thenValueIsAssigned() { + int x = 5; + + assertEquals(5, x); + } + + @Test + public void whenCompoundAssignmentUsed_thenSameAsSimpleAssignment() { + int a = 3, b = 3, c = -2; + a = a * c; // Simple assignment operator + b *= c; // Compound assignment operator + + assertEquals(a, b); + } + + @Test + public void whenAssignmentOperatorIsUsed_thenValueIsReturned() { + long x = 5; + long y = (x=3); + + assertEquals(3, y); + assertEquals(y, x); + } + + @Test + public void whenCompoundOperatorsAreUsed_thenOperationsArePerformedAndAssigned() { + //Simple assignment + int x = 5; //x is 5 + + //Incrementation + x += 5; //x is 10 + assertEquals(10, x); + + //Decrementation + x -= 2; //x is 8 + assertEquals(8, x); + + //Multiplication + x *= 2; //x is 16 + assertEquals(16, x); + + //Division + x /= 4; //x is 4 + assertEquals(4, x); + + //Modulus + x %= 3; //x is 1 + assertEquals(1, x); + + + //Binary AND + x &= 4; //x is 0 + assertEquals(0, x); + + //Binary exclusive OR + x ^= 4; //x is 4 + assertEquals(4, x); + + //Binary inclusive OR + x |= 8; //x is 12 + assertEquals(12, x); + + + //Binary Left Shift + x <<= 2; //x is 48 + assertEquals(48, x); + + //Binary Right Shift + x >>= 2; //x is 12 + assertEquals(12, x); + + //Shift right zero fill + x >>>= 1; //x is 6 + assertEquals(6, x); + } + + @Test(expected = NullPointerException.class) + public void whenArrayIsNull_thenThrowNullException() { + int[] numbers = null; + + //Trying Incrementation + numbers[2] += 5; + } + + @Test(expected = ArrayIndexOutOfBoundsException.class) + public void whenArrayIndexNotCorrect_thenThrowArrayIndexException() { + int[] numbers = {0, 1}; + + //Trying Incrementation + numbers[2] += 5; + } + + @Test + public void whenArrayIndexIsCorrect_thenPerformOperation() { + int[] numbers = {0, 1}; + + //Incrementation + numbers[1] += 5; + assertEquals(6, numbers[1]); + } + +} From 7b3e306d2288022591f0f63ac89fbaad606253be Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Thu, 29 Nov 2018 08:06:18 -0800 Subject: [PATCH 492/546] BAEL-2309 update readme --- core-java-lang/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 62af72818f..79d2375c24 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -57,4 +57,5 @@ - [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) +- [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) From 5812866573fbd12890b909f88331b238974b509f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Carrasquel?= Date: Thu, 29 Nov 2018 11:58:12 -0500 Subject: [PATCH 493/546] Ways to iterate over a list Issue: BAEL-2311 --- .../com/baeldung/java/list/WaysToIterate.java | 67 +++++++++++++++++ .../java/list/WaysToIterateUnitTest.java | 71 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java create mode 100644 core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java diff --git a/core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java b/core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java new file mode 100644 index 0000000000..3cce08eabb --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java @@ -0,0 +1,67 @@ +package com.baeldung.java.list; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +/** + * Demonstrates the different ways to loop over + * the elements of a list. + */ +public class WaysToIterate { + + List countries = Arrays.asList("Germany", "Panama", "Australia"); + + /** + * Iterate over a list using a basic for loop + */ + public void iterateWithForLoop() { + for (int i = 0; i < countries.size(); i++) { + System.out.println(countries.get(i)); + } + } + + /** + * Iterate over a list using the enhanced for loop + */ + public void iterateWithEnhancedForLoop() { + for (String country : countries) { + System.out.println(country); + } + } + + /** + * Iterate over a list using an Iterator + */ + public void iterateWithIterator() { + Iterator countriesIterator = countries.iterator(); + while(countriesIterator.hasNext()) { + System.out.println(countriesIterator.next()); + } + } + + /** + * Iterate over a list using a ListIterator + */ + public void iterateWithListIterator() { + ListIterator listIterator = countries.listIterator(); + while(listIterator.hasNext()) { + System.out.println(listIterator.next()); + } + } + + /** + * Iterate over a list using the Iterable.forEach() method + */ + public void iterateWithForEach() { + countries.forEach(System.out::println); + } + + /** + * Iterate over a list using the Stream.forEach() method + */ + public void iterateWithStreamForEach() { + countries.stream().forEach((c) -> System.out.println(c)); + } +} \ No newline at end of file diff --git a/core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java b/core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java new file mode 100644 index 0000000000..973c60b233 --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java @@ -0,0 +1,71 @@ +package com.baeldung.java.list; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +import org.junit.Test; + +public class WaysToIterateUnitTest { + + List globalCountries = new ArrayList(); + List europeanCountries = Arrays.asList("Germany", "Panama", "Australia"); + + @Test + public void whenIteratingUsingForLoop_thenReturnThreeAsSizeOfList() { + for (int i = 0; i < europeanCountries.size(); i++) { + globalCountries.add(europeanCountries.get(i)); + } + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingEnhancedForLoop_thenReturnThreeAsSizeOfList() { + for (String country : europeanCountries) { + globalCountries.add(country); + } + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingIterator_thenReturnThreeAsSizeOfList() { + Iterator countriesIterator = europeanCountries.iterator(); + while (countriesIterator.hasNext()) { + globalCountries.add(countriesIterator.next()); + } + + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingListIterator_thenReturnThreeAsSizeOfList() { + ListIterator countriesIterator = europeanCountries.listIterator(); + while (countriesIterator.hasNext()) { + globalCountries.add(countriesIterator.next()); + } + + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingForEach_thenReturnThreeAsSizeOfList() { + europeanCountries.forEach(country -> globalCountries.add(country)); + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingStreamForEach_thenReturnThreeAsSizeOfList() { + europeanCountries.stream().forEach((country) -> globalCountries.add(country)); + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } +} \ No newline at end of file From 3b42c4882005976595e55d9eb2239133859e4a34 Mon Sep 17 00:00:00 2001 From: Dionis Prifti Date: Thu, 29 Nov 2018 21:05:59 +0100 Subject: [PATCH 494/546] BAEL-2347: Fixed test about return value of assignment operator. --- .../com/baeldung/compoundoperators/CompoundOperatorsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java index 4a7833af95..3b3478b38e 100644 --- a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java +++ b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java @@ -24,8 +24,8 @@ public class CompoundOperatorsTest { @Test public void whenAssignmentOperatorIsUsed_thenValueIsReturned() { - long x = 5; - long y = (x=3); + long x = 1; + long y = (x+=2); assertEquals(3, y); assertEquals(y, x); From 97fe04aace59891d3746cf60d46929608053d12d Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Thu, 29 Nov 2018 23:30:46 +0200 Subject: [PATCH 495/546] reenabling some modules --- pom.xml | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 35a2de9a45..8fa93373fc 100644 --- a/pom.xml +++ b/pom.xml @@ -637,7 +637,7 @@ dubbo persistence-modules/flyway - + JGit jni jooby @@ -662,24 +662,13 @@ sse-jaxrs static-analysis stripe - + structurizr Twitter4J wicket xstream cas/cas-secured-app cas/cas-server - - - - - - - - - - - - + graphql/graphql-java @@ -687,9 +676,6 @@ spring-boot-custom-starter/greeter persistence-modules/spring-boot-h2/spring-boot-h2-database - - - flyway-cdi-extension spring-security-acl @@ -711,7 +697,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -734,8 +720,8 @@ spring-rest-angular spring-rest-full spring-rest-query-language - - + spring-rest + spring-rest-simple spring-resttemplate helidon @@ -1030,7 +1016,7 @@ jackson java-strings - + java-collections-conversions java-collections-maps java-streams @@ -1114,9 +1100,10 @@ rabbitmq - persistence-modules/spring-data-mongodb - --> From 71f76d28ccddb5780254968c81a2810818f8e9ae Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Thu, 29 Nov 2018 16:15:20 -0800 Subject: [PATCH 496/546] BAEL-2279 update readme --- spring-5-reactive/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 267925b798..4fab0c12ad 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -16,3 +16,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) - [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) - [Validation for Functional Endpoints in Spring 5](https://www.baeldung.com/spring-functional-endpoints-validation) +- [Logging a Reactive Sequence](https://www.baeldung.com/spring-reactive-sequence-logging) From 02fc56c41bd5004bef4d2d4c091eccde2a341285 Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Thu, 29 Nov 2018 20:54:00 -0600 Subject: [PATCH 497/546] BAEL-2354: add link back to article --- cdi/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cdi/README.md b/cdi/README.md index 0477ce85bd..1523aacf6b 100644 --- a/cdi/README.md +++ b/cdi/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [CDI Interceptor vs Spring AspectJ](http://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) - [An Introduction to CDI (Contexts and Dependency Injection) in Java](http://www.baeldung.com/java-ee-cdi) +- [Introduction to the Event Notification Model in CDI 2.0](https://www.baeldung.com/cdi-event-notification) From f4c5f8b8ae250190defaabe7df9c832a3a80659a Mon Sep 17 00:00:00 2001 From: raghav-jha Date: Fri, 30 Nov 2018 11:40:11 +0530 Subject: [PATCH 498/546] JPA One-To-One Association Tutorial Issue: BAEL-2394 --- .../hibernate/onetoone/HibernateUtil.java | 38 +++++++++ .../baeldung/hibernate/onetoone/Strategy.java | 25 ++++++ .../onetoone/foreignkeybased/Address.java | 60 ++++++++++++++ .../onetoone/foreignkeybased/User.java | 51 ++++++++++++ .../onetoone/jointablebased/Employee.java | 53 ++++++++++++ .../onetoone/jointablebased/WorkStation.java | 61 ++++++++++++++ .../onetoone/sharedkeybased/Address.java | 60 ++++++++++++++ .../onetoone/sharedkeybased/User.java | 50 ++++++++++++ .../src/main/resources/one-to-one.cfg.xml | 16 ++++ ...ToOneAnnotationFKBasedIntegrationTest.java | 80 +++++++++++++++++++ ...ToOneAnnotationJTBasedIntegrationTest.java | 80 +++++++++++++++++++ ...oOneAnnotationSPKBasedIntegrationTest.java | 79 ++++++++++++++++++ .../src/test/resources/one-to-one.cfg.xml | 16 ++++ 13 files changed, 669 insertions(+) create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml create mode 100644 persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java create mode 100644 persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java create mode 100644 persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java create mode 100644 persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java new file mode 100644 index 0000000000..899fcde947 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java @@ -0,0 +1,38 @@ +package com.baeldung.hibernate.onetoone; + +import org.hibernate.SessionFactory; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.Configuration; +import org.hibernate.service.ServiceRegistry; + +public class HibernateUtil { + private static SessionFactory sessionFactory; + + private static SessionFactory buildSessionFactory(Strategy strategy) { + try { + // Create the SessionFactory from hibernate-annotation.cfg.xml + Configuration configuration = new Configuration(); + + for (Class entityClass : strategy.getEntityClasses()) { + configuration.addAnnotatedClass(entityClass); + } + configuration.configure("one-to-one.cfg.xml"); + + ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()) + .build(); + + SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry); + + return sessionFactory; + } catch (Throwable ex) { + ex.printStackTrace(); + throw new ExceptionInInitializerError(ex); + } + } + + public static SessionFactory getSessionFactory(Strategy strategy) { + if (sessionFactory == null) + sessionFactory = buildSessionFactory(strategy); + return sessionFactory; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java new file mode 100644 index 0000000000..3180566ca5 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java @@ -0,0 +1,25 @@ +package com.baeldung.hibernate.onetoone; + + +import java.util.Arrays; +import java.util.List; + +public enum Strategy { + //See that the classes belongs to different packages + FOREIGN_KEY(Arrays.asList(com.baeldung.hibernate.onetoone.foreignkeybased.User.class, + com.baeldung.hibernate.onetoone.foreignkeybased.Address.class)), + SHARED_PRIMARY_KEY(Arrays.asList(com.baeldung.hibernate.onetoone.sharedkeybased.User.class, + com.baeldung.hibernate.onetoone.sharedkeybased.Address.class)), + JOIN_TABLE_BASED(Arrays.asList(com.baeldung.hibernate.onetoone.jointablebased.Employee.class, + com.baeldung.hibernate.onetoone.jointablebased.WorkStation.class)); + + private List> entityClasses; + + Strategy(List> entityClasses) { + this.entityClasses = entityClasses; + } + + public List> getEntityClasses() { + return entityClasses; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java new file mode 100644 index 0000000000..e05eb46030 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java @@ -0,0 +1,60 @@ +package com.baeldung.hibernate.onetoone.foreignkeybased; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "address") +public class Address { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "street") + private String street; + + @Column(name = "city") + private String city; + + @OneToOne(mappedBy = "address") + private User user; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java new file mode 100644 index 0000000000..56b108d0d1 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java @@ -0,0 +1,51 @@ +package com.baeldung.hibernate.onetoone.foreignkeybased; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "users") +public class User { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "username") + private String userName; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "address_id", referencedColumnName = "id") + private Address address; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java new file mode 100644 index 0000000000..a0bc101b9f --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java @@ -0,0 +1,53 @@ +package com.baeldung.hibernate.onetoone.jointablebased; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "employee") +public class Employee { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "ename") + private String name; + + @OneToOne(cascade = CascadeType.ALL) + @JoinTable(name = "emp_workstation", joinColumns = {@JoinColumn(name = "employee_id", referencedColumnName = "id")}, + inverseJoinColumns = {@JoinColumn(name = "workstation_id", referencedColumnName = "id")}) + private WorkStation workStation; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public WorkStation getWorkStation() { + return workStation; + } + + public void setWorkStation(WorkStation workStation) { + this.workStation = workStation; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java new file mode 100644 index 0000000000..f530611f6e --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java @@ -0,0 +1,61 @@ +package com.baeldung.hibernate.onetoone.jointablebased; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "workstation") +public class WorkStation { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "workstation_number") + private Integer workstationNumber; + + @Column(name = "floor") + private String floor; + + @OneToOne(mappedBy = "workStation") + private Employee employee; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getWorkstationNumber() { + return workstationNumber; + } + + public void setWorkstationNumber(Integer workstationNumber) { + this.workstationNumber = workstationNumber; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public Employee getEmployee() { + return employee; + } + + public void setEmployee(Employee employee) { + this.employee = employee; + } +} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java new file mode 100644 index 0000000000..927516f6bb --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java @@ -0,0 +1,60 @@ +package com.baeldung.hibernate.onetoone.sharedkeybased; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "address") +public class Address { + + @Id + @Column(name = "id") + private Long id; + + @Column(name = "street") + private String street; + + @Column(name = "city") + private String city; + + @OneToOne + @MapsId + private User user; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java new file mode 100644 index 0000000000..fa00db1271 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java @@ -0,0 +1,50 @@ +package com.baeldung.hibernate.onetoone.sharedkeybased; + + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "users") +public class User { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "username") + private String userName; + + @OneToOne(mappedBy = "user", cascade = CascadeType.ALL) + private Address address; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml b/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml new file mode 100644 index 0000000000..7522036acb --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml @@ -0,0 +1,16 @@ + + + + + org.h2.Driver + + jdbc:h2:mem:spring_hibernate_one_to_one + sa + org.hibernate.dialect.H2Dialect + thread + true + create-drop + + \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java new file mode 100644 index 0000000000..475c93f6ff --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java @@ -0,0 +1,80 @@ +package com.baeldung.hibernate.onetoone; + +import com.baeldung.hibernate.onetoone.foreignkeybased.Address; +import com.baeldung.hibernate.onetoone.foreignkeybased.User; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class HibernateOneToOneAnnotationFKBasedIntegrationTest { + + private static SessionFactory sessionFactory; + + private Session session; + + @BeforeClass + public static void beforeTests() { + sessionFactory = HibernateUtil.getSessionFactory(Strategy.FOREIGN_KEY); + } + + @Before + public void setUp() { + session = sessionFactory.openSession(); + session.beginTransaction(); + } + + @Test + public void givenData_whenInsert_thenCreates1to1relationship() { + User user = new User(); + user.setUserName("alice@baeldung.com"); + + Address address = new Address(); + address.setStreet("FK Street"); + address.setCity("FK City"); + + address.setUser(user); + user.setAddress(address); + + //Address entry will automatically be created by hibernate, since cascade type is specified as ALL + session.persist(user); + session.getTransaction().commit(); + + assert1to1InsertedData(); + } + + private void assert1to1InsertedData() { + @SuppressWarnings("unchecked") + List userList = session.createQuery("FROM User").list(); + + assertNotNull(userList); + assertEquals(1, userList.size()); + + User user = userList.get(0); + assertEquals("alice@baeldung.com", user.getUserName()); + + Address address = user.getAddress(); + assertNotNull(address); + assertEquals("FK Street", address.getStreet()); + assertEquals("FK City", address.getCity()); + + } + + @After + public void tearDown() { + session.close(); + } + + @AfterClass + public static void afterTests() { + sessionFactory.close(); + } +} diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java new file mode 100644 index 0000000000..df4cd4d137 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java @@ -0,0 +1,80 @@ +package com.baeldung.hibernate.onetoone; + +import com.baeldung.hibernate.onetoone.jointablebased.Employee; +import com.baeldung.hibernate.onetoone.jointablebased.WorkStation; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class HibernateOneToOneAnnotationJTBasedIntegrationTest { + + private static SessionFactory sessionFactory; + + private Session session; + + @BeforeClass + public static void beforeTests() { + sessionFactory = HibernateUtil.getSessionFactory(Strategy.JOIN_TABLE_BASED); + } + + @Before + public void setUp() { + session = sessionFactory.openSession(); + session.beginTransaction(); + } + + @Test + public void givenData_whenInsert_thenCreates1to1relationship() { + Employee employee = new Employee(); + employee.setName("bob@baeldung.com"); + + WorkStation workStation = new WorkStation(); + workStation.setWorkstationNumber(626); + workStation.setFloor("Sixth Floor"); + + + employee.setWorkStation(workStation); + workStation.setEmployee(employee); + + session.persist(employee); + session.getTransaction().commit(); + + assert1to1InsertedData(); + } + + private void assert1to1InsertedData() { + @SuppressWarnings("unchecked") + List employeeList = session.createQuery("FROM Employee").list(); + assertNotNull(employeeList); + assertEquals(1, employeeList.size()); + + Employee employee = employeeList.get(0); + assertEquals("bob@baeldung.com", employee.getName()); + + WorkStation workStation = employee.getWorkStation(); + + assertNotNull(workStation); + assertEquals((long) 626, (long) workStation.getWorkstationNumber()); + assertEquals("Sixth Floor", workStation.getFloor()); + + } + + @After + public void tearDown() { + session.close(); + } + + @AfterClass + public static void afterTests() { + sessionFactory.close(); + } +} diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java new file mode 100644 index 0000000000..7931a8e3fe --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java @@ -0,0 +1,79 @@ +package com.baeldung.hibernate.onetoone; + +import com.baeldung.hibernate.onetoone.sharedkeybased.Address; +import com.baeldung.hibernate.onetoone.sharedkeybased.User; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class HibernateOneToOneAnnotationSPKBasedIntegrationTest { + + private static SessionFactory sessionFactory; + + private Session session; + + @BeforeClass + public static void beforeTests() { + sessionFactory = HibernateUtil.getSessionFactory(Strategy.SHARED_PRIMARY_KEY); + } + + @Before + public void setUp() { + session = sessionFactory.openSession(); + session.beginTransaction(); + } + + @Test + public void givenData_whenInsert_thenCreates1to1relationship() { + User user = new User(); + user.setUserName("alice@baeldung.com"); + + Address address = new Address(); + address.setStreet("SPK Street"); + address.setCity("SPK City"); + + address.setUser(user); + user.setAddress(address); + + //Address entry will automatically be created by hibernate, since cascade type is specified as ALL + session.persist(user); + session.getTransaction().commit(); + + assert1to1InsertedData(); + } + + + private void assert1to1InsertedData() { + @SuppressWarnings("unchecked") + List userList = session.createQuery("FROM User").list(); + assertNotNull(userList); + assertEquals(1, userList.size()); + + User user = userList.get(0); + assertEquals("alice@baeldung.com", user.getUserName()); + + Address address = user.getAddress(); + assertNotNull(address); + assertEquals("SPK Street", address.getStreet()); + assertEquals("SPK City", address.getCity()); + } + + @After + public void tearDown() { + session.close(); + } + + @AfterClass + public static void afterTests() { + sessionFactory.close(); + } +} diff --git a/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml b/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml new file mode 100644 index 0000000000..60417e312d --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml @@ -0,0 +1,16 @@ + + + + + org.h2.Driver + + jdbc:h2:mem:spring_hibernate_one_to_one + sa + org.hibernate.dialect.H2Dialect + thread + true + create-drop + + From ee6162e04b5394ce234c3e8c0cdd283bf26fa989 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 09:05:42 +0200 Subject: [PATCH 499/546] Update README.md (#5794) --- patterns/design-patterns/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/patterns/design-patterns/README.md b/patterns/design-patterns/README.md index ae372bd460..e56872b3fd 100644 --- a/patterns/design-patterns/README.md +++ b/patterns/design-patterns/README.md @@ -13,3 +13,4 @@ - [Interpreter Design Pattern in Java](http://www.baeldung.com/java-interpreter-pattern) - [State Design Pattern in Java](https://www.baeldung.com/java-state-design-pattern) - [The Decorator Pattern in Java](https://www.baeldung.com/java-decorator-pattern) +- [Abstract Factory Pattern in Java](https://www.baeldung.com/java-abstract-factory-pattern) From e98f2f4f605f8fb805609bbe6ecb664c699e3b57 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 10:27:43 +0200 Subject: [PATCH 500/546] Update README.md --- core-java-lang/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 79d2375c24..607abbcdc5 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -58,4 +58,3 @@ - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) - From 30bbc946d203b16c81b21c7bdbf4d12714a87830 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Fri, 30 Nov 2018 12:06:24 +0200 Subject: [PATCH 501/546] pom cleanup --- pom.xml | 1043 +++++++++++++++++-------------------------------------- 1 file changed, 316 insertions(+), 727 deletions(-) diff --git a/pom.xml b/pom.xml index 8fa93373fc..d149e07f57 100644 --- a/pom.xml +++ b/pom.xml @@ -323,207 +323,164 @@ parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin - asm - atomix - persistence-modules/apache-cayenne - aws - aws-lambda - akka-streams - algorithms-genetic - algorithms-miscellaneous-1 - algorithms-miscellaneous-2 - algorithms-sorting - annotations - apache-cxf - apache-fop - apache-geode - apache-poi - apache-tika - apache-thrift - apache-curator - apache-zookeeper - apache-opennlp - autovalue - axon - azure - bootique - cdi - java-strings - - core-java - core-java-lang - core-java-arrays - core-java-collections - java-collections-conversions - java-collections-maps - core-java-io - core-java-8 - java-streams - persistence-modules/core-java-persistence - core-kotlin - kotlin-libraries - core-groovy - core-java-concurrency - core-java-concurrency-collections - couchbase - persistence-modules/deltaspike - dozer - ethereum - feign - flips - testing-modules/groovy-spock - testing-modules/load-testing-comparison - google-cloud - google-web-toolkit - gson - guava - guava-collections - guava-modules/guava-18 - guava-modules/guava-19 - guava-modules/guava-21 - guice - disruptor - core-scala - spring-static-resources - hazelcast - persistence-modules/hbase - persistence-modules/hibernate5 - httpclient - hystrix - image-processing - immutables - persistence-modules/influxdb - jackson - persistence-modules/java-cassandra - vavr - java-lite - java-numbers - java-rmi - java-vavr-stream - javax-servlets - javaxval - jaxb - javafx - jgroups - jee-7 - jee-7-security - jhipster - jjwt - jsf - json-path - json - jsoup - testing-modules/junit-5 - - libraries - libraries-data - libraries-security - libraries-server - linkrest - logging-modules/log-mdc - logging-modules/log4j - logging-modules/log4j2 - logging-modules/logback - lombok - mapstruct - metrics - maven - mesos-marathon - msf4j - testing-modules/mockito - testing-modules/mockito-2 - testing-modules/mocks - mustache - mvn-wrapper - noexception - persistence-modules/orientdb - osgi - orika - patterns - pdf - protobuffer - persistence-modules/querydsl - reactor-core - persistence-modules/redis - testing-modules/rest-assured - testing-modules/rest-testing - resteasy - rxjava - rxjava-2 - spring-swagger-codegen - testing-modules/selenium-junit-testng - persistence-modules/solr - spark-java - spring-4 - spring-5 - spring-5-data-reactive - spring-5-reactive - spring-5-reactive-security - spring-5-reactive-client - spring-5-mvc - spring-5-security - spring-5-security-oauth - spring-5-reactive-oauth - spring-activiti - spring-akka - spring-amqp - spring-all - spring-amqp-simple - spring-apache-camel - spring-batch - spring-bom - spring-boot - spring-boot-client - spring-boot-keycloak - spring-boot-bootstrap - spring-boot-admin - spring-boot-camel - spring-boot-ops - persistence-modules/spring-boot-persistence - spring-boot-security - spring-boot-mvc - spring-boot-vue - spring-boot-logging-log4j2 - spring-boot-disable-console-logging - spring-cloud-data-flow - spring-cloud - spring-cloud-bus - spring-core - spring-cucumber - spring-ejb - spring-aop - persistence-modules/spring-data-cassandra - persistence-modules/spring-data-couchbase-2 - persistence-modules/spring-data-dynamodb - persistence-modules/spring-data-elasticsearch - persistence-modules/spring-data-jpa - persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb - persistence-modules/spring-data-neo4j - persistence-modules/spring-data-redis - spring-data-rest - persistence-modules/spring-data-solr - spring-dispatcher-servlet - spring-exceptions - spring-freemarker - persistence-modules/spring-hibernate-3 - persistence-modules/spring-hibernate4 - persistence-modules/spring-hibernate-5 - persistence-modules/spring-data-eclipselink - spring-integration - spring-jenkins-pipeline - spring-jersey - jmeter - spring-jms - spring-jooq - persistence-modules/spring-jpa - ddd - + parent-boot-2 + parent-spring-4 + parent-spring-5 + parent-java + parent-kotlin + + asm + atomix + aws + aws-lambda + akka-streams + algorithms-genetic + algorithms-miscellaneous-1 + algorithms-miscellaneous-2 + algorithms-sorting + annotations + apache-cxf + apache-fop + apache-poi + apache-tika + apache-thrift + apache-curator + apache-zookeeper + apache-opennlp + autovalue + axon + azure + apache-velocity + apache-solrj + apache-meecrowave + antlr + + bootique + + cdi + core-java-collections + core-java-io + core-java-8 + core-groovy + couchbase + + dozer + disruptor + drools + deeplearning4j + + ethereum + + feign + flips + + google-cloud + gson + guava + guava-collections + guava-modules/guava-18 + guava-modules/guava-19 + guava-modules/guava-21 + guice + + hazelcast + hystrix + httpclient + + image-processing + immutables + + jackson + java-strings + + java-collections-conversions + java-collections-maps + java-streams + java-lite + java-numbers + java-rmi + java-vavr-stream + javax-servlets + javaxval + jaxb + javafx + jgroups + jee-7 + jee-7-security + jjwt + jsf + json-path + json + jsoup + jta + jws + jersey + java-spi + java-ee-8-security-api + + libraries-data + linkrest + logging-modules/log-mdc + logging-modules/log4j + logging-modules/logback + lombok + lucene + + mapstruct + maven + mesos-marathon + msf4j + mustache + mvn-wrapper + mybatis + metrics + maven-archetype + + noexception + + osgi + orika + + patterns + pdf + protobuffer + performance-tests + + persistence-modules/java-jdbi + persistence-modules/redis + persistence-modules/orientdb + persistence-modules/querydsl + persistence-modules/apache-cayenne + persistence-modules/solr + persistence-modules/spring-data-dynamodb + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-neo4j + persistence-modules/spring-data-solr + persistence-modules/spring-hibernate-5 + persistence-modules/spring-data-eclipselink + persistence-modules/spring-jpa + persistence-modules/spring-hibernate-3 + persistence-modules/spring-data-gemfire + persistence-modules/spring-boot-persistence + persistence-modules/liquibase + persistence-modules/java-cockroachdb + persistence-modules/deltaspike + persistence-modules/hbase + persistence-modules/influxdb + persistence-modules/spring-hibernate4 + + reactor-core + resteasy + rxjava + rxjava-2 + rabbitmq + + + + persistence-modules/spring-data-mongodb + @@ -562,148 +519,50 @@ parent-java parent-kotlin - spring-session - spring-sleuth - spring-social-login - spring-spel - spring-state-machine - spring-thymeleaf - spring-userservice - spring-zuul - spring-remoting - spring-reactor - spring-vertx - spring-jinq - spring-rest-embedded-tomcat - testing-modules/testing - testing-modules/testng - video-tutorials - xml - xmlunit-2 - struts-2 - apache-velocity - apache-solrj - rabbitmq - vertx - persistence-modules/spring-data-gemfire - mybatis - spring-drools - drools - persistence-modules/liquibase - spring-boot-property-exp - testing-modules/mockserver - testing-modules/test-containers - undertow - vaadin - vertx-and-rxjava - saas - deeplearning4j - lucene - vraptor - persistence-modules/java-cockroachdb - spring-security-thymeleaf - persistence-modules/java-jdbi - jersey - java-spi - performance-tests - twilio - spring-boot-ctx-fluent - java-ee-8-security-api - spring-webflux-amqp - antlr - maven-archetype - optaplanner - apache-meecrowave - spring-reactive-kotlin - persistence-modules/jnosql - spring-boot-angular-ecommerce - jta - - java-websocket - persistence-modules/activejdbc - animal-sniffer-mvn-plugin - apache-avro - apache-bval - apache-shiro - apache-spark - asciidoctor - checker-plugin - - - core-java-sun - custom-pmd - dagger - data-structures - dubbo - persistence-modules/flyway - - JGit - jni - jooby - - - - ratpack - rest-with-spark-java - spring-boot-autoconfiguration - spring-boot-custom-starter - spring-boot-jasypt - spring-data-rest-querydsl - spring-groovy - spring-mobile - spring-mustache - spring-mvc-simple - spring-mybatis - spring-rest-hal-browser - spring-rest-shell - spring-rest-template - spring-roo - spring-security-stormpath - sse-jaxrs - static-analysis - stripe - structurizr - Twitter4J - wicket - xstream - cas/cas-secured-app - cas/cas-server - graphql/graphql-java - - - - - spring-boot-custom-starter/greeter - persistence-modules/spring-boot-h2/spring-boot-h2-database - - flyway-cdi-extension + spring-4 + spring-5 + spring-5-reactive + spring-5-reactive-security + spring-5-reactive-client + spring-5-mvc + spring-5-security + spring-5-security-oauth + spring-activiti + spring-akka + spring-amqp + spring-all + spring-apache-camel + spring-batch + spring-bom - spring-security-acl - spring-security-cache-control - spring-security-client/spring-security-jsp-authentication - spring-security-client/spring-security-jsp-authorize - spring-security-client/spring-security-jsp-config - spring-security-client/spring-security-mvc - spring-security-client/spring-security-thymeleaf-authentication - spring-security-client/spring-security-thymeleaf-authorize - spring-security-client/spring-security-thymeleaf-config - spring-security-core - spring-security-mvc-boot - spring-security-mvc-custom - spring-security-mvc-digest-auth - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc-session - spring-security-mvc-socket - spring-security-openid - spring-security-react - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-rest - spring-security-sso - spring-security-x509 + spring-boot-keycloak + spring-boot-bootstrap + spring-boot-admin + spring-boot-camel + spring-boot-security + spring-boot-mvc + spring-boot-logging-log4j2 + spring-boot-disable-console-logging + spring-cloud-data-flow + spring-cloud + spring-cloud-bus + spring-core + spring-cucumber + spring-ejb + spring-aop + + spring-data-rest + spring-dispatcher-servlet + spring-exceptions + spring-freemarker + + spring-integration + spring-jenkins-pipeline + spring-jersey + + spring-jms + spring-jooq spring-kafka spring-katharsis spring-ldap @@ -721,49 +580,118 @@ spring-rest-full spring-rest-query-language spring-rest - spring-rest-simple spring-resttemplate - helidon - - - - - - default-third - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 3 - true - - **/*IntegrationTest.java - **/*IntTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - **/*JdbcTest.java - **/*LiveTest.java - - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin + spring-rest-simple + spring-security-acl + spring-security-cache-control + spring-security-client/spring-security-jsp-authentication + spring-security-client/spring-security-jsp-authorize + spring-security-client/spring-security-jsp-config + spring-security-client/spring-security-mvc + spring-security-client/spring-security-thymeleaf-authentication + spring-security-client/spring-security-thymeleaf-authorize + spring-security-client/spring-security-thymeleaf-config + spring-security-core + spring-security-mvc-boot + spring-security-mvc-digest-auth + spring-security-mvc-ldap + spring-security-mvc-login + spring-security-mvc-persisted-remember-me + spring-security-mvc-session + spring-security-mvc-socket + spring-security-openid + + spring-security-rest-basic-auth + spring-security-rest-custom + spring-security-rest + spring-security-sso + spring-security-x509 + spring-session + spring-sleuth + spring-social-login + spring-spel + spring-state-machine + spring-thymeleaf + spring-userservice + spring-zuul + spring-remoting + spring-reactor + spring-vertx + spring-vault + spring-jinq + spring-rest-embedded-tomcat + spring-static-resources + spring-swagger-codegen + spring-drools + spring-boot-property-exp + spring-security-thymeleaf + spring-boot-ctx-fluent + spring-webflux-amqp + + spark-java + saas + struts-2 + + testing-modules/selenium-junit-testng + testing-modules/groovy-spock + testing-modules/mockito + testing-modules/mockito-2 + testing-modules/mocks + testing-modules/rest-assured + testing-modules/rest-testing + testing-modules/junit-5 + testing-modules/junit5-migration + testing-modules/testing + testing-modules/testng + testing-modules/mockserver + testing-modules/test-containers + twilio + + undertow + + video-tutorials + vaadin + vertx-and-rxjava + vraptor + vertx + vavr + + xmlunit-2 + xml + + + + + + + spring-boot + spring-boot-ops + core-kotlin + core-java + google-web-toolkit + spring-security-mvc-custom + core-java-concurrency + --> + + + + @@ -1140,6 +1068,7 @@ parent-kotlin spring-4 + spring-5 spring-5-reactive spring-5-reactive-security spring-5-reactive-client @@ -1248,45 +1177,6 @@ spring-boot-ctx-fluent spring-webflux-amqp - - - - - - - - - integration-lite-third - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin spark-java saas @@ -1338,320 +1228,19 @@ testing-modules/gatling spring-boot spring-boot-ops - spring-5 core-kotlin core-java google-web-toolkit spring-security-mvc-custom core-java-concurrency --> - - - - - - - - integration - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin - - - - - - - - - - testing-modules/mockito - testing-modules/mockito-2 - testing-modules/mocks - mustache - mvn-wrapper - noexception - persistence-modules/orientdb - osgi - orika - patterns - pdf - protobuffer - persistence-modules/querydsl - reactor-core - persistence-modules/redis - testing-modules/rest-assured - testing-modules/rest-testing - resteasy - rxjava - rxjava-2 - spring-swagger-codegen - testing-modules/selenium-junit-testng - persistence-modules/solr - spark-java - spring-4 - spring-5 - spring-5-data-reactive - spring-5-reactive - spring-5-reactive-security - spring-5-reactive-client - spring-5-mvc - spring-5-security - spring-5-security-oauth - spring-activiti - spring-akka - spring-amqp - spring-all + + + - - - - spring-bom - spring-boot - spring-boot-client - spring-boot-keycloak - spring-boot-bootstrap - spring-boot-admin - spring-boot-camel - spring-boot-ops - persistence-modules/spring-boot-persistence - spring-boot-security - spring-boot-mvc - spring-boot-logging-log4j2 - spring-boot-disable-console-logging - spring-cloud-data-flow - spring-cloud - spring-cloud-bus - spring-core - spring-cucumber - spring-ejb - spring-aop - persistence-modules/spring-data-cassandra - persistence-modules/spring-data-couchbase-2 - persistence-modules/spring-data-dynamodb - persistence-modules/spring-data-elasticsearch - persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb - persistence-modules/spring-data-jpa - persistence-modules/spring-data-neo4j - persistence-modules/spring-data-redis - spring-data-rest - - - - - - - persistence-modules/spring-data-solr - spring-dispatcher-servlet - spring-exceptions - spring-freemarker - persistence-modules/spring-hibernate-3 - persistence-modules/spring-hibernate4 - persistence-modules/spring-hibernate-5 - persistence-modules/spring-data-eclipselink - spring-integration - spring-jenkins-pipeline - spring-jersey - spring-jms - spring-jooq - persistence-modules/spring-jpa - spring-kafka - spring-katharsis - spring-ldap - spring-mockito - spring-mvc-forms-jsp - spring-mvc-forms-thymeleaf - spring-mvc-java - spring-mvc-velocity - spring-mvc-webflow - spring-mvc-xml - spring-mvc-kotlin - spring-protobuf - spring-quartz - spring-rest-angular - spring-rest-full - spring-rest-query-language - spring-rest - spring-resttemplate - spring-rest-simple - spring-reactive-kotlin - - - - - - - - - - - - - - - - java-websocket - persistence-modules/activejdbc - animal-sniffer-mvn-plugin - apache-avro - apache-bval - apache-shiro - apache-spark - asciidoctor - checker-plugin - - - core-java-sun - custom-pmd - dagger - data-structures - dubbo - persistence-modules/flyway - - - jni - jooby - - - - ratpack - rest-with-spark-java - spring-boot-autoconfiguration - spring-boot-custom-starter - spring-boot-jasypt - spring-data-rest-querydsl - spring-groovy - spring-mobile - spring-mustache - spring-mvc-simple - spring-mybatis - spring-rest-hal-browser - spring-rest-shell - spring-rest-template - spring-roo - spring-security-stormpath - sse-jaxrs - static-analysis - stripe - - - wicket - xstream - cas/cas-secured-app - - - - - - - - - - - - - - jenkins/hello-world - - - - spring-boot-custom-starter/greeter - persistence-modules/spring-boot-h2/spring-boot-h2-database - - - - + spring-5-data-reactive + --> + From 7be6c2f8de71a4e60f6177b2dd33d2d0c9c9098a Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Fri, 30 Nov 2018 13:10:10 +0200 Subject: [PATCH 502/546] minor pom cleanup --- pom.xml | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index d149e07f57..ef7a7f6b1d 100644 --- a/pom.xml +++ b/pom.xml @@ -468,6 +468,11 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 + persistence-modules/spring-data-mongodb + persistence-modules/java-cassandra + persistence-modules/spring-data-cassandra + persistence-modules/spring-data-couchbase-2 + persistence-modules/spring-data-redis reactor-core resteasy @@ -475,12 +480,6 @@ rxjava-2 rabbitmq - - - persistence-modules/spring-data-mongodb - @@ -600,7 +599,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -628,7 +627,7 @@ spring-security-thymeleaf spring-boot-ctx-fluent spring-webflux-amqp - + spark-java saas struts-2 @@ -662,12 +661,7 @@ @@ -1020,6 +1014,11 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 + persistence-modules/spring-data-mongodb + persistence-modules/java-cassandra + persistence-modules/spring-data-cassandra + persistence-modules/spring-data-couchbase-2 + persistence-modules/spring-data-redis reactor-core resteasy @@ -1027,12 +1026,6 @@ rxjava-2 rabbitmq - - - persistence-modules/spring-data-mongodb - @@ -1148,7 +1141,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From 55aff7f5f21fefbf89f8854b38f99813d1e5fd4e Mon Sep 17 00:00:00 2001 From: FrancoCorleone Date: Fri, 30 Nov 2018 13:35:27 +0100 Subject: [PATCH 503/546] Upgrading commons lang3 and guava dependencies (#5790) * Upgrading Guava package * Upgrading commons lang3 package --- java-strings/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-strings/pom.xml b/java-strings/pom.xml index ab94c28d4d..f4fb1c0865 100755 --- a/java-strings/pom.xml +++ b/java-strings/pom.xml @@ -122,13 +122,13 @@ - 3.5 + 3.8.1 1.10 3.6.1 1.19 61.1 - 26.0-jre + 27.0.1-jre From a797be29bd1a75868e9714d3a84c0f86260a79cc Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Fri, 30 Nov 2018 18:43:11 +0200 Subject: [PATCH 504/546] temporarily disabling the module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ef7a7f6b1d..da17fc2931 100644 --- a/pom.xml +++ b/pom.xml @@ -599,7 +599,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -1141,7 +1141,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From 4058bfc60114b9a32e69474bfb6e4b148ff06331 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 30 Nov 2018 22:16:08 +0530 Subject: [PATCH 505/546] BAEL-9567 Align module names, folder names and artifact id - Added "name" in pom.xml whereever it was missing and aligned the present ones with the artifactid and foldername --- algorithms-genetic/pom.xml | 4 +-- algorithms-miscellaneous-1/pom.xml | 4 +-- algorithms-miscellaneous-2/pom.xml | 2 +- algorithms-sorting/pom.xml | 2 +- annotations/annotation-processing/pom.xml | 3 +- annotations/annotation-user/pom.xml | 1 + annotations/pom.xml | 3 +- apache-avro/pom.xml | 3 +- apache-bval/pom.xml | 3 +- apache-curator/pom.xml | 1 + apache-cxf/cxf-aegis/pom.xml | 3 +- apache-cxf/cxf-introduction/pom.xml | 3 +- apache-cxf/cxf-jaxrs-implementation/pom.xml | 3 +- apache-cxf/cxf-spring/pom.xml | 1 + apache-cxf/pom.xml | 2 +- apache-cxf/sse-jaxrs/pom.xml | 2 +- apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml | 7 ++-- apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml | 8 ++--- apache-geode/pom.xml | 5 ++- apache-opennlp/pom.xml | 1 + apache-poi/pom.xml | 2 +- apache-pulsar/pom.xml | 33 ++++++++++--------- apache-shiro/pom.xml | 3 +- apache-thrift/pom.xml | 2 +- apache-tika/pom.xml | 4 +-- apache-zookeeper/pom.xml | 2 +- asm/pom.xml | 1 + atomix/pom.xml | 3 +- axon/pom.xml | 3 +- cas/cas-server/pom.xml | 3 +- cdi/pom.xml | 2 +- core-groovy/pom.xml | 1 + core-java-9/pom.xml | 1 - core-java/pom.xml | 2 +- core-kotlin/pom.xml | 1 + core-scala/pom.xml | 1 + data-structures/pom.xml | 2 +- drools/pom.xml | 3 +- dubbo/pom.xml | 1 + flyway-cdi-extension/pom.xml | 2 +- guava-modules/guava-18/pom.xml | 4 +-- guava-modules/guava-19/pom.xml | 4 +-- guava-modules/guava-21/pom.xml | 3 +- guest/core-java-9/pom.xml | 3 +- guest/core-java/pom.xml | 1 + guest/core-kotlin/pom.xml | 3 +- guest/deep-jsf/pom.xml | 1 + guest/junit5-example/pom.xml | 3 +- guest/log4j2-example/pom.xml | 3 +- guest/logback-example/pom.xml | 1 + guest/memory-leaks/pom.xml | 4 +-- guest/remote-debugging/pom.xml | 2 +- guest/slf4j/guide/pom.xml | 3 +- guest/slf4j/guide/slf4j-log4j/pom.xml | 2 +- guest/slf4j/guide/slf4j-log4j2/pom.xml | 2 +- guest/slf4j/guide/slf4j-logback/pom.xml | 2 +- guest/spring-boot-app/pom.xml | 1 + guest/spring-mvc/pom.xml | 2 +- guest/thread-pools/pom.xml | 3 +- guest/tomcat-app/pom.xml | 1 + guest/webservices/rest-client/pom.xml | 1 + guest/webservices/rest-server/pom.xml | 1 + guest/webservices/spring-rest-service/pom.xml | 1 + helidon/helidon-mp/pom.xml | 4 +-- helidon/helidon-se/pom.xml | 4 +-- helidon/pom.xml | 3 +- image-processing/pom.xml | 4 +-- immutables/pom.xml | 4 +-- .../app-auth-basic-store-db/pom.xml | 2 +- .../app-auth-custom-form-store-custom/pom.xml | 2 +- .../app-auth-custom-no-store/pom.xml | 2 +- .../app-auth-form-store-ldap/pom.xml | 2 +- java-ee-8-security-api/pom.xml | 1 + java-lite/pom.xml | 1 + java-rmi/pom.xml | 1 + java-spi/exchange-rate-api/pom.xml | 1 + java-spi/exchange-rate-app/pom.xml | 1 + java-spi/exchange-rate-impl/pom.xml | 1 + java-spi/pom.xml | 1 + java-vavr-stream/pom.xml | 1 + java-websocket/pom.xml | 4 +-- javafx/pom.xml | 3 +- javax-servlets/pom.xml | 1 + javaxval/pom.xml | 4 +-- jee-7/pom.xml | 1 + jenkins/hello-world/pom.xml | 4 +-- jersey/pom.xml | 2 +- jhipster/jhipster-microservice/pom.xml | 4 +-- jhipster/jhipster-monolithic/pom.xml | 1 + jni/pom.xml | 3 +- jsf/pom.xml | 1 + json/pom.xml | 3 +- jsoup/pom.xml | 1 + jta/pom.xml | 3 +- jws/pom.xml | 4 +-- kotlin-libraries/pom.xml | 1 + libraries-server/pom.xml | 3 +- linkrest/pom.xml | 2 +- logging-modules/log4j/pom.xml | 1 + logging-modules/log4j2/pom.xml | 3 +- maven-archetype/pom.xml | 3 +- .../maven-polyglot-json-extension/pom.xml | 4 +-- maven/pom.xml | 1 + maven/versions-maven-plugin/pom.xml | 5 +-- mesos-marathon/pom.xml | 3 +- metrics/pom.xml | 3 +- microprofile/pom.xml | 1 + msf4j/pom.xml | 1 + muleesb/pom.xml | 6 ++-- mybatis/pom.xml | 3 +- optaplanner/pom.xml | 7 ++-- parent-boot-1/pom.xml | 1 + parent-boot-2/pom.xml | 1 + patterns/design-patterns/pom.xml | 4 ++- patterns/front-controller/pom.xml | 1 + patterns/intercepting-filter/pom.xml | 2 +- patterns/pom.xml | 1 + performance-tests/pom.xml | 3 +- persistence-modules/hbase/pom.xml | 1 + persistence-modules/hibernate5/pom.xml | 1 + persistence-modules/java-cassandra/pom.xml | 1 + persistence-modules/java-cockroachdb/pom.xml | 1 + persistence-modules/java-jdbi/pom.xml | 1 + persistence-modules/java-jpa/pom.xml | 7 ++-- persistence-modules/java-mongodb/pom.xml | 1 + .../jnosql/jnosql-artemis/pom.xml | 6 ++-- .../jnosql/jnosql-diana/pom.xml | 6 ++-- persistence-modules/jnosql/pom.xml | 2 +- persistence-modules/liquibase/pom.xml | 1 + persistence-modules/orientdb/pom.xml | 2 +- .../spring-boot-h2-database/pom.xml | 2 +- .../spring-boot-persistence/pom.xml | 4 +-- .../spring-data-gemfire/pom.xml | 1 + persistence-modules/spring-data-jpa/pom.xml | 1 + .../spring-data-keyvalue/pom.xml | 1 + persistence-modules/spring-data-neo4j/pom.xml | 3 +- persistence-modules/spring-data-redis/pom.xml | 1 + protobuffer/pom.xml | 3 +- reactor-core/pom.xml | 4 +-- rxjava-2/pom.xml | 4 +-- rxjava/pom.xml | 4 +-- spring-5-data-reactive/pom.xml | 1 + spring-amqp-simple/pom.xml | 1 + spring-boot-admin/pom.xml | 1 + spring-boot-autoconfiguration/pom.xml | 2 +- spring-boot-camel/pom.xml | 3 +- spring-boot-crud/pom.xml | 2 +- spring-boot-ctx-fluent/pom.xml | 2 +- .../greeter-library/pom.xml | 3 +- .../greeter-spring-boot-autoconfigure/pom.xml | 2 +- .../greeter-spring-boot-sample-app/pom.xml | 2 +- .../greeter-spring-boot-starter/pom.xml | 2 +- spring-boot-custom-starter/greeter/pom.xml | 3 +- spring-boot-custom-starter/pom.xml | 1 + .../disabling-console-jul/pom.xml | 2 +- .../disabling-console-log4j2/pom.xml | 2 +- .../disabling-console-logback/pom.xml | 4 ++- spring-boot-disable-console-logging/pom.xml | 1 + spring-boot-logging-log4j2/pom.xml | 2 +- .../property-exp-custom-config/pom.xml | 3 +- .../property-exp-default-config/pom.xml | 3 +- spring-cloud-bus/pom.xml | 1 + spring-cloud-data-flow/etl/pom.xml | 3 +- spring-cloud-data-flow/pom.xml | 3 +- .../dynamodb-config/pom.xml | 1 + .../spring-cloud-archaius/jdbc-config/pom.xml | 1 + .../zookeeper-config/pom.xml | 1 + spring-cloud/spring-cloud-aws/pom.xml | 2 +- .../spring-cloud-bootstrap/config/pom.xml | 1 + .../spring-cloud-bootstrap/discovery/pom.xml | 2 +- .../spring-cloud-bootstrap/gateway/pom.xml | 1 + spring-cloud/spring-cloud-bootstrap/pom.xml | 1 + .../spring-cloud-bootstrap/svc-book/pom.xml | 2 +- .../spring-cloud-bootstrap/svc-rating/pom.xml | 2 +- .../spring-cloud-bootstrap/zipkin/pom.xml | 1 + .../spring-cloud-config/client/pom.xml | 5 +-- spring-cloud/spring-cloud-config/pom.xml | 1 + .../spring-cloud-config/server/pom.xml | 5 +-- .../spring-cloud-connectors-heroku/pom.xml | 1 + spring-cloud/spring-cloud-contract/pom.xml | 1 + spring-cloud/spring-cloud-eureka/pom.xml | 2 +- .../spring-cloud-eureka-client/pom.xml | 4 +-- .../spring-cloud-eureka-feign-client/pom.xml | 2 +- .../spring-cloud-eureka-server/pom.xml | 2 +- spring-cloud/spring-cloud-functions/pom.xml | 6 ++-- spring-cloud/spring-cloud-gateway/pom.xml | 2 +- .../demo-backend/pom.xml | 3 +- .../demo-frontend/pom.xml | 3 +- spring-cloud/spring-cloud-kubernetes/pom.xml | 2 +- .../spring-cloud-security/auth-server/pom.xml | 1 + spring-cloud/spring-cloud-task/pom.xml | 1 + spring-cloud/spring-cloud-zookeeper/pom.xml | 3 +- .../eureka-client/pom.xml | 2 +- .../eureka-server/pom.xml | 2 +- .../pom.xml | 2 +- .../zuul-server/pom.xml | 1 + spring-drools/pom.xml | 3 +- spring-ejb/spring-ejb-remote/pom.xml | 3 +- spring-ejb/wildfly/pom.xml | 4 +-- spring-ejb/wildfly/widlfly-web/pom.xml | 3 +- spring-ejb/wildfly/wildfly-ear/pom.xml | 3 +- .../wildfly/wildfly-ejb-interfaces/pom.xml | 3 +- spring-ejb/wildfly/wildfly-ejb/pom.xml | 3 +- spring-ejb/wildfly/wildfly-jpa/pom.xml | 3 +- spring-freemarker/pom.xml | 2 +- spring-jersey/pom.xml | 3 +- spring-jooq/pom.xml | 3 +- spring-katharsis/pom.xml | 3 +- spring-ldap/pom.xml | 1 + spring-mvc-simple/pom.xml | 3 +- spring-mybatis/pom.xml | 3 +- spring-reactive-kotlin/pom.xml | 2 +- .../remoting-hessian-burlap/pom.xml | 1 + .../remoting-hessian-burlap-client/pom.xml | 11 ++++--- .../remoting-hessian-burlap-server/pom.xml | 7 ++-- spring-remoting/remoting-http/pom.xml | 4 ++- .../remoting-http-client/pom.xml | 1 + .../remoting-http-server/pom.xml | 1 + spring-remoting/remoting-jms/pom.xml | 10 +++--- .../remoting-jms/remoting-jms-client/pom.xml | 7 ++-- .../remoting-jms/remoting-jms-server/pom.xml | 7 ++-- spring-remoting/remoting-rmi/pom.xml | 3 +- .../remoting-rmi/remoting-rmi-client/pom.xml | 9 ++--- .../remoting-rmi/remoting-rmi-server/pom.xml | 7 ++-- spring-rest-hal-browser/pom.xml | 3 +- spring-roo/pom.xml | 2 +- spring-security-angular/server/pom.xml | 4 +-- spring-security-cache-control/pom.xml | 2 +- .../pom.xml | 2 +- spring-security-x509/pom.xml | 3 +- .../spring-security-x509-basic-auth/pom.xml | 3 +- .../spring-security-x509-client-auth/pom.xml | 3 +- spring-session/spring-session-redis/pom.xml | 1 + spring-sleuth/pom.xml | 3 +- spring-spel/pom.xml | 2 +- spring-state-machine/pom.xml | 3 +- spring-swagger-codegen/pom.xml | 1 + .../spring-swagger-codegen-app/pom.xml | 3 +- spring-thymeleaf/pom.xml | 1 + spring-userservice/pom.xml | 4 +-- spring-vertx/pom.xml | 3 +- sse-jaxrs/pom.xml | 2 +- sse-jaxrs/sse-jaxrs-client/pom.xml | 4 +-- sse-jaxrs/sse-jaxrs-server/pom.xml | 8 ++--- static-analysis/pom.xml | 2 +- structurizr/pom.xml | 2 +- struts-2/pom.xml | 2 +- testing-modules/gatling/pom.xml | 3 +- testing-modules/groovy-spock/pom.xml | 1 + .../load-testing-comparison/pom.xml | 7 ++-- testing-modules/mockito-2/pom.xml | 2 +- testing-modules/mockserver/pom.xml | 3 +- testing-modules/parallel-tests-junit/pom.xml | 2 ++ testing-modules/selenium-junit-testng/pom.xml | 3 +- twilio/pom.xml | 3 +- vertx-and-rxjava/pom.xml | 3 +- video-tutorials/jackson-annotations/pom.xml | 3 +- vraptor/pom.xml | 2 +- xmlunit-2/pom.xml | 1 + 259 files changed, 421 insertions(+), 279 deletions(-) diff --git a/algorithms-genetic/pom.xml b/algorithms-genetic/pom.xml index 2a10a81980..662e0c5913 100644 --- a/algorithms-genetic/pom.xml +++ b/algorithms-genetic/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung algorithms-genetic 0.0.1-SNAPSHOT - + algorithms-genetic + com.baeldung parent-modules diff --git a/algorithms-miscellaneous-1/pom.xml b/algorithms-miscellaneous-1/pom.xml index 16749d452e..75b031282b 100644 --- a/algorithms-miscellaneous-1/pom.xml +++ b/algorithms-miscellaneous-1/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung algorithms-miscellaneous-1 0.0.1-SNAPSHOT - + algorithms-miscellaneous-1 + com.baeldung parent-modules diff --git a/algorithms-miscellaneous-2/pom.xml b/algorithms-miscellaneous-2/pom.xml index eeae544612..25472d4888 100644 --- a/algorithms-miscellaneous-2/pom.xml +++ b/algorithms-miscellaneous-2/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung algorithms-miscellaneous-2 0.0.1-SNAPSHOT + algorithms-miscellaneous-2 com.baeldung diff --git a/algorithms-sorting/pom.xml b/algorithms-sorting/pom.xml index 60ae37f2a4..2aee6e9199 100644 --- a/algorithms-sorting/pom.xml +++ b/algorithms-sorting/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung algorithms-sorting 0.0.1-SNAPSHOT + algorithms-sorting com.baeldung diff --git a/annotations/annotation-processing/pom.xml b/annotations/annotation-processing/pom.xml index 8e53334521..d9aca6040d 100644 --- a/annotations/annotation-processing/pom.xml +++ b/annotations/annotation-processing/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 annotation-processing - + annotation-processing + com.baeldung 1.0.0-SNAPSHOT diff --git a/annotations/annotation-user/pom.xml b/annotations/annotation-user/pom.xml index 07ea9a5b5a..422cc7f119 100644 --- a/annotations/annotation-user/pom.xml +++ b/annotations/annotation-user/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 annotation-user + annotation-user annotations diff --git a/annotations/pom.xml b/annotations/pom.xml index 2c73d3d91b..6d83f5b057 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -4,7 +4,8 @@ 4.0.0 annotations pom - + annotations + parent-modules com.baeldung diff --git a/apache-avro/pom.xml b/apache-avro/pom.xml index ddf5844271..18f9c34d64 100644 --- a/apache-avro/pom.xml +++ b/apache-avro/pom.xml @@ -3,10 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung apache-avro 0.0.1-SNAPSHOT - Apache Avro + apache-avro UTF-8 diff --git a/apache-bval/pom.xml b/apache-bval/pom.xml index 5ddb1ecb59..786f587fb1 100644 --- a/apache-bval/pom.xml +++ b/apache-bval/pom.xml @@ -4,7 +4,8 @@ apache-bval apache-bval 0.0.1-SNAPSHOT - + apache-bval + com.baeldung parent-modules diff --git a/apache-curator/pom.xml b/apache-curator/pom.xml index ac10811e7a..bcca38b199 100644 --- a/apache-curator/pom.xml +++ b/apache-curator/pom.xml @@ -4,6 +4,7 @@ apache-curator 0.0.1-SNAPSHOT jar + apache-curator com.baeldung diff --git a/apache-cxf/cxf-aegis/pom.xml b/apache-cxf/cxf-aegis/pom.xml index b7e9e426a2..1d36178b82 100644 --- a/apache-cxf/cxf-aegis/pom.xml +++ b/apache-cxf/cxf-aegis/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-aegis - + cxf-aegis + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-introduction/pom.xml b/apache-cxf/cxf-introduction/pom.xml index a9e82c16b3..17f03afd25 100644 --- a/apache-cxf/cxf-introduction/pom.xml +++ b/apache-cxf/cxf-introduction/pom.xml @@ -4,7 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-introduction - + cxf-introduction + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-jaxrs-implementation/pom.xml b/apache-cxf/cxf-jaxrs-implementation/pom.xml index 89acbdf1bd..03d0f67c90 100644 --- a/apache-cxf/cxf-jaxrs-implementation/pom.xml +++ b/apache-cxf/cxf-jaxrs-implementation/pom.xml @@ -4,7 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-jaxrs-implementation - + cxf-jaxrs-implementation + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-spring/pom.xml b/apache-cxf/cxf-spring/pom.xml index 31e75e7cdd..97715af54c 100644 --- a/apache-cxf/cxf-spring/pom.xml +++ b/apache-cxf/cxf-spring/pom.xml @@ -3,6 +3,7 @@ 4.0.0 cxf-spring war + cxf-spring com.baeldung diff --git a/apache-cxf/pom.xml b/apache-cxf/pom.xml index 8918fd4450..0016f33d70 100644 --- a/apache-cxf/pom.xml +++ b/apache-cxf/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-cxf 0.0.1-SNAPSHOT + apache-cxf pom diff --git a/apache-cxf/sse-jaxrs/pom.xml b/apache-cxf/sse-jaxrs/pom.xml index d4b6c19d03..cb5c96660a 100644 --- a/apache-cxf/sse-jaxrs/pom.xml +++ b/apache-cxf/sse-jaxrs/pom.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - sse-jaxrs + sse-jaxrs pom diff --git a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml index 0f5406fbc7..c7acf22c32 100644 --- a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml +++ b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml @@ -3,15 +3,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + sse-jaxrs-client + sse-jaxrs-client + com.baeldung sse-jaxrs 0.0.1-SNAPSHOT - sse-jaxrs-client - 3.2.0 @@ -21,7 +21,6 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 singleEvent diff --git a/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml b/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml index 2e82dc3829..eeb5726ee1 100644 --- a/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml +++ b/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml @@ -3,16 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + sse-jaxrs-server + sse-jaxrs-server + war + com.baeldung sse-jaxrs 0.0.1-SNAPSHOT - sse-jaxrs-server - war - 2.4.2 false diff --git a/apache-geode/pom.xml b/apache-geode/pom.xml index a3f6604ac4..738accdcb8 100644 --- a/apache-geode/pom.xml +++ b/apache-geode/pom.xml @@ -3,11 +3,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - com.baeldung apache-geode 1.0-SNAPSHOT - + apache-geode + com.baeldung parent-modules diff --git a/apache-opennlp/pom.xml b/apache-opennlp/pom.xml index 985c9a2df2..6b2e6a9729 100644 --- a/apache-opennlp/pom.xml +++ b/apache-opennlp/pom.xml @@ -4,6 +4,7 @@ 4.0.0 apache-opennlp 1.0-SNAPSHOT + apache-opennlp jar diff --git a/apache-poi/pom.xml b/apache-poi/pom.xml index a1ec626d43..54c3e8e928 100644 --- a/apache-poi/pom.xml +++ b/apache-poi/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-poi 0.0.1-SNAPSHOT + apache-poi com.baeldung diff --git a/apache-pulsar/pom.xml b/apache-pulsar/pom.xml index da004a7638..a4c09586eb 100644 --- a/apache-pulsar/pom.xml +++ b/apache-pulsar/pom.xml @@ -1,21 +1,22 @@ - 4.0.0 - com.baeldung.pulsar - pulsar-java - 0.0.1 + 4.0.0 + com.baeldung.pulsar + apache-pulsar + 0.0.1 + apache-pulsar - - - org.apache.pulsar - pulsar-client - 2.1.1-incubating - compile - - - - 1.8 - 1.8 - + + + org.apache.pulsar + pulsar-client + 2.1.1-incubating + compile + + + + 1.8 + 1.8 + diff --git a/apache-shiro/pom.xml b/apache-shiro/pom.xml index 98d9563284..644d70b30a 100644 --- a/apache-shiro/pom.xml +++ b/apache-shiro/pom.xml @@ -5,7 +5,8 @@ 4.0.0 apache-shiro 1.0-SNAPSHOT - + apache-shiro + parent-boot-1 com.baeldung diff --git a/apache-thrift/pom.xml b/apache-thrift/pom.xml index b22364cb19..ab54fc2cef 100644 --- a/apache-thrift/pom.xml +++ b/apache-thrift/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-thrift 0.0.1-SNAPSHOT + apache-thrift pom diff --git a/apache-tika/pom.xml b/apache-tika/pom.xml index 5a76fdeeda..0399914a5f 100644 --- a/apache-tika/pom.xml +++ b/apache-tika/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung apache-tika 0.0.1-SNAPSHOT - + apache-tika + com.baeldung parent-modules diff --git a/apache-zookeeper/pom.xml b/apache-zookeeper/pom.xml index 0b29186ccc..53e4217358 100644 --- a/apache-zookeeper/pom.xml +++ b/apache-zookeeper/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-zookeeper 0.0.1-SNAPSHOT + apache-zookeeper jar diff --git a/asm/pom.xml b/asm/pom.xml index 5aad2a0e37..e56438c808 100644 --- a/asm/pom.xml +++ b/asm/pom.xml @@ -5,6 +5,7 @@ com.baeldung.examples asm 1.0 + asm jar diff --git a/atomix/pom.xml b/atomix/pom.xml index f85d2d7484..e50c1d867f 100644 --- a/atomix/pom.xml +++ b/atomix/pom.xml @@ -4,7 +4,8 @@ com.atomix.io atomix 0.0.1-SNAPSHOT - + atomix + com.baeldung parent-modules diff --git a/axon/pom.xml b/axon/pom.xml index 915a04feb5..c643ea9e57 100644 --- a/axon/pom.xml +++ b/axon/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 axon - + axon + parent-modules com.baeldung diff --git a/cas/cas-server/pom.xml b/cas/cas-server/pom.xml index 9b61aaec3d..98f5f10493 100644 --- a/cas/cas-server/pom.xml +++ b/cas/cas-server/pom.xml @@ -3,8 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd "> 4.0.0 cas-server - war 1.0 + cas-server + war parent-boot-1 diff --git a/cdi/pom.xml b/cdi/pom.xml index 0b735e0ca5..0cf5062ccc 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - com.baeldung cdi 1.0-SNAPSHOT + cdi com.baeldung diff --git a/core-groovy/pom.xml b/core-groovy/pom.xml index 909250710e..e54c766280 100644 --- a/core-groovy/pom.xml +++ b/core-groovy/pom.xml @@ -4,6 +4,7 @@ 4.0.0 core-groovy 1.0-SNAPSHOT + core-groovy jar diff --git a/core-java-9/pom.xml b/core-java-9/pom.xml index f22d0a3ed9..cd1fa74dbb 100644 --- a/core-java-9/pom.xml +++ b/core-java-9/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-9 0.2-SNAPSHOT core-java-9 diff --git a/core-java/pom.xml b/core-java/pom.xml index 9fbc8f6810..64345ab14c 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -3,8 +3,8 @@ 4.0.0 core-java 0.1.0-SNAPSHOT - jar core-java + jar com.baeldung diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml index 2b559b19e0..ed79ebc01b 100644 --- a/core-kotlin/pom.xml +++ b/core-kotlin/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 core-kotlin + core-kotlin jar diff --git a/core-scala/pom.xml b/core-scala/pom.xml index eb7c1c3330..343f21484a 100644 --- a/core-scala/pom.xml +++ b/core-scala/pom.xml @@ -4,6 +4,7 @@ 4.0.0 core-scala 1.0-SNAPSHOT + core-scala jar diff --git a/data-structures/pom.xml b/data-structures/pom.xml index c1a1f1d371..4958598234 100644 --- a/data-structures/pom.xml +++ b/data-structures/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung data-structures 0.0.1-SNAPSHOT + data-structures com.baeldung diff --git a/drools/pom.xml b/drools/pom.xml index 009ac8acec..b5cfc7d6dc 100644 --- a/drools/pom.xml +++ b/drools/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 drools - + drools + com.baeldung parent-spring-4 diff --git a/dubbo/pom.xml b/dubbo/pom.xml index 6f81ec5cff..9fe228bf89 100644 --- a/dubbo/pom.xml +++ b/dubbo/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 dubbo + dubbo parent-modules diff --git a/flyway-cdi-extension/pom.xml b/flyway-cdi-extension/pom.xml index c6ee26f783..dbb32f1e5a 100644 --- a/flyway-cdi-extension/pom.xml +++ b/flyway-cdi-extension/pom.xml @@ -3,10 +3,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung flyway-cdi-extension 1.0-SNAPSHOT + flyway-cdi-extension 1.8 diff --git a/guava-modules/guava-18/pom.xml b/guava-modules/guava-18/pom.xml index ce9395fbf4..d55aa9ce82 100644 --- a/guava-modules/guava-18/pom.xml +++ b/guava-modules/guava-18/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung guava-18 0.1.0-SNAPSHOT - + guava-18 + com.baeldung parent-java diff --git a/guava-modules/guava-19/pom.xml b/guava-modules/guava-19/pom.xml index 5dfb4d2cec..0548bb0c1f 100644 --- a/guava-modules/guava-19/pom.xml +++ b/guava-modules/guava-19/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung guava-19 0.1.0-SNAPSHOT - + guava-19 + com.baeldung parent-java diff --git a/guava-modules/guava-21/pom.xml b/guava-modules/guava-21/pom.xml index 945b7c27c1..bdb1058a48 100644 --- a/guava-modules/guava-21/pom.xml +++ b/guava-modules/guava-21/pom.xml @@ -4,7 +4,8 @@ 4.0.0 guava-21 1.0-SNAPSHOT - + guava-21 + com.baeldung parent-java diff --git a/guest/core-java-9/pom.xml b/guest/core-java-9/pom.xml index e9271b42ff..3847c19d16 100644 --- a/guest/core-java-9/pom.xml +++ b/guest/core-java-9/pom.xml @@ -4,7 +4,8 @@ com.stackify core-java-9 0.0.1-SNAPSHOT - + core-java-9 + com.baeldung parent-modules diff --git a/guest/core-java/pom.xml b/guest/core-java/pom.xml index 787dd764a1..5057f7eaed 100644 --- a/guest/core-java/pom.xml +++ b/guest/core-java/pom.xml @@ -4,6 +4,7 @@ com.stackify core-java 0.0.1-SNAPSHOT + core-java com.baeldung diff --git a/guest/core-kotlin/pom.xml b/guest/core-kotlin/pom.xml index 6b189143a4..a57dd28ffd 100644 --- a/guest/core-kotlin/pom.xml +++ b/guest/core-kotlin/pom.xml @@ -6,7 +6,8 @@ 1.0-SNAPSHOT com.stackify jar - + core-kotlin + jcenter diff --git a/guest/deep-jsf/pom.xml b/guest/deep-jsf/pom.xml index e09b5e0606..12426a8833 100644 --- a/guest/deep-jsf/pom.xml +++ b/guest/deep-jsf/pom.xml @@ -4,6 +4,7 @@ com.stackify deep-jsf 0.0.1-SNAPSHOT + deep-jsf war diff --git a/guest/junit5-example/pom.xml b/guest/junit5-example/pom.xml index 457fb1fcaa..7c0cc3e776 100644 --- a/guest/junit5-example/pom.xml +++ b/guest/junit5-example/pom.xml @@ -4,7 +4,8 @@ junit5-example junit5-example 0.0.1-SNAPSHOT - + junit5-example + com.baeldung parent-modules diff --git a/guest/log4j2-example/pom.xml b/guest/log4j2-example/pom.xml index f64869879f..ab55e0b60e 100644 --- a/guest/log4j2-example/pom.xml +++ b/guest/log4j2-example/pom.xml @@ -4,7 +4,8 @@ log4j2-example log4j2-example 0.0.1-SNAPSHOT - + log4j2-example + com.baeldung parent-modules diff --git a/guest/logback-example/pom.xml b/guest/logback-example/pom.xml index 04de6a00a2..6e9fe0ddea 100644 --- a/guest/logback-example/pom.xml +++ b/guest/logback-example/pom.xml @@ -4,6 +4,7 @@ com.stackify logback-example 0.0.1-SNAPSHOT + logback-example com.baeldung diff --git a/guest/memory-leaks/pom.xml b/guest/memory-leaks/pom.xml index 956ae9c408..f1d411acbc 100644 --- a/guest/memory-leaks/pom.xml +++ b/guest/memory-leaks/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung memory-leaks 0.0.1-SNAPSHOT - + memory-leaks + com.baeldung parent-modules diff --git a/guest/remote-debugging/pom.xml b/guest/remote-debugging/pom.xml index 974421de97..07b9cc49d8 100644 --- a/guest/remote-debugging/pom.xml +++ b/guest/remote-debugging/pom.xml @@ -5,8 +5,8 @@ com.stackify remote-debugging 0.0.1-SNAPSHOT + remote-debugging war - remote-debugging org.springframework.boot diff --git a/guest/slf4j/guide/pom.xml b/guest/slf4j/guide/pom.xml index 0db9b46247..657ede73b6 100644 --- a/guest/slf4j/guide/pom.xml +++ b/guest/slf4j/guide/pom.xml @@ -2,13 +2,12 @@ 4.0.0 - com.stackify.slf4j.guide slf4j-parent-module 1.0.0-SNAPSHOT + slf4j-parent-module pom - org.springframework.boot spring-boot-starter-parent diff --git a/guest/slf4j/guide/slf4j-log4j/pom.xml b/guest/slf4j/guide/slf4j-log4j/pom.xml index 0d08fa6191..bca5392f4d 100644 --- a/guest/slf4j/guide/slf4j-log4j/pom.xml +++ b/guest/slf4j/guide/slf4j-log4j/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - slf4j-log4j 0.0.1-SNAPSHOT + slf4j-log4j jar diff --git a/guest/slf4j/guide/slf4j-log4j2/pom.xml b/guest/slf4j/guide/slf4j-log4j2/pom.xml index 643649335f..9473362cb8 100644 --- a/guest/slf4j/guide/slf4j-log4j2/pom.xml +++ b/guest/slf4j/guide/slf4j-log4j2/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - slf4j-log4j2 0.0.1-SNAPSHOT + slf4j-log4j2 jar diff --git a/guest/slf4j/guide/slf4j-logback/pom.xml b/guest/slf4j/guide/slf4j-logback/pom.xml index e8aebf0ef6..0327e79732 100644 --- a/guest/slf4j/guide/slf4j-logback/pom.xml +++ b/guest/slf4j/guide/slf4j-logback/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - slf4j-logback 0.0.1-SNAPSHOT + slf4j-logback jar diff --git a/guest/spring-boot-app/pom.xml b/guest/spring-boot-app/pom.xml index 7daa8f668e..423dadbb99 100644 --- a/guest/spring-boot-app/pom.xml +++ b/guest/spring-boot-app/pom.xml @@ -4,6 +4,7 @@ spring-boot-app spring-boot-app 0.0.1-SNAPSHOT + spring-boot-app war diff --git a/guest/spring-mvc/pom.xml b/guest/spring-mvc/pom.xml index c0ef451605..3bffb1530d 100644 --- a/guest/spring-mvc/pom.xml +++ b/guest/spring-mvc/pom.xml @@ -5,8 +5,8 @@ com.stackify.guest spring-mvc 0.0.1-SNAPSHOT - jar spring-mvc + jar Spring MVC sample project diff --git a/guest/thread-pools/pom.xml b/guest/thread-pools/pom.xml index db9a5ac89f..2591cb2746 100644 --- a/guest/thread-pools/pom.xml +++ b/guest/thread-pools/pom.xml @@ -4,7 +4,8 @@ com.stackify thread-pools 0.0.1-SNAPSHOT - + thread-pools + com.baeldung parent-modules diff --git a/guest/tomcat-app/pom.xml b/guest/tomcat-app/pom.xml index 7fd27e869b..9ce77c758a 100644 --- a/guest/tomcat-app/pom.xml +++ b/guest/tomcat-app/pom.xml @@ -4,6 +4,7 @@ com.stackify tomcat-app 0.0.1-SNAPSHOT + tomcat-app war diff --git a/guest/webservices/rest-client/pom.xml b/guest/webservices/rest-client/pom.xml index 5e52b7161c..8508186e86 100644 --- a/guest/webservices/rest-client/pom.xml +++ b/guest/webservices/rest-client/pom.xml @@ -3,6 +3,7 @@ com.stackify rest-client 0.0.1-SNAPSHOT + rest-client war diff --git a/guest/webservices/rest-server/pom.xml b/guest/webservices/rest-server/pom.xml index 4b3d241293..c576924215 100644 --- a/guest/webservices/rest-server/pom.xml +++ b/guest/webservices/rest-server/pom.xml @@ -4,6 +4,7 @@ com.stackify rest-server 0.0.1-SNAPSHOT + rest-server war diff --git a/guest/webservices/spring-rest-service/pom.xml b/guest/webservices/spring-rest-service/pom.xml index 49d35766e8..fcec8a3e12 100644 --- a/guest/webservices/spring-rest-service/pom.xml +++ b/guest/webservices/spring-rest-service/pom.xml @@ -4,6 +4,7 @@ com.stackify spring-rest-service 0.0.1-SNAPSHOT + spring-rest-service war diff --git a/helidon/helidon-mp/pom.xml b/helidon/helidon-mp/pom.xml index 1ec1131a67..1f39431886 100644 --- a/helidon/helidon-mp/pom.xml +++ b/helidon/helidon-mp/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - helidon-mp - + helidon-mp + com.baeldung.helidon helidon diff --git a/helidon/helidon-se/pom.xml b/helidon/helidon-se/pom.xml index 5e14ecb81c..8982bf048e 100644 --- a/helidon/helidon-se/pom.xml +++ b/helidon/helidon-se/pom.xml @@ -3,9 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - helidon-se - + helidon-se + com.baeldung.helidon helidon diff --git a/helidon/pom.xml b/helidon/pom.xml index ea8cc52ee0..85bab4db42 100644 --- a/helidon/pom.xml +++ b/helidon/pom.xml @@ -2,10 +2,9 @@ 4.0.0 - com.baeldung.helidon helidon - 1.0.0-SNAPSHOT + helidon pom diff --git a/image-processing/pom.xml b/image-processing/pom.xml index fe8001ae3a..ce75145dc7 100644 --- a/image-processing/pom.xml +++ b/image-processing/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung image-processing 1.0-SNAPSHOT - + image-processing + com.baeldung parent-modules diff --git a/immutables/pom.xml b/immutables/pom.xml index 17510690b0..efb21e584a 100644 --- a/immutables/pom.xml +++ b/immutables/pom.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 immutables - 1.0.0-SNAPSHOT - + immutables + com.baeldung parent-modules diff --git a/java-ee-8-security-api/app-auth-basic-store-db/pom.xml b/java-ee-8-security-api/app-auth-basic-store-db/pom.xml index 6ecc9f7e80..cf92fe2ecd 100644 --- a/java-ee-8-security-api/app-auth-basic-store-db/pom.xml +++ b/java-ee-8-security-api/app-auth-basic-store-db/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - app-auth-basic-store-db + app-auth-basic-store-db war diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml b/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml index bf5315e993..43809f1cd5 100644 --- a/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml +++ b/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - app-auth-custom-form-store-custom + app-auth-custom-form-store-custom war diff --git a/java-ee-8-security-api/app-auth-custom-no-store/pom.xml b/java-ee-8-security-api/app-auth-custom-no-store/pom.xml index c05c0f19be..f9d63f8623 100644 --- a/java-ee-8-security-api/app-auth-custom-no-store/pom.xml +++ b/java-ee-8-security-api/app-auth-custom-no-store/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - app-auth-custom-no-store + app-auth-custom-no-store war diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml index 570b36add5..6a7b97b2d7 100644 --- a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml +++ b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - app-auth-form-store-ldap + app-auth-form-store-ldap war diff --git a/java-ee-8-security-api/pom.xml b/java-ee-8-security-api/pom.xml index 7546839492..ad33c74ad3 100644 --- a/java-ee-8-security-api/pom.xml +++ b/java-ee-8-security-api/pom.xml @@ -5,6 +5,7 @@ 4.0.0 java-ee-8-security-api 1.0-SNAPSHOT + java-ee-8-security-api pom diff --git a/java-lite/pom.xml b/java-lite/pom.xml index 5111cd2e7f..03f4e29f4e 100644 --- a/java-lite/pom.xml +++ b/java-lite/pom.xml @@ -5,6 +5,7 @@ org.baeldung java-lite 1.0-SNAPSHOT + java-lite war diff --git a/java-rmi/pom.xml b/java-rmi/pom.xml index 33931baedf..ad413b66ab 100644 --- a/java-rmi/pom.xml +++ b/java-rmi/pom.xml @@ -4,6 +4,7 @@ com.baeldung.rmi java-rmi 1.0-SNAPSHOT + java-rmi jar diff --git a/java-spi/exchange-rate-api/pom.xml b/java-spi/exchange-rate-api/pom.xml index b626916b56..fd3a7ae0a7 100644 --- a/java-spi/exchange-rate-api/pom.xml +++ b/java-spi/exchange-rate-api/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 exchange-rate-api + exchange-rate-api jar diff --git a/java-spi/exchange-rate-app/pom.xml b/java-spi/exchange-rate-app/pom.xml index a42a30ceda..7a076d560c 100644 --- a/java-spi/exchange-rate-app/pom.xml +++ b/java-spi/exchange-rate-app/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 exchange-rate-app + exchange-rate-app jar diff --git a/java-spi/exchange-rate-impl/pom.xml b/java-spi/exchange-rate-impl/pom.xml index 41c874c659..8a77b51793 100644 --- a/java-spi/exchange-rate-impl/pom.xml +++ b/java-spi/exchange-rate-impl/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 exchange-rate-impl + exchange-rate-impl jar diff --git a/java-spi/pom.xml b/java-spi/pom.xml index 9ac87bf960..97a22024bd 100644 --- a/java-spi/pom.xml +++ b/java-spi/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 java-spi + java-spi pom diff --git a/java-vavr-stream/pom.xml b/java-vavr-stream/pom.xml index 395d2c81ba..c92f3c8742 100644 --- a/java-vavr-stream/pom.xml +++ b/java-vavr-stream/pom.xml @@ -5,6 +5,7 @@ com.baeldung.samples java-vavr-stream 1.0 + java-vavr-stream jar diff --git a/java-websocket/pom.xml b/java-websocket/pom.xml index e8ff8dfc36..7ba3ca61d0 100644 --- a/java-websocket/pom.xml +++ b/java-websocket/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung java-websocket - war 0.0.1-SNAPSHOT + java-websocket + war com.baeldung diff --git a/javafx/pom.xml b/javafx/pom.xml index c9c5bc294e..44e6f7e8da 100644 --- a/javafx/pom.xml +++ b/javafx/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 javafx - + javafx + parent-modules com.baeldung diff --git a/javax-servlets/pom.xml b/javax-servlets/pom.xml index 7b4eecd880..f00dd0ebe8 100644 --- a/javax-servlets/pom.xml +++ b/javax-servlets/pom.xml @@ -5,6 +5,7 @@ com.baeldung.javax-servlets javax-servlets 1.0-SNAPSHOT + javax-servlets war diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 22f1827213..5f2690b5b4 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung javaxval 0.1-SNAPSHOT - + javaxval + com.baeldung parent-modules diff --git a/jee-7/pom.xml b/jee-7/pom.xml index 9011648d17..97ed2cc51d 100644 --- a/jee-7/pom.xml +++ b/jee-7/pom.xml @@ -5,6 +5,7 @@ 4.0.0 jee-7 1.0-SNAPSHOT + jee-7 war JavaEE 7 Arquillian Archetype Sample diff --git a/jenkins/hello-world/pom.xml b/jenkins/hello-world/pom.xml index fb2154c7ad..f00a551173 100644 --- a/jenkins/hello-world/pom.xml +++ b/jenkins/hello-world/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - jenkins-hello-world + hello-world 1.0-SNAPSHOT + hello-world hpi - Hello World Plugin A sample Jenkins Hello World plugin diff --git a/jersey/pom.xml b/jersey/pom.xml index b55bdc5330..a3adb4cf5a 100644 --- a/jersey/pom.xml +++ b/jersey/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - com.baeldung jersey 0.0.1-SNAPSHOT + jersey war diff --git a/jhipster/jhipster-microservice/pom.xml b/jhipster/jhipster-microservice/pom.xml index 4a60e47f87..051d5f70b7 100644 --- a/jhipster/jhipster-microservice/pom.xml +++ b/jhipster/jhipster-microservice/pom.xml @@ -3,9 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jhipster-microservice + jhipster-microservice pom - JHipster Microservice - + jhipster com.baeldung.jhipster diff --git a/jhipster/jhipster-monolithic/pom.xml b/jhipster/jhipster-monolithic/pom.xml index e242668759..12dead99df 100644 --- a/jhipster/jhipster-monolithic/pom.xml +++ b/jhipster/jhipster-monolithic/pom.xml @@ -3,6 +3,7 @@ 4.0.0 jhipster-monolithic war + jhipster-monolithic JHipster Monolithic Application diff --git a/jni/pom.xml b/jni/pom.xml index d4cc409d33..4850e07ed7 100644 --- a/jni/pom.xml +++ b/jni/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jni - + jni + com.baeldung parent-modules diff --git a/jsf/pom.xml b/jsf/pom.xml index 2ac8a9f7c2..fc6d4a0ee2 100644 --- a/jsf/pom.xml +++ b/jsf/pom.xml @@ -4,6 +4,7 @@ 4.0.0 jsf 0.1-SNAPSHOT + jsf war diff --git a/json/pom.xml b/json/pom.xml index b688baec06..db98ec437e 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -4,7 +4,8 @@ org.baeldung json 0.0.1-SNAPSHOT - + json + com.baeldung parent-modules diff --git a/jsoup/pom.xml b/jsoup/pom.xml index 2704d7bc00..f6e25e7a23 100644 --- a/jsoup/pom.xml +++ b/jsoup/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jsoup + jsoup jar diff --git a/jta/pom.xml b/jta/pom.xml index 89bdccf25e..4754c1872b 100644 --- a/jta/pom.xml +++ b/jta/pom.xml @@ -3,8 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung - jta-demo + jta 1.0-SNAPSHOT + jta jar JEE JTA demo diff --git a/jws/pom.xml b/jws/pom.xml index 1970ab9921..2c89b687f8 100644 --- a/jws/pom.xml +++ b/jws/pom.xml @@ -3,9 +3,9 @@ 4.0.0 com.example jws - war 0.0.1-SNAPSHOT - jws-example + jws + war com.baeldung diff --git a/kotlin-libraries/pom.xml b/kotlin-libraries/pom.xml index 92a643e458..ae77a9aa2d 100644 --- a/kotlin-libraries/pom.xml +++ b/kotlin-libraries/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 kotlin-libraries + kotlin-libraries jar diff --git a/libraries-server/pom.xml b/libraries-server/pom.xml index 6fca09faf4..661f5f01d5 100644 --- a/libraries-server/pom.xml +++ b/libraries-server/pom.xml @@ -1,9 +1,10 @@ 4.0.0 - com.baeldung libraries-server 0.0.1-SNAPSHOT + libraries-server + com.baeldung parent-modules diff --git a/linkrest/pom.xml b/linkrest/pom.xml index a27caea1ff..073a173aff 100644 --- a/linkrest/pom.xml +++ b/linkrest/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung linkrest 0.0.1-SNAPSHOT + linkrest war diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index 1b27e03445..40db69fb94 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/pom.xml @@ -6,6 +6,7 @@ com.baeldung log4j 1.0-SNAPSHOT + log4j com.baeldung diff --git a/logging-modules/log4j2/pom.xml b/logging-modules/log4j2/pom.xml index 65da318636..d46f92dcd6 100644 --- a/logging-modules/log4j2/pom.xml +++ b/logging-modules/log4j2/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 log4j2 - + log4j2 + com.baeldung parent-modules diff --git a/maven-archetype/pom.xml b/maven-archetype/pom.xml index f7871c81ea..73ddc78fc7 100644 --- a/maven-archetype/pom.xml +++ b/maven-archetype/pom.xml @@ -5,9 +5,10 @@ com.baeldung.archetypes maven-archetype 1.0-SNAPSHOT + maven-archetype maven-archetype Archetype used to generate rest application based on jaxrs 2.1 - + diff --git a/maven-polyglot/maven-polyglot-json-extension/pom.xml b/maven-polyglot/maven-polyglot-json-extension/pom.xml index d5c5b7ab55..fe1e025d1f 100644 --- a/maven-polyglot/maven-polyglot-json-extension/pom.xml +++ b/maven-polyglot/maven-polyglot-json-extension/pom.xml @@ -3,11 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.maven.polyglot maven-polyglot-json-extension 1.0-SNAPSHOT - + maven-polyglot-json-extension + 1.8 1.8 diff --git a/maven/pom.xml b/maven/pom.xml index 4bec533226..01fd28db74 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -4,6 +4,7 @@ com.baeldung maven 0.0.1-SNAPSHOT + maven war diff --git a/maven/versions-maven-plugin/pom.xml b/maven/versions-maven-plugin/pom.xml index 295c77b860..dc0cba75f9 100644 --- a/maven/versions-maven-plugin/pom.xml +++ b/maven/versions-maven-plugin/pom.xml @@ -3,9 +3,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung - versions-maven-plugin-example + versions-maven-plugin 0.0.1-SNAPSHOT - + versions-maven-plugin + 1.15 diff --git a/mesos-marathon/pom.xml b/mesos-marathon/pom.xml index f92c00892b..dee8eca10d 100644 --- a/mesos-marathon/pom.xml +++ b/mesos-marathon/pom.xml @@ -5,7 +5,8 @@ com.baeldung mesos-marathon 0.0.1-SNAPSHOT - + mesos-marathon + parent-boot-1 com.baeldung diff --git a/metrics/pom.xml b/metrics/pom.xml index 9cf1ec588f..79d340aa49 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 metrics - + metrics + parent-modules com.baeldung diff --git a/microprofile/pom.xml b/microprofile/pom.xml index d75b6443ed..52df348ace 100644 --- a/microprofile/pom.xml +++ b/microprofile/pom.xml @@ -5,6 +5,7 @@ com.baeldung microprofile 1.0-SNAPSHOT + microprofile war diff --git a/msf4j/pom.xml b/msf4j/pom.xml index 9a6483772b..4a6f63159d 100644 --- a/msf4j/pom.xml +++ b/msf4j/pom.xml @@ -5,6 +5,7 @@ com.baeldung.msf4j msf4j 0.0.1-SNAPSHOT + msf4j parent-modules diff --git a/muleesb/pom.xml b/muleesb/pom.xml index b34123567a..4b74b6d4f4 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -6,9 +6,9 @@ com.mycompany muleesb 1.0.0-SNAPSHOT - mule - Mule muleesb Application - + muleesb + mule + com.baeldung parent-modules diff --git a/mybatis/pom.xml b/mybatis/pom.xml index aa9ff9e288..4e63d14ded 100644 --- a/mybatis/pom.xml +++ b/mybatis/pom.xml @@ -5,7 +5,8 @@ com.baeldung mybatis 1.0.0-SNAPSHOT - + mybatis + com.baeldung parent-modules diff --git a/optaplanner/pom.xml b/optaplanner/pom.xml index 22abbedc8c..fbce0ea072 100644 --- a/optaplanner/pom.xml +++ b/optaplanner/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + optaplanner + optaplanner + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - optaplanner diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index 171806390d..53f91f975d 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -3,6 +3,7 @@ 4.0.0 parent-boot-1 0.0.1-SNAPSHOT + parent-boot-1 pom Parent for all Spring Boot 1.x modules diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index 67837e1a4e..89afd79bf4 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -3,6 +3,7 @@ 4.0.0 parent-boot-2 0.0.1-SNAPSHOT + parent-boot-2 pom Parent for all Spring Boot 2 modules diff --git a/patterns/design-patterns/pom.xml b/patterns/design-patterns/pom.xml index dc2631b36e..ac201ad653 100644 --- a/patterns/design-patterns/pom.xml +++ b/patterns/design-patterns/pom.xml @@ -4,7 +4,9 @@ 4.0.0 design-patterns 1.0 - jar + design-patterns + jar + com.baeldung patterns diff --git a/patterns/front-controller/pom.xml b/patterns/front-controller/pom.xml index 435b0dd9cd..bb003dd00a 100644 --- a/patterns/front-controller/pom.xml +++ b/patterns/front-controller/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 front-controller + front-controller war diff --git a/patterns/intercepting-filter/pom.xml b/patterns/intercepting-filter/pom.xml index fa94d5d1fd..33589dc242 100644 --- a/patterns/intercepting-filter/pom.xml +++ b/patterns/intercepting-filter/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - intercepting-filter + intercepting-filter war diff --git a/patterns/pom.xml b/patterns/pom.xml index df09f1836a..bc1f5173e2 100644 --- a/patterns/pom.xml +++ b/patterns/pom.xml @@ -4,6 +4,7 @@ 4.0.0 patterns pom + patterns com.baeldung diff --git a/performance-tests/pom.xml b/performance-tests/pom.xml index 8c9d027724..7d77c2a0e3 100644 --- a/performance-tests/pom.xml +++ b/performance-tests/pom.xml @@ -4,7 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 performance-tests - + performance-tests + parent-modules com.baeldung diff --git a/persistence-modules/hbase/pom.xml b/persistence-modules/hbase/pom.xml index ffd1464482..daf0db5291 100644 --- a/persistence-modules/hbase/pom.xml +++ b/persistence-modules/hbase/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 hbase + hbase parent-modules diff --git a/persistence-modules/hibernate5/pom.xml b/persistence-modules/hibernate5/pom.xml index 24f4055a82..363e2153b6 100644 --- a/persistence-modules/hibernate5/pom.xml +++ b/persistence-modules/hibernate5/pom.xml @@ -5,6 +5,7 @@ com.baeldung hibernate5 0.0.1-SNAPSHOT + hibernate5 com.baeldung diff --git a/persistence-modules/java-cassandra/pom.xml b/persistence-modules/java-cassandra/pom.xml index 36ec6b5ac8..aac5d49547 100644 --- a/persistence-modules/java-cassandra/pom.xml +++ b/persistence-modules/java-cassandra/pom.xml @@ -4,6 +4,7 @@ com.baeldung java-cassandra 1.0.0-SNAPSHOT + java-cassandra com.baeldung diff --git a/persistence-modules/java-cockroachdb/pom.xml b/persistence-modules/java-cockroachdb/pom.xml index 870707c750..2a92934a6e 100644 --- a/persistence-modules/java-cockroachdb/pom.xml +++ b/persistence-modules/java-cockroachdb/pom.xml @@ -5,6 +5,7 @@ com.baeldung java-cockroachdb 1.0-SNAPSHOT + java-cockroachdb parent-modules diff --git a/persistence-modules/java-jdbi/pom.xml b/persistence-modules/java-jdbi/pom.xml index 885906fcd0..9281f4fd9d 100644 --- a/persistence-modules/java-jdbi/pom.xml +++ b/persistence-modules/java-jdbi/pom.xml @@ -4,6 +4,7 @@ 4.0.0 java-jdbi 1.0-SNAPSHOT + java-jdbi parent-modules diff --git a/persistence-modules/java-jpa/pom.xml b/persistence-modules/java-jpa/pom.xml index 78764f7148..ddab51a2e2 100644 --- a/persistence-modules/java-jpa/pom.xml +++ b/persistence-modules/java-jpa/pom.xml @@ -2,15 +2,16 @@ + 4.0.0 + java-jpa + java-jpa + parent-modules com.baeldung 1.0.0-SNAPSHOT ../../pom.xml - 4.0.0 - - java-jpa diff --git a/persistence-modules/java-mongodb/pom.xml b/persistence-modules/java-mongodb/pom.xml index bbc48f54c2..9658ef567f 100644 --- a/persistence-modules/java-mongodb/pom.xml +++ b/persistence-modules/java-mongodb/pom.xml @@ -5,6 +5,7 @@ com.baeldung java-mongodb 1.0-SNAPSHOT + java-mongodb com.baeldung diff --git a/persistence-modules/jnosql/jnosql-artemis/pom.xml b/persistence-modules/jnosql/jnosql-artemis/pom.xml index 9c2bfd1ba0..8a978fb179 100644 --- a/persistence-modules/jnosql/jnosql-artemis/pom.xml +++ b/persistence-modules/jnosql/jnosql-artemis/pom.xml @@ -3,6 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + jnosql-artemis + jnosql-artemis + war com.baeldung.jnosql @@ -10,9 +13,6 @@ 1.0-SNAPSHOT - jnosql-artemis - war - 2.4.2 false diff --git a/persistence-modules/jnosql/jnosql-diana/pom.xml b/persistence-modules/jnosql/jnosql-diana/pom.xml index 767defb2a8..126f0314d9 100644 --- a/persistence-modules/jnosql/jnosql-diana/pom.xml +++ b/persistence-modules/jnosql/jnosql-diana/pom.xml @@ -3,15 +3,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + jnosql-diana + jnosql-diana + com.baeldung.jnosql jnosql 1.0-SNAPSHOT - jnosql-diana - diff --git a/persistence-modules/jnosql/pom.xml b/persistence-modules/jnosql/pom.xml index c87ad3cf4b..5fb29a3b9c 100644 --- a/persistence-modules/jnosql/pom.xml +++ b/persistence-modules/jnosql/pom.xml @@ -3,10 +3,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.jnosql jnosql 1.0-SNAPSHOT + jnosql pom diff --git a/persistence-modules/liquibase/pom.xml b/persistence-modules/liquibase/pom.xml index cb2bee8d48..b06d38e6a0 100644 --- a/persistence-modules/liquibase/pom.xml +++ b/persistence-modules/liquibase/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 liquibase + liquibase parent-modules diff --git a/persistence-modules/orientdb/pom.xml b/persistence-modules/orientdb/pom.xml index e4bc9a0585..a8ac3fb789 100644 --- a/persistence-modules/orientdb/pom.xml +++ b/persistence-modules/orientdb/pom.xml @@ -4,8 +4,8 @@ 4.0.0 orientdb 0.0.1-SNAPSHOT + orientdb jar - intro-orientdb introduction to the OrientDB Java APIs diff --git a/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml b/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml index 4d677ab0d4..6ebc75de8d 100644 --- a/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml +++ b/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml @@ -3,10 +3,10 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.h2db spring-boot-h2-database 0.0.1-SNAPSHOT + spring-boot-h2-database jar Demo Spring Boot applications that starts H2 in memory database diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index 80472fdd57..0ea42b1cb7 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -2,11 +2,11 @@ - 4.0.0 - + 4.0.0 com.baeldung spring-boot-persistence 0.1.0 + spring-boot-persistence parent-boot-2 diff --git a/persistence-modules/spring-data-gemfire/pom.xml b/persistence-modules/spring-data-gemfire/pom.xml index 34346c502f..292b7387ac 100644 --- a/persistence-modules/spring-data-gemfire/pom.xml +++ b/persistence-modules/spring-data-gemfire/pom.xml @@ -5,6 +5,7 @@ com.baeldung spring-data-gemfire 1.0.0-SNAPSHOT + spring-data-gemfire jar diff --git a/persistence-modules/spring-data-jpa/pom.xml b/persistence-modules/spring-data-jpa/pom.xml index 643210ab89..786e587734 100644 --- a/persistence-modules/spring-data-jpa/pom.xml +++ b/persistence-modules/spring-data-jpa/pom.xml @@ -5,6 +5,7 @@ 4.0.0 com.baeldung spring-data-jpa + spring-data-jpa parent-boot-2 diff --git a/persistence-modules/spring-data-keyvalue/pom.xml b/persistence-modules/spring-data-keyvalue/pom.xml index 6675595f2b..1fee0a88d4 100644 --- a/persistence-modules/spring-data-keyvalue/pom.xml +++ b/persistence-modules/spring-data-keyvalue/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-data-keyvalue + spring-data-keyvalue parent-boot-2 diff --git a/persistence-modules/spring-data-neo4j/pom.xml b/persistence-modules/spring-data-neo4j/pom.xml index 2be4df71be..1e5d51ddf2 100644 --- a/persistence-modules/spring-data-neo4j/pom.xml +++ b/persistence-modules/spring-data-neo4j/pom.xml @@ -3,7 +3,8 @@ 4.0.0 spring-data-neo4j 1.0 - + spring-data-neo4j + com.baeldung parent-modules diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index bee3d683b8..683f874b6c 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -4,6 +4,7 @@ com.baeldung spring-data-redis 1.0 + spring-data-redis jar diff --git a/protobuffer/pom.xml b/protobuffer/pom.xml index ff443a1615..d9e6cb26e4 100644 --- a/protobuffer/pom.xml +++ b/protobuffer/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 protobuffer - + protobuffer + parent-modules com.baeldung diff --git a/reactor-core/pom.xml b/reactor-core/pom.xml index cf720ad6ea..db9550df7b 100644 --- a/reactor-core/pom.xml +++ b/reactor-core/pom.xml @@ -1,11 +1,11 @@ 4.0.0 - org.baeldung reactor-core 0.0.1-SNAPSHOT - + reactor-core + com.baeldung parent-modules diff --git a/rxjava-2/pom.xml b/rxjava-2/pom.xml index a18b096b6d..3b4c167f3a 100644 --- a/rxjava-2/pom.xml +++ b/rxjava-2/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - rxjava-2 1.0-SNAPSHOT - + rxjava-2 + com.baeldung parent-java diff --git a/rxjava/pom.xml b/rxjava/pom.xml index b316001d87..596a5196da 100644 --- a/rxjava/pom.xml +++ b/rxjava/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - rxjava 1.0-SNAPSHOT - + rxjava + com.baeldung parent-java diff --git a/spring-5-data-reactive/pom.xml b/spring-5-data-reactive/pom.xml index 5c723c6e29..aa73cf11ae 100644 --- a/spring-5-data-reactive/pom.xml +++ b/spring-5-data-reactive/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-5-data-reactive + spring-5-data-reactive jar diff --git a/spring-amqp-simple/pom.xml b/spring-amqp-simple/pom.xml index ea9c227d8c..57d84acee6 100644 --- a/spring-amqp-simple/pom.xml +++ b/spring-amqp-simple/pom.xml @@ -5,6 +5,7 @@ com.baeldung spring-amqp-simple 1.0.0-SNAPSHOT + spring-amqp-simple parent-boot-1 diff --git a/spring-boot-admin/pom.xml b/spring-boot-admin/pom.xml index 58cea728cc..23852dee57 100644 --- a/spring-boot-admin/pom.xml +++ b/spring-boot-admin/pom.xml @@ -3,6 +3,7 @@ 4.0.0 spring-boot-admin 0.0.1-SNAPSHOT + spring-boot-admin pom diff --git a/spring-boot-autoconfiguration/pom.xml b/spring-boot-autoconfiguration/pom.xml index b88587f731..1c3d8796ed 100644 --- a/spring-boot-autoconfiguration/pom.xml +++ b/spring-boot-autoconfiguration/pom.xml @@ -5,7 +5,7 @@ spring-boot-autoconfiguration 0.0.1-SNAPSHOT war - spring-boot-auto-configuration + spring-boot-autoconfiguration This is simple boot application demonstrating a custom auto-configuration diff --git a/spring-boot-camel/pom.xml b/spring-boot-camel/pom.xml index 19a0bec809..8bab0ed5c8 100644 --- a/spring-boot-camel/pom.xml +++ b/spring-boot-camel/pom.xml @@ -5,7 +5,8 @@ com.example spring-boot-camel 0.0.1-SNAPSHOT - + spring-boot-camel + com.baeldung parent-modules diff --git a/spring-boot-crud/pom.xml b/spring-boot-crud/pom.xml index f803a7e70b..749bf9cb5a 100644 --- a/spring-boot-crud/pom.xml +++ b/spring-boot-crud/pom.xml @@ -3,10 +3,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung.spring-boot-crud spring-boot-crud 0.1.0 + spring-boot-crud org.springframework.boot diff --git a/spring-boot-ctx-fluent/pom.xml b/spring-boot-ctx-fluent/pom.xml index f9b691aea7..b238374612 100644 --- a/spring-boot-ctx-fluent/pom.xml +++ b/spring-boot-ctx-fluent/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung spring-boot-ctx-fluent 0.0.1-SNAPSHOT + spring-boot-ctx-fluent jar diff --git a/spring-boot-custom-starter/greeter-library/pom.xml b/spring-boot-custom-starter/greeter-library/pom.xml index 3717ba005c..7e0c5c4d22 100644 --- a/spring-boot-custom-starter/greeter-library/pom.xml +++ b/spring-boot-custom-starter/greeter-library/pom.xml @@ -1,10 +1,11 @@ 4.0.0 - com.baeldung greeter-library 0.0.1-SNAPSHOT + greeter-library + spring-boot-custom-starter com.baeldung diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml index 5862bdd6c8..1e4ee698c6 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung greeter-spring-boot-autoconfigure 0.0.1-SNAPSHOT + greeter-spring-boot-autoconfigure spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml index 88c5d1caf5..91cc41d669 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung greeter-spring-boot-sample-app 0.0.1-SNAPSHOT + greeter-spring-boot-sample-app spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml index e71882db29..560d6fa79b 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung greeter-spring-boot-starter 0.0.1-SNAPSHOT + greeter-spring-boot-starter spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter/pom.xml b/spring-boot-custom-starter/greeter/pom.xml index 3cfd6da09e..95fcaa66c8 100644 --- a/spring-boot-custom-starter/greeter/pom.xml +++ b/spring-boot-custom-starter/greeter/pom.xml @@ -1,10 +1,11 @@ 4.0.0 - com.baeldung greeter 0.0.1-SNAPSHOT + greeter + parent-boot-1 com.baeldung diff --git a/spring-boot-custom-starter/pom.xml b/spring-boot-custom-starter/pom.xml index 97b33ce2b8..9c03cfdd0e 100644 --- a/spring-boot-custom-starter/pom.xml +++ b/spring-boot-custom-starter/pom.xml @@ -4,6 +4,7 @@ com.baeldung spring-boot-custom-starter 0.0.1-SNAPSHOT + spring-boot-custom-starter pom diff --git a/spring-boot-disable-console-logging/disabling-console-jul/pom.xml b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml index ceac0616e9..fbcd0768f9 100644 --- a/spring-boot-disable-console-logging/disabling-console-jul/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml @@ -2,7 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 disabling-console-jul - + disabling-console-jul diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml index d6e9a8b5e5..6f3f01669e 100644 --- a/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml @@ -2,7 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 disabling-console-log4j2 - + disabling-console-log4j2 diff --git a/spring-boot-disable-console-logging/disabling-console-logback/pom.xml b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml index f18066ea03..fef0a1f4c6 100644 --- a/spring-boot-disable-console-logging/disabling-console-logback/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml @@ -1,11 +1,13 @@ 4.0.0 + disabling-console-logback + disabling-console-logback + com.baeldung spring-boot-disable-console-logging 0.0.1-SNAPSHOT - disabling-console-logback diff --git a/spring-boot-disable-console-logging/pom.xml b/spring-boot-disable-console-logging/pom.xml index ec84372f99..63ed129347 100644 --- a/spring-boot-disable-console-logging/pom.xml +++ b/spring-boot-disable-console-logging/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-disable-console-logging + spring-boot-disable-console-logging pom Projects for Disabling Spring Boot Console Logging tutorials diff --git a/spring-boot-logging-log4j2/pom.xml b/spring-boot-logging-log4j2/pom.xml index 38dc5fb341..ad678a14cf 100644 --- a/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-logging-log4j2/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - spring-boot-logging-log4j2 jar + spring-boot-logging-log4j2 Demo project for Spring Boot Logging with Log4J2 diff --git a/spring-boot-property-exp/property-exp-custom-config/pom.xml b/spring-boot-property-exp/property-exp-custom-config/pom.xml index ab22c5ad30..9988924408 100644 --- a/spring-boot-property-exp/property-exp-custom-config/pom.xml +++ b/spring-boot-property-exp/property-exp-custom-config/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - property-exp-custom - com.baeldung property-exp-custom-config 0.0.1-SNAPSHOT + property-exp-custom-config jar diff --git a/spring-boot-property-exp/property-exp-default-config/pom.xml b/spring-boot-property-exp/property-exp-default-config/pom.xml index 4ede36e61a..7892288f45 100644 --- a/spring-boot-property-exp/property-exp-default-config/pom.xml +++ b/spring-boot-property-exp/property-exp-default-config/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - property-exp-default - com.baeldung property-exp-default-config 0.0.1-SNAPSHOT + property-exp-default-config jar diff --git a/spring-cloud-bus/pom.xml b/spring-cloud-bus/pom.xml index d493c4e984..784e4cbae6 100644 --- a/spring-cloud-bus/pom.xml +++ b/spring-cloud-bus/pom.xml @@ -7,6 +7,7 @@ spring-cloud-bus 1.0.0-SNAPSHOT pom + spring-cloud-bus parent-boot-1 diff --git a/spring-cloud-data-flow/etl/pom.xml b/spring-cloud-data-flow/etl/pom.xml index 2b904f6e0d..e203999ee9 100644 --- a/spring-cloud-data-flow/etl/pom.xml +++ b/spring-cloud-data-flow/etl/pom.xml @@ -5,7 +5,8 @@ etl-spring-cloud-data-flow 0.0.1-SNAPSHOT pom - + etl-spring-cloud-data-flow + org.baeldung.spring.cloud spring-cloud-data-flow diff --git a/spring-cloud-data-flow/pom.xml b/spring-cloud-data-flow/pom.xml index 5a007f3c7d..dd1ceed71a 100644 --- a/spring-cloud-data-flow/pom.xml +++ b/spring-cloud-data-flow/pom.xml @@ -5,7 +5,8 @@ spring-cloud-data-flow 0.0.1-SNAPSHOT pom - + spring-cloud-data-flow + com.baeldung parent-modules diff --git a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml index 3ffbf8f619..96f6c8711e 100644 --- a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 dynamodb-config + dynamodb-config jar diff --git a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml index bb283576d8..59dea4890e 100644 --- a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jdbc-config + jdbc-config jar diff --git a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml index 8f8ec99ad8..51010eefb2 100644 --- a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 zookeeper-config + zookeeper-config jar diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index 09518483a4..7edabd03f5 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -5,7 +5,7 @@ com.baeldung.spring.cloud spring-cloud-aws jar - Spring Cloud AWS + spring-cloud-aws Spring Cloud AWS Examples diff --git a/spring-cloud/spring-cloud-bootstrap/config/pom.xml b/spring-cloud/spring-cloud-bootstrap/config/pom.xml index 14a926fc2c..1379af0b05 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/config/pom.xml @@ -4,6 +4,7 @@ 4.0.0 config 1.0.0-SNAPSHOT + config parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml index f94d8829f6..735d3745d7 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - discovery 1.0.0-SNAPSHOT + discovery parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index fc69c16738..2efa926e3a 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -4,6 +4,7 @@ 4.0.0 gateway 1.0.0-SNAPSHOT + gateway parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/pom.xml b/spring-cloud/spring-cloud-bootstrap/pom.xml index 74801159eb..46460c0d74 100644 --- a/spring-cloud/spring-cloud-bootstrap/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/pom.xml @@ -4,6 +4,7 @@ 4.0.0 spring-cloud-bootstrap 1.0.0-SNAPSHOT + spring-cloud-bootstrap pom diff --git a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml index c0d920d373..eb855a91e3 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung.spring.cloud svc-book 1.0.0-SNAPSHOT + svc-book parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index 3aa2db8f65..7c1e93bad1 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung.spring.cloud svc-rating 1.0.0-SNAPSHOT + svc-rating parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml index 8735e24d48..1bf9ecb9e7 100644 --- a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml @@ -4,6 +4,7 @@ 4.0.0 zipkin 1.0.0-SNAPSHOT + zipkin parent-boot-1 diff --git a/spring-cloud/spring-cloud-config/client/pom.xml b/spring-cloud/spring-cloud-config/client/pom.xml index 800a496a82..c55f9bc471 100644 --- a/spring-cloud/spring-cloud-config/client/pom.xml +++ b/spring-cloud/spring-cloud-config/client/pom.xml @@ -3,13 +3,14 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + client + client + com.baeldung.spring.cloud spring-cloud-config 1.0-SNAPSHOT - client diff --git a/spring-cloud/spring-cloud-config/pom.xml b/spring-cloud/spring-cloud-config/pom.xml index b28828bf37..1a4efc7a60 100644 --- a/spring-cloud/spring-cloud-config/pom.xml +++ b/spring-cloud/spring-cloud-config/pom.xml @@ -5,6 +5,7 @@ com.baeldung.spring.cloud spring-cloud-config 1.0-SNAPSHOT + spring-cloud-config pom diff --git a/spring-cloud/spring-cloud-config/server/pom.xml b/spring-cloud/spring-cloud-config/server/pom.xml index 7bbb903cf9..b4be7663e2 100644 --- a/spring-cloud/spring-cloud-config/server/pom.xml +++ b/spring-cloud/spring-cloud-config/server/pom.xml @@ -3,13 +3,14 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + server + server + com.baeldung.spring.cloud spring-cloud-config 1.0-SNAPSHOT - server diff --git a/spring-cloud/spring-cloud-connectors-heroku/pom.xml b/spring-cloud/spring-cloud-connectors-heroku/pom.xml index f00c9eb1fc..d2e9292511 100644 --- a/spring-cloud/spring-cloud-connectors-heroku/pom.xml +++ b/spring-cloud/spring-cloud-connectors-heroku/pom.xml @@ -5,6 +5,7 @@ com.baeldung.spring.cloud spring-cloud-connectors-heroku 1.0.0-SNAPSHOT + spring-cloud-connectors-heroku parent-boot-1 diff --git a/spring-cloud/spring-cloud-contract/pom.xml b/spring-cloud/spring-cloud-contract/pom.xml index 5dde6a7a99..3563d0ee58 100644 --- a/spring-cloud/spring-cloud-contract/pom.xml +++ b/spring-cloud/spring-cloud-contract/pom.xml @@ -6,6 +6,7 @@ com.baeldung.spring.cloud spring-cloud-contract 1.0.0-SNAPSHOT + spring-cloud-contract com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-eureka/pom.xml b/spring-cloud/spring-cloud-eureka/pom.xml index 7f7e2650d5..99d8c0ed40 100644 --- a/spring-cloud/spring-cloud-eureka/pom.xml +++ b/spring-cloud/spring-cloud-eureka/pom.xml @@ -6,7 +6,7 @@ spring-cloud-eureka 1.0.0-SNAPSHOT pom - Spring Cloud Eureka + spring-cloud-eureka Spring Cloud Eureka Server and Sample Clients diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml index 0bf9547aff..5378095af0 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml @@ -2,12 +2,10 @@ 4.0.0 - spring-cloud-eureka-client 1.0.0-SNAPSHOT jar - - Spring Cloud Eureka Client + spring-cloud-eureka-client Spring Cloud Eureka Sample Client diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml index d572b10d40..f2057c8a76 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml @@ -5,7 +5,7 @@ spring-cloud-eureka-feign-client 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Feign Client + spring-cloud-eureka-feign-client Spring Cloud Eureka - Sample Feign Client diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml index da2c50d3c7..587aed6c49 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml @@ -5,7 +5,7 @@ spring-cloud-eureka-server 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Server + spring-cloud-eureka-server Spring Cloud Eureka Server Demo diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml index 8b2b0ad385..5686fc8c64 100644 --- a/spring-cloud/spring-cloud-functions/pom.xml +++ b/spring-cloud/spring-cloud-functions/pom.xml @@ -3,13 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.spring - cloudfunction-aws + spring-cloud-functions 0.0.1-SNAPSHOT jar - - cloudfunction-aws + spring-cloud-functions Demo project for Spring Cloud Function diff --git a/spring-cloud/spring-cloud-gateway/pom.xml b/spring-cloud/spring-cloud-gateway/pom.xml index 4d8b57d4cf..c297d90896 100644 --- a/spring-cloud/spring-cloud-gateway/pom.xml +++ b/spring-cloud/spring-cloud-gateway/pom.xml @@ -4,7 +4,7 @@ 4.0.0 spring-cloud-gateway jar - Spring Cloud Gateway + spring-cloud-gateway com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml b/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml index 308a81fd74..f7b04baec3 100644 --- a/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 demo-backend - + demo-backend + com.baeldung.spring.cloud spring-cloud-kubernetes diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml b/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml index 968529c648..da55ca5034 100644 --- a/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 demo-frontend - + demo-frontend + com.baeldung.spring.cloud spring-cloud-kubernetes diff --git a/spring-cloud/spring-cloud-kubernetes/pom.xml b/spring-cloud/spring-cloud-kubernetes/pom.xml index fd9f7b5876..984b3811dd 100644 --- a/spring-cloud/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/pom.xml @@ -2,11 +2,11 @@ 4.0.0 - com.baeldung.spring.cloud spring-cloud-kubernetes 1.0-SNAPSHOT pom + spring-cloud-kubernetes demo-frontend diff --git a/spring-cloud/spring-cloud-security/auth-server/pom.xml b/spring-cloud/spring-cloud-security/auth-server/pom.xml index 92f92808f6..4b3f94b825 100644 --- a/spring-cloud/spring-cloud-security/auth-server/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-server/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 auth-server + auth-server Spring Cloud Security APP Server Module diff --git a/spring-cloud/spring-cloud-task/pom.xml b/spring-cloud/spring-cloud-task/pom.xml index ef76d464bc..748cc378f1 100644 --- a/spring-cloud/spring-cloud-task/pom.xml +++ b/spring-cloud/spring-cloud-task/pom.xml @@ -6,6 +6,7 @@ spring-cloud-task 1.0.0-SNAPSHOT pom + spring-cloud-task parent-boot-1 diff --git a/spring-cloud/spring-cloud-zookeeper/pom.xml b/spring-cloud/spring-cloud-zookeeper/pom.xml index 4535c2072d..9661f2b71a 100644 --- a/spring-cloud/spring-cloud-zookeeper/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/pom.xml @@ -4,7 +4,8 @@ 4.0.0 spring-cloud-zookeeper pom - + spring-cloud-zookeeper + com.baeldung.spring.cloud spring-cloud diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml index 6a5b7ddb55..c4f7ae704a 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml @@ -5,7 +5,7 @@ eureka-client 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Client + eureka-client Spring Cloud Eureka Sample Client diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml index e3c5109a26..0256ee7000 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml @@ -5,7 +5,7 @@ eureka-server 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Server + eureka-server Spring Cloud Eureka Server Demo diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml index 4d3687134f..edd7b9d99e 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml @@ -7,7 +7,7 @@ spring-cloud-zuul-eureka-integration 1.0.0-SNAPSHOT pom - Spring Cloud Zuul and Eureka Integration + spring-cloud-zuul-eureka-integration Spring Cloud Zuul and Eureka Integration diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml index e64ceb501e..39f94efdf0 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 zuul-server + zuul-server com.baeldung.spring.cloud diff --git a/spring-drools/pom.xml b/spring-drools/pom.xml index 8c65d5e34e..5bb2d6a8e9 100644 --- a/spring-drools/pom.xml +++ b/spring-drools/pom.xml @@ -5,7 +5,8 @@ com.baeldung spring-drools 1.0.0-SNAPSHOT - + spring-drools + com.baeldung parent-modules diff --git a/spring-ejb/spring-ejb-remote/pom.xml b/spring-ejb/spring-ejb-remote/pom.xml index 4756846cc8..797cc3ac68 100644 --- a/spring-ejb/spring-ejb-remote/pom.xml +++ b/spring-ejb/spring-ejb-remote/pom.xml @@ -4,7 +4,8 @@ 4.0.0 spring-ejb-remote ejb - + spring-ejb-remote + com.baeldung.spring.ejb spring-ejb diff --git a/spring-ejb/wildfly/pom.xml b/spring-ejb/wildfly/pom.xml index 8f7d4c287a..f50dad82f1 100644 --- a/spring-ejb/wildfly/pom.xml +++ b/spring-ejb/wildfly/pom.xml @@ -2,10 +2,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT pom - wildfly-example + wildfly com.baeldung.spring.ejb diff --git a/spring-ejb/wildfly/widlfly-web/pom.xml b/spring-ejb/wildfly/widlfly-web/pom.xml index 559c5f1755..1dcb18a230 100644 --- a/spring-ejb/wildfly/widlfly-web/pom.xml +++ b/spring-ejb/wildfly/widlfly-web/pom.xml @@ -3,7 +3,8 @@ 4.0.0 widlfly-web war - + widlfly-web + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-ear/pom.xml b/spring-ejb/wildfly/wildfly-ear/pom.xml index d1e47ecd0f..dc9059370f 100644 --- a/spring-ejb/wildfly/wildfly-ear/pom.xml +++ b/spring-ejb/wildfly/wildfly-ear/pom.xml @@ -3,7 +3,8 @@ 4.0.0 wildfly-ear ear - + wildfly-ear + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml index ec502f2ab3..0324aa8e47 100644 --- a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 wildfly-ejb-interfaces - + wildfly-ejb-interfaces + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-ejb/pom.xml b/spring-ejb/wildfly/wildfly-ejb/pom.xml index 2c87ec8449..22bceef044 100644 --- a/spring-ejb/wildfly/wildfly-ejb/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb/pom.xml @@ -3,7 +3,8 @@ 4.0.0 wildfly-ejb ejb - + wildfly-ejb + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-jpa/pom.xml b/spring-ejb/wildfly/wildfly-jpa/pom.xml index 12cf2c81e4..6a0352c102 100644 --- a/spring-ejb/wildfly/wildfly-jpa/pom.xml +++ b/spring-ejb/wildfly/wildfly-jpa/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 wildfly-jpa - + wildfly-jpa + com.baeldung.wildfly wildfly-example diff --git a/spring-freemarker/pom.xml b/spring-freemarker/pom.xml index 4ff57e27f0..02f2a3fd06 100644 --- a/spring-freemarker/pom.xml +++ b/spring-freemarker/pom.xml @@ -5,7 +5,7 @@ spring-freemarker war 1.0-SNAPSHOT - Spring Freemarker Example + spring-freemarker com.baeldung diff --git a/spring-jersey/pom.xml b/spring-jersey/pom.xml index 872835177d..5e7b50d291 100644 --- a/spring-jersey/pom.xml +++ b/spring-jersey/pom.xml @@ -6,7 +6,8 @@ spring-jersey 0.1-SNAPSHOT war - + spring-jersey + com.baeldung parent-modules diff --git a/spring-jooq/pom.xml b/spring-jooq/pom.xml index 744ae34cc8..bbd6025418 100644 --- a/spring-jooq/pom.xml +++ b/spring-jooq/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-jooq - + spring-jooq + parent-boot-1 com.baeldung diff --git a/spring-katharsis/pom.xml b/spring-katharsis/pom.xml index 39648a982c..756aae93d3 100644 --- a/spring-katharsis/pom.xml +++ b/spring-katharsis/pom.xml @@ -5,7 +5,8 @@ spring-katharsis 0.0.1-SNAPSHOT war - + spring-katharsis + parent-boot-1 com.baeldung diff --git a/spring-ldap/pom.xml b/spring-ldap/pom.xml index 3b2525d899..7399a84c2b 100644 --- a/spring-ldap/pom.xml +++ b/spring-ldap/pom.xml @@ -5,6 +5,7 @@ spring-ldap 0.1-SNAPSHOT jar + spring-ldap com.baeldung diff --git a/spring-mvc-simple/pom.xml b/spring-mvc-simple/pom.xml index e4e30183eb..8d7ad0fa7f 100644 --- a/spring-mvc-simple/pom.xml +++ b/spring-mvc-simple/pom.xml @@ -4,8 +4,7 @@ spring-mvc-simple war 0.0.1-SNAPSHOT - Spring MVC simple Maven Webapp - http://maven.apache.org + spring-mvc-simple com.baeldung diff --git a/spring-mybatis/pom.xml b/spring-mybatis/pom.xml index 7b8b66fef1..af70cb6377 100644 --- a/spring-mybatis/pom.xml +++ b/spring-mybatis/pom.xml @@ -5,8 +5,7 @@ spring-mybatis jar 0.0.1-SNAPSHOT - spring-mybatis Maven Webapp - http://maven.apache.org + spring-mybatis com.baeldung diff --git a/spring-reactive-kotlin/pom.xml b/spring-reactive-kotlin/pom.xml index bff39984e0..7bd31396f7 100644 --- a/spring-reactive-kotlin/pom.xml +++ b/spring-reactive-kotlin/pom.xml @@ -4,7 +4,7 @@ 4.0.0 spring-reactive-kotlin jar - Spring Reactive Kotlin + spring-reactive-kotlin Demo project for Spring Boot diff --git a/spring-remoting/remoting-hessian-burlap/pom.xml b/spring-remoting/remoting-hessian-burlap/pom.xml index 6cb5a51812..e63d0ee22e 100644 --- a/spring-remoting/remoting-hessian-burlap/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/pom.xml @@ -5,6 +5,7 @@ 4.0.0 remoting-hessian-burlap pom + remoting-hessian-burlap spring-remoting diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml index f337d5e51f..104712c3d7 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml @@ -2,15 +2,16 @@ - + 4.0.0 + spring-remoting-hessian-burlap-client + spring-remoting-hessian-burlap-client + + remoting-hessian-burlap com.baeldung 1.0-SNAPSHOT - 4.0.0 - - spring-remoting-hessian-burlap-client - + org.springframework.boot diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml index 5b6e03348f..33b824442f 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-hessian-burlap-server + remoting-hessian-burlap-server + remoting-hessian-burlap com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-hessian-burlap-server diff --git a/spring-remoting/remoting-http/pom.xml b/spring-remoting/remoting-http/pom.xml index 3262736ec8..886a28b886 100644 --- a/spring-remoting/remoting-http/pom.xml +++ b/spring-remoting/remoting-http/pom.xml @@ -4,8 +4,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http - Parent for all modules related to HTTP Spring Remoting. pom + + remoting-http + Parent for all modules related to HTTP Spring Remoting. com.baeldung diff --git a/spring-remoting/remoting-http/remoting-http-client/pom.xml b/spring-remoting/remoting-http/remoting-http-client/pom.xml index 9a6e98ffdd..56412d3cdf 100644 --- a/spring-remoting/remoting-http/remoting-http-client/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-client/pom.xml @@ -4,6 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http-client + remoting-http-client Shows how to invoke a remote service using Spring Remoting HTTP. diff --git a/spring-remoting/remoting-http/remoting-http-server/pom.xml b/spring-remoting/remoting-http/remoting-http-server/pom.xml index 53d27a5efa..c3f87e776e 100644 --- a/spring-remoting/remoting-http/remoting-http-server/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-server/pom.xml @@ -4,6 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http-server + remoting-http-server Shows how to expose a service using Spring Remoting HTTP. diff --git a/spring-remoting/remoting-jms/pom.xml b/spring-remoting/remoting-jms/pom.xml index fe36431423..e24b5b7929 100644 --- a/spring-remoting/remoting-jms/pom.xml +++ b/spring-remoting/remoting-jms/pom.xml @@ -2,18 +2,20 @@ + 4.0.0 + remoting-jms + remoting-jms + pom + spring-remoting com.baeldung 1.0-SNAPSHOT - 4.0.0 - pom + remoting-jms-client remoting-jms-server - remoting-jms - \ No newline at end of file diff --git a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml index ed27282a38..b7b1af5a1a 100644 --- a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-jms-client + remoting-jms-client + remoting-jms com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-jms-client UTF-8 diff --git a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml index 7657267f1d..8a17cdb0a9 100644 --- a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-jms-server + remoting-jms-server + remoting-jms com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-jms-server UTF-8 diff --git a/spring-remoting/remoting-rmi/pom.xml b/spring-remoting/remoting-rmi/pom.xml index cd15a6ec60..b3b84786b8 100644 --- a/spring-remoting/remoting-rmi/pom.xml +++ b/spring-remoting/remoting-rmi/pom.xml @@ -3,8 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - pom remoting-rmi + pom + remoting-rmi spring-remoting diff --git a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml index 1e3cd4b977..4ac0283e94 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml @@ -2,15 +2,16 @@ + 4.0.0 + remoting-rmi-client + remoting-rmi-client + remoting-rmi com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-rmi-client - + org.springframework.boot diff --git a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml index 68b01829e1..7fb4d2c1bc 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-rmi-server + remoting-rmi-server + remoting-rmi com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-rmi-server UTF-8 diff --git a/spring-rest-hal-browser/pom.xml b/spring-rest-hal-browser/pom.xml index 6c56faf0b2..ee0a2c043d 100644 --- a/spring-rest-hal-browser/pom.xml +++ b/spring-rest-hal-browser/pom.xml @@ -3,10 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-rest-hal-browser 1.0-SNAPSHOT + spring-rest-hal-browser + diff --git a/spring-roo/pom.xml b/spring-roo/pom.xml index c205c98dc0..baa0e7f5e6 100644 --- a/spring-roo/pom.xml +++ b/spring-roo/pom.xml @@ -6,7 +6,7 @@ com.baeldung spring-roo 1.0.0.BUILD-SNAPSHOT - Spring Roo + spring-roo jar diff --git a/spring-security-angular/server/pom.xml b/spring-security-angular/server/pom.xml index c1faecca55..55269bb35f 100644 --- a/spring-security-angular/server/pom.xml +++ b/spring-security-angular/server/pom.xml @@ -3,10 +3,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung - spring-security-angular + server 0.0.1-SNAPSHOT jar - spring-security-angular + server Spring Security Angular diff --git a/spring-security-cache-control/pom.xml b/spring-security-cache-control/pom.xml index b7dfc9db3a..c630774849 100644 --- a/spring-security-cache-control/pom.xml +++ b/spring-security-cache-control/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung spring-security-cache-control 1.0-SNAPSHOT + spring-security-cache-control parent-boot-1 diff --git a/spring-security-client/spring-security-jsp-authentication/pom.xml b/spring-security-client/spring-security-jsp-authentication/pom.xml index 0e564b47b8..9bb58863d9 100644 --- a/spring-security-client/spring-security-jsp-authentication/pom.xml +++ b/spring-security-client/spring-security-jsp-authentication/pom.xml @@ -6,7 +6,7 @@ spring-security-jsp-authentication 0.0.1-SNAPSHOT war - spring-security-jsp-authenticate + spring-security-jsp-authentication Spring Security JSP Authentication tag sample diff --git a/spring-security-x509/pom.xml b/spring-security-x509/pom.xml index 0cee3b3129..658840e866 100644 --- a/spring-security-x509/pom.xml +++ b/spring-security-x509/pom.xml @@ -6,7 +6,8 @@ spring-security-x509 0.0.1-SNAPSHOT pom - + spring-security-x509 + parent-boot-1 com.baeldung diff --git a/spring-security-x509/spring-security-x509-basic-auth/pom.xml b/spring-security-x509/spring-security-x509-basic-auth/pom.xml index 67f2b4fbcd..5b68a8e63b 100644 --- a/spring-security-x509/spring-security-x509-basic-auth/pom.xml +++ b/spring-security-x509/spring-security-x509-basic-auth/pom.xml @@ -2,11 +2,10 @@ 4.0.0 - spring-security-x509-basic-auth 0.0.1-SNAPSHOT jar - Spring Security x.509 Basic Authentication + spring-security-x509-basic-auth Spring x.509 Authentication Demo diff --git a/spring-security-x509/spring-security-x509-client-auth/pom.xml b/spring-security-x509/spring-security-x509-client-auth/pom.xml index 5cb4001a94..47ec7f971d 100644 --- a/spring-security-x509/spring-security-x509-client-auth/pom.xml +++ b/spring-security-x509/spring-security-x509-client-auth/pom.xml @@ -2,11 +2,10 @@ 4.0.0 - spring-security-x509-client-auth 0.0.1-SNAPSHOT jar - Spring Security x.509 Client Authentication + spring-security-x509-client-auth Spring x.509 Client Authentication Demo diff --git a/spring-session/spring-session-redis/pom.xml b/spring-session/spring-session-redis/pom.xml index 00da656226..96d90b2776 100644 --- a/spring-session/spring-session-redis/pom.xml +++ b/spring-session/spring-session-redis/pom.xml @@ -5,6 +5,7 @@ spring-session-redis 1.0.0-SNAPSHOT jar + spring-session-redis parent-boot-1 diff --git a/spring-sleuth/pom.xml b/spring-sleuth/pom.xml index a9a8d3e96e..5ce9e07858 100644 --- a/spring-sleuth/pom.xml +++ b/spring-sleuth/pom.xml @@ -6,7 +6,8 @@ spring-sleuth 1.0.0-SNAPSHOT jar - + spring-sleuth + parent-boot-1 com.baeldung diff --git a/spring-spel/pom.xml b/spring-spel/pom.xml index 4af318fde2..aa6eb45158 100644 --- a/spring-spel/pom.xml +++ b/spring-spel/pom.xml @@ -5,7 +5,7 @@ com.baeldung spring-spel 1.0-SNAPSHOT - Spring SpEL + spring-spel com.baeldung diff --git a/spring-state-machine/pom.xml b/spring-state-machine/pom.xml index 5d15e4dfad..b911b5b5ee 100644 --- a/spring-state-machine/pom.xml +++ b/spring-state-machine/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-state-machine - + spring-state-machine + parent-modules com.baeldung diff --git a/spring-swagger-codegen/pom.xml b/spring-swagger-codegen/pom.xml index 8e551d850f..e1bb98360e 100644 --- a/spring-swagger-codegen/pom.xml +++ b/spring-swagger-codegen/pom.xml @@ -4,6 +4,7 @@ spring-swagger-codegen 0.0.1-SNAPSHOT pom + spring-swagger-codegen com.baeldung diff --git a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml index 4aff696828..f9410b6865 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-swagger-codegen-app - + spring-swagger-codegen-app + com.baeldung spring-swagger-codegen diff --git a/spring-thymeleaf/pom.xml b/spring-thymeleaf/pom.xml index 0926728aba..78f95fe1df 100644 --- a/spring-thymeleaf/pom.xml +++ b/spring-thymeleaf/pom.xml @@ -5,6 +5,7 @@ spring-thymeleaf 0.1-SNAPSHOT war + spring-thymeleaf com.baeldung diff --git a/spring-userservice/pom.xml b/spring-userservice/pom.xml index 7144a57ca6..e562171103 100644 --- a/spring-userservice/pom.xml +++ b/spring-userservice/pom.xml @@ -1,12 +1,12 @@ 4.0.0 - spring-userservice spring-userservice 0.0.1-SNAPSHOT war - + spring-userservice + com.baeldung parent-spring-4 diff --git a/spring-vertx/pom.xml b/spring-vertx/pom.xml index 790eeff128..14ed77d359 100644 --- a/spring-vertx/pom.xml +++ b/spring-vertx/pom.xml @@ -2,10 +2,9 @@ 4.0.0 - spring-vertx jar - Spring Vertx + spring-vertx A demo project with vertx spring integration diff --git a/sse-jaxrs/pom.xml b/sse-jaxrs/pom.xml index ac9bff937f..68d1b1bc2b 100644 --- a/sse-jaxrs/pom.xml +++ b/sse-jaxrs/pom.xml @@ -3,10 +3,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.sse sse-jaxrs 1.0-SNAPSHOT + sse-jaxrs pom diff --git a/sse-jaxrs/sse-jaxrs-client/pom.xml b/sse-jaxrs/sse-jaxrs-client/pom.xml index a9068e133f..15a991bfc0 100644 --- a/sse-jaxrs/sse-jaxrs-client/pom.xml +++ b/sse-jaxrs/sse-jaxrs-client/pom.xml @@ -3,6 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + sse-jaxrs-client + sse-jaxrs-client com.baeldung.sse @@ -10,8 +12,6 @@ 1.0-SNAPSHOT - sse-jaxrs-client - 3.2.0 diff --git a/sse-jaxrs/sse-jaxrs-server/pom.xml b/sse-jaxrs/sse-jaxrs-server/pom.xml index 1e89c70e13..825dcddbdf 100644 --- a/sse-jaxrs/sse-jaxrs-server/pom.xml +++ b/sse-jaxrs/sse-jaxrs-server/pom.xml @@ -3,16 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + sse-jaxrs-server + war + sse-jaxrs-server + com.baeldung.sse sse-jaxrs 1.0-SNAPSHOT - sse-jaxrs-server - war - 2.4.2 false diff --git a/static-analysis/pom.xml b/static-analysis/pom.xml index 14853d81f7..94d68f895b 100644 --- a/static-analysis/pom.xml +++ b/static-analysis/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung static-analysis 1.0-SNAPSHOT + static-analysis com.baeldung diff --git a/structurizr/pom.xml b/structurizr/pom.xml index cbbbf8d68c..76b1e355f1 100644 --- a/structurizr/pom.xml +++ b/structurizr/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - com.baeldung structurizr + structurizr com.baeldung diff --git a/struts-2/pom.xml b/struts-2/pom.xml index fee68c8303..ac8579d9e0 100644 --- a/struts-2/pom.xml +++ b/struts-2/pom.xml @@ -5,7 +5,7 @@ struts-2 0.0.1-SNAPSHOT pom - Struts 2 + struts-2 com.baeldung diff --git a/testing-modules/gatling/pom.xml b/testing-modules/gatling/pom.xml index 8d4c89ec62..158da176c6 100644 --- a/testing-modules/gatling/pom.xml +++ b/testing-modules/gatling/pom.xml @@ -6,7 +6,8 @@ org.baeldung gatling 1.0-SNAPSHOT - + gatling + com.baeldung parent-modules diff --git a/testing-modules/groovy-spock/pom.xml b/testing-modules/groovy-spock/pom.xml index e0da345eb4..3dd01c29ab 100644 --- a/testing-modules/groovy-spock/pom.xml +++ b/testing-modules/groovy-spock/pom.xml @@ -6,6 +6,7 @@ groovy-spock 1.0-SNAPSHOT jar + groovy-spock com.baeldung diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml index 869eda1bb5..42614d310b 100644 --- a/testing-modules/load-testing-comparison/pom.xml +++ b/testing-modules/load-testing-comparison/pom.xml @@ -2,15 +2,16 @@ + 4.0.0 + load-testing-comparison + load-testing-comparison + parent-modules com.baeldung 1.0.0-SNAPSHOT ../../pom.xml - 4.0.0 - - load-testing-bakeoff 1.8 diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index cab4d7977b..5f60566566 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/pom.xml @@ -5,7 +5,7 @@ mockito-2 0.0.1-SNAPSHOT jar - mockito-2-with-java8 + mockito-2 com.baeldung diff --git a/testing-modules/mockserver/pom.xml b/testing-modules/mockserver/pom.xml index c2fa2870e2..1db409bd7c 100644 --- a/testing-modules/mockserver/pom.xml +++ b/testing-modules/mockserver/pom.xml @@ -5,7 +5,8 @@ com.baeldung mockserver 1.0.0-SNAPSHOT - + mockserver + com.baeldung parent-modules diff --git a/testing-modules/parallel-tests-junit/pom.xml b/testing-modules/parallel-tests-junit/pom.xml index 3fd4e695e5..ecca8b3930 100644 --- a/testing-modules/parallel-tests-junit/pom.xml +++ b/testing-modules/parallel-tests-junit/pom.xml @@ -5,6 +5,8 @@ parallel-tests-junit 0.0.1-SNAPSHOT pom + parallel-tests-junit + math-test-functions string-test-functions diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index e22f7421cf..ae15fc97c0 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/pom.xml @@ -4,7 +4,8 @@ com.baeldung selenium-junit-testng 0.0.1-SNAPSHOT - + selenium-junit-testng + com.baeldung parent-modules diff --git a/twilio/pom.xml b/twilio/pom.xml index 610cc04b60..81fbf8ab20 100644 --- a/twilio/pom.xml +++ b/twilio/pom.xml @@ -4,7 +4,8 @@ 4.0.0 twilio 1.0-SNAPSHOT - + twilio + parent-modules com.baeldung diff --git a/vertx-and-rxjava/pom.xml b/vertx-and-rxjava/pom.xml index cbc94dd8f1..389eaf687b 100644 --- a/vertx-and-rxjava/pom.xml +++ b/vertx-and-rxjava/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 vertx-and-rxjava - + vertx-and-rxjava + com.baeldung parent-modules diff --git a/video-tutorials/jackson-annotations/pom.xml b/video-tutorials/jackson-annotations/pom.xml index 748721b83c..121609ad4d 100644 --- a/video-tutorials/jackson-annotations/pom.xml +++ b/video-tutorials/jackson-annotations/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - com.baeldung jackson-annotations 1.0.0-SNAPSHOT - jacksonannotation + jackson-annotations com.baeldung diff --git a/vraptor/pom.xml b/vraptor/pom.xml index ae43d8e083..97005bd158 100644 --- a/vraptor/pom.xml +++ b/vraptor/pom.xml @@ -1,11 +1,11 @@ 4.0.0 - com.baeldung vraptor 1.0.0 war + vraptor A demo project to start using VRaptor 4 diff --git a/xmlunit-2/pom.xml b/xmlunit-2/pom.xml index 806ebb6c0e..faefeca7a1 100644 --- a/xmlunit-2/pom.xml +++ b/xmlunit-2/pom.xml @@ -4,6 +4,7 @@ com.baeldung xmlunit-2 1.0 + xmlunit-2 com.baeldung From 30864ad7bf208a24a6e7d445828a2dea1d22d4bb Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 30 Nov 2018 22:28:32 +0530 Subject: [PATCH 506/546] BAEL-9567 Align module names, folder names and artifact id - Fixed parent pom id --- spring-ejb/wildfly/widlfly-web/pom.xml | 4 ++-- spring-ejb/wildfly/wildfly-ear/pom.xml | 2 +- spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml | 2 +- spring-ejb/wildfly/wildfly-ejb/pom.xml | 2 +- spring-ejb/wildfly/wildfly-jpa/pom.xml | 2 +- spring-ejb/wildfly/wildfly-mdb/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-ejb/wildfly/widlfly-web/pom.xml b/spring-ejb/wildfly/widlfly-web/pom.xml index 1dcb18a230..f0baac10dd 100644 --- a/spring-ejb/wildfly/widlfly-web/pom.xml +++ b/spring-ejb/wildfly/widlfly-web/pom.xml @@ -4,10 +4,10 @@ widlfly-web war widlfly-web - + com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-ear/pom.xml b/spring-ejb/wildfly/wildfly-ear/pom.xml index dc9059370f..93d6df96e5 100644 --- a/spring-ejb/wildfly/wildfly-ear/pom.xml +++ b/spring-ejb/wildfly/wildfly-ear/pom.xml @@ -7,7 +7,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml index 0324aa8e47..41c7012ea9 100644 --- a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml @@ -6,7 +6,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-ejb/pom.xml b/spring-ejb/wildfly/wildfly-ejb/pom.xml index 22bceef044..12bfc9c1bf 100644 --- a/spring-ejb/wildfly/wildfly-ejb/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb/pom.xml @@ -7,7 +7,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-jpa/pom.xml b/spring-ejb/wildfly/wildfly-jpa/pom.xml index 6a0352c102..3005ab714c 100644 --- a/spring-ejb/wildfly/wildfly-jpa/pom.xml +++ b/spring-ejb/wildfly/wildfly-jpa/pom.xml @@ -6,7 +6,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-mdb/pom.xml b/spring-ejb/wildfly/wildfly-mdb/pom.xml index 186ddc50c0..a2ffca2fc5 100644 --- a/spring-ejb/wildfly/wildfly-mdb/pom.xml +++ b/spring-ejb/wildfly/wildfly-mdb/pom.xml @@ -6,7 +6,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT From b02321519f0193b25a193cdbf5a7a7ce0313f5b1 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 19:28:39 +0200 Subject: [PATCH 507/546] Update CustomRequestSecurityConfig.java --- .../java/com/baeldung/oauth2/CustomRequestSecurityConfig.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java index 51caee8178..2aba5a82ac 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java @@ -115,5 +115,4 @@ public class CustomRequestSecurityConfig extends WebSecurityConfigurerAdapter { } return null; } - } From dfa76b232f6a5d0299acf763bfb19a190c7a6621 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 19:41:31 +0200 Subject: [PATCH 508/546] Update README.md --- spring-5-reactive/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 4fab0c12ad..fc898a56dc 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -17,3 +17,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) - [Validation for Functional Endpoints in Spring 5](https://www.baeldung.com/spring-functional-endpoints-validation) - [Logging a Reactive Sequence](https://www.baeldung.com/spring-reactive-sequence-logging) + From 2c44ec056e1056ece63ebdc722a700cfbe7321c5 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 19:56:53 +0200 Subject: [PATCH 509/546] Update README.md --- cdi/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cdi/README.md b/cdi/README.md index 1523aacf6b..bfb635be9e 100644 --- a/cdi/README.md +++ b/cdi/README.md @@ -2,3 +2,4 @@ - [CDI Interceptor vs Spring AspectJ](http://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) - [An Introduction to CDI (Contexts and Dependency Injection) in Java](http://www.baeldung.com/java-ee-cdi) - [Introduction to the Event Notification Model in CDI 2.0](https://www.baeldung.com/cdi-event-notification) + From 6f717e04d5f119f39fd1753f6f3a234217b7a5bf Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 20:26:30 +0200 Subject: [PATCH 510/546] Update and rename CompoundOperatorsTest.java to CompoundOperatorsUnitTest.java --- ...ompoundOperatorsTest.java => CompoundOperatorsUnitTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-java-lang/src/test/java/com/baeldung/compoundoperators/{CompoundOperatorsTest.java => CompoundOperatorsUnitTest.java} (98%) diff --git a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java similarity index 98% rename from core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java rename to core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java index 3b3478b38e..532776edd4 100644 --- a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java +++ b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java @@ -4,7 +4,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; -public class CompoundOperatorsTest { +public class CompoundOperatorsUnitTest { @Test public void whenAssignmentOperatorIsUsed_thenValueIsAssigned() { From a2982271e3362b467d57dd36b3557c8eb0dbc094 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 21:16:33 +0200 Subject: [PATCH 511/546] Update README.md --- core-java-lang/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 607abbcdc5..79d2375c24 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -58,3 +58,4 @@ - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) + From b740a59e2baa23032febb4abb5892c7072f95f37 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 21:17:29 +0200 Subject: [PATCH 512/546] Update README.md --- restx/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/restx/README.md b/restx/README.md index f586f08a21..665f7ea82d 100644 --- a/restx/README.md +++ b/restx/README.md @@ -1,3 +1,4 @@ # Relevant Articles * [Introduction to RESTX](https://www.baeldung.com/java-restx) + From 95dc6fd367ab733887dd7f7a314965d98ee43764 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 21:17:59 +0200 Subject: [PATCH 513/546] Update pom.xml --- algorithms-genetic/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/algorithms-genetic/pom.xml b/algorithms-genetic/pom.xml index 662e0c5913..fc6d36dac1 100644 --- a/algorithms-genetic/pom.xml +++ b/algorithms-genetic/pom.xml @@ -61,4 +61,5 @@ 1.11 - \ No newline at end of file + + From 6e478c5fed04af8807be8afce9d5266cf59b68d3 Mon Sep 17 00:00:00 2001 From: Muhammad Asif Anwar Date: Sat, 1 Dec 2018 00:57:07 +0400 Subject: [PATCH 514/546] for BAEL 10834 (#5816) * Update pom.xml * enabling spring-security-react module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index da17fc2931..ef7a7f6b1d 100644 --- a/pom.xml +++ b/pom.xml @@ -599,7 +599,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -1141,7 +1141,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From eeb02d95ae78750ea0254be3338c007a20df5f3e Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 23:20:02 +0200 Subject: [PATCH 515/546] Update pom.xml --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ef7a7f6b1d..7b295abc24 100644 --- a/pom.xml +++ b/pom.xml @@ -405,7 +405,8 @@ jaxb javafx jgroups - jee-7 + jee-7-security jjwt jsf From b0039348cfa292774718babb813e4dde15955e77 Mon Sep 17 00:00:00 2001 From: Loredana Date: Fri, 30 Nov 2018 23:50:52 +0200 Subject: [PATCH 516/546] fix module names --- spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml | 1 - spring-cloud-data-flow/etl/customer-transform/pom.xml | 1 - spring-cloud-data-flow/etl/pom.xml | 5 ++--- spring-cloud-data-flow/pom.xml | 3 +-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml b/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml index 468d8e17d0..779a4a803a 100644 --- a/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml +++ b/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml @@ -4,7 +4,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.customer customer-mongodb-sink jar diff --git a/spring-cloud-data-flow/etl/customer-transform/pom.xml b/spring-cloud-data-flow/etl/customer-transform/pom.xml index bc4b648907..c344b0fc57 100644 --- a/spring-cloud-data-flow/etl/customer-transform/pom.xml +++ b/spring-cloud-data-flow/etl/customer-transform/pom.xml @@ -4,7 +4,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.customer customer-transform 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/etl/pom.xml b/spring-cloud-data-flow/etl/pom.xml index e203999ee9..1f35d2072b 100644 --- a/spring-cloud-data-flow/etl/pom.xml +++ b/spring-cloud-data-flow/etl/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - org.baeldung.spring.cloud - etl-spring-cloud-data-flow + etl + etl 0.0.1-SNAPSHOT pom - etl-spring-cloud-data-flow org.baeldung.spring.cloud diff --git a/spring-cloud-data-flow/pom.xml b/spring-cloud-data-flow/pom.xml index dd1ceed71a..b5ef5d2c2a 100644 --- a/spring-cloud-data-flow/pom.xml +++ b/spring-cloud-data-flow/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - org.baeldung.spring.cloud spring-cloud-data-flow 0.0.1-SNAPSHOT pom - spring-cloud-data-flow + spring-cloud-data-flow com.baeldung From eb1a92698b544a30e9ec5ad2f99711ca9a8f1309 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Fri, 30 Nov 2018 15:26:54 -0800 Subject: [PATCH 517/546] BAEL-2368 update readme --- java-collections-conversions/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java-collections-conversions/README.md b/java-collections-conversions/README.md index 761a78d7b0..0f89e07d63 100644 --- a/java-collections-conversions/README.md +++ b/java-collections-conversions/README.md @@ -8,4 +8,5 @@ - [Converting between a List and a Set in Java](http://www.baeldung.com/convert-list-to-set-and-set-to-list) - [Convert a Map to an Array, List or Set in Java](http://www.baeldung.com/convert-map-values-to-array-list-set) - [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) -- [How to Convert List to Map in Java](http://www.baeldung.com/java-list-to-map) \ No newline at end of file +- [How to Convert List to Map in Java](http://www.baeldung.com/java-list-to-map) +- [Array to String Conversions](https://www.baeldung.com/java-array-to-string) From b81bcc75f68ab9db34e1e761c6aedc78c2dcdda0 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Fri, 30 Nov 2018 15:27:12 -0800 Subject: [PATCH 518/546] Update README.md --- core-java-lang/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 79d2375c24..0f75e9474b 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -59,3 +59,4 @@ - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) + From e884dc106340904c5af72dd54932c1bf8d3e6d94 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Fri, 30 Nov 2018 22:39:06 -0600 Subject: [PATCH 519/546] Fixed compiler errors in spring-boot-crud --- .../src/main/java/com/baeldung/crud/Application.java | 2 -- .../baeldung/crud/controllers/UserController.java | 6 ++++-- .../com/baeldung/crud/UserControllerUnitTest.java | 12 +++++++----- .../test/java/com/baeldung/crud/UserUnitTest.java | 4 +++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java index 436cccb964..d9f594fb75 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java @@ -14,8 +14,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @EnableJpaRepositories(basePackages="com.baeldung.crud.repositories") @EnableTransactionManagement @EntityScan(basePackages="com.baeldung.crud.entities") - -@SpringBootApplication public class Application { public static void main(String[] args) { diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java index 1b7185c2fd..9a6cb477aa 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java @@ -1,8 +1,7 @@ package com.baeldung.crud.controllers; -import com.baeldung.crud.UserRepository; -import com.baeldung.crud.entities.User; import javax.validation.Valid; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -11,6 +10,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + @Controller public class UserController { diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java index 7773a962fb..2de0828ae5 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java @@ -1,16 +1,18 @@ package com.baeldung.crud; -import com.baeldung.crud.UserController; -import com.baeldung.crud.entities.User; -import com.baeldung.crud.UserRepository; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.BeforeClass; -import org.junit.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + +import org.junit.BeforeClass; +import org.junit.Test; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; +import com.baeldung.crud.controllers.UserController; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + public class UserControllerUnitTest { private static UserController userController; diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java index a3c6a922d8..565f6727c3 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java @@ -1,9 +1,11 @@ package com.baeldung.crud; -import com.baeldung.crud.User; import static org.assertj.core.api.Assertions.assertThat; + import org.junit.Test; +import com.baeldung.crud.entities.User; + public class UserUnitTest { @Test From a303df4442c3d7c038f50f412c6248e913290dba Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 1 Dec 2018 08:51:37 +0200 Subject: [PATCH 520/546] fix module names --- spring-cloud-data-flow/data-flow-server/pom.xml | 1 - spring-cloud-data-flow/data-flow-shell/pom.xml | 1 - spring-cloud-data-flow/etl/pom.xml | 2 +- spring-cloud-data-flow/log-sink/pom.xml | 1 - spring-cloud-data-flow/time-processor/pom.xml | 1 - spring-cloud-data-flow/time-source/pom.xml | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/spring-cloud-data-flow/data-flow-server/pom.xml b/spring-cloud-data-flow/data-flow-server/pom.xml index 0133d65978..a02d2984c1 100644 --- a/spring-cloud-data-flow/data-flow-server/pom.xml +++ b/spring-cloud-data-flow/data-flow-server/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud data-flow-server 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/data-flow-shell/pom.xml b/spring-cloud-data-flow/data-flow-shell/pom.xml index e4ec145277..3b155736c3 100644 --- a/spring-cloud-data-flow/data-flow-shell/pom.xml +++ b/spring-cloud-data-flow/data-flow-shell/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud data-flow-shell 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/etl/pom.xml b/spring-cloud-data-flow/etl/pom.xml index 1f35d2072b..7d5040e8ad 100644 --- a/spring-cloud-data-flow/etl/pom.xml +++ b/spring-cloud-data-flow/etl/pom.xml @@ -7,7 +7,7 @@ pom - org.baeldung.spring.cloud + com.baeldung spring-cloud-data-flow 0.0.1-SNAPSHOT diff --git a/spring-cloud-data-flow/log-sink/pom.xml b/spring-cloud-data-flow/log-sink/pom.xml index 33a0a4df45..69de679c2a 100644 --- a/spring-cloud-data-flow/log-sink/pom.xml +++ b/spring-cloud-data-flow/log-sink/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud log-sink 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/time-processor/pom.xml b/spring-cloud-data-flow/time-processor/pom.xml index 4f31e55b96..e630df1865 100644 --- a/spring-cloud-data-flow/time-processor/pom.xml +++ b/spring-cloud-data-flow/time-processor/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud time-processor 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/time-source/pom.xml b/spring-cloud-data-flow/time-source/pom.xml index dc593fdb14..649af32cf0 100644 --- a/spring-cloud-data-flow/time-source/pom.xml +++ b/spring-cloud-data-flow/time-source/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud time-source 0.0.1-SNAPSHOT jar From 8a48239decdea2f491d6d3845f2cfbefbaec66d5 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 1 Dec 2018 08:53:41 +0200 Subject: [PATCH 521/546] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7b295abc24..3c5c171c96 100644 --- a/pom.xml +++ b/pom.xml @@ -600,7 +600,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From 51352c470f98c417bb4ecb9b3150eb9f167bc361 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Sat, 1 Dec 2018 00:40:53 -0700 Subject: [PATCH 522/546] SQLite with Spring Boot Added custom dialect for SQLite database. Simplify spring-data-rest Configuration Now uses profiles so that learners don't need to uncomment code in order for demonstrations to work. Issue: BAEL-2213 --- spring-data-rest/pom.xml | 11 +++ .../java/com/baeldung/config/DbConfig.java | 26 ++++++- .../com/baeldung/dialect/SQLiteDialect.java | 78 +++++++++++++++++++ .../dialect/SQLiteIdentityColumnSupport.java | 22 ++++++ .../src/main/resources/application.properties | 1 + .../resources/persistence-sqlite.properties | 7 +- 6 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java create mode 100644 spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index a6f12e1904..2fe4715bac 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -33,6 +33,15 @@ com.h2database h2 + + org.springframework.boot + spring-boot-autoconfigure + + + org.xerial + sqlite-jdbc + ${sqlite.version} + @@ -43,6 +52,8 @@ + com.baeldung.SpringDataRestApplication + 3.25.2 2.1.0.RELEASE diff --git a/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java b/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java index 8d1f9de497..26d882d6a0 100644 --- a/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java +++ b/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java @@ -7,6 +7,7 @@ import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @@ -14,11 +15,12 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; -//@Configuration +@Configuration @EnableJpaRepositories(basePackages = "com.baeldung.repositories") // @PropertySource("persistence-h2.properties") // @PropertySource("persistence-hsqldb.properties") // @PropertySource("persistence-derby.properties") +//@PropertySource("persistence-sqlite.properties") public class DbConfig { @Autowired @@ -59,3 +61,25 @@ public class DbConfig { } } + +@Configuration +@Profile("h2") +@PropertySource("persistence-h2.properties") +class H2Config {} + +@Configuration +@Profile("hsqldb") +@PropertySource("persistence-hsqldb.properties") +class HsqldbConfig {} + + +@Configuration +@Profile("derby") +@PropertySource("persistence-derby.properties") +class DerbyConfig {} + + +@Configuration +@Profile("sqlite") +@PropertySource("persistence-sqlite.properties") +class SqliteConfig {} diff --git a/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java new file mode 100644 index 0000000000..4512f7d34d --- /dev/null +++ b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java @@ -0,0 +1,78 @@ +package com.baeldung.dialect; + +import org.hibernate.dialect.Dialect; +import org.hibernate.dialect.identity.IdentityColumnSupport; + +import java.sql.Types; + +public class SQLiteDialect extends Dialect { + + public SQLiteDialect() { + registerColumnType(Types.BIT, "integer"); + registerColumnType(Types.TINYINT, "tinyint"); + registerColumnType(Types.SMALLINT, "smallint"); + registerColumnType(Types.INTEGER, "integer"); + registerColumnType(Types.BIGINT, "bigint"); + registerColumnType(Types.FLOAT, "float"); + registerColumnType(Types.REAL, "real"); + registerColumnType(Types.DOUBLE, "double"); + registerColumnType(Types.NUMERIC, "numeric"); + registerColumnType(Types.DECIMAL, "decimal"); + registerColumnType(Types.CHAR, "char"); + registerColumnType(Types.VARCHAR, "varchar"); + registerColumnType(Types.LONGVARCHAR, "longvarchar"); + registerColumnType(Types.DATE, "date"); + registerColumnType(Types.TIME, "time"); + registerColumnType(Types.TIMESTAMP, "timestamp"); + registerColumnType(Types.BINARY, "blob"); + registerColumnType(Types.VARBINARY, "blob"); + registerColumnType(Types.LONGVARBINARY, "blob"); + registerColumnType(Types.BLOB, "blob"); + registerColumnType(Types.CLOB, "clob"); + registerColumnType(Types.BOOLEAN, "integer"); + } + + public IdentityColumnSupport getIdentityColumnSupport() { + return new SQLiteIdentityColumnSupport(); + } + + public boolean hasAlterTable() { + return false; + } + + public boolean dropConstraints() { + return false; + } + + public String getDropForeignKeyString() { + return ""; + } + + public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey) { + return ""; + } + + public String getAddPrimaryKeyConstraintString(String constraintName) { + return ""; + } + + public String getForUpdateString() { + return ""; + } + + public String getAddColumnString() { + return "add column"; + } + + public boolean supportsOuterJoinForUpdate() { + return false; + } + + public boolean supportsIfExistsBeforeTableName() { + return true; + } + + public boolean supportsCascadeDelete() { + return false; + } +} diff --git a/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java new file mode 100644 index 0000000000..cf6e3a9a97 --- /dev/null +++ b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java @@ -0,0 +1,22 @@ +package com.baeldung.dialect; + +import org.hibernate.MappingException; +import org.hibernate.dialect.identity.IdentityColumnSupportImpl; + +public class SQLiteIdentityColumnSupport extends IdentityColumnSupportImpl { + + @Override + public boolean supportsIdentityColumns() { + return true; + } + + @Override + public String getIdentitySelectString(String table, String column, int type) throws MappingException { + return "select last_insert_rowid()"; + } + + @Override + public String getIdentityColumnString(int type) throws MappingException { + return "integer"; + } +} diff --git a/spring-data-rest/src/main/resources/application.properties b/spring-data-rest/src/main/resources/application.properties index e69de29bb2..06cb22a4fe 100644 --- a/spring-data-rest/src/main/resources/application.properties +++ b/spring-data-rest/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.profiles.default=h2 \ No newline at end of file diff --git a/spring-data-rest/src/main/resources/persistence-sqlite.properties b/spring-data-rest/src/main/resources/persistence-sqlite.properties index 018c2cbaca..b6b5f4e4d6 100644 --- a/spring-data-rest/src/main/resources/persistence-sqlite.properties +++ b/spring-data-rest/src/main/resources/persistence-sqlite.properties @@ -1,4 +1,7 @@ driverClassName=org.sqlite.JDBC -url=jdbc:sqlite:memory:myDb +url=jdbc:sqlite:memory:myDb?cache=shared username=sa -password=sa \ No newline at end of file +password=sa +hibernate.dialect=com.baeldung.dialect.SQLiteDialect +hibernate.hbm2ddl.auto=create-drop +hibernate.show_sql=true From d2f148c90fee69b4e60b288e9defe1c476c056fa Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 1 Dec 2018 09:53:13 +0200 Subject: [PATCH 523/546] Update Application.java --- .../src/main/java/com/baeldung/crud/Application.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java index d9f594fb75..0b686e90e9 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java @@ -19,4 +19,5 @@ public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } + } From 0bdc4f6602b530d4f009a8582edb7a3a2a93650c Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 1 Dec 2018 09:53:40 +0200 Subject: [PATCH 524/546] Update README.md --- core-java-lang/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 0f75e9474b..79d2375c24 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -59,4 +59,3 @@ - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) - From 7cbd26433d079de819e1c564941fac67ca2d59e5 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 11:22:23 +0200 Subject: [PATCH 525/546] pom cleanup work --- pom.xml | 186 +++++++++++++++++++++++++++----------------------------- 1 file changed, 88 insertions(+), 98 deletions(-) diff --git a/pom.xml b/pom.xml index 3c5c171c96..86ed229bce 100644 --- a/pom.xml +++ b/pom.xml @@ -363,6 +363,9 @@ core-java-8 core-groovy couchbase + core-java-concurrency + core-kotlin + core-java dozer disruptor @@ -419,6 +422,7 @@ java-spi java-ee-8-security-api + libraries libraries-data linkrest logging-modules/log-mdc @@ -469,7 +473,7 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 - persistence-modules/spring-data-mongodb + persistence-modules/spring-data-mongodb persistence-modules/java-cassandra persistence-modules/spring-data-cassandra persistence-modules/spring-data-couchbase-2 @@ -527,6 +531,8 @@ spring-5-mvc spring-5-security spring-5-security-oauth + + spring-aop spring-activiti spring-akka spring-amqp @@ -534,7 +540,6 @@ spring-apache-camel spring-batch spring-bom - spring-boot-keycloak spring-boot-bootstrap spring-boot-admin @@ -543,29 +548,34 @@ spring-boot-mvc spring-boot-logging-log4j2 spring-boot-disable-console-logging + spring-boot-property-exp + spring-boot-ctx-fluent + spring-boot + spring-boot-ops spring-cloud-data-flow spring-cloud spring-cloud-bus spring-core spring-cucumber - spring-ejb - spring-aop - spring-data-rest + spring-drools spring-dispatcher-servlet + spring-ejb spring-exceptions + spring-freemarker - spring-integration + + spring-jinq spring-jenkins-pipeline spring-jersey - spring-jms spring-jooq spring-kafka spring-katharsis spring-ldap + spring-mockito spring-mvc-forms-jsp spring-mvc-forms-thymeleaf @@ -574,6 +584,7 @@ spring-mvc-webflow spring-mvc-xml spring-mvc-kotlin + spring-protobuf spring-quartz spring-rest-angular @@ -582,6 +593,26 @@ spring-rest spring-resttemplate spring-rest-simple + spring-remoting + + spring-session + spring-sleuth + spring-social-login + spring-spel + spring-state-machine + spring-thymeleaf + spring-userservice + + spring-zuul + spring-reactor + spring-vertx + spring-vault + spring-rest-embedded-tomcat + spring-swagger-codegen + spring-webflux-amqp + + spring-static-resources + spring-security-thymeleaf spring-security-acl spring-security-cache-control spring-security-client/spring-security-jsp-authentication @@ -600,34 +631,13 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest spring-security-sso spring-security-x509 - spring-session - spring-sleuth - spring-social-login - spring-spel - spring-state-machine - spring-thymeleaf - spring-userservice - spring-zuul - spring-remoting - spring-reactor - spring-vertx - spring-vault - spring-jinq - spring-rest-embedded-tomcat - - spring-static-resources - spring-swagger-codegen - spring-drools - spring-boot-property-exp - spring-security-thymeleaf - spring-boot-ctx-fluent - spring-webflux-amqp + spring-security-mvc-custom spark-java saas @@ -668,17 +678,12 @@ @@ -910,6 +915,9 @@ core-java-8 core-groovy couchbase + core-java-concurrency + core-kotlin + core-java dozer disruptor @@ -952,7 +960,8 @@ jaxb javafx jgroups - jee-7 + jee-7-security jjwt jsf @@ -965,6 +974,7 @@ java-spi java-ee-8-security-api + libraries libraries-data linkrest logging-modules/log-mdc @@ -1015,7 +1025,7 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 - persistence-modules/spring-data-mongodb + persistence-modules/spring-data-mongodb persistence-modules/java-cassandra persistence-modules/spring-data-cassandra persistence-modules/spring-data-couchbase-2 @@ -1069,6 +1079,8 @@ spring-5-mvc spring-5-security spring-5-security-oauth + + spring-aop spring-activiti spring-akka spring-amqp @@ -1076,7 +1088,6 @@ spring-apache-camel spring-batch spring-bom - spring-boot-keycloak spring-boot-bootstrap spring-boot-admin @@ -1085,29 +1096,34 @@ spring-boot-mvc spring-boot-logging-log4j2 spring-boot-disable-console-logging + spring-boot-property-exp + spring-boot-ctx-fluent + spring-boot + spring-boot-ops spring-cloud-data-flow spring-cloud spring-cloud-bus spring-core spring-cucumber - spring-ejb - spring-aop - spring-data-rest + spring-drools spring-dispatcher-servlet + spring-ejb spring-exceptions + spring-freemarker - spring-integration + + spring-jinq spring-jenkins-pipeline spring-jersey - spring-jms spring-jooq spring-kafka spring-katharsis spring-ldap + spring-mockito spring-mvc-forms-jsp spring-mvc-forms-thymeleaf @@ -1116,6 +1132,7 @@ spring-mvc-webflow spring-mvc-xml spring-mvc-kotlin + spring-protobuf spring-quartz spring-rest-angular @@ -1124,6 +1141,26 @@ spring-rest spring-resttemplate spring-rest-simple + spring-remoting + + spring-session + spring-sleuth + spring-social-login + spring-spel + spring-state-machine + spring-thymeleaf + spring-userservice + + spring-zuul + spring-reactor + spring-vertx + spring-vault + spring-rest-embedded-tomcat + spring-swagger-codegen + spring-webflux-amqp + + spring-static-resources + spring-security-thymeleaf spring-security-acl spring-security-cache-control spring-security-client/spring-security-jsp-authentication @@ -1142,35 +1179,13 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest spring-security-sso spring-security-x509 - spring-session - spring-sleuth - spring-social-login - spring-spel - spring-state-machine - spring-thymeleaf - spring-userservice - spring-zuul - spring-remoting - spring-reactor - spring-vertx - spring-vault - spring-jinq - spring-rest-embedded-tomcat - - spring-static-resources - spring-swagger-codegen - spring-drools - spring-boot-property-exp - spring-security-thymeleaf - spring-boot-ctx-fluent - spring-webflux-amqp - + spring-security-mvc-custom spark-java saas @@ -1205,28 +1220,18 @@ @@ -1268,23 +1273,8 @@ parent-spring-5 parent-java parent-kotlin - libraries - geotools - jhipster - testing-modules/gatling - spring-boot - spring-boot-ops - spring-5 - core-kotlin - kotlin-libraries - core-java - google-web-toolkit - spring-security-mvc-custom - persistence-modules/hibernate5 - persistence-modules/spring-data-elasticsearch - core-java-concurrency - core-java-concurrency-collections - restx + + From 5d512da017bcdf653fb6d96c4fb2d4ee6951f193 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 11:23:47 +0200 Subject: [PATCH 526/546] adding the jira --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 86ed229bce..cd128aa4c5 100644 --- a/pom.xml +++ b/pom.xml @@ -631,7 +631,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -1179,7 +1179,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From a2b79472d9cbd74f076f32f792a1c31d138762c4 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sat, 1 Dec 2018 07:10:46 -0600 Subject: [PATCH 527/546] BAEL-2246: add link back to article (#5824) --- java-strings/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java-strings/README.md b/java-strings/README.md index 222b28e8ad..11893e68a2 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -38,3 +38,4 @@ - [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) - [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) - [Removing Repeated Characters from a String](https://www.baeldung.com/java-remove-repeated-char) +- [Join Array of Primitives with Separator in Java](https://www.baeldung.com/java-join-primitive-array) From 2fa22543451c87fd28f98280e4abd19997f6af53 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 18:49:06 +0200 Subject: [PATCH 528/546] ignoring module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cd128aa4c5..4b64a1a27e 100644 --- a/pom.xml +++ b/pom.xml @@ -364,7 +364,7 @@ core-groovy couchbase core-java-concurrency - core-kotlin + core-java dozer @@ -916,7 +916,7 @@ core-groovy couchbase core-java-concurrency - core-kotlin + core-java dozer From 90ca342016f2495acb1d551d17143be3043650e5 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 19:39:47 +0200 Subject: [PATCH 529/546] disabling very long running module --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b64a1a27e..f9eee3b5e6 100644 --- a/pom.xml +++ b/pom.xml @@ -363,7 +363,7 @@ core-java-8 core-groovy couchbase - core-java-concurrency + core-java From 56400babbf49417074097d0b10c4747610a4cdfa Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 19:40:23 +0200 Subject: [PATCH 530/546] disabling very long running module --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f9eee3b5e6..2bed3c4960 100644 --- a/pom.xml +++ b/pom.xml @@ -915,7 +915,7 @@ core-java-8 core-groovy couchbase - core-java-concurrency + core-java From fe7e4f87f2ad412e60ac50405870ad89baf49b29 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 20:45:56 +0200 Subject: [PATCH 531/546] ignoring long running module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2bed3c4960..6480193201 100644 --- a/pom.xml +++ b/pom.xml @@ -422,7 +422,7 @@ java-spi java-ee-8-security-api - libraries + libraries-data linkrest logging-modules/log-mdc @@ -974,7 +974,7 @@ java-spi java-ee-8-security-api - libraries + libraries-data linkrest logging-modules/log-mdc From dcb2dd46027ea9ed32e579a025b3f96496c506b5 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Sun, 2 Dec 2018 07:41:24 -0800 Subject: [PATCH 532/546] BAEL-2300 update readme --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index e8923e9a2f..b8ad28cc0c 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -88,3 +88,4 @@ - [Changing the Order in a Sum Operation Can Produce Different Results?](https://www.baeldung.com/java-floating-point-sum-order) - [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources) - [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) +- [Guide to Character Encoding](https://www.baeldung.com/java-char-encoding) From 0a87548bf80fdb8cfbd15edab2621df836ba1bda Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Sun, 2 Dec 2018 08:11:11 -0800 Subject: [PATCH 533/546] BAEL-2089 update readme --- persistence-modules/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/README.md b/persistence-modules/README.md index f12163bd6a..75ccc749e5 100644 --- a/persistence-modules/README.md +++ b/persistence-modules/README.md @@ -9,3 +9,4 @@ - [Introduction to Lettuce – the Java Redis Client](http://www.baeldung.com/java-redis-lettuce) - [A Guide to Jdbi](http://www.baeldung.com/jdbi) - [Pessimistic Locking in JPA](http://www.baeldung.com/jpa-pessimistic-locking) +- [Get All Data from a Table with Hibernate](https://www.baeldung.com/hibernate-select-all) From 857192358caf26bba0fec77f6991aed290fa91ab Mon Sep 17 00:00:00 2001 From: fanatixan Date: Sun, 2 Dec 2018 19:36:38 +0100 Subject: [PATCH 534/546] bael-2361 (#5804) * bael-2361 * Update RemoveLeadingAndTrailingZeroes.java * moving examples to java-string project --- .../RemoveLeadingAndTrailingZeroes.java | 103 +++++++++++++ ...emoveLeadingAndTrailingZeroesUnitTest.java | 143 ++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java create mode 100644 java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java diff --git a/java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java b/java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java new file mode 100644 index 0000000000..c9d748e897 --- /dev/null +++ b/java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java @@ -0,0 +1,103 @@ +package com.baeldung.string.removeleadingtrailingchar; + + +import org.apache.commons.lang3.StringUtils; + +import com.google.common.base.CharMatcher; + +public class RemoveLeadingAndTrailingZeroes { + + public static String removeLeadingZeroesWithStringBuilder(String s) { + StringBuilder sb = new StringBuilder(s); + + while (sb.length() > 1 && sb.charAt(0) == '0') { + sb.deleteCharAt(0); + } + + return sb.toString(); + } + + public static String removeTrailingZeroesWithStringBuilder(String s) { + StringBuilder sb = new StringBuilder(s); + + while (sb.length() > 1 && sb.charAt(sb.length() - 1) == '0') { + sb.setLength(sb.length() - 1); + } + + return sb.toString(); + } + + public static String removeLeadingZeroesWithSubstring(String s) { + int index = 0; + + for (; index < s.length() - 1; index++) { + if (s.charAt(index) != '0') { + break; + } + } + + return s.substring(index); + } + + public static String removeTrailingZeroesWithSubstring(String s) { + int index = s.length() - 1; + + for (; index > 0; index--) { + if (s.charAt(index) != '0') { + break; + } + } + + return s.substring(0, index + 1); + } + + public static String removeLeadingZeroesWithApacheCommonsStripStart(String s) { + String stripped = StringUtils.stripStart(s, "0"); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeTrailingZeroesWithApacheCommonsStripEnd(String s) { + String stripped = StringUtils.stripEnd(s, "0"); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeLeadingZeroesWithGuavaTrimLeadingFrom(String s) { + String stripped = CharMatcher.is('0') + .trimLeadingFrom(s); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeTrailingZeroesWithGuavaTrimTrailingFrom(String s) { + String stripped = CharMatcher.is('0') + .trimTrailingFrom(s); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeLeadingZeroesWithRegex(String s) { + return s.replaceAll("^0+(?!$)", ""); + } + + public static String removeTrailingZeroesWithRegex(String s) { + return s.replaceAll("(?!^)0+$", ""); + } +} diff --git a/java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java b/java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java new file mode 100644 index 0000000000..55f932fea1 --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java @@ -0,0 +1,143 @@ +package com.baeldung.string.removeleadingtrailingchar; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.stream.Stream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +public class RemoveLeadingAndTrailingZeroesUnitTest { + + public static Stream leadingZeroTestProvider() { + return Stream.of(Arguments.of("", ""), Arguments.of("abc", "abc"), Arguments.of("123", "123"), Arguments.of("0abc", "abc"), Arguments.of("0123", "123"), Arguments.of("0000123", "123"), Arguments.of("1230", "1230"), Arguments.of("01230", "1230"), Arguments.of("01", "1"), + Arguments.of("0001", "1"), Arguments.of("0", "0"), Arguments.of("00", "0"), Arguments.of("0000", "0"), Arguments.of("12034", "12034"), Arguments.of("1200034", "1200034"), Arguments.of("0012034", "12034"), Arguments.of("1203400", "1203400")); + } + + public static Stream trailingZeroTestProvider() { + return Stream.of(Arguments.of("", ""), Arguments.of("abc", "abc"), Arguments.of("123", "123"), Arguments.of("abc0", "abc"), Arguments.of("1230", "123"), Arguments.of("1230000", "123"), Arguments.of("0123", "0123"), Arguments.of("01230", "0123"), Arguments.of("10", "1"), + Arguments.of("1000", "1"), Arguments.of("0", "0"), Arguments.of("00", "0"), Arguments.of("0000", "0"), Arguments.of("12034", "12034"), Arguments.of("1200034", "1200034"), Arguments.of("0012034", "0012034"), Arguments.of("1203400", "12034")); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithStringBuilder_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithStringBuilder(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithStringBuilder_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithStringBuilder(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithSubstring_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithSubstring(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithSubstring_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithSubstring(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithApacheCommonsStripStart_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithApacheCommonsStripStart(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithApacheCommonsStripEnd_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithApacheCommonsStripEnd(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithGuavaTrimLeadingFrom_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithGuavaTrimLeadingFrom(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithGuavaTrimTrailingFrom_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithGuavaTrimTrailingFrom(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithRegex_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithRegex(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithRegex_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithRegex(input); + + // then + assertThat(result).isEqualTo(expected); + } + +} From 6b29e94a406d81e23f6d7534c3692b7c855da12a Mon Sep 17 00:00:00 2001 From: chrisoberle Date: Sun, 2 Dec 2018 21:23:39 -0500 Subject: [PATCH 535/546] BAEL-2174 How to use proxies in core java (#5805) * move samples from core-java to new core-java-net module * remove erroneous commit of .vscode dir --- core-java-net/.gitignore | 25 +++++++++++++++++++ core-java-net/README.md | 3 +++ core-java-net/pom.xml | 19 ++++++++++++++ .../proxies/CommandLineProxyDemo.java | 0 .../networking/proxies/DirectProxyDemo.java | 0 .../networking/proxies/SocksProxyDemo.java | 0 .../proxies/SystemPropertyProxyDemo.java | 0 .../proxies/UrlConnectionUtils.java | 0 .../networking/proxies/WebProxyDemo.java | 0 core-java-net/src/test/resources/.gitignore | 13 ++++++++++ pom.xml | 4 ++- 11 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 core-java-net/.gitignore create mode 100644 core-java-net/README.md create mode 100644 core-java-net/pom.xml rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java (100%) create mode 100644 core-java-net/src/test/resources/.gitignore diff --git a/core-java-net/.gitignore b/core-java-net/.gitignore new file mode 100644 index 0000000000..374c8bf907 --- /dev/null +++ b/core-java-net/.gitignore @@ -0,0 +1,25 @@ +*.class + +0.* + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* +.resourceCache + +# Packaged files # +*.jar +*.war +*.ear + +# Files generated by integration tests +backup-pom.xml +/bin/ +/temp + +#IntelliJ specific +.idea/ +*.iml \ No newline at end of file diff --git a/core-java-net/README.md b/core-java-net/README.md new file mode 100644 index 0000000000..b7a142ea27 --- /dev/null +++ b/core-java-net/README.md @@ -0,0 +1,3 @@ +========= + +## Core Java Net diff --git a/core-java-net/pom.xml b/core-java-net/pom.xml new file mode 100644 index 0000000000..28d5766a9a --- /dev/null +++ b/core-java-net/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + core-java-net + 0.1.0-SNAPSHOT + jar + core-java-net + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + core-java-net + + diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java diff --git a/core-java-net/src/test/resources/.gitignore b/core-java-net/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-net/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6480193201..b5c61dff9d 100644 --- a/pom.xml +++ b/pom.xml @@ -366,7 +366,8 @@ core-java - + core-java-net + dozer disruptor drools @@ -918,6 +919,7 @@ core-java + core-java-net dozer disruptor From dcf28dd16638a27ea620d5d47b904ebe1195afc5 Mon Sep 17 00:00:00 2001 From: Seun Matt Date: Mon, 3 Dec 2018 17:03:41 +0100 Subject: [PATCH 536/546] refactor the spring boot persistence mongodb module (#5829) * added example code for BAEL-2366 * moved example code for BAEL-2366 * example code for BAEL-1961 * moved example code into integration test * updated the test assertions * refactor the spring boot persistence mongodb module * remove redundant example code * declared the spring boot persistence module in the root pom * fixed issue with non-imported file --- .../.gitignore | 4 + .../spring-boot-persistence-mongodb/pom.xml | 106 ++++++++++++++++++ .../SpringBootPersistenceApplication.java | 13 +++ .../baeldung/mongodb/daos/UserRepository.java | 0 .../mongodb/events/UserModelListener.java | 0 .../mongodb/models/DatabaseSequence.java | 0 .../com/baeldung/mongodb/models/User.java | 0 .../services/SequenceGeneratorService.java | 0 .../src/main/resources/application.properties | 8 ++ ...goDbAutoGeneratedFieldIntegrationTest.java | 7 +- pom.xml | 1 + .../com/baeldung/mongodb/Application.java | 19 ---- .../mongodb/MongoDbSpringIntegrationTest.java | 1 + 13 files changed, 137 insertions(+), 22 deletions(-) create mode 100644 persistence-modules/spring-boot-persistence-mongodb/.gitignore create mode 100644 persistence-modules/spring-boot-persistence-mongodb/pom.xml create mode 100644 persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/daos/UserRepository.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/events/UserModelListener.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/models/User.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java (100%) create mode 100644 persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java (88%) delete mode 100644 spring-boot/src/main/java/com/baeldung/mongodb/Application.java diff --git a/persistence-modules/spring-boot-persistence-mongodb/.gitignore b/persistence-modules/spring-boot-persistence-mongodb/.gitignore new file mode 100644 index 0000000000..f96dae6a60 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/.gitignore @@ -0,0 +1,4 @@ + +/.idea/ +/target/ +/spring-boot-persistence.iml diff --git a/persistence-modules/spring-boot-persistence-mongodb/pom.xml b/persistence-modules/spring-boot-persistence-mongodb/pom.xml new file mode 100644 index 0000000000..fc267eedf6 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/pom.xml @@ -0,0 +1,106 @@ + + + 4.0.0 + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + spring-boot-persistence-mongodb + war + spring-boot-persistence-mongodb + This is simple boot application for Spring boot persistence mongodb test + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-data-mongodb + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + org.junit.platform + junit-platform-launcher + ${junit-platform.version} + test + + + org.springframework.boot + spring-boot-starter-test + test + + + + + spring-boot-persistence + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-war-plugin + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + json + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java new file mode 100644 index 0000000000..2dff3f37df --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java @@ -0,0 +1,13 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringBootPersistenceApplication { + + public static void main(String ... args) { + SpringApplication.run(SpringBootPersistenceApplication.class, args); + } + +} diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/daos/UserRepository.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/daos/UserRepository.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/events/UserModelListener.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/events/UserModelListener.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/models/User.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/User.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/models/User.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/User.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties new file mode 100644 index 0000000000..5b1b8000d0 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties @@ -0,0 +1,8 @@ +spring.application.name=spring-boot-persistence +server.port=${PORT:0} + +#spring boot mongodb +spring.data.mongodb.host=localhost +spring.data.mongodb.port=27017 +spring.data.mongodb.database=springboot-mongo + diff --git a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java b/persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java similarity index 88% rename from spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java rename to persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java index 3430bca69a..cec1ad5fea 100644 --- a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java +++ b/persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java @@ -5,17 +5,18 @@ import com.baeldung.mongodb.models.User; 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.test.context.junit4.SpringRunner; -import static org.assertj.core.api.Assertions.assertThat; -import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) +@SpringBootTest public class MongoDbAutoGeneratedFieldIntegrationTest { @Autowired - private UserRepository userRepository; + UserRepository userRepository; @Test public void contextLoads() {} diff --git a/pom.xml b/pom.xml index b5c61dff9d..dabb4a9628 100644 --- a/pom.xml +++ b/pom.xml @@ -479,6 +479,7 @@ persistence-modules/spring-data-cassandra persistence-modules/spring-data-couchbase-2 persistence-modules/spring-data-redis + persistence-modules/spring-boot-persistence-mongodb reactor-core resteasy diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/Application.java b/spring-boot/src/main/java/com/baeldung/mongodb/Application.java deleted file mode 100644 index c0a9ad59a7..0000000000 --- a/spring-boot/src/main/java/com/baeldung/mongodb/Application.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.mongodb; - -import com.baeldung.mongodb.daos.UserRepository; -import com.baeldung.mongodb.models.User; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -import java.util.List; - -@SpringBootApplication -public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java index 5431217c3e..39127f62e9 100644 --- a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java +++ b/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java @@ -2,6 +2,7 @@ package com.baeldung.mongodb; import static org.assertj.core.api.Assertions.assertThat; +import org.baeldung.boot.Application; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; From d25f0f1bb3e4dae3618ccfdcc09e2bf61212c978 Mon Sep 17 00:00:00 2001 From: yatendragoel Date: Mon, 3 Dec 2018 23:02:16 +0530 Subject: [PATCH 537/546] BAEL-2403: Immutable Map implementations in Java (#5828) * BAEL-2203 - Convert java.time.Instant to java.sql.Timestamp and vice-versa * BAEL-2203: Review edits * Removed ZoneId code * Converted class to JUnit Test * Update and rename ConvertInstantToTimestampTest.java to ConvertInstantToTimestampUnitTest.java * BAEL-2403: Immutable Map implementations in Java * BAEL-2403: Immutable Map implementations in Java - Changed file name --- .../java/map/ImmutableMapUnitTest.java | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java new file mode 100644 index 0000000000..b239ae07d8 --- /dev/null +++ b/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java @@ -0,0 +1,87 @@ +package com.baeldung.java.map; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +import com.google.common.collect.ImmutableMap; + + +public class ImmutableMapUnitTest { + + @Test + public void whenCollectionsUnModifiableMapMethod_thenOriginalCollectionChangesReflectInUnmodifiableMap() { + + Map mutableMap = new HashMap<>(); + mutableMap.put("USA", "North America"); + + Map unmodifiableMap = Collections.unmodifiableMap(mutableMap); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableMap.put("Canada", "North America")); + + mutableMap.remove("USA"); + assertFalse(unmodifiableMap.containsKey("USA")); + + mutableMap.put("Mexico", "North America"); + assertTrue(unmodifiableMap.containsKey("Mexico")); + } + + @Test + @SuppressWarnings("deprecation") + public void whenGuavaImmutableMapFromCopyOfMethod_thenOriginalCollectionChangesDoNotReflectInImmutableMap() { + + Map mutableMap = new HashMap<>(); + mutableMap.put("USA", "North America"); + + ImmutableMap immutableMap = ImmutableMap.copyOf(mutableMap); + assertTrue(immutableMap.containsKey("USA")); + + assertThrows(UnsupportedOperationException.class, () -> immutableMap.put("Canada", "North America")); + + mutableMap.remove("USA"); + assertTrue(immutableMap.containsKey("USA")); + + mutableMap.put("Mexico", "North America"); + assertFalse(immutableMap.containsKey("Mexico")); + } + + @Test + @SuppressWarnings("deprecation") + public void whenGuavaImmutableMapFromBuilderMethod_thenOriginalCollectionChangesDoNotReflectInImmutableMap() { + + Map mutableMap = new HashMap<>(); + mutableMap.put("USA", "North America"); + + ImmutableMap immutableMap = ImmutableMap.builder() + .putAll(mutableMap) + .put("Costa Rica", "North America") + .build(); + assertTrue(immutableMap.containsKey("USA")); + assertTrue(immutableMap.containsKey("Costa Rica")); + + assertThrows(UnsupportedOperationException.class, () -> immutableMap.put("Canada", "North America")); + + mutableMap.remove("USA"); + assertTrue(immutableMap.containsKey("USA")); + + mutableMap.put("Mexico", "North America"); + assertFalse(immutableMap.containsKey("Mexico")); + } + + @Test + @SuppressWarnings("deprecation") + public void whenGuavaImmutableMapFromOfMethod_thenOriginalCollectionChangesDoNotReflectInImmutableMap() { + + ImmutableMap immutableMap = ImmutableMap.of("USA", "North America", "Costa Rica", "North America"); + assertTrue(immutableMap.containsKey("USA")); + assertTrue(immutableMap.containsKey("Costa Rica")); + + assertThrows(UnsupportedOperationException.class, () -> immutableMap.put("Canada", "North America")); + } + +} From 3addff050fd2d2c67408f6151f3a96f42752e832 Mon Sep 17 00:00:00 2001 From: Mher Baghinyan Date: Tue, 4 Dec 2018 09:17:57 +0400 Subject: [PATCH 538/546] printf examples Issue: BAEL-2228 --- .../com/baeldung/printf/PrintfExamples.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/printf/PrintfExamples.java diff --git a/core-java/src/main/java/com/baeldung/printf/PrintfExamples.java b/core-java/src/main/java/com/baeldung/printf/PrintfExamples.java new file mode 100644 index 0000000000..3d451f6f50 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/printf/PrintfExamples.java @@ -0,0 +1,61 @@ +package com.baeldung.printf; + +import java.util.Date; +import java.util.Locale; + +public class PrintfExamples { + + public static void main(String[] args) { + + printfNewLine(); + printfChar(); + printfString(); + printfNumber(); + printfDateTime(); + printfBoolean(); + } + + private static void printfNewLine() { + System.out.printf("baeldung%nline%nterminator"); + } + + private static void printfString() { + System.out.printf("'%s' %n", "baeldung"); + System.out.printf("'%S' %n", "baeldung"); + System.out.printf("'%15s' %n", "baeldung"); + System.out.printf("'%-10s' %n", "baeldung"); + } + + private static void printfChar() { + System.out.printf("%c%n", 's'); + System.out.printf("%C%n", 's'); + } + + private static void printfNumber() { + System.out.printf("simple integer: %d%n", 10000L); + + System.out.printf(Locale.US, "%,d %n", 10000); + System.out.printf(Locale.ITALY, "%,d %n", 10000); + + System.out.printf("%f%n", 5.1473); + System.out.printf("'%5.2f'%n", 5.1473); + System.out.printf("'%5.2e'%n", 5.1473); + } + + private static void printfBoolean() { + System.out.printf("%b%n", null); + System.out.printf("%B%n", false); + System.out.printf("%B%n", 5.3); + System.out.printf("%b%n", "random text"); + } + + private static void printfDateTime() { + Date date = new Date(); + System.out.printf("%tT%n", date); + System.out.printf("hours %tH: minutes %tM: seconds %tS%n", date, date, date); + System.out.printf("%1$tH:%1$tM:%1$tS %1$tp %1$tL %1$tN %1$tz %n", date); + + System.out.printf("%1$tA %1$tB %1$tY %n", date); + System.out.printf("%1$td.%1$tm.%1$ty %n", date); + } +} From 57d6c392b2cdabc158274ee5c3d87447f107795b Mon Sep 17 00:00:00 2001 From: Eugen Date: Tue, 4 Dec 2018 17:00:27 +0200 Subject: [PATCH 539/546] Update README.md --- spring-rest-full/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-rest-full/README.md b/spring-rest-full/README.md index b8fef9cb82..a5d72372f7 100644 --- a/spring-rest-full/README.md +++ b/spring-rest-full/README.md @@ -17,7 +17,7 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com - [Project Configuration with Spring](http://www.baeldung.com/project-configuration-with-spring) - [Metrics for your Spring REST API](http://www.baeldung.com/spring-rest-api-metrics) - [Bootstrap a Web Application with Spring 4](http://www.baeldung.com/bootstraping-a-web-application-with-spring-and-java-based-configuration) -- [Build a REST API with Spring 4 and Java Config](http://www.baeldung.com/building-a-restful-web-service-with-spring-and-java-based-configuration) +- [Build a REST API with Spring and Java Config](http://www.baeldung.com/building-a-restful-web-service-with-spring-and-java-based-configuration) - [Error Handling for REST with Spring](http://www.baeldung.com/exception-handling-for-rest-with-spring) From a370f6e78170adbede74bb3d6a749ea9c8685850 Mon Sep 17 00:00:00 2001 From: Dhananjay Singh Date: Wed, 5 Dec 2018 07:23:51 +0530 Subject: [PATCH 540/546] Calculate Factorial in Java (#5748) * Factorials * Refactored factorials * Change input to int * Small fixes * Renamed tests --- algorithms-miscellaneous-1/pom.xml | 6 ++ .../algorithms/factorial/Factorial.java | 63 ++++++++++++++++ .../factorial/FactorialUnitTest.java | 72 +++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/factorial/Factorial.java create mode 100644 algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/factorial/FactorialUnitTest.java diff --git a/algorithms-miscellaneous-1/pom.xml b/algorithms-miscellaneous-1/pom.xml index 75b031282b..5006670dd9 100644 --- a/algorithms-miscellaneous-1/pom.xml +++ b/algorithms-miscellaneous-1/pom.xml @@ -17,6 +17,11 @@ commons-math3 ${commons-math3.version} + + com.google.guava + guava + ${guava.version} + commons-codec commons-codec @@ -73,6 +78,7 @@ 3.6.1 3.9.0 1.11 + 25.1-jre \ No newline at end of file diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/factorial/Factorial.java b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/factorial/Factorial.java new file mode 100644 index 0000000000..43d2221773 --- /dev/null +++ b/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/factorial/Factorial.java @@ -0,0 +1,63 @@ +package com.baeldung.algorithms.factorial; + +import java.math.BigInteger; +import java.util.stream.LongStream; + +import org.apache.commons.math3.util.CombinatoricsUtils; + +import com.google.common.math.BigIntegerMath; + +public class Factorial { + + public long factorialUsingForLoop(int n) { + long fact = 1; + for (int i = 2; i <= n; i++) { + fact = fact * i; + } + return fact; + } + + public long factorialUsingStreams(int n) { + return LongStream.rangeClosed(1, n) + .reduce(1, (long x, long y) -> x * y); + } + + public long factorialUsingRecursion(int n) { + if (n <= 2) { + return n; + } + return n * factorialUsingRecursion(n - 1); + } + + private Long[] factorials = new Long[20]; + + public long factorialUsingMemoize(int n) { + + if (factorials[n] != null) { + return factorials[n]; + } + + if (n <= 2) { + return n; + } + long nthValue = n * factorialUsingMemoize(n - 1); + factorials[n] = nthValue; + return nthValue; + } + + public BigInteger factorialHavingLargeResult(int n) { + BigInteger result = BigInteger.ONE; + for (int i = 2; i <= n; i++) + result = result.multiply(BigInteger.valueOf(i)); + return result; + } + + public long factorialUsingApacheCommons(int n) { + return CombinatoricsUtils.factorial(n); + } + + public BigInteger factorialUsingGuava(int n) { + return BigIntegerMath.factorial(n); + } + +} diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/factorial/FactorialUnitTest.java b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/factorial/FactorialUnitTest.java new file mode 100644 index 0000000000..c185dba62b --- /dev/null +++ b/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/factorial/FactorialUnitTest.java @@ -0,0 +1,72 @@ +package com.baeldung.algorithms.factorial; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.math.BigInteger; + +import org.junit.Before; +import org.junit.Test; + +public class FactorialUnitTest { + + Factorial factorial; + + @Before + public void setup() { + factorial = new Factorial(); + } + + @Test + public void whenCalculatingFactorialUsingForLoop_thenCorrect() { + int n = 5; + + assertThat(factorial.factorialUsingForLoop(n)).isEqualTo(120); + } + + @Test + public void whenCalculatingFactorialUsingStreams_thenCorrect() { + int n = 5; + + assertThat(factorial.factorialUsingStreams(n)).isEqualTo(120); + } + + @Test + public void whenCalculatingFactorialUsingRecursion_thenCorrect() { + int n = 5; + + assertThat(factorial.factorialUsingRecursion(n)).isEqualTo(120); + } + + @Test + public void whenCalculatingFactorialUsingMemoize_thenCorrect() { + int n = 5; + + assertThat(factorial.factorialUsingMemoize(n)).isEqualTo(120); + + n = 6; + + assertThat(factorial.factorialUsingMemoize(n)).isEqualTo(720); + } + + @Test + public void whenCalculatingFactorialHavingLargeResult_thenCorrect() { + int n = 22; + + assertThat(factorial.factorialHavingLargeResult(n)).isEqualTo(new BigInteger("1124000727777607680000")); + } + + @Test + public void whenCalculatingFactorialUsingApacheCommons_thenCorrect() { + int n = 5; + + assertThat(factorial.factorialUsingApacheCommons(n)).isEqualTo(120); + } + + @Test + public void whenCalculatingFactorialUsingGuava_thenCorrect() { + int n = 22; + + assertThat(factorial.factorialUsingGuava(n)).isEqualTo(new BigInteger("1124000727777607680000")); + } + +} From c4d92d17b5d77d9e675d25a4e0620af4cb8f130f Mon Sep 17 00:00:00 2001 From: gmconte <3528114+gmconte@users.noreply.github.com> Date: Wed, 5 Dec 2018 03:09:47 +0000 Subject: [PATCH 541/546] BAEL-2346: modifying concurrency code to add more examples (#5843) --- .../ScheduledExecutorServiceDemo.java | 58 ++++++++++++------- .../daemon/MultipleThreadsExample.java | 12 ++++ .../baeldung/concurrent/daemon/NewThread.java | 10 +++- .../daemon/SingleThreadExample.java | 8 +++ 4 files changed, 65 insertions(+), 23 deletions(-) create mode 100644 core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/MultipleThreadsExample.java create mode 100644 core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/SingleThreadExample.java diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/Scheduledexecutorservice/ScheduledExecutorServiceDemo.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/Scheduledexecutorservice/ScheduledExecutorServiceDemo.java index b77019eea5..0989195ba7 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/Scheduledexecutorservice/ScheduledExecutorServiceDemo.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/Scheduledexecutorservice/ScheduledExecutorServiceDemo.java @@ -1,34 +1,52 @@ package com.baeldung.concurrent.Scheduledexecutorservice; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.function.Function; public class ScheduledExecutorServiceDemo { - public void execute() { + private void execute() { ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); - - ScheduledFuture scheduledFuture = executorService.schedule(() -> { - // Task - }, 1, TimeUnit.SECONDS); - - executorService.scheduleAtFixedRate(() -> { - // Task - }, 1, 10, TimeUnit.SECONDS); - - executorService.scheduleWithFixedDelay(() -> { - // Task - }, 1, 10, TimeUnit.SECONDS); - - Future future = executorService.schedule(() -> { - // Task - return "Hellow world"; - }, 1, TimeUnit.SECONDS); - + getTasksToRun().apply(executorService); executorService.shutdown(); } + private void executeWithMultiThread() { + ScheduledExecutorService executorService = Executors.newScheduledThreadPool(2); + getTasksToRun().apply(executorService); + executorService.shutdown(); + } + + private Function getTasksToRun() { + return (executorService -> { + ScheduledFuture scheduledFuture1 = executorService.schedule(() -> { + // Task + }, 1, TimeUnit.SECONDS); + + ScheduledFuture scheduledFuture2 = executorService.scheduleAtFixedRate(() -> { + // Task + }, 1, 10, TimeUnit.SECONDS); + + ScheduledFuture scheduledFuture3 = executorService.scheduleWithFixedDelay(() -> { + // Task + }, 1, 10, TimeUnit.SECONDS); + + ScheduledFuture scheduledFuture4 = executorService.schedule(() -> { + // Task + return "Hellow world"; + }, 1, TimeUnit.SECONDS); + return null; + }); + } + + public static void main(String... args) { + ScheduledExecutorServiceDemo demo = new ScheduledExecutorServiceDemo(); + demo.execute(); + demo.executeWithMultiThread(); + } + + } diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/MultipleThreadsExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/MultipleThreadsExample.java new file mode 100644 index 0000000000..492466e0c3 --- /dev/null +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/MultipleThreadsExample.java @@ -0,0 +1,12 @@ +package com.baeldung.concurrent.daemon; + +public class MultipleThreadsExample { + public static void main(String[] args) { + NewThread t1 = new NewThread(); + t1.setName("MyThread-1"); + NewThread t2 = new NewThread(); + t2.setName("MyThread-2"); + t1.start(); + t2.start(); + } +} diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/NewThread.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/NewThread.java index 4d87978070..370ce99c09 100644 --- a/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/NewThread.java +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/NewThread.java @@ -1,14 +1,18 @@ package com.baeldung.concurrent.daemon; public class NewThread extends Thread { - public void run() { long startTime = System.currentTimeMillis(); while (true) { for (int i = 0; i < 10; i++) { - System.out.println("New Thread is running..." + i); + System.out.println(this.getName() + ": New Thread is running..." + i); + try { + //Wait for one sec so it doesn't print too fast + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } } - // prevent the Thread to run forever. It will finish it's execution after 2 seconds if (System.currentTimeMillis() - startTime > 2000) { Thread.currentThread().interrupt(); diff --git a/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/SingleThreadExample.java b/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/SingleThreadExample.java new file mode 100644 index 0000000000..16d8b2be1e --- /dev/null +++ b/core-java-concurrency/src/main/java/com/baeldung/concurrent/daemon/SingleThreadExample.java @@ -0,0 +1,8 @@ +package com.baeldung.concurrent.daemon; + +public class SingleThreadExample { + public static void main(String[] args) { + NewThread t = new NewThread(); + t.start(); + } +} From a21f82001cee47d1d69fecc069b8da631a3d6533 Mon Sep 17 00:00:00 2001 From: Ger Roza Date: Wed, 5 Dec 2018 01:14:12 -0200 Subject: [PATCH 542/546] Added cases using subscribeOn and publishOn when debuggin reactive streams, for analysis (#5841) --- .../consumer/chronjobs/ChronJobs.java | 32 +++++++++++++++++++ .../debugging/consumer/model/Foo.java | 7 +++- .../debugging/consumer/model/FooDto.java | 8 +++-- .../consumer/service/FooService.java | 29 +++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java index 09cbc34a6f..bf96ab56d6 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/chronjobs/ChronJobs.java @@ -119,4 +119,36 @@ public class ChronJobs { logger.info("process 4 with approach 4"); service.processUsingApproachFourWithCheckpoint(fluxFoo); } + + @Scheduled(fixedRate = 20000) + public void consumeFiniteFluxWitParallelScheduler() { + Flux fluxFoo = client.get() + .uri("/functional-reactive/periodic-foo-2") + .accept(MediaType.TEXT_EVENT_STREAM) + .retrieve() + .bodyToFlux(FooDto.class) + .delayElements(Duration.ofMillis(100)) + .map(dto -> { + logger.debug("process 5-parallel with dto id {} name{}", dto.getId(), dto.getName()); + return new Foo(dto); + }); + logger.info("process 5-parallel with approach 5-parallel"); + service.processUsingApproachFivePublishingToDifferentParallelThreads(fluxFoo); + } + + @Scheduled(fixedRate = 20000) + public void consumeFiniteFluxWithSingleSchedulers() { + Flux fluxFoo = client.get() + .uri("/functional-reactive/periodic-foo-2") + .accept(MediaType.TEXT_EVENT_STREAM) + .retrieve() + .bodyToFlux(FooDto.class) + .delayElements(Duration.ofMillis(100)) + .map(dto -> { + logger.debug("process 5-single with dto id {} name{}", dto.getId(), dto.getName()); + return new Foo(dto); + }); + logger.info("process 5-single with approach 5-single"); + service.processUsingApproachFivePublishingToDifferentSingleThreads(fluxFoo); + } } diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java index e101457b84..ac5093c261 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/Foo.java @@ -6,8 +6,13 @@ import org.springframework.data.annotation.Id; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; -@Data +@Getter +@Setter +@NoArgsConstructor @AllArgsConstructor public class Foo { diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java index 50508fd216..33f19c4e60 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/model/FooDto.java @@ -1,9 +1,13 @@ package com.baeldung.debugging.consumer.model; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; -@Data +@Getter +@Setter +@NoArgsConstructor @AllArgsConstructor public class FooDto { diff --git a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java index 937e445ef5..438f6d473c 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java +++ b/spring-5-reactive/src/main/java/com/baeldung/debugging/consumer/service/FooService.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; import com.baeldung.debugging.consumer.model.Foo; import reactor.core.publisher.Flux; +import reactor.core.scheduler.Schedulers; @Component public class FooService { @@ -88,4 +89,32 @@ public class FooService { flux.subscribe(); } + public void processUsingApproachFivePublishingToDifferentParallelThreads(Flux flux) { + logger.info("starting approach five-parallel!"); + flux = concatAndSubstringFooName(flux).publishOn(Schedulers.newParallel("five-parallel-foo")) + .log(); + flux = concatAndSubstringFooName(flux); + flux = divideFooQuantity(flux); + flux = reportResult(flux, "FIVE-PARALLEL").publishOn(Schedulers.newSingle("five-parallel-bar")); + flux = concatAndSubstringFooName(flux).doOnError(error -> { + logger.error("Approach 5-parallel failed!", error); + }); + flux.subscribeOn(Schedulers.newParallel("five-parallel-starter")) + .subscribe(); + } + + public void processUsingApproachFivePublishingToDifferentSingleThreads(Flux flux) { + logger.info("starting approach five-single!"); + flux = flux.log() + .subscribeOn(Schedulers.newSingle("five-single-starter")); + flux = concatAndSubstringFooName(flux).publishOn(Schedulers.newSingle("five-single-foo")); + flux = concatAndSubstringFooName(flux); + flux = divideFooQuantity(flux); + flux = reportResult(flux, "FIVE-SINGLE").publishOn(Schedulers.newSingle("five-single-bar")); + flux = concatAndSubstringFooName(flux).doOnError(error -> { + logger.error("Approach 5-single failed!", error); + }); + flux.subscribe(); + } + } From cac62f06ae95ca2c97d1707a24973a48c778d246 Mon Sep 17 00:00:00 2001 From: Priyesh Mashelkar Date: Wed, 5 Dec 2018 18:30:14 +0000 Subject: [PATCH 543/546] BAEL-2344 Hibernate Named Query (#5835) * Added writer * Added implementation and test class * Added more details * Updated tests * Updated code as per review comments * Added test class and one named query * Updated test class * Added update HQL * Added new initialisation script and new queries * Corrected queries * Removed commented code * printf examples Issue: BAEL-2228 * Update README.md * Added implementation and test class * Added more details * Updated tests * Updated code as per review comments * Added test class and one named query * Updated test class * Added update HQL * Added new initialisation script and new queries * Corrected queries * Removed commented code --- .../hibernate/entities/DeptEmployee.java | 75 +++++++++++++ .../src/main/resources/init_database.sql | 10 ++ .../hibernate/NamedQueryIntegrationTest.java | 103 ++++++++++++++++++ .../resources/hibernate-namedquery.properties | 9 ++ .../hibernate/entities/DeptEmployee.java | 14 ++- 5 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java create mode 100644 hibernate5/src/main/resources/init_database.sql create mode 100644 hibernate5/src/test/java/com/baeldung/hibernate/NamedQueryIntegrationTest.java create mode 100644 hibernate5/src/test/resources/hibernate-namedquery.properties diff --git a/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java b/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java new file mode 100644 index 0000000000..7813e89a48 --- /dev/null +++ b/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java @@ -0,0 +1,75 @@ +package com.baeldung.hibernate.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; + +@org.hibernate.annotations.NamedQueries({ @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_FindByEmployeeNumber", query = "from DeptEmployee where employeeNumber = :employeeNo"), + @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_FindAllByDesgination", query = "from DeptEmployee where designation = :designation"), + @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_UpdateEmployeeDepartment", query = "Update DeptEmployee set department = :newDepartment where employeeNumber = :employeeNo"), + @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_FindAllByDepartment", query = "from DeptEmployee where department = :department", timeout = 1, fetchSize = 10) }) +@org.hibernate.annotations.NamedNativeQueries({ @org.hibernate.annotations.NamedNativeQuery(name = "DeptEmployee_FindByEmployeeName", query = "select * from deptemployee emp where name=:name", resultClass = DeptEmployee.class), + @org.hibernate.annotations.NamedNativeQuery(name = "DeptEmployee_UpdateEmployeeDesignation", query = "call UPDATE_EMPLOYEE_DESIGNATION(:employeeNumber, :newDesignation)", resultClass = DeptEmployee.class) }) +@Entity +public class DeptEmployee { + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private long id; + + private String employeeNumber; + + private String designation; + + private String name; + + @ManyToOne + private Department department; + + public DeptEmployee(String name, String employeeNumber, Department department) { + this.name = name; + this.employeeNumber = employeeNumber; + this.department = department; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEmployeeNumber() { + return employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Department getDepartment() { + return department; + } + + public void setDepartment(Department department) { + this.department = department; + } + + public String getDesignation() { + return designation; + } + + public void setDesignation(String designation) { + this.designation = designation; + } +} diff --git a/hibernate5/src/main/resources/init_database.sql b/hibernate5/src/main/resources/init_database.sql new file mode 100644 index 0000000000..154a5a0bc0 --- /dev/null +++ b/hibernate5/src/main/resources/init_database.sql @@ -0,0 +1,10 @@ +CREATE ALIAS UPDATE_EMPLOYEE_DESIGNATION AS $$ +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.SQLException; +@CODE +void updateEmployeeDesignation(final Connection conn, final String employeeNumber, final String designation) throws SQLException { + CallableStatement updateStatement = conn.prepareCall("update deptemployee set designation = '" + designation + "' where employeeNumber = '" + employeeNumber + "'"); + updateStatement.execute(); +} +$$; \ No newline at end of file diff --git a/hibernate5/src/test/java/com/baeldung/hibernate/NamedQueryIntegrationTest.java b/hibernate5/src/test/java/com/baeldung/hibernate/NamedQueryIntegrationTest.java new file mode 100644 index 0000000000..ef6ec89bc4 --- /dev/null +++ b/hibernate5/src/test/java/com/baeldung/hibernate/NamedQueryIntegrationTest.java @@ -0,0 +1,103 @@ +package com.baeldung.hibernate; + +import java.io.IOException; + +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.NativeQuery; +import org.hibernate.query.Query; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.baeldung.hibernate.entities.Department; +import com.baeldung.hibernate.entities.DeptEmployee; + +public class NamedQueryIntegrationTest { + private static Session session; + + private Transaction transaction; + + private Long purchaseDeptId; + + @BeforeClass + public static void setUpClass() throws IOException { + session = HibernateUtil.getSessionFactory("hibernate-namedquery.properties").openSession(); + } + + @Before + public void setUp() throws IOException { + transaction = session.beginTransaction(); + session.createNativeQuery("delete from deptemployee").executeUpdate(); + session.createNativeQuery("delete from department").executeUpdate(); + Department salesDepartment = new Department("Sales"); + Department purchaseDepartment = new Department("Purchase"); + DeptEmployee employee1 = new DeptEmployee("John Wayne", "001", salesDepartment); + DeptEmployee employee2 = new DeptEmployee("Sarah Vinton", "002", salesDepartment); + DeptEmployee employee3 = new DeptEmployee("Lisa Carter", "003", salesDepartment); + session.persist(salesDepartment); + session.persist(purchaseDepartment); + purchaseDeptId = purchaseDepartment.getId(); + session.persist(employee1); + session.persist(employee2); + session.persist(employee3); + transaction.commit(); + transaction = session.beginTransaction(); + } + + @After + public void tearDown() { + if(transaction.isActive()) { + transaction.rollback(); + } + } + + @Test + public void whenNamedQueryIsCalledUsingCreateNamedQuery_ThenOk() { + Query query = session.createNamedQuery("DeptEmployee_FindByEmployeeNumber", DeptEmployee.class); + query.setParameter("employeeNo", "001"); + DeptEmployee result = query.getSingleResult(); + Assert.assertNotNull(result); + Assert.assertEquals("John Wayne", result.getName()); + } + + @Test + public void whenNamedNativeQueryIsCalledUsingCreateNamedQuery_ThenOk() { + Query query = session.createNamedQuery("DeptEmployee_FindByEmployeeName", DeptEmployee.class); + query.setParameter("name", "John Wayne"); + DeptEmployee result = query.getSingleResult(); + Assert.assertNotNull(result); + Assert.assertEquals("001", result.getEmployeeNumber()); + } + + @Test + public void whenNamedNativeQueryIsCalledUsingGetNamedNativeQuery_ThenOk() { + @SuppressWarnings("rawtypes") + NativeQuery query = session.getNamedNativeQuery("DeptEmployee_FindByEmployeeName"); + query.setParameter("name", "John Wayne"); + DeptEmployee result = (DeptEmployee) query.getSingleResult(); + Assert.assertNotNull(result); + Assert.assertEquals("001", result.getEmployeeNumber()); + } + + @Test + public void whenUpdateQueryIsCalledWithCreateNamedQuery_ThenOk() { + Query spQuery = session.createNamedQuery("DeptEmployee_UpdateEmployeeDepartment"); + spQuery.setParameter("employeeNo", "001"); + Department newDepartment = session.find(Department.class, purchaseDeptId); + spQuery.setParameter("newDepartment", newDepartment); + spQuery.executeUpdate(); + transaction.commit(); + } + + @Test + public void whenNamedStoredProcedureIsCalledWithCreateNamedQuery_ThenOk() { + Query spQuery = session.createNamedQuery("DeptEmployee_UpdateEmployeeDesignation"); + spQuery.setParameter("employeeNumber", "002"); + spQuery.setParameter("newDesignation", "Supervisor"); + spQuery.executeUpdate(); + transaction.commit(); + } +} diff --git a/hibernate5/src/test/resources/hibernate-namedquery.properties b/hibernate5/src/test/resources/hibernate-namedquery.properties new file mode 100644 index 0000000000..457f965347 --- /dev/null +++ b/hibernate5/src/test/resources/hibernate-namedquery.properties @@ -0,0 +1,9 @@ +hibernate.connection.driver_class=org.h2.Driver +hibernate.connection.url=jdbc:h2:mem:mydb1;DB_CLOSE_DELAY=-1;INIT=RUNSCRIPT FROM 'src/main/resources/init_database.sql' +hibernate.connection.username=sa +hibernate.connection.autocommit=true +jdbc.password= + +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.show_sql=true +hibernate.hbm2ddl.auto=create-drop \ No newline at end of file diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java index 8b5d9c41f3..6510e70650 100644 --- a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/entities/DeptEmployee.java @@ -1,7 +1,17 @@ package com.baeldung.hibernate.entities; -import javax.persistence.*; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +@org.hibernate.annotations.NamedQueries({ @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_FindByEmployeeNumber", query = "from DeptEmployee where employeeNumber = :employeeNo"), + @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_FindAllByDesgination", query = "from DeptEmployee where designation = :designation"), + @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_UpdateEmployeeDepartment", query = "Update DeptEmployee set department = :newDepartment where employeeNumber = :employeeNo"), + @org.hibernate.annotations.NamedQuery(name = "DeptEmployee_FindAllByDepartment", query = "from DeptEmployee where department = :department", timeout = 1, fetchSize = 10) }) +@org.hibernate.annotations.NamedNativeQueries({ @org.hibernate.annotations.NamedNativeQuery(name = "DeptEmployee_FindByEmployeeName", query = "select * from deptemployee emp where name=:name", resultClass = DeptEmployee.class), + @org.hibernate.annotations.NamedNativeQuery(name = "DeptEmployee_UpdateEmployeeDesignation", query = "call UPDATE_EMPLOYEE_DESIGNATION(:employeeNumber, :newDesignation)", resultClass = DeptEmployee.class) }) @Entity public class DeptEmployee { @Id @@ -16,7 +26,7 @@ public class DeptEmployee { @ManyToOne private Department department; - + public DeptEmployee(String name, String employeeNumber, Department department) { this.name = name; this.employeeNumber = employeeNumber; From de2f02ff5d18ef9496429555539d2f8c54495346 Mon Sep 17 00:00:00 2001 From: raghav-jha Date: Thu, 6 Dec 2018 01:14:37 +0530 Subject: [PATCH 544/546] BAEL-2394 JPA One-to-One Relationship (#5847) --- .../hibernate/onetoone/HibernateUtil.java | 66 +++++++++++++++++++ .../baeldung/hibernate/onetoone/Strategy.java | 0 .../onetoone/foreignkeybased/Address.java | 0 .../onetoone/foreignkeybased/User.java | 2 +- .../onetoone/jointablebased/Employee.java | 0 .../onetoone/jointablebased/WorkStation.java | 0 .../onetoone/sharedkeybased/Address.java | 0 .../onetoone/sharedkeybased/User.java | 0 ...ToOneAnnotationFKBasedIntegrationTest.java | 0 ...ToOneAnnotationJTBasedIntegrationTest.java | 0 ...oOneAnnotationSPKBasedIntegrationTest.java | 0 .../hibernate/onetoone/HibernateUtil.java | 38 ----------- .../src/main/resources/one-to-one.cfg.xml | 16 ----- .../src/test/resources/one-to-one.cfg.xml | 16 ----- 14 files changed, 67 insertions(+), 71 deletions(-) create mode 100644 persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java (94%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java (100%) rename persistence-modules/{spring-hibernate-5 => hibernate5}/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java (100%) delete mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java delete mode 100644 persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml delete mode 100644 persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml diff --git a/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java new file mode 100644 index 0000000000..972ade9671 --- /dev/null +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java @@ -0,0 +1,66 @@ +package com.baeldung.hibernate.onetoone; + +import com.baeldung.hibernate.customtypes.LocalDateStringType; +import org.hibernate.SessionFactory; +import org.hibernate.boot.Metadata; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.service.ServiceRegistry; + +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.util.Properties; + +public class HibernateUtil { + private static SessionFactory sessionFactory; + + private HibernateUtil() { + } + + public static SessionFactory getSessionFactory(Strategy strategy) { + if (sessionFactory == null) { + sessionFactory = buildSessionFactory(strategy); + } + return sessionFactory; + } + + private static SessionFactory buildSessionFactory(Strategy strategy) { + try { + ServiceRegistry serviceRegistry = configureServiceRegistry(); + + MetadataSources metadataSources = new MetadataSources(serviceRegistry); + + for (Class entityClass : strategy.getEntityClasses()) { + metadataSources.addAnnotatedClass(entityClass); + } + + Metadata metadata = metadataSources.getMetadataBuilder() + .applyBasicType(LocalDateStringType.INSTANCE) + .build(); + + return metadata.getSessionFactoryBuilder() + .build(); + } catch (IOException ex) { + throw new ExceptionInInitializerError(ex); + } + } + + + private static ServiceRegistry configureServiceRegistry() throws IOException { + Properties properties = getProperties(); + return new StandardServiceRegistryBuilder().applySettings(properties) + .build(); + } + + private static Properties getProperties() throws IOException { + Properties properties = new Properties(); + URL propertiesURL = Thread.currentThread() + .getContextClassLoader() + .getResource("hibernate.properties"); + try (FileInputStream inputStream = new FileInputStream(propertiesURL.getFile())) { + properties.load(inputStream); + } + return properties; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java similarity index 94% rename from persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java index 56b108d0d1..dda972f29c 100644 --- a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java +++ b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java @@ -22,7 +22,7 @@ public class User { private String userName; @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "address_id", referencedColumnName = "id") + @JoinColumn(name = "address_id", referencedColumnName = "id") private Address address; public Long getId() { diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java b/persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java rename to persistence-modules/hibernate5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java b/persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java similarity index 100% rename from persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java rename to persistence-modules/hibernate5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java deleted file mode 100644 index 899fcde947..0000000000 --- a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.baeldung.hibernate.onetoone; - -import org.hibernate.SessionFactory; -import org.hibernate.boot.registry.StandardServiceRegistryBuilder; -import org.hibernate.cfg.Configuration; -import org.hibernate.service.ServiceRegistry; - -public class HibernateUtil { - private static SessionFactory sessionFactory; - - private static SessionFactory buildSessionFactory(Strategy strategy) { - try { - // Create the SessionFactory from hibernate-annotation.cfg.xml - Configuration configuration = new Configuration(); - - for (Class entityClass : strategy.getEntityClasses()) { - configuration.addAnnotatedClass(entityClass); - } - configuration.configure("one-to-one.cfg.xml"); - - ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()) - .build(); - - SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry); - - return sessionFactory; - } catch (Throwable ex) { - ex.printStackTrace(); - throw new ExceptionInInitializerError(ex); - } - } - - public static SessionFactory getSessionFactory(Strategy strategy) { - if (sessionFactory == null) - sessionFactory = buildSessionFactory(strategy); - return sessionFactory; - } -} diff --git a/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml b/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml deleted file mode 100644 index 7522036acb..0000000000 --- a/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - org.h2.Driver - - jdbc:h2:mem:spring_hibernate_one_to_one - sa - org.hibernate.dialect.H2Dialect - thread - true - create-drop - - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml b/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml deleted file mode 100644 index 60417e312d..0000000000 --- a/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - org.h2.Driver - - jdbc:h2:mem:spring_hibernate_one_to_one - sa - org.hibernate.dialect.H2Dialect - thread - true - create-drop - - From df7b723cbafd493d064ac6f97d3b58540b484b38 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 5 Dec 2018 15:54:20 -0700 Subject: [PATCH 545/546] Update README.md (#5850) Issue: BAEL-2213 --- spring-data-rest/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-data-rest/README.md b/spring-data-rest/README.md index db94a86a6f..1624a3abfd 100644 --- a/spring-data-rest/README.md +++ b/spring-data-rest/README.md @@ -21,3 +21,4 @@ To view the running application, visit [http://localhost:8080](http://localhost: - [Projections and Excerpts in Spring Data REST](http://www.baeldung.com/spring-data-rest-projections-excerpts) - [Spring Data REST Events with @RepositoryEventHandler](http://www.baeldung.com/spring-data-rest-events) - [Customizing HTTP Endpoints in Spring Data REST](https://www.baeldung.com/spring-data-rest-customize-http-endpoints) +- [Spring Boot with SQLite](https://www.baeldung.com/spring-boot-sqlite) From 8b8fda7d0b989174b3f0db1e20cadbcdf837257c Mon Sep 17 00:00:00 2001 From: Paul van Gool Date: Wed, 5 Dec 2018 18:11:21 -0800 Subject: [PATCH 546/546] BAEL-1049 * BAEL-1049: Update to latest version, and added tests. * Update FunctionalJavaUnitTest.java * Update FunctionalJavaUnitTest.java * Add blank lines before asserts. --- libraries/pom.xml | 2 +- .../baeldung/fj/FunctionalJavaUnitTest.java | 201 +++++++++++------- 2 files changed, 123 insertions(+), 80 deletions(-) diff --git a/libraries/pom.xml b/libraries/pom.xml index 936e86873d..fb1f1cd1b6 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -942,7 +942,7 @@ 2.0.4 1.3.1 1.2.6 - 4.7 + 4.8.1 1.0.1 3.3.5 2.1 diff --git a/libraries/src/test/java/com/baeldung/fj/FunctionalJavaUnitTest.java b/libraries/src/test/java/com/baeldung/fj/FunctionalJavaUnitTest.java index d62a115abd..aa06ba4eb9 100644 --- a/libraries/src/test/java/com/baeldung/fj/FunctionalJavaUnitTest.java +++ b/libraries/src/test/java/com/baeldung/fj/FunctionalJavaUnitTest.java @@ -1,79 +1,122 @@ -package com.baeldung.fj; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -import fj.F; -import fj.data.Array; -import fj.data.List; -import fj.data.Option; -import fj.function.Characters; -import fj.function.Integers; - -public class FunctionalJavaUnitTest { - - public static final F isEven = i -> i % 2 == 0; - - @Test - public void calculateEvenNumbers_givenIntList_returnTrue() { - List fList = List.list(3, 4, 5, 6); - List evenList = fList.map(isEven); - List evenListTrueResult = List.list(false, true, false, true); - List evenListFalseResult = List.list(true, false, false, true); - assertEquals(evenList.equals(evenListTrueResult), true); - assertEquals(evenList.equals(evenListFalseResult), false); - } - - @Test - public void mapList_givenIntList_returnResult() { - List fList = List.list(3, 4, 5, 6); - fList = fList.map(i -> i + 100); - List resultList = List.list(103, 104, 105, 106); - List falseResultList = List.list(15, 504, 105, 106); - assertEquals(fList.equals(resultList), true); - assertEquals(fList.equals(falseResultList), false); - } - - @Test - public void filterList_givenIntList_returnResult() { - Array array = Array.array(3, 4, 5, 6); - Array filteredArray = array.filter(Integers.even); - Array result = Array.array(4, 6); - Array wrongResult = Array.array(3, 5); - assertEquals(filteredArray.equals(result), true); - assertEquals(filteredArray.equals(wrongResult), false); - } - - @Test - public void checkForLowerCase_givenStringArray_returnResult() { - Array array = Array.array("Welcome", "To", "baeldung"); - Array array2 = Array.array("Welcome", "To", "Baeldung"); - Boolean isExist = array.exists(s -> List.fromString(s).forall(Characters.isLowerCase)); - Boolean isExist2 = array2.exists(s -> List.fromString(s).forall(Characters.isLowerCase)); - assertEquals(isExist, true); - assertEquals(isExist2, false); - } - - @Test - public void checkOptions_givenOptions_returnResult() { - Option n1 = Option.some(1); - Option n2 = Option.some(2); - - F> f1 = i -> i % 2 == 0 ? Option.some(i + 100) : Option.none(); - - Option result1 = n1.bind(f1); - Option result2 = n2.bind(f1); - - assertEquals(result1, Option.none()); - assertEquals(result2, Option.some(102)); - } - - @Test - public void foldLeft_givenArray_returnResult() { - Array intArray = Array.array(17, 44, 67, 2, 22, 80, 1, 27); - int sum = intArray.foldLeft(Integers.add, 0); - assertEquals(sum, 260); - } - -} +package com.baeldung.fj; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import fj.F; +import fj.Show; +import fj.data.Array; +import fj.data.List; +import fj.data.Option; +import fj.function.Characters; +import fj.function.Integers; + +public class FunctionalJavaUnitTest { + + public static final F isEven = i -> i % 2 == 0; + + public static final Integer timesTwoRegular(Integer i) { + return i * 2; + } + + public static final F timesTwo = i -> i * 2; + + public static final F plusOne = i -> i + 1; + + @Test + public void multiplyNumbers_givenIntList_returnTrue() { + List fList = List.list(1, 2, 3, 4); + List fList1 = fList.map(timesTwo); + List fList2 = fList.map(i -> i * 2); + + assertEquals(fList1.equals(fList2), true); + } + + @Test + public void applyMultipleFunctions_givenIntList_returnFalse() { + List fList = List.list(1, 2, 3, 4); + List fList1 = fList.map(timesTwo).map(plusOne); + Show.listShow(Show.intShow).println(fList1); + List fList2 = fList.map(plusOne).map(timesTwo); + Show.listShow(Show.intShow).println(fList2); + + assertEquals(fList1.equals(fList2), false); + } + + @Test + public void calculateEvenNumbers_givenIntList_returnTrue() { + List fList = List.list(3, 4, 5, 6); + List evenList = fList.map(isEven); + List evenListTrueResult = List.list(false, true, false, true); + List evenListFalseResult = List.list(true, false, false, true); + + assertEquals(evenList.equals(evenListTrueResult), true); + assertEquals(evenList.equals(evenListFalseResult), false); + } + + @Test + public void mapList_givenIntList_returnResult() { + List fList = List.list(3, 4, 5, 6); + fList = fList.map(i -> i + 100); + List resultList = List.list(103, 104, 105, 106); + List falseResultList = List.list(15, 504, 105, 106); + + assertEquals(fList.equals(resultList), true); + assertEquals(fList.equals(falseResultList), false); + } + + @Test + public void filterList_givenIntList_returnResult() { + Array array = Array.array(3, 4, 5, 6); + Array filteredArray = array.filter(isEven); + Array result = Array.array(4, 6); + Array wrongResult = Array.array(3, 5); + + assertEquals(filteredArray.equals(result), true); + assertEquals(filteredArray.equals(wrongResult), false); + } + + @Test + public void checkForLowerCase_givenStringArray_returnResult() { + Array array = Array.array("Welcome", "To", "baeldung"); + Array array2 = Array.array("Welcome", "To", "Baeldung"); + Boolean isExist = array.exists(s -> List.fromString(s).forall(Characters.isLowerCase)); + Boolean isExist2 = array2.exists(s -> List.fromString(s).forall(Characters.isLowerCase)); + Boolean isAll = array.forall(s -> List.fromString(s).forall(Characters.isLowerCase)); + + assertEquals(isExist, true); + assertEquals(isExist2, false); + assertEquals(isAll, false); + } + + @Test + public void checkOptions_givenOptions_returnResult() { + Option n1 = Option.some(1); + Option n2 = Option.some(2); + Option n3 = Option.none(); + + F> function = i -> i % 2 == 0 ? Option.some(i + 100) : Option.none(); + + Option result1 = n1.bind(function); + Option result2 = n2.bind(function); + Option result3 = n3.bind(function); + + assertEquals(result1, Option.none()); + assertEquals(result2, Option.some(102)); + assertEquals(result3, Option.none()); + } + + @Test + public void foldLeft_givenArray_returnResult() { + Array intArray = Array.array(17, 44, 67, 2, 22, 80, 1, 27); + int sumAll = intArray.foldLeft(Integers.add, 0); + + assertEquals(sumAll, 260); + + int sumEven = intArray.filter(isEven).foldLeft(Integers.add, 0); + + assertEquals(sumEven, 148); + } + +}